DEV Community

Discussion on: A tour of all Elm commands

leob profile image
leob • Edited on

Well actually I see it as an advantage that Elm is FP ... :-)

I've played a bit with Haskell in the past and while I found it pretty abstract and academic it intrigued me too. Then recently I started working with Rust, and it reminded me a lot of Haskell (even though Rust is not exclusively FP).

And even the Javascript world is gradually moving towards FP ... filter/map/reduce, React with pure functional components and Hooks, RxJs ... the move to FP is there.

Interestingly I recently came across a very interesting article ( arguing that frameworks like React (and Vue, and so on) are slow (which I didn't realize because we're always being told that 'virtual DOM is fast'), and this article then went on to mention a technology called Imba (

I never heard of it before but right away it reminded me of Elm, and of Svelte. Both Imba and Svelte are compilers, which allows them to generate very fast and optimized code to manipulate the DOM. Now, Svelte is just Javascript but Imba uses its own language, which made me think of Elm :-)

So now I wonder, does the Elm compiler also manage to pull off generating crazy fast DOM manipulation code, like Svelte and Imba do (meaning, way faster than React or Vue) ?

Finally, have you ever heard of (or looked at) ReasonML ?

It's based on OCaml and made by the same group within Facebook who made React. Reminds me a lot of Elm in various ways: compiled, strong typing, FP, compiles to Javascript etcetera. I think it operates in the same space as Elm.

Thread Thread
aminnairi profile image
Amin Author

I'm not sure if Elm does what Svelte and Imba does on the optimization side for fast VirtualDOM rendering but I have read an article stating that the unoptimized (unkeyed) virtual DOM used in Elm is way faster than those used in React or Vue. Now this was a rather old article that was benchmarking using Elm 0.17 (we are now in Elm 0.19.1). So I don't know if this is still the case but I guess FP helps a lot in the optimization process.

I have been intrigued by ReasonML for a while. I love the project. I am not the best fan of the syntax but you can virtually do anything with the FFI capabilities of the language and with time (using Haskell & Elm) the syntax barrier begins to fade away.

The article you linked was very interesting! And I didn't know about Imba. I'll sure be playing with it. Looks promising too!

Thread Thread
leob profile image
leob • Edited on

The interesting thing about the article for me was not so much Imba but the huge performance differences. Those differences do not just impact the end user of the app, but also the developer, because development becomes much more simple.

It's so fast that there's no more need for clever tricks or complicated techniques to optimize speed of your app - even if you just use plain and simple JS arrays and objects and mutate things willy-nilly it's still fast enough. That was really an eye opener for me.

What I notice about ReasonML though is that you aren't hearing a lot about it, it hasn't been able to break out of its tiny niche. It's not become mainstream, far from it.

The problem for all of these JS alternatives (Elm, Imba, ReasonML) is the small community and ecosystem compared to the established incumbent, Javascript.