
We should replace asm.js with Rust - snake_case
http://ivoras.net/blog/tree/2014/Oct-we-should-replace-asmjs-with-rust.html
======
angersock
I disagree with the Javascript hate here, and the author is missing the point.

JS is (at least until ECMA6 rolls in) a small, tidy language. It's got some
bad parts, but at its core it is quite manageable. It's useful precisely
because it ignores a lot of the implementation details that make languages
like C or Rust more performant. I'm sick of people saying "JS is bad hurr durr
let's replace it with $PREFERRED_HIPSTER_LANGUAGE".

The real problem is that stupid people write javascript, lazy people write
docs for javascript, and academic people write language extensions. What
happened to C++ and made it a mudball is what is slowly happening to JS, and
what will eventually happen to Rust if it gains any traction.

Instead of replacing asm.js, we should look at a dedicated and simple
programming environment for all browsers that care about performance-critical
code. That environment should be specified as a machine, _and then left the
hell alone until some major change in technology alters the computer
engineering therein_. That way, people can program the performant bytecode in
whatever they want (ASM.js, Rust, D, C, Clojure).

The thing we _really_ need to be doing is encouraging more conservatism in our
work and tools: fewer and better languages, fewer and better libraries, more
and better documentation. You know, what any other field might consider
_engineering_.

EDIT: On a related note, the W3C and WHATWG and Khronos folks should all only
be allowed to propose things every three years, with all voting done in 6
months. And then limited to adding 2-3 features, tops. Similar for the JS and
IETF folks. This is absurd: spend some time enjoying the fruits of your labors
_before adding more shit that compounds the complexity of working developers '
lives_!

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

------
striking
Asm.js still runs in browsers that don't support it. Slowly, but it runs. Rust
would not be able to do that unless it came with a JS recompiler from Rust to
JS. Not that it couldn't work, but it would be quite strange.

------
bobajeff
I like your idea. When can we expect a prototype? Also, will you use WebKit
directly (a la Python-WebKit) or branch Chromium (a la Dartium)?

~~~
snake_case
Not the author, but I just thought this post might cause some nice discussion.

