473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Re: Implementing my own Python interpreter

Ognjen Bezanov wrote:
Hello All,

I am a third year computer science student and I'm the process of
selection for my final year project.

One option that was thought up was the idea of implement my own version
of the python interpreter (I'm referring to CPython here). Either as a
process running on another OS or as a process running directly on the CPU.

Now, I can't seem to find a decent source of information on the python
interpreter. I have made the assumption that Python works very much like
Java, you have code that is compiled into bytecode, which is then
executed in a virtual machine. IS this correct?
Mostly. It is worth noting, though, that the Python bytecode is at a higher
level than Java bytecode. You can run other languages on top of the JVM using
Java bytecode (Python, for one), but Python bytecode is geared very much towards
running Python code with Python's object model.
Is there a good source
to give me an overview of Python internals? (I can look at the code, but
I would find it easier to understand if I can see the "big picture" as
well)
Several years ago, there was someone who wrote up such a document for a
university project. Unfortunately, my Google-fu has failed me, and I cannot find
it again.
Also, any pro's out there willing to chime on the feasibility of
implementing python to run directly on the hardware (without an
underlying OS)? I don't expect 100% compatibility, but would the basics
(branching, looping, arithmatic) be feasible?
Sure. There have been a few ports to microcontrollers. For example, the
GM862-QUAD-PY cellular module has an embedded Python 1.5.2 (plus a few 2.x
features):

http://www.gm862.com/en/products/gsm...&p_ac=show&p=4

PyMite is an open source implementation for 8-bit microcontrollers:

http://pymite.python-hosting.com/

TinyPy is similar, although I don't believe it ever aimed for (or has achieved)
running OS-less:

http://www.tinypy.org/

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Oct 13 '08 #1
0 1552

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

Similar topics

0
by: vincent Salaun | last post by:
hi all, here's my problem : I've embedded a python interpreter in our java application (based on the NetBeans palteforrm) using the Jython API : http://www.jython.org/docs/javadoc/index.html...
118
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely...
1
by: Petr Prikryl | last post by:
Do you think that the following could became PEP (pre PEP). Please, read it, comment it, reformulate it,... Abstract Introduction of the mechanism for language extensions via modules...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
5
by: Adam Atlas | last post by:
Does anyone know if it would be possible to create a CPython extension -- or use the ctypes module -- to access Python's own embedding API (http://docs.python.org/api/initialization.html &c.)?...
3
by: Marcin Kalicinski | last post by:
How do I use multiple Python interpreters within the same process? I know there's a function Py_NewInterpreter. However, how do I use functions like Py_RunString etc. with it? They don't take any...
4
by: Ognjen Bezanov | last post by:
Hello All, I am a third year computer science student and I'm the process of selection for my final year project. One option that was thought up was the idea of implement my own version of...
0
by: Matt Nordhoff | last post by:
Ognjen Bezanov wrote: FWIW... There are several other implementations of Python: IronPython (.Net) Jython (Java) PyPy (Python) <http://codespeak.net/pypy/dist/pypy/doc/home.html> You might...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.