Myface

Elm: Making the Web Functional

Elm aims to make web development functional in three ways. First, Elm avoids many of the headaches of web programming by compiling to HTML, CSS, and JavaScript which saves programmers from unpleasant APIs and cross-browser compatibility issues. Second, Elm is a functional language with all of the benefits of type-safety and type-inference. Finally, Elm’s approach to GUI design makes it easy to create complicated components and interactions.

Elm is specifically designed for the creation of graphical user interfaces (GUIs). It is built around two paradigms: purely functional layout and Functional Reactive Programming. This talk is an overview of Elm’s two major design choices and their consequences for GUI design.

  1. In Elm, graphical elements – such as text, images, and video – are primitive values. They can be easily combined and composed to create complicated components. These primitive building blocks abstract away the unnecessary details of building a GUI, allowing the programmer to think on the level of components, not pixels. This is the essence of purely functional layout.
  2. Functional Reactive Programming (FRP) is a relatively new approach to graphical user interfaces and animation. The key abstraction of FRP is the signal. Signals are time-varying values, carrying anything from integers to images. With signals, an animation is simply a signal of images. A GUI is a signal of graphical primitives. FRP cleanly models complicated user interactions by combining and transforming signals.

By grounding our discussion in real examples, we will see that these two features make it simple to create complex components and modular code. If you want to see Elm in action, check out the interactive editor and compiler online at elm-lang.org.

Evan Czaplicki

Bio:

Recently graduated from Harvard with a degree in Computer Science, I am now taking a break before I start as a software engineer at Google.

I am interested in making programming more accessible: easier to use and understand. My goals and design sensibilities have been influenced both by a formal study of programming languages and practical experiences as an intern at Google and Microsoft.