[gambit-list] Strategies on decreasing executable size for Gambit-based software for client distribution
Marc Feeley
feeley at iro.umontreal.ca
Fri Oct 3 13:59:02 EDT 2008
Currently there are only two (related) ways to get a smaller executable:
1) Use shared libraries. That is, compile the Gambit runtime to a
shared library (./configure --enable-shared). Then executables will
be really small; a "hello world" program will be a few kB.
2) Compile your program to a .o1 file (or a set of .o1 files). Then
start gsi and ask it to load these files, for example: gsi mod1.o1
mod2.o1 main.o1 . Of course you can put that in a shell script.
I've thought about implementing a "tree-shaker" solution which would
be closer to what you want. It would require that the whole runtime
be compiled with your program. This would not only allow the compiler
to eliminate dead code, it would eliminate the need for intermodule
jumps and thus improve performance. I'm not planning to try this
anytime soon but it should not be too hard to do, so if the need
arises I may reconsider.
Marc
On 3-Oct-08, at 12:24 PM, Mikael More wrote:
> Hi!
>
> Compiling (display "Hello world\n") to an individual executable file
> generates a ~3MB executable.
>
> What are the strategies available to get Gambit application binary
> sizes down as much as possible, for applications to be distributed
> to client machines, with a particular designated purpose?
>
> Can parts of the Gambit core somehow be taken away, such as (eval)
> support, flonum support, arithmetical functions?
>
> Is there any strategy using which one can compile Scheme code to
> binary form, in a way that only the functions used in the code is
> included in the binary? I.e. smaller binary for (display "Hello world
> \n") than for an application that uses cos, eval, open-tcp-client.
>
> Thanks
> Mikael
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
More information about the Gambit-list
mailing list