Hacker News new | ask | show | jobs
by patwoz 1755 days ago
Can someone explain the difference of redux to elm? I don’t see a difference on the first look. I‘m a React/Redux Developer.
3 comments

Quickly? Redux is a state container that supports Flux actions and Elm is a language with a companion architecture that's recommended. The comparison would be between Elm and Javascript/Typescript+React+Redux, as it provides the ability to implement those featuresets out of the box, including Messages, which is the TEA answer to Redux and Flux actions (more or less).

Personally, I find working with Elm's state management features is like heaven compared to dealing with Redux+Typescript's intensely noisy types.

TEA was the inspiration for Flux/Redux IIRC.
> compared to dealing with Redux+Typescript's intensely noisy types.

Anybody have any experience on how this compares to ReasonML + React?

Redux is to React what the 'update' function is to Elm architecture (first code example in the following link)

https://guide.elm-lang.org/

Answering your question, the difference is Elm has a more expressive type system than javascript, and will catch a lot of errors for you, with excellent error reporting from the compiler.

The layout of the code becomes less important, because the compiler will catch most errors (actually recommended in elm guides not to split in too many files until overwhelmingly necessary)

They're really similar. Elm works hard to abstract away the JavaScript universe and create really clearly defined borders regarding being inisde Elm land or outside of Elm land. Specifically, interacting with external libs, etc. involves retrofitting them to work via a port, which lets side effecty stuff come in as a standard message without having to deviate from the basic design. Redux may do something similar (I forget), but the gist of what I'm saying is that Elm works really hard to adhere to its core primitives to limit cognitive overhead for most tasks.