4 ms·
I was hoping this was an announcement of Emscripten support for Rust :(
by tree_of_item 12y ago
I was hoping this was an announcement of Emscripten support for Rust :(
- steveklabnik 12y agoWe need Emscripten to upgrade their LLVM, last I heard. We're running a pretty cutting-edge version at the moment.
- kibwen 12y agoPeople are eagerly working on it: http://users.rust-lang.org/t/rust-to-js-with-emscripten/587 http://users.rust-lang.org/t/rust-to-js-with-emscripten/587
- haberman 12y agoLikewise I keep hoping someone will make a compile-Rust-to-portable-C story realistic also! The LLVM C backend has been revived! https://github.com/draperlaboratory/llvm-cbe https://github.com/draperlaboratory/llvm-cbe http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075934.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/07593...
- comex 12y agoLast October I tried using that repo to compile Rust to C and it proved to be totally broken (i.e. not Rust's fault). There have been a bunch of commits since then, so maybe it works these days... shouldn't be hard to test. However, don't expect it to generate code that's portable between architectures with different pointer widths.
- haberman 12y ago> However, don't expect it to generate code that's portable between architectures with different pointer widths. That's a limitation I can live with. If my only concession is that I have to have two builds (32/64), and everything else is portable, I'll be a very happy camper.
- EugeneOZ 12y agoI was hoping it's about cross-platform compilation.
- steveklabnik 12y agoBeing based on LLVM, the details are there, but it's not as easy as we'd like. This is something we want to significantly improve the UX of in the future, for sure.
- diamondlovesyou 11y agoUsing my fork [1] (you'll have to build it yourself, sorry), you can create Emscripten bins. After building your program, run `$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-thaw $RUSTC_OUT` on the output (rustc emits stable pexe's by default) and then run `$EMSCRIPTEN/emcc -o $RUSTC_OUT.html $RUSTC_OUT`. Volia. I make no guarantees that it'll all work however; I don't test Rust->JS like I do Rust->PNaCl. [1]: https://github.com/DiamondLovesYou/rust.git https://github.com/DiamondLovesYou/rust.git EDIT: Grammar.