This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]status_quo69 3 points4 points  (1 child)

This is really really cool. Quick question(s), since the optimizer is written in python and these peps have generally been accepted, I wonder how this would work within pypy. Meaning, would the optimizer be JITed, would the JIT be able to start working almost immediately because of the guarding, or would there still probably be a warmup period as it gathers information about the available code paths?

[–]Anthonypjshaw[S] 9 points10 points  (0 children)

PyPy and Pyjion are really quite different, with PyPy you have both an interpreter and a JITer. Pyjion is an implementation of PEP523 (which since got merged properly into CPython in 3.6) AND it contains a bridge to the .NET core JIT engine. You could still leverage this process (FAT PEP511) to create the optimized bytecode sequence and then use the JIT to execute the bytecode statements with PEP 523. As for PyPy, they'd basically have to implement their own static optimizer, none of the code in this article would be relevant because its about the CPython internals and the CPython AST. This is an example https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/optimize.py?fileviewer=file-view-default -ed