11 ms·
Look at where it is used. It's still a better choice for HPC and deep numerics work than virtually anything else. Which is really remarkable when you stop to th
by scottlocklin 7y ago
Look at where it is used. It's still a better choice for HPC and deep numerics work than virtually anything else. Which is really remarkable when you stop to think about it.
Sure you could probably eke out faster code if you're a mentat and really good at C, or know the internals of a C++ compiler very well. But then you have to be good (and find good collaborators), and you pay the toll of dealing with pointers and memory management. I'm pretty sure I could stand up, say, a fast Gentleman's method using Fortran faster than in C++. And I'm certain I can get a large team of numerics guys to do, say, climate simulations faster and better in Fortran than C++.
- totalperspectiv 7y agoWhat exactly is it about Fortran that makes it better for an HPC env and numeric computing than c++? Or is it more just an available libs/history question?
- jonesetc 7y agoThe big thing I always see is that it has a few important limitations, and those limitations mean that extra optimizations can be used. https://stackoverflow.com/a/146186 https://stackoverflow.com/a/146186
- totalperspectiv 7y agoThat's a fantastic SO answer.
- semi-extrinsic 7y agoApart from string processing and a few other warts, Fortran is surprisingly similar to working with Numpy - avoiding explicit loops and doing operations on arrays, slicing notation, etc. It can make a lot of computational code really easy to write and easy to read, thus easy to understand and get right. Which makes sense when you recall ForTran = Formula Translator. It's literally designed as language where you should be able to write code that's one-to-one with your equations.
- sampo 7y ago> What exactly is it about Fortran that makes it better for an HPC env and numeric computing than c++? Fortran is an easy language to learn. A domain expert doesn't need to spend months or years to learn C++, they can write safe and performant Fortran code in almost no time.