473,749 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tiny/small/minimalist Python?

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.pytho n but nothing comes up.

Thanks!
Ron

Jul 1 '07 #1
14 5615

"rtk" <on********@hot mail.comwrote in message
news:11******** **************@ o11g2000prd.goo glegroups.com.. .
| 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.pytho n but nothing comes up.

Google 'tinypython' and first entry is Mark Hammond's answer to nearly same
question. And some other responses might help you

Jul 2 '07 #2
In article <11************ **********@o11g 2000prd.googleg roups.com>,
rtk <on********@hot mail.comwrote:
>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.pytho n but nothing comes up.
Jul 2 '07 #3
rtk <on********@hot mail.comwrites:
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.
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.
Jul 2 '07 #4
Cameron Laird wrote:
In article <11************ **********@o11g 2000prd.googleg roups.com>,
rtk <on********@hot mail.comwrote:
>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.pytho n but nothing comes up.
.
.
.
Tiny Python, PyMite, EmbeddedPython, Diet Python, deeply embedded
python, ...--I need to write up a page that explains these.
Python binary/exe its self dosnt include much. if you get the full build
and just remove modules, you can strip a lot out.. scripts that try
import those files just wont work.
Jul 2 '07 #5
rtk
On Jul 1, 10:12 pm, Paul Rubin <http://phr...@NOSPAM.i nvalidwrote:
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

Jul 2 '07 #6
rtk <on********@hot mail.comwrites:
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.
Jul 2 '07 #7
rtk
On Jul 2, 9:43 am, Paul Rubin <http://phr...@NOSPAM.i nvalidwrote:
rtk <oneelkr...@hot mail.comwrites:
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 microcontroller s (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

Jul 2 '07 #8
Paul Rubin wrote:
rtk <on********@hot mail.comwrites:
>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.
Something is definately wrong.

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.

--Irmen
Jul 3 '07 #9
rtk
On Jul 2, 6:26 pm, Irmen de Jong <irmen.NOS...@x s4all.nlwrote:
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

Jul 3 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3470
by: Dave Brueck | last post by:
Below is some information I collected from a *small* project in which I wrote a Python version of a Java application. I share this info only as a data point (rather than trying to say this data "proves" something) to consider the next time the "Python makes developers more productive" thread starts up again. Background ========== An employee who left our company had written a log processor we use to read records from text files (1...
2
1696
by: Sven Kobow | last post by:
Hello, I'm not yet a python programmer but a python user. I faced a problem with tiny fonts in a wxPython app on a GNU/Debian system. Under Gentoo Linux the fonts are displayed in a normal readable size. Only on that Debian system fonts in the whole app are rather tiny. I spend quite a long time googling for a solution and found several hints on font problem issues in wxPython but none fitted to that mentioned above. Does anybody has a...
0
1760
by: Lucas Correia Villa Real | last post by:
Hello, I'm working with an ARM cpu which has only 64MB of flash memory available for storing applications. This system is running with an X server, some office applications and now I need to have a small Python interpreter, too (Python 2.2 is fine). I've googled a bit for the subject, but the only relevant links were outdated, and I haven't found any active project so far. Does anyone know of implementations which are still being...
10
1649
by: borges2003xx | last post by:
Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? thanx in advance
4
3706
by: Kinsley Turner | last post by:
Hey-ho, I'm getting a bit out of my depth porting the 'tiny encryption algorithm' from C to python. Ref: http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm http://www.simonshepherd.supanet.com/source.htm#new_ansi Specifically I don;t know how to handle a C-long block and perform the
5
4078
by: soeren | last post by:
Hello, two days ago I stumbled across a very strange problem that came up when we were printing tiny double numbers as strings and trying to read them on another place. This is part of an object serialisation framework that cannot be done in binary format currently, so please no comments about this ,-)) It took quite some time to shrink down the problem but it looks like that C++ does not behave well in regards to very tiny numbers.
0
5573
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
31
4202
by: melinama | last post by:
Hello, I've looked through alt.html and this group for an answer to my question. However, I found only cranky arguments with, occasionally, bits of hard-to-understand code - out of context - each of which is slammed by the next people along in the thread. So I'm afraid to ask this but I need to know!...
10
2246
by: Chris Thomasson | last post by:
Here is the example code: - http://appcore.home.comcast.net/vzoom/example/interface.zip which is an analog of the following technique: - http://groups.google.com/group/comp.lang.c/msg/6cf857051ca4029b
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.