So by reading the reasons why facebook choose OCaml to create Reason, I couldn't stop noting that Scala met all the requirements too. I'm not biased whatsoever, I know Scala, but I'm not a die hard scala advocate. I just like a nice type system, so in this point I'm finding really hard to choose between those two for my next project. So what are the real trade offs here?
ReasonML vs Scala.js
Hi. Software recommendation questions are really off-topic on SO. That said, I don't know much about scala.js, but Reason has a familiar JS-like syntax, some nice sugar for JS interop and JSX, targets the npm ecosystem which makes it very easy to write bindings to js libraries, produces highly readable JavaScript code which makes it easy to debug and understand what the code actually does in JS terms, and has an insanely fast compiler (like if-you-blink-you'll-miss-it kind of fast). –
Harker
Whereas Scala.js provides the full Scala language, excellent JS interop, highly optimized output and an end-to-end strongly-typed environment if your back end is Scala. (But I agree: this sort of question is generally discouraged on SO. If you're interested in the Scala.js viewpoint, I might recommend poking in the Scala.js Gitter channel.) –
Dowel
I mean, I haven't used any of those, honestly. And I haven't been able to find an article from someone explaining their experience with both of them and making a good technical comparison in regards to build system, interoperability, language support, community, etc. –
Trstram
You might have to be the first to make that technical comparison then :) I actually haven't seen anyone mention they've come to Reason from Scala.js, but plenty from Elm and ClojureScript (and of course JS, TypeScript etc.). I don't really know what that says about anything, but there seems to be little cross-pollination. You can get a taste of the Reason community and lots of help from the Reason Discord. –
Harker
@Harker I'm actually coming from Scala.js, and I know of at least two other SJS people who tried or are trying Reason. Btw caeus, here's a discussion between the Scala.js and BuckleScript (Reason's JavaScript compiler) creators: news.ycombinator.com/item?id=13450089 –
Consentaneous
Reason react can do per file compilation so it’s easy to slip into an existing project. Scala.js allows you to tap into scala libs and the scala ecosystem. If you only focus on web it’s probably best to stick with what Facebook offers. I have computations that i do and for that Scala and non-ocaml tools are more helpful. Since you already know scala, you can use the reason-react model by using a library I put together at https://github.com/aappddeevv/scalajs-react.
© 2022 - 2024 — McMap. All rights reserved.