F#, compiled to WebAssembly GC.
No JavaScript app code.

A real compiler — not a transpiler — tested against .NET on hundreds of thousands of generated inputs, plus a browser runtime written in F#. Everything interactive on this page is F# running as WasmGC.

Compiler Runtime

0disagreements with .NET in 784,000 generated test calls
20 KBwasm for a complete Elmish app, HTML DSL included — no runtime download
60×faster than JavaScript on a map/filter/fold pipeline (fused into one loop)
~600lines of JavaScript glue for DOM, canvas, workers, storage, IndexedDB, WebGPU — and no framework

Live: this is F#

Five of the demos, running right here. Each one is an F# program compiled to its own WebAssembly module — the page around it contains no application code.

All twelve demos →

Speed — measured in your browser, right now

Thirteen algorithms, each written once in F# (compiled by fsharp-wasm) and once in plain JavaScript, run on your machine, in a worker.

workloadJavaScriptF# → WasmGCratiosame result
press “Run the benchmark”
Median of alternating runs after a cold run and a warm-up; the two results must be equal before a time counts. Honest reading: V8's JIT is superb at tight loops, so expect parity (Mandelbrot, CRC-32, word count) and a loss on allocation-heavy code (binary trees) and string building (the word count). The wasm wins where the language helps: calls (Fibonacci), 64-bit integers, and the list pipeline, which the compiler fuses into one loop with no intermediate lists (that row measures the optimisation, not the VM). The F# is unmodified, idiomatic code. All results — speed, size and network load times, recorded and published — and the full benchmark page have the chart, the standard profile with its spread, and a JSON export; docs/benchmarks.md has measured results for Node, Deno, Bun and Chromium.

How it works

Three small pieces, each replaceable.

1 · fsharp-wasm
The compiler. F# source → typed AST → WasmGC, with exact .NET semantics for integers, floats, strings, printf, generics and structural equality — verified by differential tests against .NET on every commit.
2 · Browser.*
Typed F# modules for the DOM, events, canvas, storage, IndexedDB, workers, WebGPU and more — plus an HTML builder (div { … }) and an Elmish loop. A JS import is an F# function marked nativeOnly; the compiler does the marshalling.
3 · runtime/*.js
Thin glue, one small file per browser API. Strings cross as native JS strings (the engine's string builtins), a closure passed to JS becomes a JS function that re-enters the module. No bridge generator, no shared memory.
let update msg model =
    match msg with
    | Increment -> { model with Count = model.Count + 1 }, Cmd.none
    | Decrement -> { model with Count = model.Count - 1 }, Cmd.none
    | Reset     -> { model with Count = 0 }, Cmd.none

let view model dispatch =
    article {
        h2 "Counter"
        el "p" { class' "count-display"; string model.Count }
        button { onClick (fun () -> dispatch Increment); "+" }
    }

let start () = run "counter-root" { Init = init; Update = update; View = view }

All demos

Every one is a separate F# project compiled to its own .wasm; each has a Playwright test that drives it in Chromium.

Needs WebAssembly GC and the JS String Builtins: Chrome / Edge 130+, Firefox 134+.