Ask HN: JIT Compiler Landscape of 2019?

3 points by datenwolf ↗ HN
Hi Hacker News,

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'm producing compute shader GLSL code. The next step is to skip the GLSL entirely and directly produce SPIR-V.

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's C++ compiler glued together.

Long term I'd like to have two backends, one generating SPIR-V to load into Vulkan, and one that through some JIT emits host system ISA code.

I looked at a number of candidate JITs

- 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)

- LLVM ORC: huge feature set, but also huge library and comparatively slow. Seems like overkill to me.

- Mozilla NanoJIT: In the same ballpark like libjit, but no longer maintained

Then there's the JIT of LuaJIT and it'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's AsmJI, which is not a compiler, but a JIT assembler for x86_64 archs.

Did I miss something?

1 comment

[ 2.0 ms ] story [ 15.9 ms ] thread
- 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

- re LuaJIT, take a look at the RaptorJIT fork: 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/ might be of interest

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