4 ms·
I highly recommend the LLVM Kaleidoscope tutorial. [1] It takes you through all the steps required to implement a REPL for a simple single-type language, and is
by psuter 12y ago
I highly recommend the LLVM Kaleidoscope tutorial. [1] It takes you through all the steps required to implement a REPL for a simple single-type language, and is surprisingly concise given the end result.
Regarding the JIT aspect, if you are like me, you will be in awe when you encounter the single operation
f_ptr = engine->getPointerToFunction(f_def)
It turns a function definition (in LLVM IR) into an actual function pointer that you can invoke just like any other C/C++ function.
[1] http://llvm.org/docs/tutorial/LangImpl1.html#tutorial-introduction http://llvm.org/docs/tutorial/LangImpl1.html#tutorial-introd...
- tempodox 12y agoPerfect, this is exactly on point. Thanks!