4 ms·
If I get it right (from posts I've seen before and the docs on the project [1]) Reason is not really "OCaml for JavaScript" but just a parser for a more appeali
by emmanueloga_ 7y ago
If I get it right (from posts I've seen before and the docs on the project [1]) Reason is not really "OCaml for JavaScript" but just a parser for a more appealing, mostly compatible, syntax for the OCaml. So one should be able to compile to the same targets as with traditional OCaml.
Re: Mostly compatible: I remember there were certain things that were not easily expressible with Reason (but available in the OCaml syntax) a few years ago, not sure if it is still the case.
Subjective: OCaml syntax is definitely on the weird side, although I would not call it ugly. This coming from someone who enjoys writing clojure and xslt, go figure :-p.
1: https://github.com/facebook/reason/blob/master/src/README.md#repo-walkthrough https://github.com/facebook/reason/blob/master/src/README.md...
- desert_boi 7y agoBuckleScript (https://bucklescript.github.io/ https://bucklescript.github.io/) is used for using OCaml to output JavaScript. Reason can target native just like vanilla OCaml syntax can.
- emmanueloga_ 7y agoOh, I was browsing BuckleScript's history and for a minute thought evmar [1] was involved (author of the ninja build system) [2]. But I think evmar's commits are just ninja commits. First BS commit: [3]. Almost looks as if the author of BuckleScript maybe forked the ninja repo and started to work in BuckleScript from there. Why would anybody do that? Such a mystery... 1: https://github.com/BuckleScript/bucklescript/graphs/contributors?from=2010-10-10&to=2011-03-02&type=c https://github.com/BuckleScript/bucklescript/graphs/contribu... 2: https://github.com/ninja-build/ninja https://github.com/ninja-build/ninja 3: https://github.com/BuckleScript/bucklescript/commit/a626ee8bd3c77b05a38e2ebb2f82f49738e404e2 https://github.com/BuckleScript/bucklescript/commit/a626ee8b...
- adamcanady 7y agoJs_of_ocaml [1] is a good alternative to BuckleScript for standard OCaml (non-Reason). For example, it works well with Core_kernel [2] and Async_kernel [3] to provide high-level functionality that is cross compatible between Unix applications and browser applications. [1] https://github.com/ocsigen/js_of_ocaml https://github.com/ocsigen/js_of_ocaml [2] https://github.com/janestreet/core_kernel https://github.com/janestreet/core_kernel [3] https://github.com/janestreet/async_kernel https://github.com/janestreet/async_kernel
- ernst_klim 7y agoJs_of_ocaml works fine with Reason, though.
- abathologist 7y agoTo be clear, Bucklescript also works with standard OCaml (because Reason is just an alternative surface syntax).