5 ms·
So ReasonML is actually a Javascript-like syntax for OCaml, and its tool-chain converts Reason code to OCaml, which then uses a tool called Bucklescript to conv
by jarcane 8y ago
So ReasonML is actually a Javascript-like syntax for OCaml, and its tool-chain converts Reason code to OCaml, which then uses a tool called Bucklescript to convert that OCaml to Javascript.
All because some people just have to have their curly braces.
I will never stop being angry that this exists. There is no reason for it other than pedantic bikeshedding and Facebook’s mission to proprietize web tech. It does nothing but mangle a perfectly readable syntax and bifurcate the ecosystem of the language.
- thatswrong0 8y agoMaking a language feel more familiar to the developers that would likely be using it will probably speed up its adoption and decrease the learning curve for new developers. I don't understand what is so enraging about that.
- jarcane 8y agoNo one did this for Python. People still complain about it, but somehow, it became one of the most popular languages on the planet. And how is it welcoming to newcomers to essentially be upfront asking them "right, now which syntax will you use?" Unless the answer of course is just to nudge them all in the direction of the one owned by a massive corporation with more money than some countries ...
- bobbby 8y agoHow's the uptake for ocaml going? Its had 20 years maybe next year will be its year?
- zem 8y agoreason is fully compatible with ocaml. nothing has been bifurcated. it is not even the first alternative syntax - the "revised syntax" had been around forever. https://caml.inria.fr/pub/docs/manual-camlp4/manual007.html https://caml.inria.fr/pub/docs/manual-camlp4/manual007.html
- jarcane 8y agoReason compiles to Ocaml, yes. Does Facebook actually want you to just use Ocaml? Sure doesn't seem that way to me. Facebook is pushing their own tool, and their own libraries to go with it. Interoperability between Reason, Bucklescript, Ocaml native, OPAM libs, and the various build tools in between is confusing and ill-defined. The path of least resistance just seems to be "stay in our garden... there's no walls technically, but good luck hopping back and forth". And all because some people are allegedly pathologically incapable of understanding a language without bolting curly braces on it. It's the most absurd overcorrection for a pedantic complaint I've ever seen in tech.
- StreamBright 8y ago>>> Does Facebook actually want you to just use Ocaml? Facebook already uses OCaml. https://github.com/facebook/infer https://github.com/facebook/infer
- Klathmon 8y agoThey use it for a few different projects: https://github.com/facebook?language=ocaml https://github.com/facebook?language=ocaml
- emmelaich 8y ago> Reason compiles to Ocaml .. My understanding is that it can be translated both ways with no difference of semantics.
- ohadrau 8y agoI know this is getting downvoted a ton, but I certainly felt the same way before using Reason. Even now, I'm sort of undecided about my opinion on it. I love how accessible it makes OCaml (which I think it does, people pay more attention to syntax than they really ought to) but I'm always afraid that it's going to cause native OCaml to be abandoned. Reason can also sometimes make code needlessly complex IMO because it hides some of the really clear aspects of OCaml's syntax. That said, it's improved a ton since it was first released and no longer feels like a weird soup of mixed up languages.
- int_19h 8y agoIt's not just about the curly braces - there are many warts about OCaml's syntax, and some of them go beyond mere niceties, and into the territory of making it too easy to unintentionally write code that doesn't do what the author intended. In Reason, it looks like they specifically went after those, e.g.: https://reasonml.github.io/docs/en/comparison-to-ocaml#pattern-matching https://reasonml.github.io/docs/en/comparison-to-ocaml#patte...
- AlexCoventry 8y agoIn practice, your editor's indentation will alert you to the compiler's interpretation of the pattern match.
- jarcane 8y agoIf Reason uses == to represent OCaml's =, and uses === to represent OCaml's ==, then how would Reason represent OCaml's === symbol (if it were defined)? Reason provides a way! "Escape" the triple equals symbol! Yes, such a massive improvement to clarity. Seriously there is nothing here I hadn't internalized within a day of working with F# or Python. Certainly nothing that justifies forking an entire alternate syntax.
- int_19h 8y ago> Yes, such a massive improvement to clarity. Given that === is not a standard operator in OCaml, I fail to see the problem with clarity. > Certainly nothing that justifies forking an entire alternate syntax. You do realize that this is very much a subjective judgment, do you? Syntax does matter. You can argue that it doesn't matter enough to bother, but that's down to personal taste. Given the popularity that Reason seems to be enjoying, clearly, syntax is a sore point for enough people. In any case, I fail to see the problem in general. Reason doesn't fragment the OCaml ecosystem, really, since it's just a different syntax for the same core language, and libraries etc remain. It's not any different than all the macro libraries for Lisps. Nobody is forcing you to use them, and you can still use a library written in Reason from OCaml, and vice versa. There's no real fragmentation. And if Reason ever dies, all code that's written in it could just be converted to OCaml using the last version of their transpiler, and maintained as such thereafter. So, what's the problem?