3 ms·
> We should replace asm.js with Rust I don't think there is much of an argument in the article for the idea that Rust is a nice drop-in replacement for JavaScr
by thomasfoster96 12y ago
> We should replace asm.js with Rust
I don't think there is much of an argument in the article for the idea that Rust is a nice drop-in replacement for JavaScript. Everyone seems to have a different opinion as to what JavaScript should be replaced by, and I see no clear leader in the debate at all.
Google of all the players on the web had a good go at Dart and it's been left as a language that transcompiles to JS. Languages like TypeScript, CoffeeScript, and dozens of others are all fixing JavaScript to an extent and then compiling into it. I think that's an acceptable solution to JavaScript's problems.
I think the author misinterprets what asm.js is actually meant for - the author gives the impression that asm.js is a very strict subset of JavaScript which programmers should start programming their web apps in. It's not that, it's pretty much a compile target for other languages.
Plus, since when have JavaScript bitwise operators been slow? They seen fast enough to me.
> While at it, what is stopping us to ditch JavaScript altogether?
Well, there's the huge issue of trying to replace JavaScript in every browser, which would take years. The author is right in that JavaScript was a bit of a 'toy language', but that doesn't necessarily mean it's a lost cause. Removing JavaScript from the web is going to be a lot harder than adding it.
We're better off just using JavaScript as a compile target if it becomes unusable.