← Back to context

Comment by hyperbovine

13 hours ago

> What I perceive as younger people are horrified at the idea of fifty year old tools

My students are shocked (horrified?) to learn that they're basically running 50-yr old Fortran code when they use scipy.minimize to train their fancy little neural nets.

I always chuckle at how Python became the dominant language for AI / ML / data science etc but wonder why it is that Fortran and Python became the golden combo, it could have been done with any other language, no complaints, I love Python, but its just amusing to me.

  • For Fortran, I have the concept of 'immortal code' - code that is generally hard to write, is compatible with everything, and implements an algorithm in a way that's impossible to improve on - or at least doing so would be celebrated as a minor breakthrough.

    A lot of numerical optimization code is this - it conforms to a strict 'C' ABI - taking (arrays of) simple floats and ints and outputting the same, so binding it to another higher level language is trivial, so rewriting it makes little sense. If the same algorithm were written in Java, most people would not want to bring in Java as a dependency for their Python/C++/whatever project, but since this is just a tiny C object file, it's happily integrated into everything.

    They also tend to be very tricky to get right, I remember reading a paper where the author was adamant that changing the order of a multiply and an add (a mathematically invariant operation) would cause the algorithm to blow up due to the different scales of floating point values involved causing a major loss of precision. I'm sure there's tons of stories like this.

    This is the sort of code which took PhD's who studied this exact topic years to get right, even though the actual code often looks unassuming, I would dread the day when I was required to touch it (but I never do - since it always does what it says on the tin)

  • Yeah Python is older than Linux or HTTP. It was virtually unknown in the 1990s, though.

    Funny how it’s getting its time in the sun now.

  • It's really just that it's a pretty easy language to learn that finds a good balance between structure and brevity. It has very good support for the data structures you need and libraries for everything. A lot of people love the language and that built up a lot of momentum and eventually people started adding stuff like numpy and scipy and pandas and before long you had this giant scientific computing environment that almost anyone can get into.

    I tried out most of the scripting languages out there (Ruby, Perl, Tcl, Groovy, R, and many more) and Python just seemed to click more and it has a whole lot less to worry about upfront than languages like C# and Java. In comparison to languages like C and C++, it's a godsend for those with typical automation needs.

    In my eyes it seems like a pretty straightforward development. There have been plenty of other tools that may have made sense throughout history too. Matlab could have done this, but by that time nobody was going to build out massive libraries for something expensive and partly closed off.

  • NumPy was pretty early, and it hit the sweet spot for science: free, fast, with a quick and dirty scripting language around it.

    Then the whole ecosystem that Python has nowadays was built on NumPy, and sending data from one library to another was trivial because of it.

    That's it.

  • Fortran has been a research language used by people like physicists and mathematicians that know what they're doing and have been developing that tool for decades and Python is perfect for people who have no idea what they're doing.

No one uses scipy for anything serious anymore in AI research or on any type of modern models.

You're setting your students up for failure if this is how you are teaching neural networks to them. You should switch to pytorch or at least something like tensorflow or jax or you are actively doing intellectual disservice to them and leading them to be actively noncompetitive both in AI academic paper writing/grad school and in the job market.

Similarly, use of sklearn considered harmful in a world where CuML/CuPY/Nvidia RAPIDS exists.

And also, knowledge of conda/pip/poetry considered harmful in a world where UV exists.

Teach MODERN tools please.

  • It sounds like a fundamental education failure and/or an extreme failure of tool design and training in workplaces if new employees with relevant degrees don't have the basic knowledge to pick up new tools on the job. A liberal arts education is for teaching basic transferrable skills, and is not a narrowly tailored job training program.