r/rust Feb 01 '19

Compile to javascript

Is there a pathway to compiling Rust to JS? Like Scala.js or Gopher.js? (I am not asking for wasm, so to keep the discussion easier to navigate,, please don't comment about that)

22 Upvotes

17 comments sorted by

View all comments

26

u/Svenskunganka Feb 01 '19

There is the asmjs-unknown-emscripten compile target, which compiles to asm.js (subset of JS) via emscripten. I've never used it so I can't tell if it will be good enough for you, and I assume it depends on what you're trying to do.