News for hackers. Stuff that matters.
Re:Why physicists still use Fortran (2015) by ptero on Sunday October 15, 2017 @04:27PM (#15479124)
Yes, C++ does not buy you that much. Sure, it is a more modern language, but when used by scientists (not software engineers) the advantages are hardly earth shattering. Much of complexity is hidden (as it should be) into libraries.

IMO, Python stands a better chance of breaking the Fortran's lock on physics related computing. Give it a few more years and enough numpy-based libraries might make Python a real competitor. My 2c

Re:Why physicists still use Fortran (2015) by dsacco on Sunday October 15, 2017 @04:49PM (#15479226)
I have to be honest with you, as someone who writes in both C++ and Python, I really do not see Python being more of a candidate than C++ for displacing Fortran.

Can you clarify why you think Python might be able to do it? For scientific computation with high performance requirements, Python is not competitive with Fortan or C++. For work that continues to happen in Fortran due to "academic inertia", my impression (and vague experience) is that researchers find the convenience of what they're accustomed to (Fortran) to be greater than the convenience of things like rapid prototyping offered by the various Python scientific computing and data analysis libraries. There is a mental overhead is switching, and I think most academics are sort of okay writing code in whatever is familiar and battle-tested if it means they can focus more on the research at hand.

In other words, I'm not saying you're wrong, but I'm not following your reasoning.

Re:Why physicists still use Fortran (2015) by ptero on Sunday October 15, 2017 @05:37PM (#15479439)
A disclaimer -- I do not work in physics, however a couple of recent physics Ph.D. that I work with expressed similar views.

Speed is not nearly as important now as it was 10-15 years ago. A typical scientist's worstation has 20 CPU cores. If I want to use 100 CPUs for a few days, it is trivial and 1000 is easy to get. Thus the fact that Python is slow(er) does not bother me unless I am setting up something major.

What matters though, is the availability of libraries that let me reliably run my experiments. If there is a bug, it must be in my code, not the library -- a "discovery" caused by a software bug is humiliating. This is where Fortran shines and Python is not quite there yet -- the decades of beating on those libraries made them very well understood and trusted.

Re:Why physicists still use Fortran (2015) by DannyBee on Sunday October 15, 2017 @05:56PM (#15479534)
"Speed is not nearly as important now as it was 10-15 years ago." Please try telling that to other users sometime. They do not seem to agree.
Re:Why physicists still use Fortran (2015) by ptero on Sunday October 15, 2017 @06:14PM (#15479635)
What users? I do work in research and this is what I see almost every time -- doubling the number of CPUs available for a simulation is trivial; getting someone to rewrite existing code to make it twice as fast on the same CPU is hard.

I am not talking about interactive programs -- a slow browser is annoying. I am talking about scientific computing. This is just my experience, can you provide some counterexamples?

Re:Why physicists still use Fortran (2015) by lostboys67 on Monday October 16, 2017 @04:37AM (#15481717)
So more cores means you can simulate to a higher resolution
Re:Why physicists still use Fortran (2015) by cknight on Sunday October 15, 2017 @05:20PM (#15479364)
I worked as a programmer in a molecular dynamics research group for a while. I was asked to work in Python because it was what the boss was familiar with - so there's some of the same inertia happening again, just with a new(er) language, I guess.

Speed is not a huge issue if you're happy to leave your simulation running overnight anyway, or if you have the option to just throw more and more cores at the problem (or in our case, both). The goal is to get your papers published. Code developing/interpreting/debugging time is generally far more serious an obstacle to that goal than simulation speed. I was the only developer there. Everyone else in the group coded on an almost daily basis, but none of them considered themselves programmers, and very few of them actually learn about good programming practices. They're biophysics researchers.

Having not worked in Python much before I was also pretty pleased to find that, having determined that I needed to use Dijkstra's algorithm for path-finding and then working out the smallest Standard Deviation between certain sets of data points, Python came with libraries to do both of those things off the cuff. It's just so easy, I can see why it has a favoured place in this field.

Re:Why physicists still use Fortran (2015) by War_Machine on Sunday October 15, 2017 @07:29PM (#15479944)
As long as Fortran is able to keep up with Python's capabilities (or any other language's for that matter), there seems to be absolutely no reason to make a change considering Fortran's history and familiarity in Physics. In other words, other languages need to make a big enough leap forward or Fortran to lag behind enough to justify a change. Your example just shows that it's fine to use other languages, and I agree, but it's not very compelling in promoting a change in language.
Re:Why physicists still use Fortran (2015) by hzhou321 on Monday October 16, 2017 @01:12AM (#15480984)
> Speed is not a huge issue if you're happy to leave your simulation running overnight anyway, or if you have the option to just throw more and more cores at the problem

What about those cases that it's the matter between throwing at 1000 core cluster and wether we can have results before next conference in a couple months. That is what really defines the scientific programming -- it's about feasible and infeasible. For other jobs, isn't it just matter of taste?

Re:Why physicists still use Fortran (2015) by lostboys67 on Monday October 16, 2017 @05:00AM (#15481794)
Depends not all scientific programming is at universities

when I worked for BHR group (a Hydro dynamics research organisation) some times we had emergency projects that had < 24 hour turn around. I recall one where a clinet had had a serious issue at a plant and we ran the simulation and produced a report in a single day

Re:Why physicists still use Fortran (2015) by harigov on Sunday October 15, 2017 @05:22PM (#15479375)
Just because python is slow doesn't necessarily mean that every library is also slow. With numpy/scipy, which are written in C with python bindings, scientific computation is pretty fast. Python is fast becoming standard language for data science with so many tools like notebooks that make it extremely easy to do many things. I am not sure how well it compares to Fortran but it is no brainer to use it over C++, especially for research needs.
Re:Why physicists still use Fortran (2015) by CardenB on Sunday October 15, 2017 @05:38PM (#15479441)
Isn’t numpy written in Fortran?
Re:Why physicists still use Fortran (2015) by dangerbird2 on Sunday October 15, 2017 @06:09PM (#15479617)
The native code python extensions for numpy are written in C, but numpy often links to matrix libraries written in Fortran like BLAS and LAPACK
Re:Why physicists still use Fortran (2015) by Redoubts on Sunday October 15, 2017 @08:23PM (#15480098)
Scipy is where a lot of the fortran is.
Re:Why physicists still use Fortran (2015) by brei on Sunday October 15, 2017 @05:39PM (#15479446)
I don't see Python displacing Fortran or C++, but I do see Python showing up in HPC as a platform for DSLs. Instead of handling the expensive part of the computation, Python acts as a UI layer / configuration manager / code generator. For an example, see fenics: [https://fenicsproject.org/]
Re:Why physicists still use Fortran (2015) by vacri on Sunday October 15, 2017 @05:03PM (#15479285)
In a previous discussion of this kind (I'm not in this area myself), a scientist had said that the speed of the languages is less important than iterating the algorithms, and it was a lot easier for non-developer scientists to work with python than with C++.
Re:Why physicists still use Fortran (2015) by dralley on Sunday October 15, 2017 @11:58PM (#15480735)
>Give it a few more years and enough numpy-based libraries might make Python a real competitor.

A lot of Numpy is written in FORTRAN.

Re:Why physicists still use Fortran (2015) by dagw on Monday October 16, 2017 @08:09AM (#15482614)
Hardly any of numpy is written in Fortran. It's basically all C and Python. Numpy does however links to and provide wrappers around some existing Fortran libraries.