Small languages (was Re: Lua, Lunatic and Python

Gustavo Niemeyer niemeyer at conectiva.com
Mon Dec 15 17:49:56 CET 2003


> > I really don't see Python and Lua overlapping in their fields right
> > now. Lua is clearly not developed with general system tasks in mind,
> > and Python is clearly not developed to be a configuration language,
> 
> I think there was some flame wars on TCL/whatever a while (well, ages)
> back, where RMS was insisting that people should not settle for
> stripped down languages in favor of "complete" languages. I tend to
> agree.

Heh.. "people should not".. That's the tipical RMS arrogance.
It's easy to say "people should not" when you don't actually need
something. I'm a big Python fan, and a contributor as well.
Choosing Lua for apt-rpm was not a preference, but a need.
APT-RPM is used in installer environments, where Python is not
available. The APT-RPM library has about 500kb already. Turning a
multi-megabyte interpreter as a requirement is not an option in
that case.

Today, the Lua interpreter source code is included inside APT-RPM
tarball. I've also included in the build all default Lua standard
libraries (string handling, etc), a posix module, and a regular
expression module, moving the static library size to 130kb (no
external dependencies, besides libc).

As an interesting note, I've also written a SWIG based Python
interface, which is available with the APT-RPM tarball as well.
Unfortunately SWIG is not very good at handling C++, so I had
to patch it while buildling the APT-RPM support. More recently,
I've been in contact with David Beazley, and there's a chance
that the next SWIG will support enough C++ to compile the Python
bindings. If that doesn't happen, I'll probably move to a handmade
interface in the future. I'm trying to avoid that, as this will
be a huge work, given the wide API.

> Python is a wonderful configuration language, and I don't see
> the need to do much "configuring" on systems that can't handle Python.

Understood. Something like "You're in trouble anyway.. why should you
make your work any easier?". I disagree.

> BTW, how big is something like Guile or other minimal Scheme anyway?
> Why wouldn't it do?

Guile's static library is about 1MB in size. In that case I'd
choose Python, not Guile. I don't remember about Scheme, but while
looking for some embeddable language I've gone trough that path,
and ended up in Lua as the best option. Let me know if you find
something better.

> > or as small as possible. This may change in the future, but I belive
> > (and hope) that instead of Lua becoming a general purpose language,
> > the Python core will get smaller, with something like the pypy
> > project.
> 
> How small does it need to be for your application?

Do you have something with 1kb? :-)

-- 
Gustavo Niemeyer
http://niemeyer.net





More information about the Python-list mailing list