Software development

Learning functional reactive programming with Elm

Topics
Functional, Reactive, FRP, Elm

A couple of weeks ago I decided I would learn something new: functional reactive programming (FRP). It is a programming paradigm that has become very popular over the past few years, as demonstrated by the popularization of languages such as Haskell and Clojure. There is also a strong functional and reactive movement in the web frontend. JavaScript, the only programming language browsers understand, can be used in many different ways, fitting several programming paradigms. The core ideas of immutability and pure functions are quite alien to JavaScript, though, which is why I figured the learning FRP might prove easier with some other language.

Elm is a functional reactive language that compiles to something a web browser can understand. It forces a JS programmer to readjust their thinking, as there are no mutable variables and types are strong. All interaction is modeled through "signals", which are essentially streams of values changing over time. This is why Elm makes a perfect fit for learning FRP. In case you are the least bit curious, please take a look at the article I wrote: Learning FP the hard way: Experiences on the Elm language

Hats off to the Futurice Spice Program for making this learning experience possible!

 

Cover image: Chinese Elm, 1988-2007 on WikiMedia Commons