Mailing List Archive

Python for Small Systems patch
Python for Small Systems is a minimal version of the python interpreter,
intended to run on small embedded systems with a limited amount of
memory.

Since there is some interest in the newsgroup, we have decide to release
an alpha version of the patch. You can download the patch from the
following page:

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

There is no documentation about the changes, but I guess that it is not
so difficult to figure out what Raul has been doing.

There are some simple examples in the Demo/hitachi directory. The
configure scripts are broken. We plan to modify the configure scripts
for cross-compilation. We are still testing, cleaning
and trying to reduce the memory requirements of the patched interpreter.
We also plan to write some documentation.

Please send comments to Raul (rparra@abo.fi) or to me (iporres@abo.fi),

Regards,
Ivan


--
Ivan Porres Paltor Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science Phone: +358-2-2154033
Lemminkäinengatan 14A
FIN-20520 Turku - Finland http://www.abo.fi/~iporres
Re: Python for Small Systems patch [ In reply to ]
Ivan Porres Paltor wrote:
>
> Python for Small Systems is a minimal version of the python interpreter,
> intended to run on small embedded systems with a limited amount of
> memory.
>
> Since there is some interest in the newsgroup, we have decide to release
> an alpha version of the patch. You can download the patch from the
> following page:
>
> http://www.abo.fi/~iporres/python
>
> There is no documentation about the changes, but I guess that it is not
> so difficult to figure out what Raul has been doing.

Ivan,
small Python is a very interesting thing,
thanks for the preview.

But, aren't 12600 lines of diff a little too much
to call it "not difficult to figure out"? :-)

The very last line was indeed helpful:

+++ Pss/miniconfigure Tue Mar 16 16:59:42 1999
@@ -0,0 +1 @@
+./configure --prefix="/home/rparra/python/Python-1.5.1"
--without-complex --without-float --without-long --without-file
--without-libm --without-libc --without-fpectl --without-threads
--without-dec-threads --with-libs=

But I'd be interested in a brief list
of which other features are out, and even more which
structures were changed. Would that be possible?

thanks - chris

--
Christian Tismer :^) <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
10553 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
we're tired of banana software - shipped green, ripens at home
Re: Python for Small Systems patch [ In reply to ]
Christian Tismer wrote:
> Ivan,
> small Python is a very interesting thing,
> thanks for the preview.
>
> But, aren't 12600 lines of diff a little too much
> to call it "not difficult to figure out"? :-)

Raul Parra (rpb), the author of the patch, got the "source scissors"
(#ifndef WITHOUT... #endif) and cut the interpreter until it fitted in a
embedded system with some RAM, no keyboard, no screen and no OS. An
example application can be a printer where the print jobs are python
bytecompiled scripts (instead of postscript).

We plan to write some documentation about the patch. Meanwhile, here are
some of the changes:

WITHOUT_PARSER, WITHOUT_COMPILER
Defining WITHOUT_PARSER removes the parser. This has a lot of
implications (no eval() !) but saves a lot of memory. The interpreter
can only execute byte-compiled scripts, that is PyCodeObjects.

Most embedded processors have poor floating point capabilities. (They
can not compete with DSP's):

WITHOUT-COMPLEX
Removes support for complex numbers

WITHOUT-LONG
Removes long numbers

WITHOUT-FLOAT
Removes floating point numbers

Dependences with the OS:

WITHOUT-FILE
Removes file objects. No file, no print, no input, no interactive
prompt. This is not to bad in a device without hard disk, keyboard or
screen...

WITHOUT-GETPATH
Removes dependencies with os path.(Probabily this change should be
integrated with WITHOUT-FILE)

These changes render most of the standard modules unusable.
There are no fundamental changes on the interpter, just cut and cut....

Ivan
--
Ivan Porres Paltor Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science Phone: +358-2-2154033
Lemminkäinengatan 14A
FIN-20520 Turku - Finland http://www.abo.fi/~iporres
Re: Python for Small Systems patch [ In reply to ]
Ivan Porres Paltor wrote:
>
> Christian Tismer wrote:
> > Ivan,
> > small Python is a very interesting thing,
> > thanks for the preview.
> >
> > But, aren't 12600 lines of diff a little too much
> > to call it "not difficult to figure out"? :-)
>
> Raul Parra (rpb), the author of the patch, got the "source scissors"
> (#ifndef WITHOUT... #endif) and cut the interpreter until it fitted in a
> embedded system with some RAM, no keyboard, no screen and no OS. An
> example application can be a printer where the print jobs are python
> bytecompiled scripts (instead of postscript).
>
> We plan to write some documentation about the patch. Meanwhile, here are
> some of the changes:

Many thanks, this is really interesting

> These changes render most of the standard modules unusable.
> There are no fundamental changes on the interpter, just cut and cut....

I see. A last thing which I'm curious about is the executable
size. If this can be compared to a Windows dll at all. Did you
compile without the changes for your target as well?
How is the ratio? The python15.dll file contains everything
of core Python and is about 560 KB large.
If your engine goes down to, say below 200 KB, this could
be a great thing for embedding Python into other apps.

ciao & thanks - chris

--
Christian Tismer :^) <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
10553 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
we're tired of banana software - shipped green, ripens at home