[LLVMdev] MCJIT or ORC JIT for new project?

Kevin Atkinson k at kevina.org
Wed Jul 1 22:50:38 PDT 2015


Hi,

For a new language I am developing (in the very early stages, nothing public 
posted yet) I would like to able to use a JIT for several purposes:

1) Create a functional REPL as is done is done with in the Kaleidoscope 
tutorial.

2) Be able to interpret my language in addition to compiling.

3) While compiling, be able to execute arbitrary code at compile time.  The 
simple case will be to get a value, similar to C++ constexpr but without any 
restrictions.  The complicated case will be to support a full macro system 
similar to syntax-rules in Racket or defmacro in Lisp.

For (1) I would require being able to execute a function at a time. I would 
also like to be able to discard temporary functions used just to get a 
value.

For (2) and (3) lazy compilation is required, catching the results would also 
be great.

For right now I plan to use a direct AST based interpreter, but I would also 
like have JIT available when it is needed.

It looks like the new ORC JIT will be better suited for my needs.  Would it be 
better to use the devel version of LLVM and the new JIT?  Or is the new ORC 
JIT too much of a moving target and would it be better to stick with MCJIT?

If it is best to stick with MCJIT can someone point me to a working 
Kaleidoscope that will work with MCJIT and the latest released version of 
LLVM.  There are several versions floating around and I am confused on what 
version to use.  The examples in Kaleidoscope/MCJIT/lazy don't compile with 
3.6.1 and I was hoping there was a version that would compile.

Let me know if anything is unclear.

Thanks in Advance,
Kevin





More information about the llvm-dev mailing list