Hacker News new | ask | show | jobs
by killaken2000 2700 days ago
A youtuber that I follow recently finished his PhD and used FORTRAN extensively. He said that he started with python and it was incredibly slow so he rewrote everything in FORTRAN.

It may be that his use case (something with cloud or other weather modeling function) was just particularly well suited

3 comments

Any compiled language will be drastically faster than an interpretive scripting language like Python (although numpy/scipy is generally C or Fortran libraries compiled to be called by Python). Having said that I used Fortran for my PhD to do radiation simulations because I was implementing a new methodology into existing code.

In my opinion Fortran is easier and safer to use for scientists with little background in coding because it was built to do math/simulations really well AND it's readable almost like psuedocode (compared with C or C++). Also, modern Fortran is object-oriented which makes building reusable tools and large packages pretty easy.

Having said all of this I think a lot of the physics/nuclear/aerospace/finance community is probably transitioning into more modern languages and starting to employ people with actual CS backgrounds to build with more updated coding practices.

Did they write python correctly though? If you vectorize your algos well enough to exclusively use numpy scipy and never use python loops then python is really really fast (not because python is fast but because numpy/scipy is fast)
Numpy/Scipy are fast, because their backend is written in Fortran :)
I think if we push this to the limit we would all be writing assembler or making circuits :)
Exactly. That's why I say that the speed argument is a bit obsolete by now. We can have the best of the two worlds with python! Elegance/simplicity and speed.

The focus on the speed of execution also downplays two other important aspects of python: speed of writing code and possibility to visualize results easily. As a theorist these two aspects outweigh any argument in favor of Fortran. The only serious competition to python for me is mathematica.

The truth is, any language other than Fortran/C is slow for any serious high-performance-computing task (which is not the same as everyday back-of-envelop calculations and plotting).
these days if you want fortran fast python you google julialang
I do use Julia; however, it is too immature to serve as a viable Fortran replacement. Still, a great language.