Welcome! I’m excited that you’re excited about getting started with Elm. Elm is great. It’s hip, cool, a little funky, and genuinely powerful. Let’s get started.

What is Elm?

So the folks over at Pragmatic Studio gave a great one sentence answer to this question: “Elm is a functional programming language that compiles to JavaScript and runs in the browser.”

The basic building block of Elm is the function. Every Elm application is built from a bunch of functions composed together and wired up in such a way that data flows from user interactions, through a store-like architecture, and changes are presented to the view. The program “reacts” to the user’s actions. Elm could even be called a functional “reactive” language. It really depends who you ask though, “reactive” is kind of a fuzzy word.

What’s it good for?

Functions in Elm are pure. This means that they just turn inputs to outputs and do nothing else (no side effects). A program composed of pure functions leads to deterministic state management, time travel debugging, and improved testability. The presence of strong typing and a static compiler means no run-time errors. Bundle these features into a compile-to-Javascript language and you get a sleek, minimalistic toolbox for building responsive, testable, and maintainable web applications that don’t fail at run-time. Yea. Wow.

How do I get started?!

1 npm install -g elm

I kid you not. It’s that easy to get Elm on your computer. If you don’t have npm, get it here.

2 Download the Elm plugin for your favorite editor.

You can get it for Atom, Brackets, Emacs, Intellij, Light Table, Sublime Text, Vim, and VS Code. I also recommend elm-format. Since the Elm compiler needs things to be formatted a specific way, elm-format saves you a lot of time by automatically indenting and formatting things the way the compiler likes. You can even configure elm-format to run every time you save your file. This greatly improves the already-pleasant development experience with Elm.

3 Open up elm-repl and start experimenting!

Do this by typing elm-repl into the terminal and voila!

Now, some of you may be getting the following error (or something very similar):

libtinfo.so.5: cannot open shared object file: No such file or directory

If you happen to be one of the lucky ones, try entering this command and it should fix the issue:

sudo ln -s /usr/lib/libncurses++w.so.6.0 /usr/lib/libtinfo.so.5

More Resources

1 Installing Elm

2 Pragmatic Studio Course

3 elm-lang/elm-platform issue #115 - solution for issue mentioned in last section