Incremental compilation

Basile Starynkevitch basile@starynkevitch.net
Mon Jan 1 00:00:00 GMT 2018


On 12/30/18 12:54 PM, Marc Nieper-Wißkirchen wrote:
> Am So., 30. Dez. 2018 um 09:46 Uhr schrieb Basile Starynkevitch
> <basile@starynkevitch.net>:
> My use case is compiling a Scheme library. It contains macro
> definitions whose transformation procedures have to be compiled at
> first to expand subsequent parts of the library body. Furthermore, the
> compiled transformation procedures of global macro defintions have to
> appear in the final dynamic library as well.
>
>> The common wisdom would be to compile each function separately (perhaps
>> into its own shared object on Linux).
>>
>> Be aware that it is perfectly acceptable to have a big lot (e.g. many
>> hundred thousands) of shared objects on Linux.
> That's good to know!
>
> So what I probably need is a kind of linker for libgccjit that
> combines many of the compiled shared objects into one final module
>
No you don't need that. You can keep the many compiled shared objects, 
and it would be actually simpler. You should not need to combine all 
these in a single module (except for optimization purposes, and for that 
special case, which in my view is not useful, you would recompile all 
your functions again).

In practice, since you are implementing a Scheme, you are dealing with 
closures, not plain C or GCCJIT functions. A closure contain a pointer 
to a function (and closed values).

Queinnec's book Lisp In Small Pieces should be highly relevant to you.

-- 
Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France



More information about the Jit mailing list