5 ms·
Fortran actually isn't a static language. It's evolved over time. The last significant revision according to wikipedia is just over a year old. The beauty and h
by 6gvONxR4sf7o 7y ago
Fortran actually isn't a static language. It's evolved over time. The last significant revision according to wikipedia is just over a year old. The beauty and horror of it probably depends which era of it you're looking at.
- aidenn0 7y agoIn the late 90s I remember a saying roughly "I don't know what language scientists will be using in 20 years, but it will probably be named Fortran"
- dlivingston 7y agoAs someone professionally involved with computational physics / geophysics, I can vouch that Fortran is still heavily used in these domains. EDIT: for a modern, relatively new and highly-used scientific codebase that uses Fortran90 exclusively, see PFLOTRAN: https://bitbucket.org/pflotran/pflotran/src/master/ https://bitbucket.org/pflotran/pflotran/src/master/
- retrovm 7y agoRelated saying: a scientist can write a FORTRAN program in any language.
- airstrike 7y agoThat is witty on so many levels I'm simply in awe
- leephillips 7y agoThe quote is from Tony Hoare, winner of the 1980 Turing Award, in 1982. https://arstechnica.com/science/2014/05/scientific-computings-future-can-any-coding-language-top-a-1950s-behemoth/ https://arstechnica.com/science/2014/05/scientific-computing...
- the_af 7y agoI also like the saying "you can write FORTRAN in any language".
- sampo 7y agoAfter Fortran got its array syntax 29 years ago, there aren't many languages that you can use to write array-manipulating code like in Fortran. Maybe just Julia and NumPy?
- badrequest 7y agoWhat are the highlights of Fortran's array manipulation capabilities?
- myrryr 7y agoWell, things like... you have 2, 2 dimensional arrays of the same size, A and B. You want to make a new array, where each cell in A is added to the same cell in B. So you are going to do a loop over 2 variables, right? in FORTRAN the code is... C = A + B in Julia the code is C = A .+ B
- the_af 7y agoInteresting. Does it result in a compile error if you try arrays of different sizes? (If it's just a run time error, I don't see how it's different to implementing this with operator overloading in any language that supports it).
- palae 7y agoSure, if you try with non conformable arrays, gfortran for example would tell you something like this: Different shape for array assignment at (1) on dimension 1 Note that a scalar is conformable to any array, so that A = 2 for example would work for any shape of A, and would fill A with 2's.
- nwallin 7y ago
- DoofusOfDeath 7y agoComing from a C++/Java background, I loved the fact that in 2 hours I was able to learn enough Fortran 77 to take ownership of a very large app.
- simplicio 7y agoI think one of the reasons its still frequently used in some parts of academia is a Grad student can figure it out in a few day of self-study and move on to doing their actual research from there. As opposed to if you want them to work with a large C++ program, getting them familiar enough with the language to be useful can take half a semester.
- vanderZwan 7y agoIIRC, most people who use Fortran use it because there are extremely specialized physics libraries (or astronomy, or chemistry, and so on) that were probably written three to four decades ago by an extremely intelligent PhD student who lacks a proper programming background. Which suggests that the biggest source of horror would be that most code you'll come across was written by a non-programmer who is intelligent enough to translate an extremely complicated and niche problem domain into very clever and completely un-idiomatic code, who likely was unable to read their own library mere months after graduating because most PhDs don't fully understand their own thesis within months after graduating.
- yiyus 7y agoFor sure, there are a few cases like the one you mention (I personally work with this kind of code in a daily basis), but that's not the reason most people use Fortran. There are many libraries with a level of robustness and performance that you won't find anywhere else, there are highly optimized compilers, and it is the standard language in many fields. It's also quite safe for non-programmers. Those non-programmers write complex algorithms, but the code itself is not "clever and completely un-idiomatic". Most often, it is quite naive, just a series of formulas one after the other. You will find very long subroutines, bad names, some obvious inefficiencies, and maybe some spaghetti, but nothing to be afraid of.
- rossdavidh 7y agoMy understanding from supercomputing center folks is that, if you just want to run these half a dozen equations for a bajillion nodes in parallel as fast as possible, it is still the best language for the job. Not speaking from personal experience, though.
- 6gvONxR4sf7o 7y ago"Idiomatic" depends on language and domain and era and purpose. Consider the dgemm method in BLAS (double general matrix multiply, powers all sorts of modern code like numpy). It's such a workhorse, used by everything under the sun. But it does one thing. It multiplies two matrices of doubles. You're going to want to optimize the hell out of it and ensure it's correct, then never revisit it. It's been around (in the exact same form as far as I can tell) nearly as long as I've been alive. The right, idiomatic code for that is going to look different from the right, idiomatic code for something at the business logic level that changes every 6 months. It does it a disservice to shit on it like you are.
- mxcrossb 7y agoI’m a professional FORTRAN developer. I would say even FORTRAN 90 has a very rich and capable feature set. The problem is not the language, it’s the other developers :). A lot of codes have been developed by people used to FORTRAN 77, so even if they’re using new features the codes are poorly designed.