Hacker News new | ask | show | jobs
by jordigh 3506 days ago
We have a toy LLVM attempt that compiled a few trivial loops but hooked into the unstable C++ LLVM API. Nobody really knew how to maintain it, and we got tired chasing after the unstable API, so we let it bitrot to death.

I don't expect any other JIT backend (libgccjit could be another possibility) would require any less knowledge of compilers and language design. Does Graal have some magic for us? Can it give us a JIT compiler even if most of us are not compiler writers or language designers?

1 comments

From https://wiki.openjdk.java.net/display/Graal/Publications+and...

Forget “this language is fast”, “this language has the libraries I need”, and “this language has the tool support I need”. The Truffle framework for implementing managed languages in Java gives you native performance, multi-language integration with all other Truffle languages, and tool support - all of that by just implementing an abstract syntax tree (AST) interpreter in Java.

Truffle applies AST specialization during interpretation, which enables partial evaluation to create highly optimized native code without the need to write a compiler specifically for a language. The Java VM contributes high-performance garbage collection, threads, and parallelism support.

So you won't need the know-how to write a compiler, but instead write an interpreter optimized for execution with Graal.