Python on Tandy Model 102?

Skip Montanaro skip at pobox.com
Tue Jan 15 03:43:34 CET 2002


    Sean> you miss the point.  I have copied a perl binary onto a boot disk.

I'm not sure what the significance is of having copied a perl binary to a
boot disk is, but my new dental work is bugging me, so I'm feeling kind of
feisty today...

At first, I thought there must have been something magic going on w/ Perl:

    % ls -l /usr/bin/python
    -rwxr-xr-x    1 root     root       606588 Aug 30 10:37 /usr/bin/python
    % ls -l /usr/bin/perl5.6.1 
    -rwxr-xr-x    1 root     root        10376 Sep  9 17:03 /usr/bin/perl5.6.1

then ldd showed me that Perl hides most of its mojo in a shared library:

    % ls -l /usr/lib/perl5/5.6.1/i386-linux/CORE/libperl.so
    -r-xr-xr-x    1 root     root       857720 Sep  9 17:03 /usr/lib/perl5/5.6.1/i386-linux/CORE/libperl.so

And the standard supporting files are about the same size as well:

    % pwd
    /usr/lib/perl5
    % du -s 5.6.1
    21064       5.6.1

    % pwd
    /usr/lib/python2.1
    % du -s .
    24240       .

Until you consider that the python2.1 directory contains: .pyo and .pyc
files, the entire test suite, the config directory (with a libpython2.1.a),
lib-old, and whatever site-packages I've installed (Numeric, PIL, etc).  I
made a copy of that tree, then zapped all the cruft that wouldn't be
necessary.  I didn't pick through the various modules deleting this-n-that
module that would be uninteresting for bare bones work (Tkinter, threading,
unicodedata, etc).  Still, I managed to easily get that to 4.8MB.

If I was really serious, I could recompile Python statically with just the
extension modules and other features I wanted (no threads or complex
numbers, optimize for space, ...), compress it with upx, pick over the
library and throw much of it out, and probably get to something that would
fit on a boot disk with a reasonable suite of libraries as well.

I suspect your point is that the perl binary & shared library are together
sufficient to write lots of cool Perl code with nary a "use" or "require" in
sight.  I suppose that's another little notch in the Perl gun, but it
doesn't much matter to me.  For the simple tasks necessary on a brand new
system, bash and the standard Unix tools work just fine.  Hell, you can do a
lot with just "echo"... ;-)

who-needs-ls?-ly, y'rs,

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list