| ▲ | MaxBarraclough 4 hours ago | |
Reminds me of the 2024 blog post Look ma, I wrote a new JIT compiler for PostgreSQL [0]. Both articles lament that Postgres's LLVM-based JIT [1] takes a while to generate code. > The rarity of JIT compilers makes me believe that implementing a JIT compiler historically was too difficult for it to be worthwhile. That's only true of writing a JIT from scratch. There's no rarity of JITs, it's just that LLVM (and other frameworks) are often used. Every major interpreter has a JIT compiler. PCRE2 has a JIT compiler. There are JIT frameworks out there with much faster code-generation than LLVM: Cranelift, GNU Lightning, Mir. I doubt they could do code-generation faster than a custom copy-and-patch JIT, but they'd be much faster than LLVM. [0] https://www.pinaraf.info/2024/03/look-ma-i-wrote-a-new-jit-c... , discussed: https://news.ycombinator.com/item?id=39742916 | ||
| ▲ | pjmlp 3 hours ago | parent | next [-] | |
The original Dartmouth BASIC had a JIT like approach, the REPL would compile to machine code before execution. It was the limits of 8 bit home computers hardware that made the interpreter version be more widely known. Same to Lisp, Smalltalk, and many other languages. Fully agree with you. | ||
| ▲ | BoingBoomTschak 3 hours ago | parent | prev [-] | |
A few other small and fast JITs: https://github.com/zherczeg/sljit (used by libpcre), https://github.com/asmjit/asmjit (RPCS3 and FBGEMM) and https://webkit.org/blog/5852/introducing-the-b3-jit-compiler... (only used by JSC in Webkit, I think) | ||