Add JIT tutorial-1
authorLuke Lau <luke_lau@icloud.com>
Mon, 3 Jun 2019 14:48:04 +0000 (15:48 +0100)
committerLuke Lau <luke_lau@icloud.com>
Mon, 3 Jun 2019 23:15:37 +0000 (00:15 +0100)
commit5bc689cdfd6b319d45b178117a63a446e3dfb978
tree91234630c98023cc9522bd70d1293fe72ad76a16
parentde8c7223c79f10c69f9916db1f15b34d20938e2c
parent30d298135396c1e988ddb0453484153928d48303
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.