Skip to content

About

Planned: scientific computing in F# for WebAssembly GC (linear algebra, geospatial, chemistry, quantum simulation).

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

fsharp-wasm-sci

Status of every repository

Part of the fsharp-wasm platform: scientific computing. Will build on core. Status: planned, no code yet. All projects · Roadmap · Tests · Benchmarks · Live demos

Scientific computing for F# that runs as WebAssembly GC, in the browser and on the edge: linear algebra, geospatial analysis, chemistry and quantum simulation, written in F# with no native dependency, so that a program carries only what it calls.

This repository is a plan, not yet a library. Nothing here compiles. What exists is the layer it will stand on, and it lives where every other library can reach it (the rule: code goes in the lowest layer all its users can reach).

What is there to build on

where state
hierarchies of ordered leaves, a cube of prefix sums over two of them (the total of any group over any group is four reads), pivoting, drill-down, formulas over measures FSharp.Wasm.Frame, used by the accounting grid working; a million lines turned in 4 to 5 ms (measured 2026-11-24, a headless Chromium)
JSON and numbers FSharp.Wasm.Data in core working
flat tensors with strides, ragged arrays as offset buffers, columnar tables with group-by, join and radix sort planned for core, next to Frame: the accounting grid and these libraries need the same thing underneath not started
the test framework, with differential tests against .NET fsharp-wasmecto working
the benchmark harness for size and speed fsharp-wasm-runtime working

What will be here

Libraries, in this order, each only when the layer below it is real and measured:

  1. Linear algebra (FSharp.Sci.Linalg): blocked matrix multiplication, LU, Cholesky, QR, compressed sparse rows.
  2. Geospatial (FSharp.Sci.Geo): flat-buffer spatial indexes, WGS84 and Web Mercator and UTM, great-circle distances, polygon area and clipping, raster grids.
  3. Chemistry (FSharp.Sci.Chem): a periodic table as compile-time constants, molecular graphs, a SMILES parser, masses and formulas.
  4. Quantum (FSharp.Sci.Quantum): a complex number without allocation, a state-vector simulator, the usual gates.

Where a workload is too large for F# in a browser, an optional kernel library (Rust) is possible (the same Rust is not written twice); the F# version stays the default, because it is small. How data crosses that boundary is not decided: WIT copies, and the better design for numbers may be handles to buffers with WIT only for the list of operations; docs/plan.md says what is known, and the measurement that decides it.

Principles

  • Memory layout first: a dense tensor is one flat array and its strides, a ragged array is its values and offsets, so that the garbage collector has few objects and the loops are cache friendly.
  • Source only, and only what is called: the compiler emits the functions and types a program uses.
  • Every number is measured and dated: size, speed against .NET and against JavaScript, and agreement with a reference (differential tests). A target is not a claim.

Contributing

Open an issue for the library you want (the roadmap and the issues of this repository say what is next), and read AGENTS.md for how the platform is worked on. Code is Apache-2.0.

License

Apache-2.0.

About

Planned: scientific computing in F# for WebAssembly GC (linear algebra, geospatial, chemistry, quantum simulation).

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors