Porting Pythin to embedded platform

Gerhard Häring gh_pythonlist at gmx.de
Wed Jan 2 21:24:52 EST 2002


Le 02/01/02 à 23:21, Frederic Rudman écrivit:
> I'm new to python. I'm looking for a small portable language to quickly port
> to a small-memory based embedded system.

I'm all for Python, but Lua is somewhat smaller than Python (and less
powerful), while still having a nice syntax. Don't have the URL at hand.

> 1) Does anyone know where to best get info on that?

For specific problems, right on this list/newsgroup :-)

Deeply Embedded Python might be interesting to you:

    http://www.abo.fi/~iporres/python/

It's a port of Python 1.5.1 to an embedded system without even an OS.

> 2) What's the general footprint of Python in an embedded system (ballpark)
> 3) Is there a "parser phase" output to python (so that I only need to port
> the interpreter to the embedded base: no interactivity needed there anyway)

If I understand correctly, this is what happens anyway when "embedding"
Python, i. e. link to libpython.(a/so) resp. the Python DLL on Windows.

> and if so, what's the general footprint of the interpreter? Or do I need to
> port the parser as well?
> 4) What level of ANSI C api do I need for a port: all of it, the memallocs
> only, something in between?

There Python core shouldn't need much ANSI C. You task will probably be
to decide which modules you want to compile in. Just deselect the
modules you don't want to have in the core by editing Modules/Setup, and
for getting out even more, you can use a few #ifdefs.

Also check the autoconf build options (if autoconf applies to your build
process at all; else just "fake" it, like the Windows build process
does: edit pyconfig.h by hand). You can for example build without
threads and Unicode support.

My only experience is that I cross-compiled Python 2.2 for my Compaq
iPAQ running Linux/StrongArm.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))




More information about the Python-list mailing list