Cloudflare said on September 28, 2026 that it is releasing the first public experimental preview of first-class support for the Emscripten wasm32-unknown-emscripten Rust compiler target in the wasm-bindgen toolchain and in its Rust Workers. The company said the work lets native Rust code, including Tokio-based applications, run on the Workers platform.
What Cloudflare announced
Cloudflare described the release as "the first public experimental preview" of support for running native Rust code and Tokio-based applications on Workers. wasm-bindgen, which Cloudflare said is the open source toolchain powering Rust-based WebAssembly applications on its V8-based Workers Runtime, now supports the Emscripten target.
According to the company, enabling the Emscripten target for wasm-bindgen was a long-term effort first initiated by Google over a year ago, then reviewed and supported by the Cloudflare engineers who maintain wasm-bindgen. Cloudflare said the patchsets and example applications are available today for experimental use, while the work remains pre-release.
Cloudflare said Emscripten is an open-source WebAssembly compiler toolchain initially created by Mozilla and currently maintained by Google engineers, and that Workers can support it using its Node.js compilation flags because Workers supports Web Platform APIs and Node.js compatibility.
How the toolchains were reconciled
Cloudflare said Mitch Foley of Google's Portable Toolchains team encountered the need for Rust WebAssembly toolchains to interoperate with C++, but that both wasm-bindgen and Emscripten assumed they were in charge of loading JavaScript and generating the final JS and Wasm output.
The plan crafted by Foley and colleague Yifan Yang, as described by Cloudflare, was for Emscripten to continue driving the build, load the Wasm module and provide the companion JavaScript, while wasm-bindgen produces a smaller portable version of its JavaScript bindings that can be included in Emscripten's library system. The result, Cloudflare said, is interoperability under a new -sWASM_BINDGEN configuration.
Tokio, sockets and epoll
Cloudflare said Workers are single-threaded and hosted within a JavaScript event loop, while Tokio's async design relies on blocking operations supported through threaded parking semantics, making the two models incompatible. It said it pursued two approaches: WebAssembly JavaScript Promise Integration (JSPI) and a proposed LocalEventLoop runtime for Tokio in which the runtime's wait is replaced by a wake driven by the host.
The company said it has contributed full Tokio support patchsets that are under review upstream, with the first target support patch for wasm32-unknown-emscripten already landed in Tokio. It added that LocalEventLoop::block_on panics where a normal runtime would park, because the wait belongs to the host.
Sockets were the remaining gap, Cloudflare said, because Emscripten supported poll() and a WebSocket emulation layer but not epoll_wait(), on which Tokio's I/O driver is built via mio. Cloudflare said it contributed over 40 pull requests to Emscripten, producing the -sNODERAWSOCKETS compilation option that enables epoll, TCP, UDP and Unix sockets in Node.js and on Workers. It also said it drafted an Emscripten proposal for an emscripten_epoll_add_listener API.
The Minecraft server demo
To test the target, Cloudflare said Dan Lapid implemented the Rust-native Pumpkin Minecraft server running on a Durable Object over a single weekend, with TCP ingress and real TCP sockets via Tokio.
Because a Durable Object has exactly one thread, Cloudflare said the tick loop and chunk scheduler were turned into async tasks and each Rayon job into a Tokio task. Persistence used Emscripten's -sNODERAWFS option to forward file system calls to the node:fs compatibility layer, with a durable-object-fs backend storing files as rows in the Durable Object's SQLite storage.
Cloudflare said the demonstration shows the level of native compatibility possible with the new Emscripten target, and invited feedback on GitHub and in the #rust-on-workers channel on its Discord.
What to do
- Treat the release as pre-release: Cloudflare says the patchsets and workflows are available today for experimental use only.
- Consult the wasm-bindgen Emscripten documentation page for details on using the wasm32-unknown-emscripten target.
- Expect to apply Cloudflare's Tokio patches directly when following its Rust Workers Tokio examples, since the changes are still pending upstream integration.
- Use Emscripten's -sNODERAWSOCKETS option for epoll, TCP, UDP and Unix sockets, and -sNODERAWFS to route file system calls to the node:fs compatibility layer.
- Send feedback or contributions through GitHub or the #rust-on-workers channel on Cloudflare's Discord.
Key facts and where they come from
- Cloudflare announced the first public experimental preview of Emscripten target support for Rust on Workers.
Today we’re announcing the first public experimental preview of a feature to better support native Rust code and even Tokio-based applications just running natively on Workers
- The effort was initiated by Google more than a year ago.
Enabling the Emscripten target for wasm-bindgen has been a long-term effort, first initiated by Google over a year ago
- A new -sWASM_BINDGEN configuration links the two toolchains.
the wasm-bindgen and Emscripten toolchains now have seamless interoperability under the new -sWASM_BINDGEN configuration
- Libraries including libc, socket2 and Mio required patching.
Some low-level systems libraries that were unaware of Emscripten required patching, for example libc, socket2, and Mio.
- The first wasm32-unknown-emscripten target patch has landed upstream in Tokio.
with the first target support patch for wasm32-unknown-emscripten already landed upstream in Tokio
- Cloudflare contributed more than 40 pull requests to Emscripten for the -sNODERAWSOCKETS option.
We contributed this work in over 40 pull requests to Emscripten, which is now the -sNODERAWSOCKETS layer compilation option
- A Pumpkin Minecraft server was run inside a Durable Object with TCP ingress.
we were able to get a Rust-native Minecraft server (Pumpkin) running inside of a Durable Object with TCP ingress, using real TCP sockets via Tokio
- LocalEventLoop::block_on panics instead of parking.
where a normal runtime would park, LocalEventLoop::block_on panics instead
