Why I write and who you are

by Zebulun Arendsee

Contents:

In this series, I will make the case for the practicality of strongly-typed functional languages. My target reader is the practical bioinformatician. You know who you are. When faced with a problem, you seek the shortest path to the solution. Your eyes are on the end, not the means. Any time spent learning programming language arcana is time not spent doing science. So why would you be interested in strongly-typed functional programming languages?

I’ve had this debate many times. Indeed, the “you” I write to is an averaging of many people I’ve known: friends, co-workers, random conference-goers, reviewers who casually torpedoed my grants because “Python does everything”. The argument typically flounders because we don’t have a common conceptual framework. Instead of discussing the interesting problem, how best to do computational science, we argue over the definitions of words. It is my goal here to provide a foundation on which we can have a proper discussion.

To contrast strongly-typed functional languages and weakly-typed imperative/mixed languages I will focus on Haskell and Python. I chose Haskell because I know it well and the language is, at its core, very simple and minimal. Rust is likely better than Haskell for most bioinformatics applications, but my case for Haskell will apply to it as well.

A common reaction to Haskell is to immediately dismiss it as irrelevant. Why are you wasting time with esoteric languages? We care about practical problems and getting results to our collaborators as quickly as possible. We care about efficient solutions and fast development, not your academic concerns about soundness and elegance. OK, I’m definitely bitter.

The implicit assumption is that Haskell is slow, hard to write, and hard to read. That Haskell is not practical. My goal is to counter this assumption. I may not convince you to replace the conventional Bash/Python/R ecosystem for Haskell or Rust, but I hope you will at least learn what you are missing and where such languages may be valuable.

This series will be a long term endeavor. I will start with a three-part tutorial on Haskell where I will argue that the type system is your friend. The Haskell tutorial will hopefully show you the beauty of Haskell and the reason why it is so loved by its users. It will not, however, show the practicality of the language. To that end I will write a series of side-by-side comparisons that show implementations of non-trivial problems in both Haskell and Python.

built on 2024-08-12 11:47:46.22895832 UTC from file 2023-11-20-stfl-intro