[pypy-dev] update (+patch) on embedding pypy

Kibeom Kim kk1674 at nyu.edu
Tue Apr 17 01:46:35 CEST 2012


On Mon, Apr 16, 2012 at 5:03 PM, Amaury Forgeot d'Arc
<amauryfa at gmail.com> wrote:
> Hi,
>
> 2012/4/16 Kibeom Kim <kk1674 at nyu.edu>
>>
>> 1. Can other embedding c-api (e.g. PyObject_CallObject) be supported
>> in the similar manner?
>
>
> There are already 430 functions which are already supported...
> PyObject_CallObject was one of the easiest.
> The recent developments brought the ability to start a pypy interpreter from
> C code.
>
oh ok.

>>
>> 2. Can we embed multiple independent pypy?
>>
>> (http://bytes.com/topic/python/answers/793370-multiple-independent-python-interpreters-c-c-program)
>
>
> Not very well, but this is also the case for CPython.
> Note that PyObject_CallObject for example has no context to specify which
> interpreter it would use;
> and there can only be one PyObject_CallObject function in a single
> executable.
>
> Why do you need independent interpreters?
> Would multiple threads suit your needs?
>
> --
> Amaury Forgeot d'Arc

It's not my needs, but I think that's better-designed interpreter lib.
If pypy decides to support, I guess there should be two versions of
api sets, one for CPython api compatibility, and the other one for
multiple independent interpreter support.

Py_Initialize();
Py_Initialize(PyPyInterpreter pypyinterpreter);

PyObject* PyObject_CallObject(PyObject *callable_object, PyObject *args)
PyObject* PyObject_CallObject(PyPyInterpreter pypyinterpreter,
PyObject *callable_object, PyObject *args)

But maybe no one needs it... I don't know..

-Kibeom Kim


More information about the pypy-dev mailing list