Tiny/small/minimalist Python?

2007-07-01 Thread rtk
I'm looking for information on building a tiny/small/minimalist/
vanilla python interpreter.  One that implements the core language and
a few of the key modules but isn't tied to any specific operating
system.

I guess I'm asking for the smallest subset of the standard Python
source code files that is necessary to get a working interpreter using
a plain C compiler.

Is this even possible?  If so, has someone done it already?  I've
looked on Google and in comp.lang.python but nothing comes up.

Thanks!
Ron

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 1, 10:12 pm, Paul Rubin  wrote:
> You've gotten good suggestions about Python configurations.  Depending
> on your application you might look at alternative languages as well.
> Lua and Hedgehog Lisp both come to mind as small embedded interpreters.

PyMite will get a closer look from me eventually but I found that Lua
will fit my immediate needs quite nicely.  Thanks for the suggestion.

FYI.. I wanted a simple version of Python to run on an ancient DEC
Alpha box.  I got VMS Python 2.5 up and running but it is too slow to
use.  It takes *minutes* to get the interpreter prompt after typing
'python'!  Lua, on the other hand, compiled without changes (used the
ANSI switch) and runs nicely.  I'm always up for learning a new
language anyway.

Ron

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 2, 9:43 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> rtk <[EMAIL PROTECTED]> writes:
> > FYI.. I wanted a simple version of Python to run on an ancient DEC
> > Alpha box.  I got VMS Python 2.5 up and running but it is too slow to
> > use.  It takes *minutes* to get the interpreter prompt after typing
> > 'python'!
>
> Something is wrong.  Maybe it's trying to DNS itself and timing out,
> or something like that.

The trouble is that the Alpha is too old.  VMS Python is compiled for
a newer machine with a different instruction set and the Alpha is
emulating the machine instructions it does not have (a nice feature of
OpenVMS, but of dubious value).

For my needs, the effort of recompiling all of Python wasn't worth
it.  Since Lua runs under Unix it will be perfect for my project.  I'm
writing a compiler for a simple language to 6502 assembly code.  I've
already written one in Python for small PIC microcontrollers (see PIC0
at http://www.geocities.com/oneelkruns/) and was planning on using
Python for this compiler project as well but it will be fun to use
something new, too.  I am thinking of doing most of the development in
OpenVMS, just for the heck of it.

Ron

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 2, 6:26 pm, Irmen de Jong <[EMAIL PROTECTED]> wrote:
> Back in the days my port of Python to the Commodore Amiga machine ran
> quite comfortably on a 50 mhz CPU with 4 Mb of RAM. (ok ok it was
> Python 1.5.2, that has to be said).
> Python started in about 5 seconds on that Amiga if I remember
> correctly. I'm quite sure your 'ancient' DEC Alpha box is way more
> powerful than my Amiga back then.

Yes, I agree (the box in question is an AlphaServer 1000 4/200), but
the killer is the fact that the Alpha is emulating *machine
instructions* that are part of the Python image which are not part of
the instruction set of that Alpha.  That's what kills performance.
When I asked about it on the VMS Python forum I was told to give my
Alpha to a museum and get a more powerful machine :)

I did look briefly at Python 1.5.2, since it is simpler, but I'm
taking the trouble I've had as an excuse to learn a new language.  So
far, I'm liking Lua, save the big pet peeve of starting indices at 1
and not 0 as all sane people do.  I'm currently using Python quite a
bit for other projects, so it won't be neglected.

Ron

-- 
http://mail.python.org/mailman/listinfo/python-list