[pypy-dev] Calling PyPy interpreter from C?

Bryan Buck bbuck3898 at emailias.com
Wed Jun 3 20:12:03 CEST 2009

Thank you for your reply. A subprocess is a possibility, although I'd
like to avoid it if I can. Of course I was hoping there was some already-
available way to do this that I had overlooked, but if necessary
modifying PyPy isn't totally out of the question. How difficult is
not easily? I guess I would have to change the translator to produce
a library instead of an executable, and create an API for calling the
interpreter from C? It does seem like a somewhat involved project,
but I'm just trying to gauge the relative difficulty vs. the other
possibilities I have in mind (all of which would also take
significant effort).

Bryan Buck

On Wed, 03 Jun 2009 12:17 -0500, "Benjamin Peterson" <benjamin at python.org> wrote:
> 2009/6/3 Bryan Buck <bbuck3898 at emailias.com>:
> > Hi,
> >
> > I have a question about PyPy - I hope this mailing list is the right
> > place for it, let me know if not.
> >
> > Is there any way to link PyPy's Python interpreter with a C program
> > and call it from C? I'm interested in embedding the interpreter in
> > another program as its scripting engine. (The reason I'm looking at
> > PyPy instead of CPython is that I'd like to use the sandboxing
> > feature.)
> Not easily. The best way would probably be to run pypy in a
> subprocess.
> >
> > Thanks for any information you can give me.
> --
> Regards, Benjamin

More information about the Pypy-dev mailing list