Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can think of R as a wrapper around Fortran, in much the same way that Python is a wrapper around C.

Not only does building R itself require a Fortran compiler, common packages do as well. If you look inside your R package tarballs, particularly of solvers, you will see Fortran.

(Scientific computing libraries in Python also wrap Fortran, but CPython doesn't depend on it. Base R depends on Fortran.)



And Fortran is still probably faster than if it used C in most cases of R's use of Fortan. http://beza1e1.tuxen.de/articles/faster_than_C.html

There is just a ton of well written Fortran for number crunching and there is zero reasons to not use them. You wouldn't gain speed and you would loss the decades of stability these Fortan scripts have given the scientific community.

I am guessing all of us old timers remember the pain of Fortran in the past.


I had to compile some Python libraries from C source on a Solaris box once. Initially I got errors due to an incompatible version of the OS maths libraries that were clearly written in Fortran, though I can't remember the details of the error messages. So not really a direct dependency on Fortran, but it was still in the mix.


In one of my classes, as a gross oversimplification, I explain that what determines the difference in speed between an R and a Python implementation of something is how much of it is secretly written in C or Fortran.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: