7 ms·
I am 36, coding 3h a day in Fortran for the oil and gas industry. I must say, even if I write a lot of Python code too, I really enjoy the way a program is "opt
by Loic 11y ago
I am 36, coding 3h a day in Fortran for the oil and gas industry. I must say, even if I write a lot of Python code too, I really enjoy the way a program is "optimized" by default, that is, if your algorithm is good, you do not need to do crazy things to get good performance out of your hardware.
- sevensor 11y agoCare 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 :)
- ced 11y agoHave you tried Julia? Optimized Fortran (esp. on specialized hardware) would still beat it no question, but IMO Julia is a better value proposition for Fortran/C programmers than it is for Python/Matlab programmers at the moment.
- Loic 11y agoI tried a bit. My problem with Julia at the moment is that it really wants to be the master and not be embedded, some work on the way[0] but the goal is more to become a general scientific language than a high performance language in which one can write some scientific code and hook it into something less "powerful" like Python. Also, a very important point is that the code I write will be in use for the next 20 to 30 years. If a, proven over decades, reliable solution is available, it is better. [0]: http://docs.julialang.org/en/latest/manual/embedding/ http://docs.julialang.org/en/latest/manual/embedding/