[pypy-dev] Static bytecode instruction optimization and pypy (JIT?) optimization

William ML Leslie william.leslie.ttg at gmail.com
Tue Jul 11 05:36:38 EDT 2017


On 11 July 2017 at 19:28, Carl Friedrich Bolz <cfbolz at gmx.de> wrote:
> On 11/07/17 10:37, Rocky Bernstein wrote:
>> Sure but that's a straw argument and has a lot of packed opinions in it.
>> Things like "run my program exactly like I expect" is loaded with
>> opinions.  As has already been noted, Python removes "if 0:" by
>> default.  When I first saw that, I thought it was cool, but honestly it
>> wasn't "exactly as I expect" because I wanted my decompiler to recreate
>> the source code as written which helps me in testing and lo and behold I
>> was getting something different :-)  You know what?  I got use to it. I
>> had to change my opinion of what "exactly as I expect" meant slightly.
>
> Actually, to me this would be an argument to remove the "if 0:"
> optimization ;-).
>

Not least of all because `if False:` is more ideomatic, but False can
be bound to a value that is True, so the statement can't be folded!

The lengths the compiler goes to in order to do what you told it (:
and yet we still get bug reports that our built-in objects have
methods that cpython's built-ins don't have and this makes some
popular library give the wrong result.

Oblig: https://twitter.com/shit_jit_says/status/446914805191172096
https://twitter.com/fijall/status/446913102190505984

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely MAY reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to DENY YOU THOSE RIGHTS would be illegal without
prior contractual agreement.


More information about the pypy-dev mailing list