Write F#. Ship WebAssembly GC. Run it in the browser and on the edge.
fsharp-wasm compiles F# to WebAssembly GC — small modules that use the engine's own garbage collector — and builds the libraries, tools and hosts around it. It is experimental: things here work and are measured, and we say plainly what is not done.
👉 fsharp-wasm.github.io — the site, the live demos and the benchmarks
- A compiler from F# to WasmGC (a WAT printer and a binary encoder behind a forked Fable front end), with 675 regression tests and a differential run against .NET of 183 012 calls without a disagreement.
- Small modules: 12–153 KB raw, 4–45 KB with brotli, for whole demo applications.
- Speed, measured (one 4-vCPU machine, 13 kernels, F# against hand-written JavaScript): on V8 the F# module is faster in 9–11 of the 13, geometric mean 1.45–1.58× without the one kernel the compiler fuses into a single loop; on JavaScriptCore 1.03×. Part of the V8 result is V8's inliner. Every number, the method and what is not measured: benchmarks.
- One backend module on six platforms: the same F# program answers identically on Node, Bun, Deno, Cloudflare Workers (with a Durable Object), Vercel and Netlify in our test matrix. It is not deployed to those platforms yet — fsharp-wasm-edge says what is a runtime and what an emulation.
| Live demos | Twelve demos that run in your browser: a counter, a todo list, a Web Worker actor, a canvas scene gallery, a widget editor, a benchmark |
| Examples | Code to read and run: classic algorithms, component linking, a server module, graphics, text shaping |
| Benchmarks | Thirteen kernels against JavaScript, the size of every module, load times on five networks — with the method and what is not measured |
| Tests | Every suite of every repository: what it checks, how many tests, how to run it, whether CI runs it |
| Backend on the edge | The same F# module on eight test targets, and the honest status: not deployed yet |
| fsharp-wasm | The compiler: F# → WebAssembly GC |
| fsharp-wasm-core | The F# base library of compiled programs — source-only, our own types instead of the .NET BCL |
| fsharp-wasm-runtime | The browser runtime, the demos and the public benchmarks |
| fsharp-wasm-graphics | A retained-mode 2D graphics stack: scene graph, widgets, a TEA runtime |
| fsharp-glyph-aura | OpenType shaping and SDF text layout, zero-alloc |
| fsharp-wasm-ide | Tools written in F#: the visual widget editor first |
| fsharp-wasm-backend | Backend modules in F# (the Ghost Todo demo) and the .NET reference libraries |
| fsharp-wasm-edge | The host that runs those modules on Cloudflare, Vercel, Netlify, Deno, Bun and Node: the core, the adapters, the platform matrix and the deploy workflow. New; not deployed yet |
| fsharp-wasm-newsletter | A newsletter designer in F#: blocks to HTML email, web version and plain text, Bootstrap 5.3 by default and configurable. New; the email is not yet tested in real mail clients |
| fsharp-wasmecto | An Expecto-style test framework compiled to WasmGC |
| fsharp · fable | Forks (MIT) the compiler builds on |
Planned, not done — we list what exists and what is intended apart. The order and the reasons are in the roadmap, and every project, with what works today, is on the projects page.
- Speed that keeps the writing pleasant: builders and small DSLs stay, and the compiler takes their cost away. A bulk path for strings across the host boundary is done (measured: the state of 5 000 todos 20.6 ms to 6.2 ms on Node); the compiled code for long strings and the builders are next.
- A pre-compiler at build time for the scene graph and for GlyphAura, so that a program carries only the scene elements, widgets and glyph data it uses.
- Editors that are a pleasure to use: the widget editor and the newsletter designer.
- A spreadsheet grid with formulas (fsharp-wasm-accounting, a repository without code so far): rows and columns that fold into total lines, and the tree of a cell in a tab of its own.
- A data science library in the manner of NumPy and Polars, and WIT with Rust libraries, so that what exists in Rust is not written twice.
- Real deployments of the Ghost Todo on Cloudflare, Vercel and Netlify.
- A GUI layer that renders real, accessible HTML — semantic elements, keyboard and screen-reader support — beside the canvas graphics.
- Less .NET, more of our own libraries: independence from what the platform happens to ship.
The work across all of these repositories is supported through GitHub Sponsors: fsharp-wasm.
We are early, so the work you do shapes the direction. Good places to start: a failing program (an issue with the F# source is the best bug report), a benchmark we should add, a platform we should run on, documentation. Questions and ideas are welcome in discussions and as issues; CONTRIBUTING says how.
Everything we wrote is Apache-2.0 (the two forks stay MIT).