Julia: faster than Fortran, cleaner than Numpy

submited by
Style Pass
2021-06-20 16:00:16

Julia is a pretty new language, which, among other things, aims to solve the so-called “two-language problem” in scientific computing.

That is, we usually test ideas in a rapid-prototyping language like Matlab or Python, but when the testing is done, and its time to do some serious computation, we need to rely on a different (compiled) programming language.

Many tools exist to ease the transition, and wrapping Fortran libraries into Python has been my preference so far. For example, wrapping up some Fortran with F2PY seems like a very convenient way to use (and distribute) efficient Fortran code that anybody can run. I also keep track of various ways of using Fortran in Python in this post.

Now, Julia aims to solve this issue in a radical way. The idea is to use a single programming language, which has both an interactive mode, suitable for rapid prototyping, but that can also be compiled and executed at C/Fortran performance.

Honestly, I was shocked by what I found in my performance comparison. Julia is amazing. I didn’t expect Julia would beat gfortran with compiler optimizations in my test. And it currently does so by a lofty margin.

Leave a Comment