Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Yes, 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.


I 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.


That's correct, yes. But pnacl is close to a big update to llvm 3.5, and hopefully emscripten will follow that not long after.


That's good to know, thanks.


1 + "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-langu...


Technically he could have been referring to C, where it's also true that 1 + "0" > 9, albeit with a warning. ;)


Unfortunately most (all?) of them have performance costs and we are already eyeing up asm.js for better performance.


There 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: