Live data from Hacker News

Pythran: Crossing the Python Frontier [pdf]

computer.org

51–60 of 70 posts

Re: Pythran: Crossing the Python Frontier [pdf]

#51
post #44

Earlier quoted context omitted.

Julia is FOrtran-indexed, and thus anathema to my religion.

In Fortran you can choose the starting index for each array separately. Even negative integers work. (But it's true that idiomatic Fortran starts indexing from 1.)

And the same is true in Julia.

Re: Pythran: Crossing the Python Frontier [pdf]

#52

Earlier quoted context omitted.

Such as?

The iterative linear solvers from IterativeSolvers.jl along with the preconditioner ecosystem is more expansive and uses genericness to have a lot more functionality (it's all able to be used with matrix-free operators, GPUs and Xeon Phis, arbitrary precision number choices along with complex, quaternions, etc.). The differential equations solvers from DifferentialEquations.jl covers a lot more domains than the stuff…

Cool! To be clear, I realize that could have come across as an accusatory "prove it!", it wasn't meant that way. I've just never really needed anything not available in the scipy ecosystem, except for some obscure statistical methods (or not that obscure, but with a non-terrible api) that I don't think are available in julia either.

Re: Pythran: Crossing the Python Frontier [pdf]

#53
post #7

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

Python has good support for a lot of functional concepts

Julia has much better support for functional programming.

Re: Pythran: Crossing the Python Frontier [pdf]

#54

Earlier quoted context omitted.

The iterative linear solvers from IterativeSolvers.jl along with the preconditioner ecosystem is more expansive and uses genericness to have a lot more functionality (it's all able to be used with matrix-free operators, GPUs and Xeon Phis, arbitrary precision number choices along with complex, quaternions, etc.). The differential equations solvers from DifferentialEquations.jl covers a lot more domains than the stuff…

Cool! To be clear, I realize that could have come across as an accusatory "prove it!", it wasn't meant that way. I've just never really needed anything not available in the scipy ecosystem, except for some obscure statistical methods (or not that obscure, but with a non-terrible api) that I don't think are available in julia either.

You'd have to go to R for those esoteric stats packages :). Yeah, I think that what's available in each of the languages is kind of unknown until people need it. It would be hard to catalog it all too in a way that's both accessible and comprehensive.

Re: Pythran: Crossing the Python Frontier [pdf]

#55
post #7

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

In research programming, you often spend as much or more time in data acquisition and munging than implementing core algorithms. Plus, more than in production code, the requirements change as you explore different applications and approach. And, because it's not production code, you have more opportunity to explore outputs at different stages to review function. It's effectively continual prototyping. All of these th…

I am giving a class on numerical methods and one student choose to use python (while my example code was in Julia). It was a pain to see how this student was constantly shooting himself in the foot due some particular behaviors of python and numpy. For instance the student did not expect that a list comprehension iterating over a numpy vector returns just a python vector. Also the fact that the index ranges the last value is excluded let to several bugs. The exercise involved a time dependent matrix and the student choosed to represent it as a 3d Array, but then he needed to constantly convert slices as a matrix to use matrix multiplication (maybe this is now better solved with python 3 and the @ operator). So in short for doing linear algebra, Julia is really more convenient to use.

Re: Pythran: Crossing the Python Frontier [pdf]

#56
> "As a matter of comparison, Cython does not support principles 1, 2, or 3 and has optional support for 4."

For 2 Type agnosticism, this can be emulated with a "fused type" in Cython. See this example: http://cython.readthedocs.io/en/latest/src/userguide/numpy_t...

But I think the major inconvenience with Cython vectorization is really not about `float32` and `float64`. You get `float64` NumPy array by default from floating-point calculations. The actual inconvenience is that the vectorized function cannot take a scalar input like the NumPy ones. To remain polymorphic, I usually have to perform an `is_scalar` check on the input in a Python wrapper before sending the input data to the Cython function.

Re: Pythran: Crossing the Python Frontier [pdf]

#57
post #7

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

I keep trying out Julia every year or so. And it has come a long way. Gone are the days of crashes, missing documentation, and terrible error messages.

And yet, for my particular area (audio signal processing), Julia is just objectively worse than Python in expressivity, library support, and even speed.

But I'll keep trying. Maybe next year.

Re: Pythran: Crossing the Python Frontier [pdf]

#58
When Python was announced, the three main things I remember striking dynamic languages people (apart from using a bastardized offside rule) were weird scope rules, lack of proper GC, and that it appeared to be designed particularly to preclude efficient implementation. We've subsequently seen the huge amount of effort that's been devoted to different ways of working around the implementation issue.

Re: Pythran: Crossing the Python Frontier [pdf]

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

Why do you need numpy if you have linear algebra built in?

Re: Pythran: Crossing the Python Frontier [pdf]

#60

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.

While I agree on a functional outlook, you're going to have a hard time generally making efficient, deterministic parallel programs, particularly distributed ones.
Post reply on HN