Ruby for OpenMoko - got it small

Varga-Háli Dániel vargadanis at gmail.com
Tue May 29 05:33:01 CEST 2007


Hi all..

I sent a mail to the mailing list but it seems that for some reason
you guys didn't get it so I am sending it one more time. At least a
summary. I am waiting for you reactions.

I began to play with Ruby, Python and Perl, to see which one is small
enough to be put on OpenMoko.
I got some surprising results. At first I got Ruby to 9 and the 8 and
the 5.1MB. Right now it is 4.9MB and it is going smaller. The 5.1MB is
with gcc 4.1.2 and the 4.9 is with 3.4. I used stdlibc.
I also tryed to use GCC2.95 but the final app became unstable and
bigger so that is not gonna be good.
I didn't cross-compile it yet (but it should run on openmoko as it is
right now).

I had some experiments with uclibc. I compiled Ruby with no
optimization and nothin with uclibc that became fairly small but I had
some difficulties for come liraries. I forced the compilation just to
see how big it would be and it was sooooooo small that you would not
believe it.
If I can get everything working with uclibc (that I doubt), the code
would be below 3MB.
I didn't take anything out of the packages but I didn't add GTK2 yet.
It will come later. I don't know if we need that for now.
It is going to sound strange but in theorem the gcc and the uclibc
apps can be binary compatible if you know what you were doing. So that
means I could try to compile everything with uclibc and those parts
that won't compile against uclibc will be compiled with gcc3.4. It
sound strange for me too, but I think it could really work.
If I add that this is for ARM processor (arm920t) than the code will
be even smaller.
My final aim (I don't know if it is possible or not) is to bring Ruby
down to around 2MB. I thought when I started that gush, just go under
10 or maybe 7-8MB. And then I got to 4.9 and 5.1. (I have an
experimental 3.5 right now. I am testing it against actual code.)
So what do you think guys? Shall I keep going and trying to get it
smaller and faster or shall I abandon this and spend my time on
something more useful.

I tried the same stuff with Python but when Ruby was 9MB it was 14, I
believe, so I figured that for Ruby as a code scripting language is
better for now.




More information about the community mailing list