Small languages (was Re: Lua, Lunatic and Python

Stephen J. Bevan stephen at dino.dnsalias.com
Thu Dec 18 01:31:32 EST 2003


Charles Steinkuehler <charles at steinkuehler.net> writes:
> I could be wrong, but it looks to me like SIOD requires a C runtime
> library to function.  One of the big attractions of using Forth (at
> least to me) is it's lack of reliance on a runtime library.  Direct
> interfacing to the linux kernel should be possible in an
> architecture-neutral manner, and the ~10K overhead of a Forth kernel is
> very minimal when compared to the ~75K overhead of SIOD (from the
> website) + the hundreds of KBytes (if not MegaBytes) of overhead for the
> runtime C library.

After stripping out various add-ons like crypto, HTML, base64,
... etc., and statically linking it against diet-libc I get :-

  $ file xsiod
  xsiod: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
  $ size xsiod
     text	   data	    bss	    dec	    hex	filename
    92169	    588	   6192	  98949	  18285	xsiod
  $ 

Which is <100K for everything -- no hidden costs of dynamic linking or
external libraries.  There is still more than could be done e.g. get
rid of any use of stdio (which if we believe the dietlibc output costs
7+KB) and trim away functions in the SIOD standard library that would
not be needed for the given application.


> Using a forth-based solution to create the root ramdisk image would
> drastically reduce the footprint of the initial ramdisk image, remove
> reliance on a particular C runtime library (allowing folks to build
> runtime root images based on uClibc, glibc, or whatever), and provide a
> *VERY* powerful yet tiny runtime scripting/programming language for
> extending the system.

IMHO what drastically reduces the footprint is not using glibc at all.




More information about the Python-list mailing list