[HN Gopher] The State of Fortran ___________________________________________________________________ The State of Fortran Author : MakisH Score : 75 points Date : 2022-04-06 18:20 UTC (4 hours ago) (HTM) web link (arxiv.org) (TXT) w3m dump (arxiv.org) | ogogmad wrote: | Are things like higher order functions and closures relevant | features for Fortran programmers? This is an open-ended question. | | [edit] Just to be clear, I don't think Fortran has these. | jordemort wrote: | The fact that "The State of Fortran" is a paper on arXiv instead | of a blog post actually says a lot about the state of Fortran. | milancurcic wrote: | The paper is published and available in early access in IEEE | CiSE: https://ieeexplore.ieee.org/document/9736688 | pjmlp wrote: | Indeed, it isn't something that is only cool for a month or to | be embraced by magpie developers. | buescher wrote: | I read that as "with all the good and bad that implies". That | others didn't... well that's Fortran for you. Or maybe just | hackernews. | kergonath wrote: | What do you mean? It's a paper written by several people on the | standard committee of who contributed to the draft standard, on | which blog would they put it? | | Traditionally, these things were published in ACM SIGPLAN | Fortran Forum (or on NAG's servers for historical reasons). | Arxiv is really natural, given the direction scientific and | technical publishing is taking. This is a heavy duty language | used by scientists and people like mechanical and nuclear | engineers. Not the latest JavaScript framework or full stack | doodad from Google. | shadowofneptune wrote: | Oh yeah, a blog. Really keeping up with the times there | compared to a paper. | ogogmad wrote: | What kind of editor support does Fortran have? I think a language | is more than just a _language_ as such, and the surrounding | environment is at least as important if not more. I 've used | things like Mathematica, RStudio and Matlab, as well as Java | IDEs, and these make all the difference. | pjmlp wrote: | There have been Visual Studio plugins for commercial compilers | since ages. | zozbot234 wrote: | Last I checked, you had to write out your program on paper, | using the special Fortran coding forms. Then you just gave the | written out forms to someone who would type out your codes at a | keypunch and give you a deck of freshly punched cards, or you | could take care of it yourself. | Stratoscope wrote: | For anyone who wants to experience the first part of this | process, here is a FORTRAN Coding Form (in caps because | that's how it was spelled back then): | | https://upload.wikimedia.org/wikipedia/commons/1/18/FortranC. | .. | | Print that in color on 81/2x14" (legal size) paper and get to | work! | | Of course there were a few other steps in the programming | process back then. | | 1. A _Systems Analyst_ took business requirements and turned | them into an overview diagram of the system structure. | | 2. A _Programmer_ took those diagrams and drew detailed | flowcharts. These included every "if" statement, every loop, | every detail. They were in effect code, but in a diagram | form. Don't forget your IBM Flowcharting Template! | https://ids.si.edu/ids/deliveryService?id=NMAH-AHB2012q05389 | | 3. A _Coder_ read the programmer 's flowcharts and wrote out | the equivalent FORTRAN code on multiple pages of Coding | Forms. | | 4. A _Keypunch Operator_ read the Coder 's forms and punched | them onto cards, one card for each line of a Coding Form. | | 5. Finally we get to the High Priest of this operation. A | _Computer Operator_ - the only person allowed to touch the | Computer! - ran your deck of cards through the machine and | blessed you with a printout. Which was usually a core dump. | colechristensen wrote: | It is entirely possible this person is telling the truth that | this was the state of things the last time they checked. :) | | Fortran was absolutely run on punch cards, which also informs | some of the strangeness of its formatting, especially pre- | fortran-90. | ratsmack wrote: | I programmed FORTRAN on punch cards and on paper tape using | a teletype, over an acoustically coupled modem, timesharing | to a Univac 1103. Those were the days. | eyegor wrote: | The Intel oneapi hpc toolkit (now free for commercial use too) | has plugins for Visual Studio that are updated regularly. Full | support in vs2019, about 90% works in vs2022. Of course you | miss out on some of the most modern features like predictions | that you get with copilot or the variant that Microsoft ships | for C#, but it still has autocomplete, type hints, etc and a | full featured debugger. There are also language server plugins | available for vscode. | semi-extrinsic wrote: | The tooling around Fortran is very similar to C. The debuggers | are the same, you can typically use ctags of some sort for | navigating between subroutines etc. across all files, and then | you can add in a compiler-editor integration that checks for | syntax errors at every save. | | There are also a couple of Fortran REPLs out there, the most | promising is probably LFortran which is only in alpha stage of | development but has Jupyter integration and will be the next | cool thing I think. | kergonath wrote: | I tend to use TextMate on Mac or SublimeText on other | platforms. Fortran also is usually very close to C, and most | standard debuggers like ten or lldb (even when LLVM had no | Fortran front-end) can be used without problems. It's a bit | barebones compared to recent IDEs, sure. What I would like in | particular is better refactoring and static analysis tools | (though the lack of the latter is mitigated by the strong type | system and some very good compilers like NAG). There is no real | equivalent to RStudio or Matlab. | ratboy666 wrote: | But... Matlab was originally written in FORTRAN ("easy access | to... LINPACK and EISPACK..."). Written by Cleve Moler, | distributed by Jim Kweeder. May 25, 1982. 7852 lines of | FORTRAN 66 (for the version I have). | | "With proper use of overlays, it is possible run the system | on a minicomputer with only 32K bytes of memory." -- Cleve | Moler | | Fred Weigel | gh02t wrote: | CLion supports Fortran via a plugin. I've used it a bit and | it's fine. | | https://www.jetbrains.com/help/clion/fortran-support.html | PrintStar wrote: | We maintain a commercial, Fortran-specific IDE, Simply Fortran, | that ships with the GNU Fortran compiler (at least on Windows | and macOS): https://simplyfortran.com | | It has many of the usual IDE expectations built in like | autocomplete, project management, debugging, Git integration, | etc. Our Windows distribution adds a few niceties like a | Fortran-oriented (though basic) GUI library, a Windows-native | coarray implementation (that doesn't use MPI), Windows-native | OpenMP and threading, and a binary package manager for pre- | built libraries. | | We're decidedly a small player in a niche market, but I like to | think Simply Fortran makes life easier for Fortran developers. | Sorry for the self-promotion! | wiremoons wrote: | Good timing for your question as there is a poll going on at | the moment about editors used with Fortran, on the Fortran Lang | community Discourse here: https://fortran- | lang.discourse.group/t/code-editors-ides-use... | | But the quick answer is that people programming in Fortran use | the usual editors - Visual Studio Code, Emacs, Vim, CLion, etc. | hatmatrix wrote: | Modern Fortran is beautiful and I love coding in it. | | However, my understanding is that its main focus is on array | computations. Now with hierarchical data structures and graphs | becoming ever pervasive, I wonder if Fortran will ever try to | compete in this space (when these higher-order concepts are | integrated into domains of Fortran's past dominance in numerical | simulation). | kergonath wrote: | Fortran is the ideal language for data-oriented programming. | Ultimately that's where performance is. I don't see it trying | to compete by creating a kind of graph-oriented language | (besides pointers and somewhat barebones generics). You | probably want a fancy higher-level language for this anyway. | | It is evolving towards a great language for parallel HPC, | integrating neatly both shared-memory and distributed computing | in a very nice framework. Much better than the usual hodgepodge | of OpenMP and MPI (or whatever API _du jour_ NVIDIA or Intel | happen to be pushing). | ogogmad wrote: | Graphs can certainly be modelled as matrices over different | kinds of scalars. But I'm not sure how relevant this is to your | use case. | fpoling wrote: | Hierarchical data structures are bad for CPU caches, see, for | example, references in [1] how various data-oriented | programming techniques try to avoid them. | | From that point of view Fortran may be even more relevant for | high-performance computing now than even 10 years ago. | | [1] https://en.m.wikipedia.org/wiki/Data-oriented_design | mrtweetyhack wrote: | throwawaybutwhy wrote: | Please note there's been some uptick in the intensity of | discussion on generics lately [0]. | | Generics are necessary to bring performant data structures to | Fortran, and yet they are nowhere near Go's generics. | | For the usual naysayers doubting Fortran's place in a modern | world: whenever you are reading or watching a weather forecast, | that's decades of Fortran staring at you. Whenever you drive past | a nuclear power plant, or an airbase with 'igloos', remember that | nuclear safety codes run on Fortran. | | [0] https://github.com/j3-fortran/generics | zdragnar wrote: | That's not to say the code quality is any good, only that it | still runs and everyone has their reasons to avoid a rewrite. | | True, the fact that it is still running says something, but not | overmuch about whether it would be pleasant to maintain, extend | or otherwise modify. | necheffa wrote: | For what it is worth - I write Fortran professionally (in some | of the use cases you describe) and I doubt its usefulness. | | The way I see it, Fortran exists today because of inertia, not | because it still has technical superiority. | | These mountains of Fortran code represent decades of investment | and undocumented "features" that you could never code around | during a rewrite. | | And so today, new code is bolted on, with a prayer that nothing | breaks, may god have mercy on your soul. | StreamBright wrote: | When we cannot re-make the things we made before is a sign of | a slow decline. | colechristensen wrote: | It's really not. It is simply very expensive to build up | experimental validation of simulation code rewritten in a | new language, and much more expensive than the aesthetic | value given by programmers who want new things. There's | nothing magic about the old things, there's just an | existing ecosystem which works which would involve a whole | lot of effort to recreate and most people think they have | better things to do. | Silamoth wrote: | Very interesting paper! It's cool to see that Fortran is still | evolving. I've been considering learning it (when I have the | time) because of its use for numerical computations and parallel | processing. I feel like there's been a big push towards general- | purpose languages like C++. However, I'd love to get a better | feel for what it's like to program in a language specifically | designed for your use case. The closest I've experienced is | MatLab, but I feel like MatLab is designed more for scientists | and engineers who need to perform some calculations but don't | want to actually learn how to program, not for professional | programmers working on scientific computation. | zozbot234 wrote: | I don't think there's much in Fortran that's still unique or | "specifically designed" for numerics compute. General purpose | languages reached parity with Fortran a long time ago. And | "general purpose" typically wins anyway because it has the | larger and more diverse ecosystem. | leephillips wrote: | Most of them did not reach parity, at least not in | performance. The fast languages are C, C++, Fortran, and | Julia. Those are the only ones used for teraflop computing. | Fortran is a great tool for scientific computing, but for new | projects, where you are not extending an existing code base, | Julia will be much more fun in every way. | ivan-pi wrote: | Depends on your needs. Sometimes you just need a hammer. | Michael Wirth had a few comments about Julia recently: | https://craftofcoding.wordpress.com/2022/03/14/why-i-have- | gi... | zabzonk wrote: | I've always liked Fortran - one big project I wrote in Fortran 77 | was an Intel 8080 simulator that was used for teaching at the | Polytechnic I worked for. The original code was on a Dec10, but I | ported it to a VAX and an IBM 4381 in a couple of days. | | It's an easy language to get to grips with, but the users | somewhat less so. At one point doing consultancy, I came across | people declaring variables like I1,I2,I3,I4 to IN where N was a | large number. | | I asked "why?" and they said "we might need them" - Fortran | programmers will see at least two reasons why this is daft. | freecodyx wrote: | Technically, all programming languages are constrained by what a | machine can do (the cpu architecture), to me all programming | languages are transpilers, just chose the language that fit best | your usecase, and that will allow you to write correct code | easly, but always keep in mind that regardless of the language | you're using, you're still constrained by same machine | architecture, | mcnrb wrote: ___________________________________________________________________ (page generated 2022-04-06 23:00 UTC)