7 ms·
This is accomplished by compiling Rust to asm.js or WebAssembly. This seems an overly complex approach. Just because you can do it doesn't mean you should.
by Animats 10y ago
This is accomplished by compiling Rust to asm.js or WebAssembly.
This seems an overly complex approach. Just because you can do it doesn't mean you should. Most of the advantages of Rust don't apply when you're targeting the Javascript engine of a browser.
Modern Javascript, as a language, isn't that bad. Use the right tool for the job.
- castis 10y agoIf you can, but you don't, could you really? Knowing nothing of rust development or this particular tool, could a potential benefit be that the outgoing javascript is structured ideologically similar to the rust code that went in? I'm not saying that this would be a primary reason to make this switch but surely this approach isn't without benefit or reason?
- wtetzner 10y agoI can imaging cases where you'd want code to run in a browser without the unpredictability of garbage collection. Also, modern Javascript has been the only available tool in browsers, but that doesn't mean it's a good one. asm.js and WebAssembly are making it easier to introduce new, and in many cases, better tools.