4 ms·
It is simply due to apprenticeship. Physicists do research, and their code is research code. Like most other research, the research code is maintained and used
by hzhou321 10y ago
It is simply due to apprenticeship. Physicists do research, and their code is research code. Like most other research, the research code is maintained and used in-house. As most in-house non-shared code (in any language), it is impenetrable unless you take apprenticeship. The masters are typically old and FORTRAN is their language and it is the only choice for the apprentices. Once the apprentices graduate and become masters themselves, they further developed their own in-house code and it is inevitably in FORTRAN too. As any over-developed code, it is too expensive to migrate even when the new master recognize the shortcoming. The bottom line, FORTRAN is not bad once you are familiar with (and invested in) it, so FORTRAN persists over another generation of apprentices ...
However, there is slight change. The new generation of masters often do know other languages, so they sometime tolerate their new apprentices to use other language and still able to teach them. So at this point, by far, not all physicists use FORTRAN.
FORTRAN will die out, just takes time.
One of the sticking point is the library BLAS/LAPACK. It is in FORTRAN. Or more precisely, its interface is in FORTRAN. I don't foresee this will change for a long time. So FORTRAN will be like COBOL, it will persist even when no-one really use it anymore.
- goerz 10y agoI think that's only party true. Physicists would probably not be exposed to Fortran if it wasn't for "apprenticeship". But the same would be true for any other very domain-specific language (let's say Mathematica). However, that doesn't change the fact that Fortran (in its modern syntax) is a great language for numerics. Its abstractions are extremely well-suited for any computation focusing on multidimensional arrays. It is certainly a more expressive language for numerics than C/C++ (and it's not as easy to shoot yourself in the foot in Fortran). There's not that many other languages that can compete for high performance applications. Julia looks like it can do some interesting things. Python is great as a glue language (but not for number crunching, and of course it's slow). I would still (and regularly do) choose Fortran for new projects. It's not going away anytime soon.
- hzhou321 10y agoLet's see how I may clarify the argument. First, if one is familiar with a language or invested in a language, he will be biased to choose that language and it makes sense for him. Before you would argue, I admit I can't prove that you are biased, but nor could you prove you are not biased. So let's agree that some anecdotes like your case is not a strong argument. So let's look at it in another angle. If physicist/people choose FORTRAN not merely due to apprenticeship, it necessarily means that there will be people choose FORTRAN even when his master do not introduce/require him to use FORTRAN. In another word, we need examples of people who choose FORTRAN despite of non-familiarity to FORTRAN. There are plenty of such cases for, e.g. rust. For me at least, I know none such. How about you? For example, how successful have you been influence other people (other than your student) to use FORTRAN? On the other hand, I do know people who choose other language despite of the familiarity of FORTRAN.
- goerz 10y agoOf course knowing a programming language strongly biases someone to choose that language in a project. I also agree you will not find a lot of people (if any) using Fortran who have not been introduced to the language as part of their research, following the recommendation of someone senior (e.g. their advisor). However your original argument was that Fortran was only used because advisors were forcing their students to do so, and that Fortran would die out eventually along with those dinosaurs. I don't think this is true, and I don't think the fact that people generally don't just stumble into Fortran by themselves is any evidence to the contrary. As the original article points out, the reason that Fortran continues to be used is that it is the most suitable language for its domain (but of course not as a general purpose language) The prerequisite for using Fortran is that someone works in a field that relies heavily on large scale, high performance numerical computation. Since Fortran is pervasive in that domain, it's extremely likely the they would be exposed to Fortran through "apprenticeship". Basically, most people who should be using Fortran are using Fortran! I've seen a few instances where people used C/C++ or Matlab in situations where Fortran would have been more appropriate. Matlab has its own drawbacks, but it is also a very domain-specific numerical language, and likewise its users are exposed to it through apprenticeship! C/C++ is still the default language for high performance computing outside of numerics, and thus it's not surprising that people who have not been exposed to Fortran would attempt to use it for numerical purposes as well. There isn't exactly a lot of choice for numerical programming: Python and Matlab are (partly) designed with numerical purposes in mind, but don't scale to high performance. C/C++ are performant, but not expressive for numerics. There really isn't any other language that would even be in consideration, besides now Julia, but Julia is extremely new, so time will tell. I don't know anything about Rust, but based on reading its Wikipedia article its not a language designed for numerics, but basically something designed to replace C++ for systems programming. Thus, like C/C++, it will be performant, but not expressive for numerical purposes.
- justin66 10y ago> FORTRAN will die out, just takes time. Perhaps, but it doesn't follow from anything you've said.
- Annatar 10y agoFORTRAN will die out, just takes time. If Fortran is good for computations, and it's fast, and it does what it is designed to do, and does it well, why should it die out? As a computer scientist and engineer, I do not understand the animosity towards Fortran?
- hzhou321 10y agoIt is not animosity -- I love the simplicity of FORTRAN -- but I am stating my speculation. C replaces FORTRAN. That is from merit point of view. In reality, computational physicists mostly goes to C++ plus Python. Truth to be told, physicists are not computer scientists and they are not even into it. They simply picked out of necessity/convenience -- which was the reason FORTRAN was picked then. PS: That FORTRAN is fast is over stated IMHO. I am familiar with high performance computing. In terms of parallel computing, it all boils down to algorithm design. In terms of vector/linear algebra, it all depends on machine tuned BLAS (which is mostly due to hand crafting rather than the language itself). There is no evidence FORTRAN code runs necessarily faster than C -- comparing first craft non-optimized code. Unlike C, FORTRAN is less capable and more cumbersome to do trendy stuff -- this is the actual merit of FORTRAN over C.
- Annatar 10y agoPS: That FORTRAN is fast is over stated IMHO. From my point of view, it's understated, and should be given much more credit than it gets. intel has done a lot of work to make their ifort compiler leverage their latest instruction sets like AVX2, resulting in even bigger speedups, and PGI has done absolutely amazing work of writing a compiler which can ingest unmodified Fortran code and compile it to run on NVidia GPU's. It's nothing short of mind blowing to me and gets way too little mention. Modern Fortran is a really nice language and all this bashing of it because it's not trendy is completely unfounded. Just ask intel.
- dagw 10y agoI believe that one of Fortran's biggest problem is that if you want to get all the advantages that modern Fortran has to offer you have to use closed source commercial tools. If the open source tools had been closer to what PGI and Intel offers in terms of features and performance I don't doubt that Fortran would be more popular.
- dfgasfjhjhsdojj 10y agoFortran has not been capitalized since the F90 standard came out...