Hacker News new | ask | show | jobs
by pacificat0r 1601 days ago
Emscriptem is targeted at browsers and for that rust does have the target wasm32-unknown-emscripten

However, when targeting wasm outside browsers wasm32-wasi is usually a better option.

3 comments

When targeting WASI or for standalone (no wasi, no emscripten) WebAssembly, Zig is currently the best option, IMHO.

Modules are small and fast, virtually all existing code is compatible out of the box and the standard library comes with full WASI support. And enabling runtime-specific optimizations such as SIMD is as simple as adding a compilation target flag.

While I maintain quite a few Rust crates specifically designed for WebAssembly/WASI usage, my personal experience is that Zig is often better, even from a performance perspective.

TinyGo is also amazing at producing optimized modules, and a lot of existing Go code can be compiled with it without any changes.

I already have wasm outside browsers, it is called JVM and CLR bytecode.

> More than 20 programming tools vendors offer some 26 programming languages — including C++, Perl, Python, Java, COBOL, RPG and Haskell — on .NET.

https://news.microsoft.com/2001/10/22/massive-industry-and-d...

"Emscripten" can target platform outside browsers. You have STANDALONE_WASM flag for that.