[pypy-dev] question about core implementation language

Rocco Moretti roccomoretti at netscape.net
Tue Jan 21 05:08:17 CET 2003


logistix <logistix at zworg.com> wrote:

>I think the point is that Python as a language provides absolutely no
>access to the machine internals.  You can't examine memory contents,
>registers, I/O bus or call code directly.  

Can you do this all in C? (without library functions coded in assembly)

>As part of the bootstrap
>process the following four functions should probably be added to the
>interperter (either as builtin functions or a module):
>
>    GetMemoryFromOS()
>    ReturnMemouryToOS()
>    Peek()
>    Poke()
>
>ANd probably:
>    get/putRegister()
>    callCode()
>
>Other than that, everything could (eventually) be written in Python.

If we were writing an Operating System, I would agree with you. (We can put down a Python based OS as another goal of the project. <while 1:wink()>)

Fortunately, we aren't quite so low level. The standard OS functions tend to be higher level. As I understand it, much of libc.so on Unix systems is simply a very thin wrapper around OS functions which behave much like the C functions that call them.

Since we don't want to reinvent the wheel, it would probably be best to reuse the standard interface provided. This is where the minimal C core comes in. We can probably limit it to basic input and output (PyBIOS?), plus a generic mechanism for discovering and calling dll/so functions.

Or am I missing your point entirely?

-Rocco

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


More information about the Pypy-dev mailing list