Rust language gets direct WebAssembly compilation

Posted on 29-11-2017 , by: admin , in , 0 Comments

Rust, the Mozilla-sponsored programming language geared to developing fast system-level software, can now compile to the WebAssembly portable code format without the need for additional tools.

Although still not officially supported, this feature was added via a pull request to enable WebAssembly as a back end by default. Through a nightly build this week, the wasm32-unknown-unknown target became natively available in Rust. (Nightly builds are unsupported test offshoots of the formal Rust language code, but their capabilities often get merged into the official build later.)

This week’s nightly build uses the LLVM tool chain more directly to support WebAssembly, with simpler setup and a bit more control over the output. LLVM provides the tool chain for Rust as well as for the Swift and Clang languages. At this point, Rust’s WebAssembly compilation has just limited support and documentation.

Mozilla says the Rust nightly build’s WebAssembly compilation capability is an improvement over the existing (and still-official) WebAssembly support, which uses the Emscripten tool.