News for hackers. Stuff that matters.
Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @11:55AM (#15477643)
As someone working on an Exascale project for electronic structure calculations, I have a theory about the longevity of Fortran. It's the fact that many of these codes were started years ago and the people who have the credentials and ability to get funding for super computing projects learned on Fortran and stayed with Fortan because they were scientist first and programmers second.

Modern Fortran has many nice features in 2017, but the people that wanted these features moved to C/C++ long before the features became available in Fortran and those that are left using Fortran are usually scientist, not programmers, and so don't care so much about these features. I think it is largely the older generation that says they will never stop using Fortran, in the survey mentioned in the article.

Just to suggest where the field is moving though. NwChem is a large successful electronic structure package using Fortran. Its next gen version NwChemEx that is being designed for exascale will exclusively be written in C++ (https://www.pnnl.gov/science/highlights/highlight.asp?id=441...).

Also just from experience people who work in HPC mostly would rather be writing C/C++, but use Fortran because they have to not because they want to.

Re:Why physicists still use Fortran (2015) by gnufx on Sunday October 15, 2017 @03:43PM (#15478904)
I makes no sense for people to have moved to C for things that have recently appeared in Fortran. What are the features they've been missing which have appeared in Fortran in the last 10 years?

So why is NWChem being re-written in C++, and what relationship does that have to exascale? Richard O'Keefe said 10 years ago ago "Why not start by rewriting the Fortran code _in_ Fortran? Fortran 90 is a very pleasant language." (NWChem is just in Fortran77 as far as I remember.)

I work in HPC, though I don't write numerical code these days, but I'd definitely prefer to write it in Fortran than C, and I'm not clever enough to use C++. I'd also much rather maintain typical scientific Fortran.

Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @06:32PM (#15479709)
I don’t use Fortran but I agree as of today and probably post 90 Fortran is nice enough but people moved to c++ for things like polymorphism and templates and pointers among other things. You could probably also rewrite nwchemex in Modern Fortran just fine. I’ll give you one example of why C++ might be easier though. Next gen linear algebra libraries are being written in c/c++ such as elemental and dplasma also Cyclopes tensor framework and probably others. When the libraries you want to use are in c/c++ the that can be the easiest path forward.
Re:Why physicists still use Fortran (2015) by sseagull on Sunday October 15, 2017 @12:10PM (#15477731)
Yes, the electronic structure community is rapidly moving away from Fortran.

In my opinion, Fortran will fall behind as newer hardware, libraries, etc, will drop Fortran support. Also, newer grad students are all much more interested in C/C++/Python. I think this is in part because the newer languages are widely used outside of science and therefore there is much more documentation and tutorials/guides. Not to mention that skills in those languages are transferrable to other areas (data science, machine learning, etc).

As a side note: Wow someone working on the ECP on HN? I'm tangentially related to the project (and just visited PNNL last week)

Re:Why physicists still use Fortran (2015) by jabl on Sunday October 15, 2017 @02:14PM (#15478312)
> Yes, the electronic structure community is rapidly moving away from Fortran.

Really? Seems to me that with very few exceptions (e.g. GPAW which is python/C and nwchemEx which I've never heard about until the parent poster mentioned it), electronic structure is pretty much a Fortran bastion.

(Source: I did a Phd doing mostly electronic structure calculations, graduated ~5 years ago)

Re:Why physicists still use Fortran (2015) by sseagull on Sunday October 15, 2017 @02:47PM (#15478536)
Well, it's moving, not moved yet.

New libraries are being written in C/C++, and maybe Python. This includes libraries that should form the foundation of the QM community (matrix/tensor and integral libraries). These are meant to take advantage of newer hardware and libraries which themselves are written in C/C++, and often in a way that is inaccessible from Fortran.

The old Fortran code will be around for a long time, but I don't know of any large-scale, serious efforts to develop new packages or major new functionality that are starting with Fortran.

(I'm not totally against Fortran - I just spend a week devloping in it. But I still much prefer C++ and Python)

Re:Why physicists still use Fortran (2015) by gnufx on Sunday October 15, 2017 @03:51PM (#15478941)
I don't understand why the implementation language of low level libraries should determine a high level language that uses them. In what way are C libraries inaccessible from Fortran, given that it defines interoperability with C?

I'm afraid you need a 10-, or preferably 20-, year perspective, not a week.

Re:Why physicists still use Fortran (2015) by sseagull on Sunday October 15, 2017 @04:02PM (#15479003)
I have been developing in Fortran for years. I just mentioned that as an aside.

About C compatiblity: Many C libraries use pointers in their interfaces. Interoperability is indeed defined by the Fortran 2003 standard, which I have used several times to wrap existing C libraries. However, much of the existing code is F90 only (some even F77...), and a vast majority of Fortran developers in the field are not familiar with even modules and other F90 features, let alone iso_c_binding in 2003.

Also, newer libraries tend to be C++ as well, which is more difficult (or at least more awkward) to wrap.

Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @06:42PM (#15479745)
It’s partly the power of library authoring that is moving things I think. To my knowlegdge most post lapack tensor algebra is all C/C++ also. I don’t know Fortran but I am not sure if it has the same flexibility when it comes to generic code and things like writing things like template expression math codes.

Finally the fact that groups like Facebook and google are writing their machine learning code in C++ shows that 1 they find it useful and 2 plenty performant. This kinda became a response to the comment above yours sorry.

Re:Why physicists still use Fortran (2015) by sseagull on Sunday October 15, 2017 @07:21PM (#15479916)
If you don't mind, I'd like to maybe chat with you a bit and get your opinion on some things (and maybe see if I've actually met you before). My (mainly throwaway) email is ytterbium35 (at major email service run by google).

If you don't feel like it, feel free to ignore.

Re:Why physicists still use Fortran (2015) by yosyp on Sunday October 15, 2017 @03:27PM (#15478807)
Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) is written in C++ and it's over 20 years old. The FORTRAN codebases seem to be centered around the finite elements/difference methods and the fluid dynamics community.
Re:Why physicists still use Fortran (2015) by sseagull on Sunday October 15, 2017 @03:40PM (#15478888)
Sorry, I wasn't specific. My comment mostly applies to the quantum mechanics (QM) community, rather than molecular dynamics. In QM, many people still run Gaussian/GAMESS/ADF/MolCAS/MolPro/Dalton, which are all Fortran (or majority Fortran). And most are Fortran 90 or earlier.

My background is in QM, so I guess that's my bias showing through :)

Re:Why physicists still use Fortran (2015) by gnufx on Sunday October 15, 2017 @04:01PM (#15478997)
Even in Molecular dynamics, there's dl_poly, for instance. Other things that come to mind in Fortran apart from nwchem are cp2k and castep.

Somewhere under http://www.archer.ac.uk, there's a summary of the time used by various codes on that UK "Tier 1" system.

Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @06:36PM (#15479726)
There is a lot of electronic structure in c and c++. For SMP there is psi4 and Orca also Garnet Chan has a new python C++ package. Then some widely used integral code generators generate c or c++ (libcints, Libint2)

On the parallel front MPQC has been around a long time and is C++.

Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @12:43PM (#15477900)
Just a grad student, soon to be postdoc, so not a big wig on ECP.
Re:Why physicists still use Fortran (2015) by neutronicus on Sunday October 15, 2017 @01:02PM (#15477972)
Specifically on the topic of HPC, I know of a lot more GPU stuff happening in C/C++ than in Fortran.
Re:Why physicists still use Fortran (2015) by cbcoutinho on Sunday October 15, 2017 @07:01PM (#15479843)
I thought Cuda was it's own language, which is accessed by either C or Fortran through bindings