[Python-Dev] Python for Small Systems patch
Ivan Porres Paltor
Ivan.Porres at abo.fi
Wed May 5 15:17:17 CEST 1999
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
More information about the Python-Dev
mailing list