I'm doing small lisp like compiler (to x86 asm) and what is bothering me is "runtime compilation", it's simple enough to do simple static C-like compiler with basic Lisp stuff (C runtime/gc and Lisp compiler emiting x86 asm) but i'm not sure how to do runtime compilation and all the problems that goes with it.
I assume that I can start extern gcc assembler each time from Lisp REPL and use C lib dynamic linker/loader (not pretty ?), or meaby create directly in memory opcodes ... but in both cases I'm not completely sure how to do dynamic symbols address resolving, heap functions/closures .....
I dont have experience in writing compilers .. so if someone can explain basic runtime compilation/loading tactics i will be grateful
Thanks
I assume that I can start extern gcc assembler each time from Lisp REPL and use C lib dynamic linker/loader (not pretty ?), or meaby create directly in memory opcodes ... but in both cases I'm not completely sure how to do dynamic symbols address resolving, heap functions/closures .....
I dont have experience in writing compilers .. so if someone can explain basic runtime compilation/loading tactics i will be grateful
Thanks