[Pyrex] pyrex for parrots?

Michal Wallace michal at sabren.com
Wed May 18 04:49:22 CEST 2005


Hi there,

I'm doing some work on pirate, a python 
compiler for the parrot virtual machine:

    http://pirate.tangentcode.com/
    http://parrotcode.org/

As it stands, pirate compiles almost all of 
python's language features, so the bulk of 
the work that remains has to do with getting 
the various objects and modules ported over 
to run on parrot.

Parrot's internal object system is very similar
to python's. A PMC (Parrot Magic Cookie - don't
ask me why they called it that) is almost
identical to a PythonObject. To me, it should 
be possible to write a generic wrapper that 
would allow Parrot to use python's native types.

However, I'm not much of a C programmer... And 
I'm wondering if it would be possible to use
pyrex to help with this task.

I've done a little bit of work with pyrex (to 
get my mac talking to a MIDI keyboard) and I 
really liked how easy it was to wrap external C
code as a python module... Can I go in the other
direction, and wrap python objects for use in
another system?

>From my experiments, it seems that PythonObjects
work just fine outside of a python interpreter,
if you replace the reference counting and interpreter
locking functions with stubs, so I think this 
approach is viable. I'm just wondering if pyrex
could help with the job.

Any thoughts?

Sincerely,

Michal J Wallace
Sabren Enterprises, Inc.
-------------------------------------
contact: michal at sabren.com
hosting: http://www.cornerhost.com/
my site: http://www.withoutane.com/
-------------------------------------




More information about the Pyrex mailing list