Retrofitting JIT Compilers into C Interpreters
ltratt
65 points
15 comments
April 15, 2026
Related Discussions
Found 5 related stories in 65.1ms across 4,686 title embeddings via pgvector HNSW
- Want to write a compiler? Just read these two papers (2008) downbad_ · 479 pts · April 15, 2026 · 58% similar
- The Journal of C Language Translation kristianp · 12 pts · April 14, 2026 · 57% similar
- CRusTTY: A pedagogical C interpreter with time-travel debugging capabilities varun_ch · 16 pts · March 11, 2026 · 54% similar
- A tail-call interpreter in (nightly) Rust g0xA52A2A · 147 pts · April 05, 2026 · 53% similar
- I Fuzzed, and Vibe Fixed, the Vibed C Compiler luu · 17 pts · March 02, 2026 · 52% similar
Discussion Highlights (7 comments)
sgbeal
i tend to think of myself as a computing nerd, but posts like this one make me realize that i don't even rate on the computing nerd scale.
mwkaufma
TL;DR compile with a fork of LLVM that enables runtime IR tracing. Very clever!
fuhsnn
Took me a while to figure out whether it's interpreters for C programs or if there's a particular class of interpreters called "C". Turns out it's about interpreters implemented in C that they use modified LLVM to do the retrofitting, but couldn't it be applicable for other languages with LLVM IR, or other switch-in-a-loop patterns in C?
djwatson24
It's quite impressive they're able to take nearly arbitrary C and do this! Very similar to what pypy is doing here, but for C, and not a python subset. However not without downsides. It sounds like average code is only 2x faster than Lua, vs. LuaJit which is often 5-10x faster.
linzhangrun
It's truly a good thing to see a project like this in the era of Vibe Coding taking flight :)
measurablefunc
Why do they need to change LLVM? Why can't they make this another LLVM IR pass?
9fwfj9r
Those interested in this type of work can also visit https://cfallin.org/blog/2024/08/28/weval/ . The difference is that they use this technique to derive an AOT compiler.