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.
Probably, the most googled and well-known example of Haskell application in major companies is the
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.
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.
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.
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.
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.
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.
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.
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.
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.