"Martin v. Löwis", 11.08.2012 23:27:
>>> +1 We should add some form of setastoptimizer API in 3.4. Please start a
>>> PEP for this. It would be nice to include the ability to properly cache
>>> the
>>> ast optimizer output so that it does not have to run every time (in pyc
>>> files or similar,
Victor Stinner, 11.08.2012 20:30:
> I started to implement an AST optimizer in Python. It's easy to create
> a new AST tree, so I'm surprised that I didn't find any existing
> project.
>
> https://bitbucket.org/haypo/misc/src/tip/python/ast_optimizer.py
Since you're about to do pretty much the sa
Stefan Behnel, 12.08.2012 06:42:
> Chris Angelico, 12.08.2012 01:22:
>>> Other idea to improve this optimizer:
>>> - move invariant out of loops. Example: "x=[]; for i in range(10):
>>> x.append(i)" => "x=[]; x_append=x.append; for i in range(10):
>>> x_append(i)". Require to infer the type of var
Chris Angelico, 12.08.2012 01:22:
>> Other idea to improve this optimizer:
>> - move invariant out of loops. Example: "x=[]; for i in range(10):
>> x.append(i)" => "x=[]; x_append=x.append; for i in range(10):
>> x_append(i)". Require to infer the type of variables.
>
> But this is risky. It's th
On Sun, Aug 12, 2012 at 11:17 AM, Victor Stinner
wrote:
> The idea would be to allow the developer to specify explicitly what he
> wants to optimize. I'm using a configuration class with a list of what
> can be optimized (ex: len(int)), but it can be changed to something
> different later.
>
> It
>> Other idea to improve this optimizer:
>> - move invariant out of loops. Example: "x=[]; for i in range(10):
>> x.append(i)" => "x=[]; x_append=x.append; for i in range(10):
>> x_append(i)". Require to infer the type of variables.
>
> But this is risky. It's theoretically possible for x.append t
On Sat, Aug 11, 2012 at 8:16 PM, Eric Snow wrote:
> On Sat, Aug 11, 2012 at 6:03 PM, Brett Cannon wrote:
> > It would also be very easy to expand importlib.abc.SourceLoader to add a
> > method which is called with source and returns the bytecode to be written
> > out
>
> Yes, please. Not having
On Sat, Aug 11, 2012 at 6:03 PM, Brett Cannon wrote:
> It would also be very easy to expand importlib.abc.SourceLoader to add a
> method which is called with source and returns the bytecode to be written
> out
Yes, please. Not having to hack around this would be nice.
> which people could overr
On Sat, Aug 11, 2012 at 2:30 PM, Victor Stinner wrote:
> Hi,
>
> I started to implement an AST optimizer in Python. It's easy to create
> a new AST tree, so I'm surprised that I didn't find any existing
> project.
>
> https://bitbucket.org/haypo/misc/src/tip/python/ast_optimizer.py
>
> To test its
On Sun, Aug 12, 2012 at 4:30 AM, Victor Stinner
wrote:
> I started to implement an AST optimizer in Python. It's easy to create
> a new AST tree, so I'm surprised that I didn't find any existing
> project.
Very nice idea!
> Other idea to improve this optimizer:
> - move invariant out of loops.
On Sat, Aug 11, 2012 at 3:27 PM, "Martin v. Löwis" wrote:
> I think you misunderstood. What gps is concerned about (IIUC) that some
> people add ast optimizers in some run of Python, but other AST optimizers in
> a different run. Then, if you use a Python byte code
> file, you should be able to fi
On 8/11/2012 2:30 PM, Victor Stinner wrote:
Hi,
I started to implement an AST optimizer in Python. It's easy to create
a new AST tree, so I'm surprised that I didn't find any existing
project.
https://bitbucket.org/haypo/misc/src/tip/python/ast_optimizer.py
To test its peephole optimizations (
+1 We should add some form of setastoptimizer API in 3.4. Please start a
PEP for this. It would be nice to include the ability to properly cache the
ast optimizer output so that it does not have to run every time (in pyc
files or similar, etc) but can verify that it is the specific ast optimi
On Sat, Aug 11, 2012 at 11:47 AM, Gregory P. Smith wrote:
>
> On Sat, Aug 11, 2012 at 11:30 AM, Victor Stinner
> wrote:
>>
>> Hi,
>>
>> I started to implement an AST optimizer in Python. It's easy to create
>> a new AST tree, so I'm surprised that I didn't find any existing
>> project.
>>
>> http
On Sat, Aug 11, 2012 at 11:30 AM, Victor Stinner
wrote:
> Hi,
>
> I started to implement an AST optimizer in Python. It's easy to create
> a new AST tree, so I'm surprised that I didn't find any existing
> project.
>
> https://bitbucket.org/haypo/misc/src/tip/python/ast_optimizer.py
Neat!
>
>
Hi,
I started to implement an AST optimizer in Python. It's easy to create
a new AST tree, so I'm surprised that I didn't find any existing
project.
https://bitbucket.org/haypo/misc/src/tip/python/ast_optimizer.py
To test its peephole optimizations (by checking manually its final
bytecode), I wr
On Sat, Aug 11, 2012 at 9:40 AM, Georg Brandl wrote:
> On 08/11/2012 04:49 PM, R. David Murray wrote:
>> On Fri, 10 Aug 2012 16:56:43 -0700, Chris Jerdonek
>> wrote:
>>> On Fri, Aug 10, 2012 at 9:21 AM, brett.cannon
>>> wrote:
>>> > http://hg.python.org/cpython/rev/0a75ce232f56
>>> > changeset:
On 08/11/2012 04:49 PM, R. David Murray wrote:
> On Fri, 10 Aug 2012 16:56:43 -0700, Chris Jerdonek
> wrote:
>> On Fri, Aug 10, 2012 at 9:21 AM, brett.cannon
>> wrote:
>> > http://hg.python.org/cpython/rev/0a75ce232f56
>> > changeset: 78485:0a75ce232f56
>> > user:Brett Cannon
>> > dat
On Fri, 10 Aug 2012 16:56:43 -0700, Chris Jerdonek
wrote:
> On Fri, Aug 10, 2012 at 9:21 AM, brett.cannon
> wrote:
> > http://hg.python.org/cpython/rev/0a75ce232f56
> > changeset: 78485:0a75ce232f56
> > user:Brett Cannon
> > date:Fri Aug 10 12:21:12 2012 -0400
> > summary:
> >
19 matches
Mail list logo