HNHacker News
TopNewBestAskShowJobs

serge-ss-paille

163 karma · joined March 31, 2016

submissionscomments
serge-ss-paille··on Pythran – a compiler for Python scientific kernels – release
More materials for the curious:

Some benchmarks here: http://serge-sans-paille.github.io/pythran-stories/testing-p...

Some more benchmark you can run on you own: https://github.com/serge-sans-paille/numpy-benchmarks/

A comparison with Julia and native code: http://serge-sans-paille.github.io/pythran-stories/micro-ben...

serge-ss-paille··on Pythran as a bridge between fast prototyping and code deployment
> could you tell us the shortcomings of Cython

In order to achieve top performance, in the context of numerical simulations, you generally end up explicity writing the loops are implicit in high-level numpy (less abstraction).

Cython does not perform any high-level optimisation on the code, while Pythran does. For instance Pytrhan computes whether an array index may be negative or not, and generates wraparound only when needed. On the otherhand Cython requires a compiler directive to do so.

That being said, Cython can do plenty of stuff Pythran cannot: import native libraries, wrap classes, mixed Python/native mode etc. It has a much stronger codebase (more tested/validated) and a larger community.

serge-ss-paille··on Pythran: Crossing the Python Frontier [pdf]
(shameful author here)

One should read

  def rosen_explicit_loop(x): 
    s = 0. 
    n = x.shape[0] 
    for i in range(0, n - 1): 
      s += 100. * (x[i + 1] - x[i] ** 2.) ** 2. + (1 - x[i]) ** 2 
    return s
(edited)
serge-ss-paille··on Pythran: Crossing the Python Frontier [pdf]
(main dev writting) Don't focus too much on the claimless :-) There still are far more wide spread tools that solve the same kind of issues (numba, cython, julia)...

The idea of the change was that it's more important to convey the problem it solves rather than how it's done ;-)