Re:How to write a simple JIT compiler
by naasking on Wednesday December 15, 2021 @08:59PM
(#29573975)
> In reality you would only get to this point after having built a complete programming language with all its parts.
Not necessarily. You might want to JIT a domain-specific abstraction, like a regular expression engine.
Wonder if you could create a new language using this approach, designed for efficient JIT compilation: maximum programmer convenience that is still coherent with maximum runtime performance, whiteout any learning curve for the user other than the language itself.
Re:How to write a simple JIT compiler
by naasking on Wednesday December 15, 2021 @09:01PM
(#29573984)
Yes, these are called multistage languages:
https://en.wikipedia.org/wiki/Multi-stage_programming
The classic example is MetaOCaml:
A couple of years ago I did the JIT 'kickstarting' machinery for fun in the Nim language: https://github.com/eterps/loader/blob/master/syscall.nim