
Ask HN: JIT Compiler Landscape of 2019? - datenwolf
Hi Hacker News,<p>in a little project of mine I wanted to add some JIT. Without going into details, the goal of this project is to create the blocks in a DSP chain at runtime from the signal graph. Right now I&#x27;m producing compute shader GLSL code. The next step is to skip the GLSL entirely and directly produce SPIR-V.<p>In addition to targeting GPUs I also want to be able to fall back to CPU execution. The current kludge is glslc, spirv-cross and the system&#x27;s C++ compiler glued together.<p>Long term I&#x27;d like to have two backends, one generating SPIR-V to load into Vulkan, and one that through <i>some</i> JIT emits host system ISA code.<p>I looked at a number of candidate JITs<p>- GNU libjit: small and just about the right set of features I think I need. Also maintenance status unclear (last commit was about 1 year ago)<p>- LLVM ORC: huge feature set, but also huge library and comparatively slow. Seems like overkill to me.<p>- Mozilla NanoJIT: In the same ballpark like libjit, but no longer maintained<p>Then there&#x27;s the JIT of LuaJIT and it&#x27;s companion DynASM. I got the impression that this JIT requires some retargeting for each architecture you want to support in your own code, but I might be wrong (have to re-read the docs). And then there&#x27;s AsmJI, which is not a compiler, but a JIT assembler for x86_64 archs.<p>Did I miss something?
======
ihnorton
\- if you are willing to do LLVM, you might look at Julia as (in some sense) a
Lispy LLVM frontend. See:
[https://www.youtube.com/watch?v=BBUrQId0HhQ](https://www.youtube.com/watch?v=BBUrQId0HhQ)

\- re LuaJIT, take a look at the RaptorJIT fork:
[https://github.com/raptorjit/raptorjit](https://github.com/raptorjit/raptorjit)
... They have (for now) stripped out all targets except x86_64. lukego has
built some neat tooling for understanding traces, and folks are working on a
straight C interpreter to reduce the porting effort for new architectures.

\- also re: LuaJIT, [http://terralang.org/](http://terralang.org/) might be of
interest

\- JVM is still around! Has some very interesting development around the
Graal/Truffle combination.

