First Thoughts on Elm

Functional Programming
Elm
Web Development
February 17, 2024
5 min read

Exploring Elm from a PureScript developer's perspective - first impressions, key differences, and initial thoughts on the ecosystem.

I would not recommend developing in Elm for greenfield projects - the compiler has not been updated in several years - and there are very few novel libraries being created.

Abstract

Elm and Purescript are both exceptional functional programming languages suitable for frontend development. While Elm is widely regarded as an accessible option for beginners transitioning from JavaScript or TypeScript, Purescript is preferred by enthusiasts of Haskell seeking a web-first alternative. In this post, I will present my initial impressions of Elm and compare it to Purescript. Furthermore, I will employ a depth-first search maze generation animation in both Purescript Halogen and Elm to assess their relative strengths and weaknesses.

Functional Programming
Depth-First Search
Elm Architecture
Zero Runtime Errors

Table of Contents

Problem Statement

In the realm of frontend development, the choice between Elm and PureScript presents an intriguing dilemma. Both languages are purely functional and statically typed, but they differ significantly in their design philosophies. Elm prioritizes simplicity and beginner-friendliness, while PureScript has a steeper learning curve but offers a wealth of features reminiscent of Haskell. Both languages promise type-safe functional programming for web applications. So, which one should we select for our projects? I will provide a brief survey of the two languages, keeping in mind the following questions:

Key Questions

  • What are areas where Elm excels over Purescript for this problem, and vice versa?
  • Can we actually achieve zero runtime errors, in practice?
  • What is the developer experience?