5 ms·
Care to share any references on learning modern Fortran? I've tangled with some pretty ancient code (full of Hollerith constants and tangled mazes of GOTOs) bu
by sevensor 11y ago
Care to share any references on learning modern Fortran? I've tangled with some pretty ancient code (full of Hollerith constants and tangled mazes of GOTOs) but I get the impression there's a whole other world of Fortran out there.
- Someone 11y agoThanks for mentioning https://en.m.wikipedia.org/wiki/Hollerith_constant https://en.m.wikipedia.org/wiki/Hollerith_constant. It turns out that the Mac OS language extension to write 32-bit integers for file types and creator codes as, for example, 'TEXT' or 'FNDR', was inherited from fortran :-) I always love to learn about stuff that has little to no use in real life (anymore).
- sevensor 11y agoI could not figure out what the heck they were for a while. When I figured it out, I felt like I'd just caught a coelocanth in a fishing net. There it was, making perfect sense in its prehistoric context, but completely out of step with the modern world. Same thing with the weird goto-based control flow. It was very disciplined and regular, but it didn't map to anything I'm used to.
- Someone 11y agoBut goto-based workflows are natural, if you are accustomed to writing assembly on a CPU that doesn't have a hardware stack :-)
- ovis 11y agoI've found Metcalfe, Reid, and Cohen[1] to be a fairly clear refresher on Fortran. Unfortunately, the build tools I use don't support many of the nicer features like user-defined types. [1] https://books.google.ca/books/about/Modern_Fortran_Explained.html?id=MmOIFEgsDLwC&redir_esc=y https://books.google.ca/books/about/Modern_Fortran_Explained...
- sevensor 11y agoThanks for the reference! I've put it on my reading list.
- semi-extrinsic 11y agoSince it's nearly Halloween: look up "assigned GOTO" if you like horror.
- jawaman 11y agoAmusingly, JavaScript has the exact same language feature.
- Turing_Machine 11y agoGCC has computed goto (e.g., do some pointer arithmetic, then jump to the address located at the pointer address), but I don't think that's in standard C.
- raverbashing 11y agoHow exactly?
- Loic 11y agoI am not using a lot of modern Fortran, so what I learnt was more small things here and there distilled over the years. This is mainly because my code in Fortran is just the hard science, the resolution of equations, and it is then used as a library from within a larger simulation software. I still find Hollerith constants in the code I work with some times to times :)