finds.dev← search

// the find

sebmarkbage/ocamlrun-wasm

★ 256 · Shell · updated Mar 2017

OCamlrun WebAssembly - OCaml Bytecode Interpreter in WASM

A 2017 experiment by Sebastian Markbåge that compiles the OCaml bytecode interpreter to WebAssembly via Emscripten, so you can run OCaml bytecode in the browser without going through js_of_ocaml. The README is honest about the tradeoffs. This is a proof-of-concept from the earliest days of WASM, not a production tool.

The core idea is sound: shipping a bytecode interpreter instead of AOT-compiled WASM avoids the upfront compile cost that hurt startup time in 2017-era browsers. The rationale for using OCaml's own GC rather than the JS GC is well-argued. Written by someone who clearly understood both the OCaml and WASM internals.

Nine years old and effectively abandoned — the WASM ecosystem it was designed around (Emscripten incoming SDK, Chrome Canary flags) no longer exists in this form. The OCaml-to-WASM story has moved on entirely; the official OCaml 5 WASM backend and wasm_of_ocaml make this approach obsolete. The repo is a single shell script and a toy example, never stripped down for real use as the README itself admits was needed. Stars are almost certainly from curiosity in 2017, not from anyone using this.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →