My room mate says this plugin is very elegant.
At the same time, it has attracted a solid following in certain sub-fields of software development. Large companies like GitHub, Microsoft, Tesla, and Meta reach for the language when the necessity arises.
That’s because Haskell is best-in-class for building two things: self-contained systems of any complexity and domain-specific languages (DSLs).
In this article, I’ll look at the success stories of Haskell in areas like finance, blockchain, education, the automotive industry, and developer tooling. I’ll explain why large companies decide to use Haskell and what seems to me to be the future of the language.
11 Haskell success stories
At the start of 2022, Hasura raised $100 million at a 1 billion valuation, making them the first Haskell unicorn.
A lot of what Hasura does can be boiled down to a performant JIT compiler that is presented as a web-server handling large concurrent loads. Haskell has allowed us to collaborate on a large codebase and has allowed us to move with startup-like speeds on infrastructure software without breaking things. (Source)
You can learn more about Hasura’s experience with Haskell by reading this blog post.
GitHub used Haskell for implementing Semantic, a command-line tool for parsing, analyzing, and comparing source code.
According to GitHub, Haskell is a good choice for this purpose because of Haskell’s strength in working with source code. As some of its most valuable features, they mention strong typing, lazy evaluation, purity, and the rich possibilities for users to define their own control flow.
The Semantic project is concerned with parsing, analyzing (evaluating), and comparing source code and as such we are firmly rooted in the academic domain of programming language theory (PLT) and spend significant time applying existing research to the real world problem of analyzing source code on GitHub. Haskell is well suited to this domain. Its language features allow concise, correct, and elegant expression of the data structures and algorithms we work with. (Source)
Read more about why GitHub chose to use Haskell for Semantic here.
Meta is known to be a Haskell user and is also one of the biggest sponsors of the Haskell Foundation.
There are three Haskell projects that Meta has worked on that deserve featuring:
Sigma, an anti-abuse platform that processes more than a million requests per second.
Glean, a system for collecting and working with facts about source code.
Haxl, a framework for efficient and concise data fetching.
Here’s what they say about Haskell:
Haskell is a purely functional programming language that is held in high esteem in the programming community for its expressive type system, rich library ecosystem, and high-quality implementations. This combination of properties enables the rapid development of robust software with strong correctness and safety guarantees. (Source)
Microsoft uses Haskell in Bond, a cross-platform framework for working with schematized data.
The Haskell part of Bond is mainly gbc, a command-line code generation tool that can generate C++ and C# code using Bond.
For a long time, Microsoft Research also significantly supported the Glasgow Haskell Compiler (GHC) by employing Simon Peyton Jones to work on it.
IOHK used Haskell to implement the Cardano blockchain platform and its smart contract language – Plutus. They chose it because Haskell is a perfect fit for high-assurance code in fields like finance and blockchain.
If you look at the history of the cryptocurrency space over the last ten years, we’re riddled with exchange failures due to poor code. We’re riddled with multi-sig failures where people are able to steal hundreds of millions of dollars. The Dow hack was the most famous hack in our industry — just because we had an intent of what we wanted to do, but the reality was the code didn’t match that intent.
So you need a programming language that gives you a much higher degree of certainty and a larger toolbox, and is much more precise. It’s like a scalpel that can allow you to very carefully implement things, so you know that it’s going to work correctly. (Source)
Tesla has been regularly hiring Haskell engineers and interns for some years already.
There isn’t a lot of information out there about the exact specifics of their work. According to a comment in a job post made on Reddit, they use Haskell to generate C code that is then compiled into vehicle firmware.
Standard Chartered is a multinational banking and services company. They use Haskell and Mu, a strict dialect of Haskell, to provide in-house technologies to traders and quantitative analysts.
They liked Haskell because it’s pure, avoids hidden state, enables massive parallelism, and is statically typed. At the same time, they needed something that would mesh well with the already existing ecosystem at Standard Chartered.
For this reason, they developed their own in-house dialect of Haskell, Mu, in 2009. They have been using it ever since.
According to a talk done by a member of the team, Marten Agren, the current codebase consists of at least 5 million lines of Mu code and 1 million lines of Haskell code.
To hear more about Haskell at Standard Chartered, you can watch the HIW 2021 talk mentioned above.
Klarna has a reputation for using various functional programming languages in their codebase. While its core system is in Erlang, Klarna also uses languages like Scala, Clojure, and Haskell.
According to a talk from the Functional Programming Sweden meetup, they started using Haskell because they loved functional programming but didn’t like Scala. Writing FP code and educating new developers in pure FP in Scala was too much of a chore in contrast to just using Haskell.
Haskell is great for business and great in production. Attracting talent has been a joy, people are excited to work in Haskell. The libraries we’ve needed exist in battle-tested form on Hackage/Stackage. The code we’ve produced has made it easy to onboard new folks. (Source)
You can read about Klarna’s experience writing production Haskell in this article by Felix Mulder.
Freckle is an online learning platform that adjusts to the skills of students. They use Haskell for all of their backend services and most of their tooling.
All the things advocates of Haskell typically mention have been true in our experience: as a production language, it is incredibly performant and has a rich library ecosystem. Developing business logic with a rich type system such as Haskell’s is an experience you can’t really describe to someone who’s never done it. There’s the base-level safety, sure, but a level above that is actually describing business logic with the types. The resulting code is robust, self-descriptive, and easy to refactor.
You can read more about Freckle’s experience using Haskell in our interview with Pat Brisbin. They also have an active engineering blog that you can check out.
Galois is a company that specializes in the research and development of trustworthy software systems for fields where failure is unacceptable. They have released several open-source projects made in collaboration with governmental agencies like NASA or NSA.
One of their most interesting projects is Copilot, a stream-based DSL for writing and monitoring embedded C programs. The framework was developed with support from NASA’s Aviation Safety Program and has been used by NASA for monitoring test flights of drones.
At Serokell, we use Haskell to great success for most of our day-to-day software development projects. We have used it to build the settlement layer of the Cardano blockchain, programming languages for the Tezos blockchain, cryptocurrency exchanges, a multi-currency wallet with its own DSL, and more.
If you need help with building a Haskell application, we’re here for you. Contact us and schedule a free 30-minute consultation with a C-level executive to talk about your goals and requirements.
What are the benefits of using Haskell?
Companies above list three things as the most significant benefits of Haskell:
Expressive type system.
Strong correctness guarantees.
In addition, while Haskell is a great programming language for everyday purposes, we can separate two popular use cases.
The first one is complex systems where strong guarantees are required (such as blockchains like Cardano and fintech projects like Klarna).
The second is compilers and DSLs. On our list, the examples for this use case are projects like Bond, Semantic, Copilot.
Both of these use cases heavily benefit from the strengths of Haskell and manage to dodge most of its cons. They can rightfully be called the “killer apps” of Haskell.
If you are considering a project in these two areas, it’s hard to go wrong with picking Haskell.
Future of Haskell
As you can see, Haskell has conquered a strong position in two different niches. Additions like dependent types, linear types, and Liquid Haskell will further improve this position.
At the same time, new programming languages like Rust and TypeScript have taken the world of general software development by storm. They incorporate a lot of what is good about Haskell (and FP in general) while also focusing on great developer experience and being more approachable.
Can Haskell compete with these languages? Most likely, yes.
Lately, significant effort has gone into improving the developer tooling and experience of Haskell. Just last year, the Haskell Foundation was launched to support the language and its ecosystem. The IHP web framework provides an accessible introduction to type-safe web development for a lot of non-Haskellers. There’s plenty of new educational content coming out, some of it on our blog.
With more and more people getting exposed to FP idioms in modern programming languages, moving to a purely functional programming language like Haskell becomes less and less hard for developers, which benefits the language and its ecosystem significantly.
Therefore, we at Serokell are excited about the future of this language and all the innovations it can still bring to the world of software development.
If you want to keep updated about the world of functional programming, follow us on Twitter or subscribe to our newsletter via the form below.
Share this on knowasiak.com to discuss with people on this topicSign Up on Knowasiak.com now if you’re not registered yet.