[Zope-dev] Parrot
Andrew Langmead
alangmead at boston.com
Mon Mar 21 13:36:29 EST 2005
On Mar 21, 2005, at 11:59 AM, Alan Milligan wrote:
> I'm not sure that it's necessarily this difficult. Perhaps it's simply
> a matter of implementing Python's import/dlopen semantics and running
> this C natively on the VM.
>
Take a look at something like
Zope-{version}/lib/Components/ExtensionClass/src
and look at the "Py{mumble}" functions that get called. To get Zope to
work under Python, either those classes will need to be written, or
compatible versions of those that interact with parrot. (which is what
Fred was asking about whether Parrot supported Python's C API) So faced
with the choice of re-writing things like ExtensionClass or emulating
enough of the Python C API to support them, I'd start with writing a
conversion library.
Some of the replacements would be easy. For example having a Py_None
global that can fetch the None object. Things like PyArg_ParseTuple
look like they map fairly well to
<http://search.cpan.org/~ltoetsch/parrot-0.1.2/docs/pdds/
pdd16_native_call.pod> Some of them (lets say PyModule_GetDict) might
be more difficult. The amount of glue code needed to convert
ExtensionClass's idea of what the cPython interpreter provides into the
functionality that the Parrot VM provides will start increasing. (does
a Parrot module have the equivalent of an embedded dictionary object?)
None of this is a show stopper, but it would take some time to get it
to work.
More information about the Zope-Dev
mailing list