|
|
|
|
|
by LandR
2495 days ago
|
|
Has anyone done both elm and clojure script for Web work? Which did you prefer, which had the best tooling etc? I need to learn Web, as mucj as I don't want to, and love clojure and fp. Also figwheel looks awesome, but how hard is it to setup. I also think maybe to really get the best out of clojure script you also need to learn react?? I'm not sure this is the case with elm. Any other non js alternatives? |
|
There’s almost no comparison.
Elm compiles much more quickly.
Elm produces much more performant code.
Elm enables you to write software that works reliably much more quickly because type errors happen at compile time, rather than at runtime like in ClojureScript.
ClojureScript’s error messages are at times incomprehensible. Elm’s error messages are best in class.
Elm is far easier to learn than ClojureScript, and you’re right — you do need to know React if you’re writing a non-trivial ClojureScript application.
Elm is criticised for not allowing a synchronous IO escape hatch. This is a pretty bad criticism I think. Being able to guarantee where effects won’t happen is a pretty great thing. Any effects work and/or JS interop can be done with ports. Ports work just fine.
Elm is also criticised for denying the user a lot of “power features” like typeclasses. I find it mildly annoying sometimes that I don’t have everything I want, but I understand the trade-off. This is to make the language more accessible to your average JavaScript developer who has never tried anything from this family of languages. And I sure as hell don’t find it annoying enough to want to drop the type-checking compiler.