5 ms·
We're writing it for the ground processing for data from a new space telescope. Personally, I wish I was writing C++ or Python, but it does allow scientists to
by xioxox 6y ago
We're writing it for the ground processing for data from a new space telescope. Personally, I wish I was writing C++ or Python, but it does allow scientists to start writing code much more easily than C/C++ does, though Python is now more familiar to younger scientists than Fortran. Python has the downside of a lack of stability, however.
Fortan is pretty painful to write in. The lack of an STL means writing algorithms yourself. There is no good set of libraries, so you have to write more stuff yourself.
The string support is horrendous. Most of the language is based around clumsy fixed size strings. I wish they would add a new flexible string type.
The compiler quality is not up to C++ standards. My code currently has some nasty workarounds for problems in gfortran. It's not good to keep discovering compiler bugs.
I also find it's much vaulted numerical capabilities overstated. Vectorization only works in simple cases. You can't drop down to using SIMD wrappers to fix this. It's nice to be able to pass arrays around more easily than C, however. A good C++ array library would be better, but that would require everyone to agree on one.
- pjmlp 6y agoThat is you problem right there, gfortran instead of something like Intel or PGI.
- xioxox 6y agoThat might fix the compiler quality and vectorization, but it doesn't fix the lack of library and terrible string support. Edit: plus to ship our code to others requires a free good quality compiler. In the C/C++ world, that is standard. In fortran, that is not the case.
- pjmlp 6y agoSure it does, because they also come with high quality libraries. Regarding C and C++ compilers, for the same reasons most high performance HPC computers use Intel, IBM, PGI compilers instead of plain gcc or clang.
- atsider 6y agoNowadays intel is not a reference for C++; the versions found on HPC compilers are not the fastest nor the best following the latest standards. I don't think commercial/open source is the key here: on the fortran side we have been long suffering from a lot of bugs/regressions with the current versions of intel fortran (with respect to the "latest" features like OOP) -- I would even say that they could be more than we are finding in gfortran. An explanation could be that they are investing time in supporting their big customers that likely use ancient code bases.
- pjmlp 6y agoMost code bases don't care about latest standards, rather quality of generated code.
- atsider 6y agoExactly, that is my point: so we are mainly still in the land of Fortran95, which is not designed for taking advantage of the latest features of the hardware.
- pjmlp 6y agoWhich doesn't change the current situation that commercial compilers still win, and NVidia/ARM contribution to LLVM comes from PGI experience. gfortran also does not do GPGPU. It was quite surprising to find out the lack of understanding from Khronos that CUDA supports Fortran out of the box, during OpenCL 3.0 Q&A session.
- atsider 6y agoBut then we are not talking about fortran anymore: I tried recently PGI and it is far behind than intel/gfortran with respect to the standard. I can code with CUDA in many more languages than fortran. If I wanted to use gfortran, I just would make a wrapper to CUDA with C++.
- neurostimulant 6y agoWhen I learn fortran years ago, I quickly gave up on string manipulation and custom file parsing. It just not worth it to struggle with string and file manipulation in fortran. Instead, I simply read or dump the array directly into raw file or netcdf file and wrote some python script to prepare input files for the fortran program or read and visualize the output.
- certik 6y agoOne of the authors of stdlib here. I agree with many of your points. Fortran needs a good compiler, that is why I started LFortran some time ago: https://lfortran.org/blog/2019/04/why-we-created-lfortran/ https://lfortran.org/blog/2019/04/why-we-created-lfortran/ and there is also Flang. Both Flang and LFortra are in development. GFortran is currently the most advanced open source compiler. See our page for the list of all compilers: https://fortran-lang.org/compilers/ https://fortran-lang.org/compilers/
- igouy 6y ago> Both Flang and LFortra are in development. GFortran is currently the most advanced open source compiler. Most of these tiny programs do at-least compile with ifc — https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/gfortran.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... — fewer of them compile with gfortran — https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/gfortran.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... — and fewer still compile with flang — https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/flang.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... No doubt there's something ifc specific about the programs, or something obvious to a Fortran programmer but…