DEV Community

Comparing Elm to React/Redux

Jason on July 11, 2019

I have recently been exploring creating web apps in Elm and found it to be a breath of fresh air compared to the usual React/Redux projects I have ...
Collapse
 
recss profile image
Kevin K. Johnson

Would it be more fair to compare Elm to ReasonML?

Collapse
 
rametta profile image
Jason

I don't think it would be more or less fair. The point was to show the similarities and how they are not much different, in order to get more people interested in it. If I compared Elm to Reason then not many people would relate to it.

Collapse
 
fhammerschmidt profile image
Florian Hammerschmidt

Absolutely. Both are statically typed languages which compile down to JS (strictly speaking, not ReasonML, but Bucklescript) with a sound type system (other than typescript).

But imho Reason is easier to learn for JS developers, especially React developers, because of syntax similarities. Also, interop (which you probably will need in a bigger project) is better in Reason.

Elm is a cleaner approach though, and is very fitting for smaller, self-contained projects.

Collapse
 
csaltos profile image
Carlos Saltos

Good idea !!

Collapse
 
josephthecoder profile image
Joseph Stevens

Great article! Best comparison Ive seen so far. Elm looks really clean.

Collapse
 
rametta profile image
Jason

Thanks!

Collapse
 
vageez profile image
Angelo

Sweet article!

I wonder, since Elm has a single view is the re-rendering when models change as efficient as React?

Will definitely try Elm out! I love the FP syntax!

Collapse
 
rametta profile image
Jason

Thanks! And apparently it's more efficient in rendering, than React, according to some benchmarks

Collapse
 
serzn1 profile image
Serge

Hi Jason.
Could you show a solution for thunks replacement (calling a bunch of actions after one action etc)?

Collapse
 
rametta profile image
Jason

You wouldn't necessarily want to call more than one action for any effect. Ideally you would have one message handler for one side effect and if you wanted to combine 2 or more together you would pipe them into one new message.

model |> update Something |> update Something2

Collapse
 
masiucd profile image
Marcell Ciszek Druzynski

Great post

Collapse
 
csaltos profile image
Carlos Saltos

If you like a video tutorial about this and more Elm content you may check udemy.com/course/elm-the-complete-...