3 ms·
I really wish I could use rust for my current work, but it has to be runnable in the browser and it looks like it would take a lot of work to get emscripten on
by jamii 12y ago
I really wish I could use rust for my current work, but it has to be runnable in the browser and it looks like it would take a lot of work to get emscripten on to the same version of llvm as rust.
I just spent two hours debugging what turned out to be a "0" where there should be a 0. Turns out that 1 + "0" > 9.
- lifthrasiir 12y ago1 + "0" > 9 in JavaScript, right? There are plenty of languages compile to JavaScript [1], maybe you can try some of them. [1] https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js https://github.com/jashkenas/coffeescript/wiki/list-of-langu...
- jamii 12y agoUnfortunately most (all?) of them have performance costs and we are already eyeing up asm.js for better performance.
- kybernetikos 12y agoThere are iteration costs in that you're adding a compile step, but in terms of runtime performance, many of the languages are close enough to js that there shouldn't be any cost over hand written js (e.g. typescript, coffeescript,etc). In production you're probably running the whole thing through a minifier anyway, and the most popular of those can actually do performance enhancing transformations too. Google claim that compiled-to-js dart performs better than hand written js, although that is probably a mixture of exaggeration and the effect of the closure compiler which you can run on javascript code anyway.
- comex 12y agoTechnically he could have been referring to C, where it's also true that 1 + "0" > 9, albeit with a warning. ;)
- azakai 12y agoYes, but to be fair, that is mostly emscripten's fault, not rust's. Once emscripten rebases onto something more recent (currently it's somewhere around 3.3-3.4), building a single-threaded program using rust shouldn't be that hard.
- jamii 12y agoI saw a related issue on emscripten-fastcomp saying they are based off the pnacl fork of llvm, which is why they are lagging behind. I'm hoping we can use rust eventually but it doesnt look like the kind of problem we can just throw money at - its a pretty big change to emscripten.