5 ms·
Elm is kinda limited in the sense that it really only works for UI. You can't use it outside of that. It also doesn't come with all the nice advanced features P
by Pako 8y ago
Elm is kinda limited in the sense that it really only works for UI. You can't use it outside of that. It also doesn't come with all the nice advanced features Purescript has which also makes it "easier" for beginners in my opinion: you don't have to learn as many foreign concepts to get productive. For example I believe I hadn't read "Monad" in the Elm docs even once.
Purescript on the other hand is more advanced and can run anywhere JS does (mainly web and node). FFI with JS is a lot easier than what Elm provides too. It has a better type system but arguably a worse compiler in the regards to error messages. Elm on the other hand has an amazing compiler: thanks to its more restricted nature it can mostly figure out what you were trying to do and give you really helpful tips.
Unfortunately I haven't used ReactML yet.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- akritrime 8y agoAre the error messages as bad as Haskell? One of the primary reasons I shifted my focus from Haskell was because of the errors generated by the compiler were not at all helpful when you are learning on your own, especially in contrast to something like Rust.
- Pako 8y agoI'm not too sure about that because I haven't used either in some time unfortunately. I tried some stuff on their online REPL. From what I gathered Purescript is doomed to produce more "unwieldy" error messages because of the more complex type system. Take this definition for example: ` some = drop (Just 5) [1,2,3,4,5,6] ` Purescript isn't even doing _that_ bad in this case: it complains that `Maybe Int` doesn't match `Int` but then goes on talking about checking if `Maybe t0` is "at least as general as" `Int` which will probably be useful information for an experienced developer but not newcomers. This is, at least from what I experienced, what happens most of the time with Purescript: you get way too much information with way too many details. Compare this to an error produced by the Elm compiler: >-- TYPE MISMATCH ---------------------------- Main.elm >The 1st argument to `drop` is not what I expect: >8| List.drop (String.toInt userInput) [1,2,3,4,5,6] > ^^^^^^^^^^^^^^^^^^^^^^ >This `toInt` call produces: > Maybe Int >But `drop` needs the 1st argument to be: > Int >Hint: Use Maybe.withDefault to handle possible errors.