For Linux-based embedded systems in particular?
I'm thinking of running it on the Linksys's Linux-based open
source router WRT54G. It has 4MB flash and 16MB RAM. I think
another model has 16MB flash. Any possibilities of running
Python on these systems?
If Python is not the best candidate for embedded systems because
of the size, what (scripting) language would you recommend?
PHP may fit but I don't quite like the language. Anything else?
Loa is small but it does not seem to be powerful enough.
A few years back there was a "deeply embedded python" project,
but it's been dead for quite a while:
http://www.tucs.fi/magazin/output.php?ID=2000.N2.LilDeEmPy
http://mail.python.org/pipermail/python-announce-list/1999-August/000157.html
--
Grant Edwards grante Yow! My BIOLOGICAL ALARM
at CLOCK just went off... It
visi.com has noiseless DOZE FUNCTION
and full kitchen!!
--
Carl J. Van Arsdall
cvana...@mvista.com
Build and Release
MontaVista Software
TCL is fairly popular in the embedded space. Fairly small footprint.
The syntax is not to everyone's taste.
mak
| Grant Edwards wrote:
| > On 2006-07-14, Jack <nos...@invalid.com> wrote:
| >
| >> Is there a Python packaging that is specifically for
| >> embedded systems? ie, very small and configurable so the
| >> user gets to select what modules to install?
| >>
| >> For Linux-based embedded systems in particular?
| >>
| >> I'm thinking of running it on the Linksys's Linux-based open
| >> source router WRT54G. It has 4MB flash and 16MB RAM. I think
| >> another model has 16MB flash. Any possibilities of running
| >> Python on these systems?
| >>
| >
| > A few years back there was a "deeply embedded python" project,
| > but it's been dead for quite a while:
| >
| > http://www.tucs.fi/magazin/output.php?ID=2000.N2.LilDeEmPy
| >
http://mail.python.org/pipermail/python-announce-list/1999-August/000157.html
| >
| >
| This raises a good question. Is there a need for python to change
| somewhat to work better in an embedded profile? Are there many people
| in the community interested in using python for embedded projects?
|
I for one would be interested in using it - if it can be made small enough - I
do not see it helping me with the nitty gritty of getting a system running on
bare metal, as the low level stuff in a small system is still best done in
assembler - but if there is a display and some sort of keyboard and you can
stick to character based stuff it will ease the "application" part of the work a
lot - its a natural for doing things like logging and simple transactions - and
if the hardware is strong enough to get IP running - then it will open up the
systems to be web based...
It will also be of use as you could prototype on a PC - emulators and simulators
of small systems are mostly a pain as it takes a lot of effort to describe the
actual hardware before these are useful...
"Small" in this context is an eight bit processor (like an 80x1 | x = 3, 5 )
with some tricks done in the hardware to expand the native 16 bit address space
to address say half a Meg of battery backed up static ram as data space, with
about 62k of code space available for the interpreter and the custom OS to run
in - (Harvard architecture, not von Neumann) - These processors have lately been
improved from the original about half a MIP to now give sustained performance of
better than 10 MIPS - So they may just be able to cripple along doing the
interpreting - But its *Quite a Challenge* to fit the interpreter in, though...
It is easily possible to expand these processor's address space to 24 bits -
that is 16 Meg - and it may be a better approach to make a 'Virtual Processor'
to run the python stuff - is there a definition for that sort of thing, akin to
Java's Virtual Processor? - It would be a better approach, as the resultant
higher level work would be more portable - to port to another class of
processor, you need merely write the Virtual Machine - in whatever Language
takes your fancy...
What is the minimum set of instructions and structure needed to make a
simplistic Python? - does anybody know?
Might just be a pipe dream...
- Hendrik van Rooyen
> If Python is not the best candidate for embedded systems because
> of the size, what (scripting) language would you recommend?
>
> PHP may fit but I don't quite like the language. Anything else?
> Loa is small but it does not seem to be powerful enough.
You mean Lua ? Not powerful enough ? What do you mean by
that ? Lua is great IMHO. Sure it does not come with thousands
of libraries, but the language design is extremely clean, the
language constructs powerful and the footprint very small.
16kloc of C code can't hurt your embedded device can they ? ;)
Please tell us what kind of limitation you find in Lua ...
Cheers,
SB
There have been lots of Lisps for the PDP-11 and comparable machines.
Python's runtime semantics are close enough to Lisp that you could
probably get something Python-like running in that kind of machine,
maybe not exactly Python. You would probably want to use small-Lisp
implementation techniques like BIBOP ("big bag of pages", Google for
it) memory organization. But I don't think any of those Lisps were
really all that useful. They were written mostly as toys.
SIOD was a well known very small Scheme interpreter that you might
like to play with:
Here's another one that I like. I haven't actually used it but
studied it for possible integration in an embedded project that I
worked on but that got cancelled. It seems very good for this type of
thing. The runtime system is just 20k bytes or so:
Picolisp is also pretty neat but maybe not aimed the same way:
http://software-lab.de/down.html
Take the challenge: it is very impressive. Of course they tailored it
to Pico Lisp's capabilities, but you can see the challenge problem is
very sensible, and the Pico Lisp solution is much easier to get to
than a Python solution:
And here is a page with a link to a gumstix Python binary:
http://cs.gmu.edu/~eclab/projects/robots/flockbots/pmwiki.php?n=Main.Python
I'm trying this out as soon as I get home!
-- Paul
Here's another recently announced hobbyist microcontroller system:
http://makezine.com/controller/
Uses Atmel SAM7X processor, ARM7, 32-bit, 256K Flash, 64K SRAM, up to
55MHz.
On-board Ethernet and CAN (Controller Area Network - wireless)
Various I/O blocks and on-board sensors
~US$150
Start shipping Aug 1st.
No Python binary yet, but cross-platform tools are available. The guys
at this magazine could really get a jump with a Python build. Here's a
related site for this kit: www.uCHobby.com
-- Paul
I was thinking of the onboard Bluetooth of the gumstix boards.
-- Paul
Lua is a nice language. Like you said, it doesn't have many libraries
as Python does. Plus, it's still evolving and the libraries are changing.
I found a few functions not working last time I tried kepler libraries.
It's good for embedded systems though because of its small footprint.
Extensions implemented in C makes it possible that the installation size
doesn't blow up when new stuff is added, like in Python.
But I still like Python better for its power and for the style of the
language
itself. And I was hoping to find a Python implementation that bears the
principles of Lua to make it suitable for embedded systems :)
The usual contestants are Forth, Lua, Tcl, and various Lisps.
Python could play quite well at least in some situations, but
entirely no one has done much since 1.5.2 times (which doesn't
seem to me like a long time).
If you're to the point of sniffing at Lua's relative poverty
of libraries, you need to detail your requirements more pre-
cisely. What's "small" and "embedded" to some people is a
full-featured host to others. Generally speaking, yes, Lua
is still advancing significantly, or, from a different per-
spective, it hasn't stabilized yet. The point is that there's
necessarily no "Pareto optimizer" which is simultaneously
smallest, fastest, newest, most mature, most Unicode-aware,
most featureful, lowest-level, highest-level, ... That's why
there's a point to the engineering we do here.
I think we should see what happens with PyPy, which might be easier to
target at embedded platforms than CPython is. Main thing needed would
be a static compiler--I haven't followed PyPy enough to know if it
relies on having Psyco at runtime.
When I asked this question last on python-dev, there was exactly one
response, and that was "yes, it needs to change".
The natural question then is "in what way?". To this, the answer
was surprising: It needs better support for cross-compilation.
Apparently, cross-compiling Python is very painful, and I guess
cross-compiling distutils-based packages even more so.
Contributions in that direction are welcome.
Regards,
Martin
J> For Linux-based embedded systems in particular?
J> I'm thinking of running it on the Linksys's Linux-based open
J> source router WRT54G. It has 4MB flash and 16MB RAM. I think
J> another model has 16MB flash. Any possibilities of running
J> Python on these systems?
You can run Python on the NSLU2 (Slug)
http://www.nslu2-linux.org/
sw packages:
http://www.nslu2-linux.org/wiki/Unslung/Packages
the best (IMHO) firmware:
http://www.nslu2-linux.org/wiki/DebianSlug/HomePage