5 ms·
I'm surprised for 2 reasons: 1/ CS folks are still talking about Fortran. 2/ The word Modern and Fortran in the same sentence. Up to a few years ago, I found o
by x3tm 8y ago
I'm surprised for 2 reasons: 1/ CS folks are still talking about Fortran. 2/ The word Modern and Fortran in the same sentence.
Up to a few years ago, I found often myself in discussions with colleagues on the benefits of Fortran vs. less horrible languages such as C. And I always thought that we are so backwards in academia (physics) compared to CS people who have buried Fortran a long time ago. There are even colleagues who use Fortran 77.
Fortunately, things are changing fast now with more and more people using Python. I learned it myself about a month ago and urged my students to stop using Fortran and/or C. I see 0 reasons to torture a new student with Fortran. I am using Jupyter notebooks with my students now and things are so much better: easier/faster debugging, appealing code and interface, higher level features, visualization tools, etc.
- alexott 8y agoAnd even write books: https://www.manning.com/books/modern-fortran https://www.manning.com/books/modern-fortran
- alexott 8y agoBut when it comes to speed, Fortran is very hard to beat, especially with specialized compilers
- x3tm 8y agoWhich are not free for the most part, right? As of 2019, the speed argument is mostly academic though. IMO. Few people do cosmo simulations on a daily basis to really care about this.
- tanderson92 8y agoYes but how many of the people who these slides were designed for are people doing cosmos simulations? That's the relevant quantity. It's especially funny because the author's area of research is in cosmos simulations. :-)
- mattkrause 8y agoA lot? I would guess the slides are meant for advanced undergrads or first year grad students in a physics program. ee how the math-y parts of the slides are pretty sophisticated (e.g., bessel functions) even though the programming part is pretty simple?
- tanderson92 8y agoOf course "a lot" is the answer. That is precisely my point: for the audience of these slides, speed does matter. :)
- mattkrause 8y agoMy bad--I parsed that as sarcasm!
- alexott 8y agoWhen I did this myself (around 20 years ago), computer time was expensive, and any speed up helped
- 4thaccount 8y agoYea, but people still do all kinds of other numerical work in Fortran like Power Systems and it is much easier to read than the new C++ replacements I've seen.
- creatornator 8y agoCheck out GFortran, it's 100% free as part of the GNU project. I believe the Intel Fortran compiler is also free (as in money, maybe not as in freedom). The speed argument does matter too--how many high frequency trading/fintech/big data/banking/engineering companies are built, at some point in the stack, on high-speed libraries written in Fortran? I don't know any numbers, but any company that uses numpy is transitively also using Fortran in their stack.
- dagw 8y agoI believe the Intel Fortran compiler is also free It's only free for students and educational uses. Not for any commercial or non-education research use.
- creatornator 8y agoWhy is it a surprise that CS people still talk about something that is, at the moment, alive and well? Fortran remains one of the best ways to get native vectorized code for fast math operations. Yes there are higher abstractions like python, but if you want to write code in the same domain as Fortran, you are using numpy, scipy, pandas, etc., and those are all literally wrappers over low level C and Fortran code. Abstractions don't remove the need for low level, "out-dated" coding models, they just make it easier for most people to build on them.
- nine_k 8y agoReliable automatic vectorization is not an outdated concept by any means.
- ekun 8y agoKeep in mind too that a lot of long scientific simulations are more complicated than vectorized loops or linear algebra. Monte Carlo algorithms were developed to simulate neutrons in the Manhattan project and programmed with the help of Von Neumman.
- tanderson92 8y agoThis is not a post with CS folks talking about Fortran--that is not TACC's role. Despite the enormous amount of snark directed Fortran's way, practitioners in HPC still use it, and Python cannot seriously be discussed in the same context.
- archgoon 8y agoWhat's wrong with Fortran? You're argument seems to be "it's old." What are the main features you find to be lacking? What language would you propose should be used for the use cases of Fortran, and why?
- x3tm 8y agoAge is a pretty good argument actually for computer languages IMO. More abstraction is better, and this usually comes with time and progress. Otherwise we would still be using Assembly, which incidentally should be faster than Fortran since most people here seem to focus on speed of execution. Python is more abstract, ie higher level and this makes it more suitable for scientific tasks than Fortran for the vast majority of problems. As I said earlier not all scientists are doing heavy simulations on a daily basis. And for scientists the goal is their science not the coding.
- goerz 8y ago> Up to a few years ago, I found often myself in discussions with colleagues on the benefits of Fortran vs. less horrible languages such as C. In the context of numerics, C is in no way a "less horrible language" than Fortran. The necessity to use pointers in C for multidimensional arrays, and the large amount of "undefined behavior" in the C standard makes it almost impossible to write bug-free number-crunching code. In particular when the person writing the code is a scientist/engineer, not a professional programmer or computer scientist, they are guaranteed to shoot themselves in the foot with C or C++.
- 4thaccount 8y agoYea...I can write reasonably performant Fortran, but have no clue how to do matrices in C without resorting to the numerical methods book that doesn't allow you to use it's algorithms and has the dumbest license ever (is it called numerical recipes in C)...the Amazon comments are illuminating.
- x3tm 8y agoWe commonly used the GSL library. http://www.gnu.org/software/gsl/ http://www.gnu.org/software/gsl/
- dagw 8y agoGSL has its own set of license 'problems' to be aware of in that it's GPL and not LGPL.
- 4thaccount 8y agoThat might work for siof my use cases, but it stinks that you can't use it for a commercial product.
- AnimalMuppet 8y agoI'm not sure that after a month you know enough to really evaluate a language (any language, not just Python). You know the problems and headaches that went away. But you haven't found all the new ones yet...