Hello Benedikt,
It's also worth to note that there is some generic mid/back-end code ready, in my OCaml native compiler framework called DragonKit in a spirit of LLVM, which I am currently actively working on. It's already able to express a toy language and JIT compile and run it within the same process on top of x86 architecture:
The code includes:
- SSA based IL using polymorphic variants
- monadic code generator
- plugable passes using first class modules
- very ad-hoc register allocator
- X86 backend
- example that evolved from LLVM kaleidoscope ported to DragonKit to Pascal/ML like language, and another example using direct translation to X86 backend.
The code is functorised and almost purely functional (with few exceptions where there is no benefit of doing that).
Maybe it could have some use in your new toplevel, or maybe it would be worth to reuse some of your work in DragonKit (or viceversa).
I welcome anybody wanting to join me in this effort.
Please take a look at:
www.github.com/danmey/DragonKitCheers;
Wojciech
greets,