Hacker News new | ask | show | jobs
by cogman10 1 day ago
Would it surprise you to learn that Rust does the same thing that Java does?

The main difference is that rust drives the VM all the way to the point of generating machine code while java generates the machine code at runtime.

Rust does a translation of the syntax to a high level bytecode, then a mid level bytecode, then to LLVM IR, and finally it lets LLVM do the translation of the IR to machine code. The way LLVM uses "VM" is exactly the same way Java is using "VM".

Javascript is similar. In fact, v8, the engine that powers node and chrome, was initially written by Java hotspot developers.

The current performance initiatives that Python and Ruby are taking are doing exactly what the JVM and Javascript does. In fact, the pypy JIT and LuaJIT are learning from and implementing what the JVM does. It's a proven mechanism to getting more performance and better optimizations.

Even GCC does the same thing under the hood.

It really is clear cut, more than you might expect.