findinglisp wrote:Yup, take a look at ECL. When you call COMPILE-FILE in ECL, it effectively spits out a temporary .c file, invokes GCC on it, and then when you LOAD it, it dynamically loads the resulting dynamic lib.
Most other Lisp compilers don't work this way, BTW. Others, like SBCL, have their own compiler/assembler internal to the Lisp image and can generate assembly code directly into memory or to a file without the need of gcc.
yes, i know that, but for example in ECL when you type function in REPL i doubt that you get compiled function (it does not invoke GCC), so if I want something like that I need to invoke gcc on every REPL input or implement interpreter beside compiler
I'm more interested in SBCL/CCL way, to assemble things directly into heap but i'm not sure how to implement this, obvious compiler need to have runtime support to push code into heap ... so it looks like that i dont know how to connect runtime and compiler to have working environment