Live data from Hacker News

Pythran: Crossing the Python Frontier [pdf]

computer.org

11–20 of 70 posts

Re: Pythran: Crossing the Python Frontier [pdf]

#11
post #7

Isn't this solved by julia? I think scientific community should use a more functional language rather than language like python tbh

Give me an ecosystem like Python has and I won't switch anyways because for when that happens I will have more experience with Python, which is much more important.

Re: Pythran: Crossing the Python Frontier [pdf]

#12
post #3

Interesting article but just skimming through it some things stand out immediately: 1.) The first snippet isn't even valid python code as floats don't have a shape attribute. s = 0. n = s.shape 2.) The inline latex math isn't rendered properly.

It should be the shape of x (actually, the zero'th element of the shape), but this is also a tad odd because this would assume that x is a numpy array, which isn't introduced until after this 'naive pure python' code block (i.e., before numpy is even introduced in the text).

Re: Pythran: Crossing the Python Frontier [pdf]

#15
post #7

Isn't this solved by julia? I think scientific community should use a more functional language rather than language like python tbh

Could you elaborate more on the advantages of a functional language?

Scientific work should strive to be functional by definition (identical input == identical output), so I could see why a programing language should reflect that.

Re: Pythran: Crossing the Python Frontier [pdf]

#17
post #7

Isn't this solved by julia? I think scientific community should use a more functional language rather than language like python tbh

Or by modern Fortran, which has had array operations since the 1990 standard? There are functional elements such as PURE functions and the FORALL construct.

Re: Pythran: Crossing the Python Frontier [pdf]

#18
post #7

Isn't this solved by julia? I think scientific community should use a more functional language rather than language like python tbh

just as soon as someone who knows C/C++ ports numpy and scipy and pandas. and gensim and nltk and sounddevice. and tensorflow and scikit-learn and keras....

Re: Pythran: Crossing the Python Frontier [pdf]

#19

Link to the actual software: https://github.com/serge-sans-paille/pythran

> "Pythran is an ahead of time compiler for a subset of the Python language, with a focus on scientific computing." and > a claimless python to c++ converter

(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 ;-)

Re: Pythran: Crossing the Python Frontier [pdf]

#20
post #9
post #3

Interesting article but just skimming through it some things stand out immediately: 1.) The first snippet isn't even valid python code as floats don't have a shape attribute. s = 0. n = s.shape 2.) The inline latex math isn't rendered properly.

I believe the input should be a numpy array of floats which has a shape attribute

(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)
Post reply on HN