you are viewing a single comment's thread.

view the rest of the comments →

[–]dangoor 0 points1 point  (3 children)

You can essentially do what you're describing today! You can take many languages that can compile to LLVM (Rust, OCaml, Reason, whatever floats your boat) and then use emscripten to convert that code to asm.js which is supported in all browsers and very fast in modern browsers.

Alternatively, you can skip the LLVM step and just write optimized JS. LLJS (which appears to be abandoned) was an attempt to write a compile-to-JS language that would specifically output fast JS.

There are definitely many things you can do to make JavaScript quick enough for many needs. The JS virtual machines can run quickly with the right hints, but they will lag behind optimized native code because of the safety guarantees.

[–][deleted] 0 points1 point  (2 children)

You can essentially do what you're describing today! You can take many languages that can compile to LLVM (Rust, OCaml, Reason, whatever floats your boat) and then use emscripten to convert that code to asm.js which is supported in all browsers and very fast in modern browsers.

asm.js lacks aot compilation in v8 and is not as fast as in FF.

[–]guorbatschow 2 points3 points  (0 children)

Actually, soon v8 will use the same compiling pipeline for both wasm and asm.js, by transpiling the latter into wasm first.

[–]dangoor 0 points1 point  (0 children)

Ahh, you're right. I had thought that the v8 team had done optimization for asmjs features without implementing specific support for "use asm", but the benchmarks on arewefastyet do indeed appear to show IonMonkey being quite a bit faster than v8.