7 ms·
10 years ago or so I really wanted to NOT use Fortran for my PhD. In my effort to try to use Python instead in my field, I fell down countless rabbit holes alo
by dagss 3y ago
10 years ago or so I really wanted to NOT use Fortran for my PhD.
In my effort to try to use Python instead in my field, I fell down countless rabbit holes along the way (like being for a year or so one of the core contributors to Cython, in an effort to make "a better Fortran").
In the end though -- I decided it was time to just Get It Done, and just did what my supervisor had patiently and subtly hinted for years. Enough rabbit holes, just get it done in Fortran, and hand in the thesis...
I think what I learned most about (having an interest in compilers and programming languages) is the ignorance the rest of the programming language community, and computer science, has about the kind of things you are actually interested in when doing HPC. What kind of language features you care about and what idioms make sense.
Learning Fortran is super simple.. that is perhaps part of the problem that also people who are barely programmers can write (bad) programs in it. So what this must mean is simply a lack of programmers, full stop, being attracted to the field.
And...C++ is truly the most wrong language for this space there could be.
- shihab 3y agoI'm in a similar position as you were right now: a PhD student in HPC domain who really wants to/ needs to use C++ for everything ( I love Python but has now come to terms with its limitations). Your last sentence is scary for me to hear- can you please elaborate a bit?
- dan-robertson 3y agoNot sure what the parent meant but I always think of https://travisdowns.github.io/blog/2019/08/26/vector-inc.html https://travisdowns.github.io/blog/2019/08/26/vector-inc.htm...
- jabl 3y agoOf all the commonly used languages, C++ is the most complex, baroque, and filled with subtle and not-so-subtle footguns. Of course with all that downside comes the upside that C and C++ are the lingua franca for low level programming where performance matters, not only HPC (yes, I hope Rust will be there one day, but I digress..). Fortran is pretty much limited to numerical computing, you're not going to find much Fortran libraries outside that domain. So if you envision doing programming like that outside HPC after your PhD, C++ might be worth the investment. But of course a lot comes down to what language other people in your group and your particular subfield, and what your supervisors are using. Doing a PhD is hard enough without being the odd guy out who's using a language nobody else in your community is using.
- cultureswitch 3y agoEver heard of Perl, PHP, JavaScript, sh or Fortran itself for that matter? Plenty of languages are far more "baroque" than C++.
- mathisfun123 3y agoIgnoring all the cliche comments about C++ complexity I'm gonna say something that is a controversial opinion of sorts: if you're a PhD student in CS and you're doing systems research and you can't write/read passable C/C++ then you shouldn't be allowed to graduate.
- noobermin 3y agoCS is NOT computational science or HPC (generally).
- mathisfun123 3y ago>you're doing systems research
- KerrAvon 3y agoMy god, though, why Python 10 years ago? There were better languages available then, like Ruby or Perl. Was NumPy just too big a thing even then?
- toddm 3y agoYou're not going to get traction using Ruby or Perl for a Ph.D. in astrophysics :)
- ethbr0 3y agoThe only ones judgy-er about using the "wrong" language than computer scientists are engineers and other scientists.
- hilbert42 3y agoI reckon that's very true but it's important in one's closed work environment. If one bypasses accepted practice then one must be very good or have very good reason or both.
- opportune 3y agoRuby and Perl in HPC? I mean this in the nicest way possible if you’re being sincere, but I can’t tell if you are trolling or not
- whatshisface 3y agoI think it is far from a foregone conclusion that Perl and Ruby are better than Python, or were ten years ago.
- mylons 3y agohow are ruby and perl better solutions to how appalled you must be given your first sentence? if anything, they're just _different_ solutions that are based on personal preference and nothing more
- jabl 3y agoThe scientific Python stack (numpy, scipy, matplotlib + a plethora of more specialized things) were definitely a very big thing 10 years ago. Deep learning was just on the cusp of taking off in a major way, but in traditional numerical computing python was very big before that.
- optimalsolver 3y ago>C++ is truly the most wrong language for this space there could be What? Why??? I switched from Python to C++ because Cython, Numba, etc. just weren't cutting it for my CPU-intensive research needs (program synthesis), and I've never looked back.
- tpoacher 3y agoI can't remember the exact quote right now, but what you say echoes that quote that goes something like: If you make a tool that has such a low barrier to entry that it makes it easy enough for unskilled people to use it and inevitably write low-quality code with it, then that is the definition of a good tool.
- jandrewrogers 3y agoI've both worked in HPC and written Fortran. C++ is almost always preferable because Fortran is too limited as a language outside of numerical code. Most HPC stopped being limited by the performance of numerical code 20 years ago. Instead, HPC codes were and are commonly limited by memory bandwidth and locality, two things C++ is almost uniquely suited for. The kind of C++ written for HPC tends to be much simpler than the kind of C++ used to write e.g. database engines. The complexity of C++ is not that onerous in context and Fortran isn't exactly an exemplar of ease of use.
- deleted 3y ago[deleted]