Hacker News new | ask | show | jobs
by sillycross 1735 days ago
Interesting post. Seems similar to the approach of HPHPC for PHP, where the code is first run offline in a simulated environment to collect type information, and then use these speculations to generate static-typed code ahead-of-time.

Would be interested to see a performance comparison with V8 JIT (instead of V8 interpreter).

1 comments

AFAIK Graal native-image also does something similar.
For Java, yes. They're working on JavaScript and Ruby etc, but not sure it's quite there yet.
They already have GraalJS which is afaik up-to-date with the EcmaScript spec and has insane throughput (on long-running tasks it has comparable speed to V8, with a much much smaller team behind it) - it can AOT compile said code as well, but I’m not sure about the performance characteristics of that.
Java is static-typed already and only has a low degree of dynamism, so the importance of doing so is much less (only to reduce the initialization time I believe).
There's a lot of interfaces and virtual calls in Java. Not sure if you're considering that dynamic or not, but I would would. Graal does some pretty intense whole-universe points-to analysis which enables monomorphisation, devirtualisation, scalar replacement, etc.
Java is yes, but the JVM runs other things and things like JRuby use the JVM bytecode for invoke_dynamic. There were a few things rewritten to use that bytecode from what I remember but it's been a while since I've worked in that area.