DEV Community

Catherine Galkina for Typeable

Posted on • Originally published at typeable.io

Do You Know Where Haskell Is Used?

Introduction

Hi there! We’re getting on with our series of posts on "where all those strange programming languages of yours are used". Last time we told you about Lisp, and now we’re going to pick up the talk about functional languages and turn our eyes to Haskell. It’s the main development language at Typeable and, surely, we couldn’t ignore this topic.

Haskell is a general-purpose purely functional programming language. Its distinctive features include strict static typing, lazy evaluations, algebraic data types, and a serious theoretical background. This language is relatively young, it emerged in 1990 but has already produced a big impact on other languages and programming language theory on the whole.

One of our recent posts described useful Haskell-based utilities, but all of them are intended to be used by tech-savvy people. Today we’re going to give some examples of practical use in various industries.

Industrial Haskell

Where and how is Haskell used?

  1. Probably, the most googled and well-known example of Haskell application in major companies is the Facebook Meta spam filters. Messages containing spam, links to potential malware and phishing attacks are filtered by Sigma, the system that was rewritten in Haskell in 2015. The choice of language was based, among other things, on performance requirements, the need for pure functions and static typing, as well as the possibility of interactive development. The Haxl framework is used under the bonnet, which the company has open-sourced. You can find more details about the development process and technical aspects in the company’s blog post.

  2. Eaton is a manufacturer of electrical and hydraulic equipment, as well as components for the aviation and automotive sectors. The company is using Haskell for day-to-day tasks such as scripting, hardware simulation, remote control tools for vehicle systems, etc. However, the most interesting thing is that they have entrusted hydraulic elements to the control of code written in Atom DSL, which is also implemented in Haskell. Atom is used to develop hard real-time systems and allows describing declaratively the system state transition rules. During compilation, the tasks are scheduled, which is why the resulting code has a deterministic execution time and constant memory consumption. This makes verification of the obtained code much easier and generally increases the system security, which is, of course, very important in this subject domain. You can read about all this in more detail on the slides and in the Atom repository.

  3. Now let’s jump to an entirely different sphere, that is, the world of music. The service called Chordify allows converting music from YouTube, SoundCloud, etc. into chords so that you could learn to play your favorite songs. Haskell is mostly used during the tracing process; to this end, developers use the HarmTrace library that analyses the sequences of musical harmonics.

Use chords generated by Haskell library to play your favorite music

  1. Kaspersky Lab is developing its own secure operating system KasperskyOS for IoT systems. Surely, this OS sets forth specific requirements for reliability and cyber security. The KasperskyOS team is actively using Haskell in the security system compiler and to create auxiliary development tools. The security configuration is described in a special DSL which is then compiled to C. As you can see, Haskell again demonstrates its usefulness when it comes to security.

  2. Some of in-house tools for automotive development in Tesla are written in Haskell, which can be seen from the regularly published vacancies. As far as I could understand from the vacancy descriptions, Haskell is used for the intermediate high-level representation of internal systems which is used to generate C code, documentation, and probably something more.

Tesla's using Haskell too!

  1. BIOCAD is one of the major biotech companies based in Russia. The company carries out the complete cycle of medicine development all the way through to mass production and marketing. In the course of medicine development BIOCAD develops its own internal services for data processing and storage. The backend of these services is written in Haskell; it uses the graph database Neo4j, for which the company has developed and published the driver called Hasbolt.

  2. Haskell has filled its niche in the development of blockchains and cryptocurrency. It seems to me, the majority of Haskell-related vacancies I’ve ever seen were in this field. Cardano should be mentioned as one of the most famous. The main cause of Haskell’s popularity in this sphere is security again. For more details see the post by FPComplete.

  3. If you find blockchains to be too dull, serious or "inhuman", I can tell you about Co-Star, an astrological application for personalized horoscopes. Their backend is written in Haskell, and the developers explained their choice of language on the application website.

Haskell has even something to do with astrology

  1. The backend of Wire messenger, with the server code publicly available in the company’s repository and detailed documentation, also written in Haskell.

  2. The American Museum of Natural History uses Haskell to study the phylogenetic graphs reflecting the evolutionary relationships between different species. The code of this project is also available on GitHub.

Conclusion

The list of examples for this post was compiled to demonstrate the variety of applications and, surely, many of them have remained offscreen. Here you can find more details on the companies and industries using Haskell:

Here at Typeable we are using Haskell to develop projects for health care, tourism, fintech and many other sectors.

Discussion (1)

Collapse
marklar profile image
Mark Wong-VanHaren

At Groq (groq.com) we use Haskell for lots of stuff!