Fortran

Marko Rauhamaa marko at pacujo.net
Thu May 29 14:55:34 EDT 2014


Steven D'Aprano <steve+comp.lang.python at pearwood.info>:

> You're talking as if this were only theoretical. It is not. The state
> of the art in compiler techniques has advanced a lot since the old
> days of the Pascal P-Machine. Parakeet, for example[2], compiles
> numeric functions to optimized machine code on the fly using
> decorators, using Static Single Assignment, which some wag described
> as being "covered in Fisher Price's My First Compiler"[3].

>From your Parakeet link:

   An eager reader may be thinking:

       I can just stick that decorator atop any Python function and it
       will magically run faster? Great! I'll paste @jit all over my
       code and my Python performance problems will be solved!

   Easy with those decorators! Parakeet is not a general-purpose
   compiler for all of Python. Parakeet only supports a handful of
   Python's data types: numbers, tuples, slices, and NumPy arrays.

Thus, by its own admission, it is not the Holy Grail I've been talking
about: a Python optimizer that makes Java redundant. For example, I have
never really had to deal with numeric computations; I have implemented
numerous communication protocols in C, C++, Java and Python. I would
love to stick to Python, but I haven't seen the performance numbers
posted that would support that decision.

Also, I know people who are using Java in large-scale online game
servers. Could they be using Python instead?

> [1] Unladen Swallow was not a failure. It's just that expectations
> were so high ("OMG OMG Google is making a Python compiler this will be
> more powerful than the Death Star and faster than time travel!!!1!")
> that it couldn't help but be a disappointment.

That would be *my* expectation. Until then, I'm quite happy with CPython
performance in the numerous niches where it is enough.


Marko



More information about the Python-list mailing list