Elm Blog

elm-lang.org · Company blog · on HN since 2011

The official blog of Elm, a functional language that compiles to JavaScript, written by its creator Evan Czaplicki.

What HN saysHN commenters like Elm as a stable, opinionated language for web front ends, and one notes it has less learning material than Haskell.
283HN people shared it
249linked it in comments
49stories submitted
4.7Kstory points
4 months agolast shared
2011people per year2026

Most-shared posts

  1. 1
  2. 2
    Making Elm faster and friendlier in 0.16
    12 people · 243 points · first shared 2015 · 90 comments on HN
  3. 3
    Compiler Errors for Humans
    10 people · 295 points · first shared 2015 · 90 comments on HN
  4. 4
    A Farewell to FRP
    9 people · 771 points · first shared 2016 · 241 comments on HN
  5. 5
    Examples.elm
    8 people · first shared 2012
  6. 6
    Compiler Errors for Humans (2015)
    7 people · 78 points · first shared 2020 · 54 comments on HN
  7. 7
    What is “Functional Reactive Programming”?
    7 people · 13 points · first shared 2012 · discussion on HN
  8. 8
    Virtual DOM in Elm
    6 people · 372 points · first shared 2014 · 112 comments on HN
  9. 9
    Farewell to frp
    6 people · first shared 2020
  10. 10
    Escape from Callback Hell: Callbacks are the modern goto
    4 people · 247 points · first shared 2012 · 147 comments on HN
  11. 11
    Asset minification with Elm (2018)
    4 people · 68 points · first shared 2019 · 57 comments on HN
  12. 12
    Interactive Programming: A New Kind of REPL
    4 people · 27 points · first shared 2013 · 3 comments on HN
  13. 13
  14. 14
    Compilers as Assistants (2015)
    4 people · 1 points · first shared 2021 · discussion on HN
  15. 15
    Examples
    4 people · first shared 2015

What HN people wrote when they linked it

naltroc · 2024-02-29
elm is a lovely lang. it would be nice to have modern APIs on it. here's the project for new eyes: https://github.com/elm/core https://elm-lang.org/
surprisetalk · 2023-01-03
For deployment, I like Cloudflare Pages/Workers for small projects and https://fly.io for large projects. For frontend, I think you'll really enjoy Elm if you like R and Python. Personally, I use vanilla JS (no framework) for small projects and Elm for large projects. For backend, there are plenty of excellent REST API frameworks for Rust, Go, Deno, Elixir, etc. I can give specific language recommendations if you're interested. [1] https://elm-lang.org [2] http://vanilla-js.com
dave4420 · 2022-11-19
Little bit unconventional, but try writing your front end in Elm, and use the elm-ui library to avoid writing html or javascript. It compiles to javascript and will generate an index.html for you if you want. Elm is highly opinionated… maybe you’ll love it, or maybe you’ll hate it, but it’s a good fit for what you want to do. https://elm-lang.org/
savanaly · 2022-08-03
I really like Elm [0] and write all my side projects in it. There are many reasons I like it, but the one that probably plays best around here is that it feels like a very learn-it-for-life type language. It has a release cadence measured in years (the latest version, 0.19.10, was released in October 2019!), and a community that has adapted to match. Elm doesn't release shiny new features often, or even necessarily ever again, but it has everything I need to make every web game I could possibly think of already so that's a good thing. [0] https://elm-lang.org/
tasuki · 2020-11-06
Yes, no desktop and backend. It might be possible to use Elm outside of web frontend, but probably wouldn't be much fun. > in terms of learning materials there isn't much compared to haskell. To whet your apetite, see https://elm-lang.org/ Then read through the excellent https://guide.elm-lang.org/ - not very long but absolutely enough to hit the ground running.
auslegung · 2019-09-03
There are lots of solid choices, and as always it depends on what your problem is. If you want to have an easy time hiring, go with something popular like React, TypeScript, Python. If you're willing to choose some excellent languages that are not going to be easy to hire for, I highly recommend http://elm-lang.org for frontend, and https://www.haskell.org for backend. Both of these scale incredibly well.
gnode · 2019-06-18
For direction of learning, I'd recommend finding challenging projects with them which they have a strong interest in, and can feel a sense of ownership over, then let their curiosity and creativity drive the teaching. The teaching should reward them by solving problems they are perceptive of and value. I think for a language, Javascript is a great choice. It's convenient because it can be used in the browser, or CLI / server with Node. It has powerful and user-friendly tools for debugging and profiling. NPM has a wealth of libraries for graphics, robotics, machine learning, and pretty much anything else you might want. For functional programming, with interoperability with Javascript, there's Elm: https://elm-lang.org/
rtfeldman · 2019-03-20
> a decent standard library and language This is what a lot of people love about Elm: it's a lovely language with a first-rate standard library. The Elm ecosystem is smaller than the JS ecosystem, but of course that's a hard requirement of a nicer foundation. More info: https://elm-lang.org
knewter · 2018-12-05
I'd recommend checking out Elm: https://elm-lang.org it's ridiculously good and if you don't have js experience that shouldn't get in your way. it's easily my favorite frontend language.
tlrobinson · 2018-07-31
The main page doesn't do a great job of showing what's interesting about Grain vs. JavaScript. The only hint is this: "No runtime exceptions, ever. Every bit of Grain you write is thoroughly sifted for type errors, with no need for any type annotations." Maybe show some examples of errors Grain would catch that JavaScript wouldn't, like Elm does: http://elm-lang.org/
elviejo · 2017-04-28
Excellent question. Turns out there is: http://elm-lang.org Is a Haskell inspired programming language that makes developing front end a delight. It helps to build Reliable front ends. Watch this conference to get a sense of what Elm does. Making the Backend Team Jelous[1] Plus the Elm architecture makes everything orderly and easy to understand. Quite a change from the mess of react components and Angular rewrites. [1] https://youtu.be/FV0DXNB94NE
callahad · 2017-04-24
Elm (http://elm-lang.org/) is a particularly elegant language for front-end web development that compiles to JavaScript, but includes things like immutability and strong, static typing right out of the box. Other languages like C, C++, and Rust can also run on the Web thanks to WebAssembly, a new compiler target for the web that's on by default in Firefox, Chrome, and Safari Technical Preview, and available behind a flag in Edge: http://caniuse.com/#feat=wasm However, interaction between the DOM and WebAssembly is still pretty rough, so it's currently best at numeric / computationasl tasks, not replacing JavaScript entirely.
pmarreck · 2016-10-21
First of all, Angular sucks (/opinion), so that's a bad example. I think it's due to the fact that Javascript is so terrible at any scale, yet is so pervasive, that working with/around it becomes this deer-in-headlights thing you can't ignore... since most HAVE to work with it in some form, doing any Web stuff. I recommend Elm, as a way around Javascript's problems while still allowing you to run in browsers: http://elm-lang.org/
ggregoire · 2016-10-20
For those wondering what's Elm: https://news.ycombinator.com/item?id=12718224 (4 days ago) - Elm in Production for France TV http://elm-lang.org - "A delightful language for reliable webapps. Generate JavaScript with great performance and no runtime exceptions."
dwenzek · 2016-07-05
I recommend http://elm-lang.org which is statically typed and designed for web development.
spiralganglion · 2016-05-15
I echo the other voices saying canvas and pure JS (or, in my case, CoffeeScript or ClojureScript). The canvas API is extremely intuitive — aside from the boilerplate setup, perhaps — and you can make some really neat things with it very quickly. The home page for my personal site has a starfield made entirely with canvas: http://ivanish.ca — best to view in a dark room so you can see all the pseudo-nebulae. Source code (if it helps): https://github.com/ivanreese/ivanish/blob/master/source/script/stars.c… You might also want to consider Elm, but I have very little first-hand experience with it: http://elm-lang.org
mtmail · 2016-04-11
The relatively new http://elm-lang.org/ (https://en.wikipedia.org/wiki/Elm_%28programming_language%29) claims "no runtime errors" and the number of compile time checks of variable types and values is really strict/amazing/well-documented. That said I tried diving a value by 0 and that threw a runtime error.
loganmhb · 2016-03-24
If you like Javascript and you want to try a language with a good static type system, you might like Elm (http://elm-lang.org/). As a bonus, it has fantastic documentation and examples of small in-browser projets -- a clock, Pong, and so on.
RehnoLindeque · 2015-08-30
Try elm (http://elm-lang.org/) first; it doesn't mention Functor, Applicative, Monoid, Monad anywhere. You might come back to Haskell later and it won't seem like such a big deal. (I use Haskell for serious work and love that a quick patch doesn't suddenly start breaking things in 10 other places - it's a real time-saver!)
sriku · 2015-06-07
Elm [1] is also worth looking into. I've been using it of late and having fun with it, despite some quirks. It's quite performant in practice too. Though I haven't done comparisons myself, Elm benchmarks claim it to be the fastest only next to Mercury [2]. [1] http://elm-lang.org [2] http://elm-lang.org/blog/Blazing-Fast-Html.elm
jaked89 · 2015-04-03
It's worth mentioning Elm, a (truly) functional-reactive language, based on virtual-DOM. http://elm-lang.org/
didyoucheckthe · 2015-02-14
> The first question I usually get ... is “Why not Haskell?”. > The answer is JavaScript. My current favorite language for this is Elm[1]. It compiles to JS, is based on Haskell, and has a few simple differences between either[2]. Elm doesn't let you use the tons of available Haskell libraries, and makes it slightly painful to integrate with JS. But it's the coolest thing for the web so far. And here's why: It uses a completely declarative state machine to model a fully interactive and complete GUI! This is the dream React.js and Om didn't even know they were heading towards! And yes, it is as good as it sounds. [1]: http://elm-lang.org/ [2]: http://elm-lang.org/learn/FAQ.elm EDIT: Also, Elm fixed Haskell's awful syntax record name collision problem, and awesomely too!
corysama · 2014-12-26
http://elm-lang.org is a functional and reactive client-side (js target) language that is still young and getting great very fast. http://pragmaticstudio.com/blog/2014/12/19/getting-started-with-elm The idea of combining Elm with Elixir or Yesod (Haskell) on the server side seems exciting. Another interesting project is Snabb Switch. If you want to learn networking at the lowest level and highest speed possible in software, Snabb a great platform for experimentation. Finally, I'll throw in http://terralang.org. It's not networking related. But, I think it's terribly interesting and not getting any attention.
kuni-toko-tachi · 2014-12-24
I'm a huge fan of ReactJS, however it isn't a perfect or optimal implementation of it's concepts. Having a purely functional frontend, with immutability is key. ReactJS is leaky in it's mix of imperative and declarative code. FluxJS also suffers from this same issue. ReactJS is the gateway drug to frontend nirvana. For more info: http://computationallyendowed.com/blog/2014/07/20/reactive-mvc.html (MVC in a Reactive World) http://elm-lang.org (ELM Language) https://github.com/swannodette/om (Om/Clojurescript) These will be _the_ technologies and approaches in 2015. ReactJS/FluxJS are great, but imperfect implementations!
nickknw · 2014-10-03
It looks similar to Elm[1] to me. Which is great as far as I'm concerned, I'm a big fan of that approach - the more exposure it gets, the better! [1] - http://elm-lang.org/
bru · 2014-09-23
There are several paths: 1. JS as an assembly language. This is what emscripten[0], a LLVM bytecode-to-JS does, by following the asm.js specification[1]. This is for CPU-intensive tasks, not DOM manipulation. You can use any language that has a LLVM frontend. 2. JS as a target language, from a specific, new language. Those include cleaner variants that keep the same semantics (CoffeeScript, TypeScript, maybe Dart, ...) or more innovative ones, such as Elm[2], which is written in Haskell too. I'd say that a big innovation that makes the life easier is FRP (which is at the heart of Elm or React.js). I fail yet to see what advantages PureScript brings compared to Elm. 0: https://github.com/kripken/emscripten 1: http://asmjs.org 2: http://elm-lang.org/
peaton · 2014-06-30
This is super helpful. The example with the multi-click stream is pretty impressive as a demo. Is anyone familiar with the Elm[1] language/library that compiles to JS? Does it facilitate good FRP practice? Or are there any better libraries/languages out there? I've just seen a lot of Elm when I've google FRP in the past. (Followed closely by Haskell.) [1] http://elm-lang.org/
arianvanp · 2014-06-28
How about http://elm-lang.org/ ? It is very similar to haskell but a bit less daunting and all its libraries are focussed on building inbrowser games. Sounds like something kids would love. Now that i am brainstorming anyway. Something like http://scratch.mit.edu would be so much nicer if it were a functional language! Instead of confusing blocks that maintain state every block is just a standalone welldefined function and combining blocks is just functional composition and application! I think it would be reaallt easy for a kid to digest mentally: blocks have inputs and outputs, thats it. Does anybody know if there are projects tjat accomplish this?
giovannibonetti · 2023-03-08
One alternative is the Model-View-Update framework developed in the Elm language [1]. A few years ago, it influenced Redux [2], but JS doesn't have good ergonomics to support it, so people complained it was too verbose. Anyway, I brought Elm to the company I worked at two jobs ago, and it worked very well, since it is conceptually very simple. The experienced developers loved its explicitness, which made it possible to build a very intricate app from just a few dependencies, which in turn allowed the company to have a very fine-grained control of the UI, and the customers loved the result. On the other hand, other less experienced developers didn't like Elm so much because React allows you to write your app with fewer lines of code. The article from this discussion explains well that React (especially with hooks) hides complexity, which bites people later. At that time, it is perhaps too late to switch to something else. Needless to say, I haven't been able to convince any other employer to use Elm, and then I see issues popping out all the time that would never happen with it. Such a waste, just because people like shiny toys and just follow what others around them are doing without thinking too much. [1] https://elm-lang.org/ [2] https://redux.js.org/understanding/history-and-design/prior-art
carapace · 2023-01-02
There's a common pattern I've seen over and over. When people learn a new thing they tend to go through a creative phase with it. The first time I noticed it was in a programming class I took in school. We were learning in Pascal. (It was cute!) When we got to the lesson on changing output colors, for the next week it was like some unicorn barfed rainbows all over our screens. People like to play. (Remember blink tag? Scrolling marquee?) What you're seeing in the JS Frontend space is (in my considered opinion) a combination of the effect of: 1) Lots of people learning to program by messing around with JS, and 2) Folks willing to pay people to mess around with JS. So you have a volcano of creativity combined with a tidal wave of money... The results were inevitable. > Follow up question : Is that complexity necessary or artificially inflated? No, and yes. It's not necessary (for the vast majority of sites) so it's definitely (IMO) artificially inflated. The good news is that you can end-run all the introduced complexity by using e.g. Elm lang ( https://elm-lang.org/ ), or just sticking to simple "plain vanilla" JS systems. The only reason to use something other than Elm is if you enjoy some other particular system (I hear good things about "htmx" https://htmx.org/ )

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close