[pypy-dev] connecting multiple interpreters (was: Re: change of strategy for the py3k branch?)

holger krekel holger at merlinux.eu
Thu May 31 11:12:17 CEST 2012


Hi Martijn,

On Wed, May 30, 2012 at 19:24 +0200, Martijn Faassen wrote:
> Hi there,
> 
> Just throwing in my little bit: any change that is made that would
> make it easier to run Python 2 and Python 3 interpretors in the same
> process would interesting, as I'm still vaguely dreaming (nothing
> more) of a combined interpreter that can run both Python 2 and Python
> 3 code.

Is there a strong reason you want this in the same process?

If not you might look into using execnet [1] for connecting python2 and
python3 interpreters which then run in two separate processes.  One can
build something higher level on top of the base execnet communication
along the lines of your "python3_import" suggestion.  It seems you anyway
need largely disconnected interpreter states.

On a sidenote, Quora uses execnet to connect python2 and PyPy [2].

best,
holger


[1] http://codespeak.net/execnet/example/hybridpython.html
[2] http://www.quora.com/Quora-Infrastructure/Did-Quoras-switch-to-PyPy-result-in-increased-memory-consumption


> Regards,
> 
> Martijn
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
> 


More information about the pypy-dev mailing list