4 ms·
Both Fortran and Julia have a concise syntax for array operations, and both, with a little care, can produce fast programs. Unless you want to program in C or C
by leephillips 3y ago
Both Fortran and Julia have a concise syntax for array operations, and both, with a little care, can produce fast programs. Unless you want to program in C or C++, those are your only options¹ for high-level languages that have already proven themselves in high performance computing.
I wouldn’t advise rewriting a substantial Fortran project in Julia; but for new projects, Julia is the better choice. Fortran is excellent in the scientific/numerical high performance niche, but it’s still awkward to move beyond that; it’s still stuck in the Formula Translator role. So the non-numerical parts of the program, that deal with input/output, for example, are awkward; Julia is more pleasant to program these tasks.
Julia lets you build your program interactively, by trying things out in the REPL. This alone may be sufficient reason to prefer it over Fortran.
Although most scientists won’t become sophisticated as programmers, for those that will, Julia can grow with them. It has extensive support for metaprogramming (for example), including real macros. Its type/dispatch system, and other features, allow you to write far more concise and better organized code than you can in Fortran. Sharing code and composing libraries² is easier in Julia.
Really, Julia is just more fun to program in.
1 HPCWire (2017) ‘Julia Joins Petaflop Club’. Available from: https://cacm.acm.org/news/221003-julia-joins-petaflop-club/fulltext https://cacm.acm.org/news/221003-julia-joins-petaflop-club/f...
2 Phillips, Lee (2020) ‘The Unreasonable Effectiveness of the Julia Programming Language’. Ars Technica. Available from: https://arstechnica.com/science/2020/10/the-unreasonable-effectiveness-of-the-julia-programming-language/ https://arstechnica.com/science/2020/10/the-unreasonable-eff...
- wiz21c 3y agoThanks ofr this answer. Looks very balanced to me.
- TheRealKing 3y agoExcept for the fact that your Julia code will always suffer from correctness problems, something that would rarely if ever happen in Fortran. https://yuri.is/not-julia/ https://yuri.is/not-julia/
- leephillips 3y agoNo, it probably won’t, and certainly not “always”. A majority of the issues raised in that article concern errors in packages that have been fixed, most rather a long time ago.
- TheRealKing 3y agoThat "always" holds for the Julia language almost surely as long as interfaces are missing in the language. It is just a matter of time to find newer issues.
- leephillips 3y agoMy Julia programs do not “always suffer from correctness problems”; therefore you are incorrect. More generally, saying that programs written in a language that happens not to include a feature you think is important (in this case, interfaces) will “always suffer from correctness problems” doesn’t seem to be a serious point of view.
- TheRealKing 3y agoAll Julia codes are arbitrarily extensible. Any Julia code can always be readily extended to silently yield incorrect results. That is the whole point of the blog post shared above. Justifying the indefensible is different from wanting or liking it.
- leephillips 3y agoI’m afraid I don’t understand anything in this comment.