Elm is an impressive programming language. It has been around for five years. It is one of the group of recent languages that compile to Javascript. As such, it has been primarily used to develop web applications. But that is selling it short. It is more innovative than most of the myriad other new languages that have been introduced in the last five years and deserves far wider attention than it has thus far garnered.
First of all, Elm is a statically typed, purely functional language. It treats all values as immutable and has a module system that enforces semantic versioning. Function invocation is accomplished by writing the function name followed by the arguments of the function separated by spaces. There are no parenthesis around the arguments to a function or commas between them. Parenthesis are reserved for forcing grouping of elements.
Elm looks clean on the page. It is designed for creating reactive web pages and consequently has the Model, View, Controller paradigm built into the basic structure of its code. It calls the Controller function ‘update’ though which actually makes more sense. It has incredibly informative and helpful error messages. It enforces good program design at compile time, consequently there are virtually no run time exceptions to deal with. Any such exceptions that do arise come from the fact that it tightly integrates with Javascript, HTML5, and CSS.
I’ve looked for books on Elm but I have only found one or two. The best one is the Elm Tutorial which is available for free online and is a compendium of most of the other online documentation. The language is small and concise. There are a number of examples available to help the neophyte get up and writing their web applications in short order.
Elm leverages the Node.js ecosystem to do a lot of its heavy lifting. Consequently, it is easy to use the Electron package to develop desktop applications in Elm. What is left facing the developer is a clean, easy to maintain syntax that encourages expressiveness while rejecting unnecessary boiler plate. Although the language is statically typed, type declarations are optional. Explicit type declarations are useful to improve performance and sometimes to allow more expressive interface definitions though.
As far as expressing web pages in Elm, it is far easier to read than HTML. I plan to do some development in Elm and will report back when I have more experience with it under my belt. In the mean time, you can check it out interactively on the web at http://elm-lang.org/.
Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.