Software Written in Haskell: Stories of Success

Yulia GavrilovaGints Dreimanis
Thursday, October 17th, 2019

Serokell started when two young programmers fell in love with Haskell and wanted to share this feeling with the world. We must confess: not everybody understands where this passion comes from. Haskell is like that smart, funny but shy girl totally outshined by her more popular classmates - Python and Java.

Now it’s time to fix that injustice. This post is a collection of great projects written in Haskell, which unearths the benefits of Haskell that the majority knows nothing about.

6 top software projects written in Haskell

1. Sigma by Facebook

Did you know that Facebook is secretly in love with Haskell too? In 2015, Facebook switched from using their own computing language FXL to Haskell when redesigning Sigma - their main weapon against spam and fraud. FXL was slow and lacked necessary abstractions like user-defined data types and modules. Haskell made the program function 3 times faster.

Time to love Haskell
Sigma by Facebook

The system is a rule engine that checks every interaction on Facebook for suspicious activities. It evaluates policies, then identifies and blocks “bad” activities. Sigma processes millions of requests per second.

To code this rule engine, the developers needed a fast and secure tool. Their main motivation for choosing Haskell was:

  • Strong typing. Helps to avoid bugs in a large scalable system. Policies run in isolation and can’t crash the platform.
  • Interactive development. It’s possible to immediately see how changes to the code affect the program.
  • Concurrency. Policies fetch data from different sources, so with increased concurrency, they are more efficient.

2. Haskell for supply chain optimization

Labrary: haskell game engine
Target

Target is a supermarket chain with a strong technology stack. The company applies Haskell in its data science department in order to solve the problem of demand uncertainty. There the probability monad has turned out to be extremely useful. Overall, Haskell helps them overcome randomness and build probabilistic models in production.

3. Functional Payout Framework at Barclays Bank

Barclays using Haskell
Barclays bank

Barclays Bank is a UK financial organization famous for its passion to explore more “exotic” technologies.

Their in-house Haskell department has created a risk management engine in Haskell. The system calculates the value of all the trades and how market changes affect it. Risk engine connects to other systems, conducts computation, does value streaming and more.

The developers at Barclays have also made the Functional Payout Framework. This also is a Haskell application. It exploits embedded domain-specific functional language to process exotic financial derivatives. Unlike other scripting languages for the same purpose, the framework is able to process multiple interpretations to price such trades and analyze the scripts.

haskell framework barclays bank
Functional Payout Framework by Barclays

4. Cryptol by Galois

Galois actively promotes the use of functional languages in the industry. They do cryptography research, critical software system design, human-computer interaction optimization, and basically any other type of RnD. Haskell is their evergreen tool to guarantee security for critical systems.

One of the interesting projects they have worked on (and which is available as an open source library) is Cryptol. Galois created Cryptol for the NSA’s Trusted Systems Research Group as a standard for cryptographic algorithm specifications.

Cryptol specification can serve as a reference for a cryptographic module, and can help authors of cryptographic implementations to check or prove properties of algorithms and experiment with new ones.

If you want to explore more of their open work, take a look at their GitHub.

5. Cardano SL

At Serokell, we’ve also worked on projects the Haskell community can be proud of. Cardano Settlement Layer is one of them. It’s a cryptocurrency designed for Cardano blockchain platform in collaboration with the University of Edinburgh, University of Athens and University of Connecticut.

The main technical feature of Cardano is the clear separation of the blockchain into two layers. The first is needed for cryptocurrency circulation and coin distribution, while the second is a platform working with smart contracts. This creates an advantage for Cardano in the speed of the transactions and the level of security of the entire system.

Cardano sl written in Haskell
Cardano SL

We used proof-of-stake instead of a proof-of-work algorithm to reimagine Bitcoin. Simply put, the reward of the “miner” depends on the balance on his account.

The project is trying to solve the problem of quickly and cheaply creating decentralized applications and smart contracts in a safe and scalable way.

6. Copilot project for NASA

Under NASA auspices, the University of Copenhagen, Galois, and National Institute of Aerospace have collaborated to create a runtime verification framework Copilot to deliver runtime monitor programs. These programs function concurrently with the target software and make sure it behaves according to the specifications.

Update: The information about the developers was updated thanks to one of our followers who pointed out the actual participants of this project.

haskell technology in industry
From Twitter

Copilot is embedded in Haskell (it’s a DSL), so a working knowledge in Haskell is a must if you want to operate with it. For example, Copilot types are enforced by the Haskell type system to ensure that target programs written in C are well-typed.

Last thing to be said

We hope the list of cool projects will continue to grow. Many enterprises like Tesla and Bloomsbury are nowadays hiring Haskell developers to bring new inspiring projects to life.

While you wait for Top Haskell Software Projects 2.0, check out our post about the history of Haskell. You’ll learn more about its exciting past - from being a theoretical abstraction to becoming a synonym for software with high security and efficiency.