4 ms·
> The pragmatism comes from the fact that you can use it today on the browser. Part of that pragmatism was already available in OCaml since it's inception. >
by cies 9y ago
> The pragmatism comes from the fact that you can use it today on the browser.
Part of that pragmatism was already available in OCaml since it's inception.
> The Reason syntax is currently functional just like OCaml and Haskell:
Reason does not prohibit --thus "allows-- OO, just as it is available in OCaml. Though both communities prefer FP style. I'd say OCaml (and therefor Reason) is FP first and OO on top of that. Contrary to Ruby's OO first and FP on top of that. Some say OCaml's OO is in there to sell it to mgmt :)
> So in essence Reason can be considered a super-set of Javascript
I do not think that's strictly true, but I get what you're trying to say.
> The Reason team is considering changing it to a syntax that ALGOL-style programmers are familiar with.
I really like the syntax as it is, and kind of hope "for my own sake" they keep it in line with OCaml and Haskell. But if this kind of syntax is needed to bring together a critical mass and start an FP revolution, then it is "just syntax" and I easily compromise on that!
- klibertp 9y ago> OCaml (and therefor Reason) is FP first and OO on top of that That's a general opinion, which I find quite sad. The object system in OCaml (the 'O' in the name stands for something...) is actually very well designed and is very different from what you may be used to from languages like Java (or even Ruby). It uses structural instead of nominal typing and separates class definition and object construction, while still being statically typed. Actually, lack of this particular OO system in F# is my biggest complaint against it.
- jasim 9y agoI would love to learn more about this. I've been programming in OCaml for a few months now and have stuck to records and immutable updates and modules for grouping behaviour. I really like this style compared to the object-oriented programming I was doing in Ruby. Real World OCaml has a chapter on objects and I'll give it one more read. But are there any other articles/links that expands on OCaml's object system and how it compares to conventional OO?