Overview

Elm Friday: What is Elm? (Part I)

No Comments

About This Series

This is the very first post in a series of short and sweet blog posts about Elm. The stated goal of this series is to take you from “completely clueless about Elm” to “chief Elm guru”, step by step. If you already have an idea what Elm is about, you can skip directly to the next episode or check out the table of contents.

So, What Is Elm?

Elm is the next big thing™ for frontends. In an ideal future not too far away, we will do all our frontend work in Elm, so you better hop on the band wagon now. Maybe you have heard about React and Flux and all this stuff the cool kids talk about nowadays? Forget about that. Elm is much better. (Disclaimer: I never did any serious work with React or Flux but I overheard some folks talk about it in the coffee kitchen at the office, so I’m obviously totally qualified to make such a statement.)

Elm is a purely functional, statically typed language that compiles to JavaScript and HTML. Its syntax is similar to Haskell, so it looks quite different from JavaScript. This might seem a bit scary at first, but rest assured, you’ll get used to it quite quickly.

It comes with some pretty awesome features:

  • Clean, readable, expressive syntax.
  • Type inference.
  • No runtime exceptions. If your Elm code compiles, it will not produce any “undefined is not a function” garbage. Never, ever. Also, when it compiles it usually also does exactly what you intended, right away.
  • It’s reeeeally fast. It claims to be faster than React. But check this benchmark and see for yourself.
  • Powerful but safe interoperability with plain vanilla JavaScript.
  • Great development tools (a live reload server and a time-traveling debugger, among others)

There is one major downside to Elm, though: Once you had a certain amount of Elm exposure and you come back to your old JavaScript (CoffeScript, TypeScript, …) project you’ll long for Elm’s power and clarity and start to ponder how much effort it would be to quickly convert the whole code base to Elm…

You can also check out the official site for more details.

This concludes the first installment of this blog post series on Elm. Now that we know what Elm is, we’re all eager to get going with it, right? Continue with the next episode.

Comment

Your email address will not be published. Required fields are marked *