Just-in-time (JIT) compilation has become a common tool for language runtimes. JIT compilers have a reputation for being complex, leaving a pedagogical gap between foundational Ahead-of-Time (AOT) concepts and dynamic code generation. This paper presents an incremental, classroom-scale approach to building a JIT compiler in manageable steps. By contrasting an AOT and a JIT backend, we expose core dynamic concerns, including executable buffers, persistent interactive state, mutation, and runtime type optimizations. The result is a minimal yet realistic educational JIT that successfully supports a Read-Eval-Print Loop (REPL) and a first-call specialization mechanism.
Shaurya Raswan, Mark Barbone, Nicolás Lehmann et al.· Proceedings of the 27th ACM...· 0 citations