Add JIT
authorLuke Lau <luke_lau@icloud.com>
Mon, 3 Jun 2019 14:48:04 +0000 (15:48 +0100)
committerLuke Lau <luke_lau@icloud.com>
Thu, 7 Nov 2019 17:11:27 +0000 (17:11 +0000)
commit7b8ef6725099f09b81f8c39ca6f00dec14213bed
treefed013c927d22ff6fe9c732427f1bb1a53a23b16
parentde8c7223c79f10c69f9916db1f15b34d20938e2c
parentbc95ec9770ea2b19dd773dd4cec05d61b4684e95
Add JIT

We have LLVM IR now, but our computers still can't run it. We could
compile our code "offline" and write it to a file, but LLVM also
provides frameworks for JITing: Just-in-time compilation. This is where
the code is compiled just before it is run, and we will be using it make
an interactive REPL.

Note that JITs are not the same as interpreters: An interpreter reads
the program and directly computes the result. A JIT reads the program
and generates more code for the computer to run, which then computes the
result.

The current LLVM Kaleidoscope tutorial uses the old MC JIT framework:
This tutorial will be using the fancy new OrcJIT framework. It's a bit
more complicated but provides a lot more flexibility.