[gambit-list] loc count

Marc Feeley feeley at iro.umontreal.ca
Tue Feb 17 16:35:15 EST 2009


On 17-Feb-09, at 1:47 PM, lowly coder wrote:

> Not impressed at all. In fact, why is Gambit so big? Why is there  
> 100K LOC for the *.scm s? There doesn't seem to be many built in  
> libraries. All for optimizing?

Don't ask why but why not!  ;-)

There are on the order of 200 procedures and special forms defined by  
R5RS.  Gambit adds another 800.  So there are lots of builtin  
features.  About 50 KLOC are in the runtime system and 50 KLOC in the  
compiler.

I've written a few small Scheme's in my career... for example picobit  
is really small (it can fit in less than 10K on an embedded system)  
and BIT is just slightly bigger but it implements almost all of R4RS.

So my question to you... why are you not using BIT?  That would be the  
best choice if you are worried about size and R4RS conformance.

I suspect there are features of Gambit that you like and that make  
your life as a programmer simpler so you prefer using it to other  
Scheme systems.  Perhaps one of

- feature-full debugger (single-stepping, backtrace, descriptive error  
messages, error pinpointing, live repair, etc)
- space and time efficient scalable thread system (how many languages  
do you know can manage millions of threads?)
- full-featured I/O system integrated into the thread system
- ability to mix compiled and interpreted code seamlessly and to load  
compiled code dynamically
- ability to interface easily with C code
- one of the many extensions (homogeneous vectors, networking,  
subprocesses, hash tables, pretty printing, readtables, serialization,  
etc)
- complete numerical library with fast bignum operations
- etc (check the README file)

All of these things contribute to the "user experience" that people  
appreciate when using Gambit.  You aren't confronted with these things  
when you first start using Gambit (and that's the way it should be)...  
you only see the simple > prompt.  But these features are ready to be  
used when you are ready to use them.  It is true that these things  
take code space, so that the gsi executable (essentially the Gambit  
runtime system) takes about 3 MB, but that compares favourably to many  
other language implementations (on desktops) and it takes only 15  
milliseconds (real time) to start and exit, so it is lightweight  
enough to use for everyday scripting (on my computer that's about 3  
times slower than /bin/sh, but still twice as fast as Scheme48 (which  
also has a 3 MB footprint) and about 30 times faster than mzscheme).   
So Gambit is not as "bloated" as you might think!

Marc




More information about the Gambit-list mailing list