472,794 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 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
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


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


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


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 1501

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

Similar topics

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...
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...
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...
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...
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.)?...
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...
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...
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...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.