Hacker News new | ask | show | jobs
by chenshuiluke 3505 days ago
What's a good alternative to Elm?
8 comments

For nearly half a decade, you have been able to compile OCaml[0] to JavaScript with js_of_ocaml[1]. For a comparison of writing native bindings for both Elm and OCaml (and some TodoMVC code that uses them), check out elm-d3[2], and ocaml-d3[3]. elm-d3 predates the virtual-dom library and was therefore the first Elm library to provide a direct interface to HTML. It also predates the removal of signals in 0.18, so it needs to be ported. Been having some difficulty with that. I've had the native code blessing to publish it for a couple years, but never have.

[0]: http://ocaml.org/

[1]: http://ocsigen.org/js_of_ocaml/

[2]: https://github.com/seliopou/elm-d3

[3]: https://github.com/seliopou/ocaml-d3

Language wise scala.js[1] with cats[2] or scalaz[3]. The FRP story there is unfortunately more complicated.

1| https://www.scala-js.org/ 2| http://typelevel.org/cats/ 3| http://scalaz.github.io/scalaz/

You can go with the Diode [1] library for an Elm/Redux-like architecture. And with that you don't need to all the way down to cats or scalaz (although you sure always can if you want to).

[1] https://github.com/ochrons/diode

Take two average JS programmers. Hand one of them the Elm docs, the other the Diode docs. What do you expect will happen?
Both will continue using typescript/redux/react combo. Scala.js mostly makes sense if you are already familiar with scala, that's hardly surprising.
Depends on what you're looking for. Keep in mind that the OP came to Elm with a Haskell mindset. Elm is simpler than Haskell (yes, at the cost of some boilerplate).

If you program in JavaScript and you want a language with no runtime exceptions, go for Elm. If you want type classes, go for PureScript.

I don't know if it is good, but there is http://www.purescript.org/

Maybe look into https://github.com/clojure/clojurescript ?

Eve looks like it is filling the same sort of role: http://programming.witheve.com
PureScript, BuckleScript, and GHCJS, are all good options depending on your risk sensitivity and lang preference.
JavaScript?