Hacker News new | past | comments | ask | show | jobs | submit login

Isn't java already compiled ahead-of-time?

You give the JVM a .class file, not a .java file.

Though this is a technicality.

Java 9 will be able to compile java source code to java byte code then compile that java byte code to native machine code, correct?




It is compiled to intermediate byte code but not machine code. You still need the JVM to JIT the byte code to something the CPU can deal with.


Not necessarily. Java byte code can be run directly on a JPM (Java Physical Machine).


Are there any that support the current class file format? ARM jazelle is no longer being worked on. So I would be surprised if there is anything that can do Java SE directly. JavaCard of course being quite different than standard Java.


Java bytecode is too highlevel for it to be suitable to run directly on hardware. Each instruction can map to multiple machine instructions. A JIT or AOT compiler can optimize the code on a lower level. A hardware implementation cannot do inlining, loop unrolling, hoist array length checks out of a loop, etc...


compile means "native code" here, not jvm bytecode.


Look at class file sometime. It is basically bad C code in appearance. It is nowhere close to assembly type code, which is what the final output of the JIT is.


Maybe I'm crazy, but the bytecode dumped from a class file definitely looks more like assembly than "bad C" to me, personally: https://gist.github.com/anonymous/e824444ea158beb7b72b26fbf1...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: