Python for Embedded Devices?

B

Brandon

Java seems to have taken off as the platform and language of choice
for many embedded devices. Would it be feasible for Python(perhaps
running on an embedded version of Linux) to act in such a capacity.
Most of my experience with Python has been with Unix-type scripting
tasks and using it when it is an applications built in scripting, but
I know some people try to use to build larger complex applications. Is
the Python interpreter portable and good enough to be used in resource
constrained devices like cell phones?
 
R

Rene Pijlman

EP:
I previously read some comparisons which did not show Python in a good light
in this regard: i.e. Python is slow compared to Perl, C++, Java.

These are usually pure compute benchmarks at the interpreted language
level. In practice I find that my Python programs perform somewhat better
than Java, probably because Python has many libraries implemented in C,
whereas Java has many pure Java libraries.
 
J

Jeff Epler

There have been a few projects to bring Python to "small" platforms like
handheld computers such as wince and palm. These are typically full
implementations of Python with a few omissions from the core language
(eg unicode, complex numbers) and a stripped-down set of standard
modules. I think this typically requires a meg or two for installation,
and I don't know whether these projects are actively maintained.

Jeff
 
C

Cameron Laird

Java seems to have taken off as the platform and language of choice
for many embedded devices. Would it be feasible for Python(perhaps
running on an embedded version of Linux) to act in such a capacity.
Most of my experience with Python has been with Unix-type scripting
tasks and using it when it is an applications built in scripting, but
I know some people try to use to build larger complex applications. Is
the Python interpreter portable and good enough to be used in resource
constrained devices like cell phones?

Yes.

And no. Yes, Python is certainly feasible for current
cellular telephones. I don't see it poised for explo-
sive growth there, but neither for technical defects
nor because of any lack of good wishes on my part.
'Twould thrill me to write more Python on embedded
projects.

The one point I'd emphasize when thinking about this
is that "embedded devices" covers a wide range, as I
believe you already know. Some developers commonly
work with hardware that's far, far more constrained
than are cellular telephones; others, who also program
embedded devices, can't be distinguished from vanilla
Linux coders.
 
M

mir nazim

Java seems to have taken off as the platform and language of choice
for many embedded devices. Would it be feasible for Python(perhaps
running on an embedded version of Linux) to act in such a capacity.
Most of my experience with Python has been with Unix-type scripting
tasks and using it when it is an applications built in scripting, but
I know some people try to use to build larger complex applications. Is
the Python interpreter portable and good enough to be used in resource
constrained devices like cell phones?

Why only embeded devices?
It should possible to create complete J2EE like platform for python
for creating complex applications. [ i m no expert. lokking for a
simple discussion.]
 
C

Cameron Laird

.
.
.
It should possible to create complete J2EE like platform for python
for creating complex applications. [ i m no expert. lokking for a
simple discussion.]

This thread interests me, if only because you and the original
poster have such different perspectives from mine. I'm confi-
dent that Python can support something like J2EE in a technical
sense, and also that J2EE is an important part of Java--but is
it a *good* part? I'm sincerely unconvinced that there's much
there Python *should* emulate (apart from what Python already
has). J2EE's certainly a marketing success; I don't know what
it teaches us about how to rationalize application development,
though.

I'm even more certain that there's no model in prospect for
organizing the current Python development team to create such
a framework.

Briefly, I see J2EE, like .NET, as aimed at the commodification
of application development. It's aimed at "Enterprise" teams
of mediocre, alienated coders. I have no enthusiasm for Python
competing with that approach.
 
P

Phil Schmidt

The one point I'd emphasize when thinking about this
is that "embedded devices" covers a wide range, as I
believe you already know. Some developers commonly
work with hardware that's far, far more constrained
than are cellular telephones; others, who also program
embedded devices, can't be distinguished from vanilla
Linux coders.

I am one such developer who works with very small systems: 8-bit
micros with under 128K flash and 4K RAM. I am keenly interested in
Python or some other similar langauge that would run on such hardware.
'C' is the usual language for such environments, but I believe that,
in many cases, using a dynamic and 'object-able' language would reduce
development time and improve product quality significantly.

I've looked at Io, Lua, PyMite and Pippy, to name a few, and none are
quite appropriate. Io is perhaps the closest match, if it were
stripped down a lot.

I have been tinkering around with some ideas to make a new language to
fit the environment I deal with. This is slow work, as I haven't a lot
of time to spend on it, and I am not a language design expert, but I'm
having fun with it!
 
J

Jeff Epler

I am one such developer who works with very small systems: 8-bit
micros with under 128K flash and 4K RAM. [...]

Luxury! My current interest runs to microcontrollers with 2k flash, 128
bytes sram, and 128 bytes eeprom. Yours sounds a lot like one of the
larger models in the same line, though. (Atmel AVR)

It's actually quite fun, and since 128 bytes is too little to use
recursion or dynamic allocation for anything, stuff like reference
counting and GC are unneeded---not a lot of strings, either. C is a
not a bad language for this hardware.

Jeff
 
M

Miki Tebeka

Hello Phil,
I've looked at Io, Lua, PyMite and Pippy, to name a few, and none are
quite appropriate. Io is perhaps the closest match, if it were
stripped down a lot.
Have you looked at tinyscheme? It a full scheme interpreter in one C file.
http://tinyscheme.sourceforge.net/home.html
I have been tinkering around with some ideas to make a new language to
fit the environment I deal with. This is slow work, as I haven't a lot
of time to spend on it, and I am not a language design expert, but I'm
having fun with it!
Maybe you can work with Fredrik Lundh on Pytte (http://effbot.org/zone/pytte.htm)

HTH.
Miki
 
N

Nicola Larosa

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Maybe you can work with Fredrik Lundh on Pytte
(http://effbot.org/zone/pytte.htm)

Thanks for this link. There's nothing to download there, unfortunately. :^(

Something else that's interesting for embedded devices is an environment for
working in Python and generating the RTOS:

"WhatOS is a free open source embedded system development solution. It
provides a complete set of tools for creating high-quality, reliable embedded
systems. These include: a real-time operating system (RTOS) generator, a
simulator for testing and debugging generated systems, and tools for
interacting with systems remotely after they have been embedded."

http://www.sticlete.com/whatos/index.html


- --
Nicola Larosa - (e-mail address removed)

"I am afraid that if the United States had to live by the [monetary]
rules that are imposed on, say, Brazil, the USA would become a
developing country in one generation. It's the system that is
currently unstable, unfair and not working." -- Bernard Lietaer

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/+SfUXv0hgDImBm4RAkkxAKCgi/prJnHbYv4BtiJwK/0g/KB3SQCfeyFR
y5tG2razumSaRYG5cyVe7Y4=
=a8cP
-----END PGP SIGNATURE-----
 
D

Dave

What about cases where the OS shields you from porting issues?

This is a question which interests me at the moment, as I'm
considering some future embedded work.

Python is available as a package for NetBSD. To what extent
does this mean that, if you can install NetBSD, you can run
a Python interpreter?

http://www.netbsd.org celebrates the fact that it targets
SBCs and some handheld devices.

Has anyone out there any experience of Python on NetBSD on embedded platforms?

Here's hoping,

Dave.
 
C

Cameron Laird

What about cases where the OS shields you from porting issues?

This is a question which interests me at the moment, as I'm
considering some future embedded work.

Python is available as a package for NetBSD. To what extent
does this mean that, if you can install NetBSD, you can run
a Python interpreter?
.
.
.
I'm quite confident that a good NetBSD installation will be
able to run (core) Python nicely. Was that your question?
While I haven't used NetBSD myself on any interesting hard-
ware, all my experience tells me the combination will be
robust.
 
P

Peter Hansen

Phil said:
I am one such developer who works with very small systems: 8-bit
micros with under 128K flash and 4K RAM. I am keenly interested in
Python or some other similar langauge that would run on such hardware.
'C' is the usual language for such environments, but I believe that,
in many cases, using a dynamic and 'object-able' language would reduce
development time and improve product quality significantly.

I've looked at Io, Lua, PyMite and Pippy, to name a few, and none are
quite appropriate. Io is perhaps the closest match, if it were
stripped down a lot.

Would you be willing to spend a sentence or two describing what basic
problems you feel each of those has for your application?

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top