Live data from Hacker News

Pythran: Crossing the Python Frontier [pdf]

computer.org

21–30 of 70 posts

Re: Pythran: Crossing the Python Frontier [pdf]

#21
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.

"Fortran is the only language that has an International Standards Body that sees that sees scientific programmers (and by extensions HPC programmers) as their target audience." https://www.youtube.com/watch?v=4Gp5YJfinOA

Re: Pythran: Crossing the Python Frontier [pdf]

#22
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....

That was done quite awhile ago? Julia now has a bunch of unique stuff Python doesn't have because the basics are already done.

Re: Pythran: Crossing the Python Frontier [pdf]

#23
post #9

Earlier quoted context omitted.

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)

...

    n = x.shape[0]

Re: Pythran: Crossing the Python Frontier [pdf]

#24
post #7

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

Maybe. It's currently just a safer bet to learn and use Python. Easier to get a job after you fail getting your next grant. I have so far seen zero Julia job ads. Hell, I see more e.g. Haskell and Fortran job ads than Julia.

Re: Pythran: Crossing the Python Frontier [pdf]

#25
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....

https://github.com/JuliaPy/PyCall.jl

Re: Pythran: Crossing the Python Frontier [pdf]

#27

Earlier quoted context omitted.

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.

That's a pretty broad statement. And it's a goal that a lot of scientific work simply doesn't allow for.

Any stochastic process will have variability for a given set of inputs. I think there are more fields within the umbrella of Science where purely functional programming isn't an achievable ideal--let alone a desirable one--than there are where this is a good fit.

You can make the argument that all programming should be functional on its own if you want, and I'm open to that. But this it's pretty sketchy to me to just shoehorn all scientific work into a category of work that should definitionally be functional.

There are huge numbers of scientists who do not agree with that at all.

Re: Pythran: Crossing the Python Frontier [pdf]

#28
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.

I've always felt that it was a bit of a shame that Fortran is falling by the wayside nowadays, a lot of universities are teaching C++ (or even C) instead now and it just isn't as pleasant to use for scientific computing work.

Re: Pythran: Crossing the Python Frontier [pdf]

#29

Does anyone know how this compares to existing Python-to-C++ transpilers like Cython or Shedskin?

Cython is a bit different from CPython / Pythran / Shedskin in that you need to learn the Cython language, which is a Python-ish programming language, but not Python.

Shedskin and Pythran look somewhat similar to me (disclaimer: I've contributed quite a bit to Shedskin but have never used Pythran so far), except in Shedskin you don't even need annotations like with Pythran (the downside being the finer control you have of the native types used is through the transpiler options). Also, Shedskin development is not much active these days — to say the least — and there's zero support for Python 3, while Pythran is under fairly active development has beta support for Python 3.

If you're interested in Python / native implementations, you might be interested by Nuitka as well: http://nuitka.net/

Post reply on HN