Exploring
The browser should not be a lite client that talks to a server. It should run the same engine — same parser, same execution. This means both kern (OCaml) and the Rust engine need to compile to WASM and run in the browser.
kern (OCaml) compiles to WASM via wasm_of_ocaml, which outputs WasmGC instructions. The Rust engine compiles to WASM via wasm-bindgen. Both need to run in the browser and talk to each other.
This is why the browser path works but the Go server path doesn't for OCaml WASM.
Two WASM modules (kern + Rust engine) need to call each other in the browser. The WASM Component Model (Wasm 3.0, September 2025) is designed for this — typed interfaces between modules. Whether this is the right mechanism needs investigation.