Since last year, I have been piecing together my HDR. And I have to admit, it is not easy to write this “short second thesis” (in the French academic system, HDR means Habilitation à Diriger des Recherches and is a manuscript that traditionally summarizes one’s work after the PhD). I am simply less motivated to revisit studies that have been published, presented at meetings, and that I consider finalized. But I have to do it regardless of how I feel about it, so I decided to push myself to complete this writing exercise by rewarding myself with a nearly-useless, crazy, hobby project: to familiarize myself with a new programming language.
Naturally, two questions need answering: Why would I do that? And which language do I pick? Let me elaborate: for a while now I have been searching for a language that allows for prototyping in few lines of code, yet can also deal with heavy-duty simulations that last a couple of days. Python and Julia fit the first, but I have had some bad experiences with long-running simulations and memory management in Python, and I’ve read about similar memory issues in Julia (see this example). Also, Python I know to a sufficient degree and Julia starts indexing at 1, not 0. In other words, I had enough reasons to look a little further.
In addition to fast prototyping, I would prefer to learn a language that makes it easy to create outreach activities and on top of that, I want to improve my parallel programming skills. That means C with OpenMP and MPI, C++ with HPX, and Rust are not ideal either. They are too low-level or complex. I did consider Chapel for a bit, but decided against that one too. It is very focused on High Performance Computing and therefore not well-suited for outreach activities, though not a bad option for university-level educational purposes.
Making a long story short, I picked Scala, a language developed at EPFL (Lausanne, CH) and built on top of the Java Virtual Machine (JVM). Its combination of object-oriented and functional programming should make it suited for rapid prototyping and it supports concurrency and parallelism. The JVM guarantees reasonable bounds on memory use and makes Android a target platform, i.e., outreach activities are possible. On top of that, Scala can be translated to JavaScript, enabling any Internet browser as a platform. According to the Internet its support for functional programming gives it a steeper learning curve, but I appreciate the challenge —for now, that is. Also, I’m aware that it will never be blazingly fast. But if that becomes a requirement, I will talk to the engineers here at Inria.
As you can imagine, I have thought of some pilot projects to try in Scala. If all goes well, I hope to share them here in the coming months. Let’s see where these adventures take me.
Update May 13, 2025
If you are interested in existing outreach activities of computational biologists, check out the wonderful virtual laboratory of Bram van Dijk. He has written a JavaScript toolbox to do funky simulations of biological phenomena: Cacatoo simulations.