3 ms·
It's not just the familiarity. ReasonML fixes real syntactic issues with OCaml: - Having to learn how to use let ... in - Having to learn how to use semi-colo
by yawaramin 8y ago
It's not just the familiarity. ReasonML fixes real syntactic issues with OCaml:
- Having to learn how to use let ... in
- Having to learn how to use semi-colons and where and why
- Having to enclose `else` clauses in parentheses or begin/end keywords and learning why they are necessary
- Having to use multiple pairs of parentheses to enclose function arguments like `foo (a + b) (c - d)`. With Reason it's `foo(a + b, c - d)`. And another bonus, function application in Reason actually looks like high school math function application
- Having to learn to distinguish between tuples and multiple arguments in data constructors
Those are just off the top of my head. In addition, ReasonML's refmt tool lets you avoid bikeshedding discussions about code formatting–it's a whole-program formatter. And some additional syntax niceties like single-@-symbol annotations and the upcoming single-line comments (//)–something OCaml will most likely never get.
- badfrog 8y agoI wouldn't consider #1-3 to be issues with OCaml syntax. It took me a while to understand what was going on with them, but once I did, I had a solid understanding of expressions vs statements, which has helped me understand functional programming better in general. IMO blending the syntax for the two will make the earliest stages of learning easier but cause confusion and longer learning curves in the long run.
- yawaramin 8y agoI can't see how. ReasonML syntax has a clear and uniform scope delimiter, curly braces. You are always sure which scope you're in, there's no room for ambiguity. You'll have to provide some more specific ways in which there could be confusion ;-)