5 ms·
Fortran is in a very strange position in the current tech landscape. There is a race of sorts going on, to simplify and commoditize high performance computing
by nologic01 3y ago
Fortran is in a very strange position in the current tech landscape.
There is a race of sorts going on, to simplify and commoditize high performance computing in the post-Moore's era. This means enabling things like easy GPU programming, easy multi-core programming, easy "number crunching" etc. Historically this was the stuff of esoteric HPC (high performance computing) pursued by highly specialized computational scientists etc. (read -> an important but non-economic domain that subsisted largely on government funds).
Yet suddenly the same arcane HPC is effectively also the domain of "AI" and the associated planetary hyperventilation. Now all sorts of modern initiatives and language ecosystems aim to reposition to gainfully intermediate that AI revolution. Python was the scripting language that somewhat unexpectedly enabled all this, but now its warts are under the microscope and people think of various alternatives (julia), supersets (mojo), newcomers like rust etc. But that race is definetely not settled and it might not be so for quite some time. The requirements are highly non-trivial.
As far as taking part in this race, Fortran seems to have missed not one but several boats. Yet the fact remains that it was a language designed for number crunching and evolved as language for HPC, with parallel computing features (since F90) etc. It combines easy to read imperative numerical code with near optimal computational performance.
Its like a former world champion in a sport that was fell out of favor for a long time but is now unexpectedly back in vogue. So the question is whether the champ can get back into shape or make room for new contenders :-)
- certik 3y agoVery well put. Also a subset of Python: https://lpython.org/ https://lpython.org/, and it shares the internals with https://lfortran.org/ https://lfortran.org/, both run at the same speed. If you have any feedback, please let us know.
- ecshafer 3y agoI’ve done computational physics and used Fortran. There are some warts, like line length requirements. But for actual math, Fortran takes the cake
- milancurcic 3y agoAnd the line length limit will soon (with Fortran 2023 later this year) practically go away--a hard limit of 10,000 characters.
- pklausler 3y agoChanges to the standard don't instantly, or even eventually, cause corresponding changes in implementations. Code that needs to be portable to many implementations will need to worry about line length limits for a long time into the future. The Venn diagram of Fortran feature availability in the various actively maintained Fortran compilers is very messy, and the ISO standard is definitely not a subset of any of them. Standard-conforming code is not necessarily portable, and highly portable code is not necessarily standard-conforming, especially since Fortran '95.
- TheRealKing 3y agoThe hard line limit length is at 1,000,000 characters not 10,000. Also, all major compilers currently have flags to significantly extend the line limit length.
- milancurcic 3y agoYou're correct about the compiler flags. 10K will be the line length limit; the 1M limit is for a statement length that can span any number of lines.
- waveBidder 3y agohaving used both FORTRAN and Julia, Julia generally had less friction and comparable speed. JIT is great for having a very short programming loop. I definitely prefer Fortran to Python though for math programming.
- noobermin 3y agoThe insistence of using dot operators for nonsensical purity ruined julia for me. A good example of computer scientists ruining things.
- milancurcic 3y agoFortran-lang's role (as an open-source org) has been 4-pronged: Tooling (build system and package manager, testing, eventually compilers etc.), modernized and maintained libraries (stdlib, minpack, fftpack, etc.), community space (Discourse), and evangelism/marketing (website, Twitter, blog posts etc.). Some members participate in the standardization process of the language, but the groups and processes are separate and complementary. It's true that one goal may be to pick an important race and try to win it. Another goal, in my view more important, is to make Fortran more pleasant to use for people/Orgs who need it (there are many) and for people who love it (there are many). I've found that more often than not, people/teams first like working with a technology, and then come up with technical arguments for why that technology is the best choice. Often the arguments are valid, sometimes they're made up, but ultimately underneath it all you either like it or not and that's all that matters. My goal with Fortran-lang has been to slowly and continuously increase the surface area of Fortran's likability. Fortran is not for everyone, but for people who think it may be, we can work to make it better and more pleasant to use. As one example, we just released a small library to make high-level HTTP requests from Fortran applications: https://github.com/fortran-lang/http-client https://github.com/fortran-lang/http-client. This was a product of one of our Google Summer of Code contributors.
- interroboink 3y ago> people/teams first like working with a technology, and then come up with technical arguments for why that technology is the best choice. Words of wisdom (: Maybe it's not the way things should be, but it's common and very human. Sometimes I'll even catch myself retconning explanations for my choices in my own head, despite myself.
- legerdemain 3y agoThanks for writing Modern Fortran!
- janalsncm 3y agoLooking forward to mojo. Right now it’s not production ready but it’ll great for some of my ML-adjacent code. For other HPC work I’ve used Rust which has some annoying syntax and lacks some of the simplicity of python.
- certik 3y agoCheck out LPython as well (also in alpha): https://lpython.org/ https://lpython.org/