On 24 Sep., 18:25, "D. S. McNeil" <dsm...@gmail.com> wrote:
> Leif wrote:
> > Any reasonable compiler does constant folding and loop-invariant code
> > motion; even Python's byte-code compiler should do that.
>
> Almost none is done.  Only the most trivial cases are handled. [...]

OMG. That's why I said "reasonable" and "should"... ;-)

[Perhaps Python does some JIT peephole optimization, since dynamic
binding of functions / methods (including operators) is always a
problem, i.e., someone could actually redefine e.g. '/'. Although
interestingly Python apparently breaks that in one of your examples,
since it evaluates 2+3 at *compile* time.]


-leif

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to