[Ecls-list] Building ECL

Juan Jose Garcia Ripoll lisp at arrakis.es
Wed Feb 23 10:10:52 UTC 2005

Jan Rychter wrote:

>I have tried building ecls (CVS HEAD) in various configurations, mostly
>to estimate its space requirements. I encountered some problems: [...]
Solved on CVS. Statically linked executables are produced now if you use 
--disable-shared. No other option is required.

>And another question, this one unrelated to the build process. Is there
>a way to save byte-compiled code to files and load them subsequently? I
>didn't find any mention of it in the manuals. It would be really useful
>for small embedded systems where space is limited -- I'm assuming the
>bytecode representation is significantly more compact than shared
>libraries that have gone through the C compiler. I'm willing to live
>with smaller execution speed, but space is a premium issue.
This is indeed a mayor concern for me. Having a printable representation 
of bytecodes would be very easy: bytecodes are made of a vector of 
uint16 (bytecodes.codes), plus a vector of lisp objects containing the 
data that is manipulated by the function (bytecodes.data) and optionally 
a lexical environment if the function was a closure (bytecodes.lex). One 
should simply

1) choose a reader macro that does not interfere with what an user 
expects from the reader. In think in clisp it is #Y
2) write a function for this reader macro.
3) extend si_write_ugly_object() for printing bytecodes with the same 
4) optionally, add machinery in the compiler so that functions can be 
stored as bytecodes instead of as C code.

So the answer is that there is no way to serialize bytecodes yet, but it 
would be a couple of days effort for somebody familiar with ECL's 
internals... Or also a nice way to _become_ familiar with it I would be 
willing to review the patches ;-)

Finally, it is yet unclear to me whether serializing bytecodes is more 
efficient that doing a gzip on a source file. After all, since by 
default bytecodes keep debugging information, your bytecodes will be 
full with the symbols for the variables, the data of the function, etc.


More information about the ecl-devel mailing list