This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients abarnert, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, serhiy.storchaka, vstinner, yselivanov
Date 2016-02-05.23:01:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454713309.82.0.581776882782.issue26297@psf.upfronthosting.co.za>
In-reply-to
Content
> we need to move some optimizations from bytecode level to AST level

You may be aware that there is a long list of similar (old) issues proposing something similar:
https://www.python.org/dev/peps/pep-0511/#usage-1-ast-optimizer

My PEP 511 tries to propose a generic API to support all proposed optimizations.

--

I didn't try yet to do something like importlib to compile an AST optimizer written in Python into a frozen module and then use it in Python. It would allow to implement an AST optimizer in pure Python to ease its maintenance *and* have it builtin into CPython, rather than having to play with AST in C (less fun).

My plan for the PEP 511 is more to start to experiment multiple AST optimizers and bytecode optimizers outside CPython, wait until the code becomes more stable, and later discuss if one optimizer deserves to become part of Python stdlib.

"Writing an optimizer or a preprocessor is out of the scope of this PEP."

--

But maybe you would prefer to have a single and simple AST optimizer builtin Python without new additional API?

I don't want to block your effort on experimentation :-) I just see a nice opportunity to sell you the PEP 511 ;-)
History
Date User Action Args
2016-02-05 23:01:49vstinnersetrecipients: + vstinner, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, serhiy.storchaka, yselivanov, abarnert
2016-02-05 23:01:49vstinnersetmessageid: <1454713309.82.0.581776882782.issue26297@psf.upfronthosting.co.za>
2016-02-05 23:01:49vstinnerlinkissue26297 messages
2016-02-05 23:01:49vstinnercreate