473,766 Members | 2,020 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
14 5616
Irmen de Jong <ir**********@x s4all.nlwrites:
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).
Even that sounds way too slow. Kyoto Common Lisp started in a few
seconds on a Microvax-class machine, and an Alpha running Vax
emulation should be at least as fast as that. Python shouldn't have
especially worse startup overhead than KCL unless it's doing something
silly.

I'd try running Python under a profiler and figure out what's slowing
it down. I don't understand the point of developing something in Lua
on a Unix system. Lua is a cute scripting language that's easier to
embed and sandbox than Python and is smaller, but the language itself
is not nearly as nice to code in. I suggested Lua because I was
imagining some kind of memory-limited embedded application that needed
a lightweight extension language without too much of an OS interface,
and Lua is good for that. Using it to write a compiler sounds
masochistic. If there's an obstacle to using Python, I'd even
consider using KCL (or its current incarnation), which has its own
compiler (compiles Lisp to C code) among other things. It does need
several MB of memory.
Jul 3 '07 #11
On Tue, 03 Jul 2007 05:25:28 GMT, Dennis Lee Bieber <wl*****@ix.net com.comwrote:
On Tue, 03 Jul 2007 02:26:43 +0200, Irmen de Jong
<ir**********@x s4all.nldeclaim ed the following in comp.lang.pytho n:
>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
....
And your's was likely more powerful than mine... I only had 2MB and no MMU
1.5.2 was great (and even more fun combined with ARexx)
How does Python combine with ARexx? Can you control applications
which provide an ARexx interface?

I stopped using my Amiga 4000/030 in 1996 or so, long before I
realized C isn't always the best choice for getting things done. I
messed around a bit with ARexx though, and while I found it neat to be
able to script an application from the inside or from the outside
using ARexx, I didn't really care for the language itself -- too
primitive for anything but the tiniest programs.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyn dns.org R'lyeh wgah'nagl fhtagn!
Jul 3 '07 #12
Dennis Lee Bieber wrote:
On 3 Jul 2007 10:03:45 GMT, Jorgen Grahn
<gr********@sni pabacken.dyndns .orgdeclaimed the following in
comp.lang.pytho n:
>How does Python combine with ARexx? Can you control applications
which provide an ARexx interface?
Irmen had supplied a Python module that had ARexx port operations.
It was not only possible to control a program with an ARexx port from your
Python programs, but it was also possible to create an ARexx host program
in Python. That is: a program exposing an ARexx command port to receive
ARexx messages. This could be done in a few lines of (python) code.

If you're interested, a bit more info is on the AmigaPython page:
http://www.monkeyhouse.eclipse.co.uk/amiga/python/

--Irmen
Jul 3 '07 #13
rtk wrote:
>
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.
Hmm, that in and of itself sounds like a good enough reason for me to
check it out! I despise zero-based subscripts. If I wanted to program
in assembler then I'd program in assembler!

:-)

Frank

Jul 4 '07 #14
In article <46************ *********@news. xs4all.nl>,
Irmen de Jong <ir**********@x s4all.nlwrote:
>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
Me, too.

I'm all for Lua--I began promoting it over ten years ago. However,
I was also working on Alphas at about that time, as well as VMS, and
of course with Python. While I don't recall that I ever had occasion
to test Python under VMS for Alpha much, I've used every other
combination quite a bit. Something's fishy about this report of a
minute-long launch-time.
Jul 6 '07 #15

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
1697
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
1762
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
1652
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
3707
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
4205
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
2247
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
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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
10168
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...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
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

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.