Content deleted Content added
Add example code |
Alexflatter (talk | contribs) No edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 3:
| name = Reason
| logo = Reason-logo.svg
| logo_size = 200px
| paradigms = [[Programming paradigm#Multi-paradigm|Multi-paradigm]]: [[Functional programming|functional]], [[Imperative programming|imperative]], [[Modular programming|modular]], [[Object-oriented programming|object-oriented]]
| family = [[ML (programming language)|ML]]: [[Caml]]: [[OCaml]]
Line 11 ⟶ 12:
| license = [[MIT License|MIT]]
| file ext = .re, .rei
| website = {{
| influenced by = [[OCaml]], [[JavaScript]]
| influenced =
Line 27 ⟶ 28:
BuckleScript was forked to Melange<ref>{{Cite web |date=2023-06-02 |title=ANN: Melange 1.0 – compile OCaml / ReasonML to JavaScript |url=https://discuss.ocaml.org/t/ann-melange-1-0-compile-ocaml-reasonml-to-javascript/12305 |access-date=2024-05-24 |website=OCaml |language=en}}</ref> to continue to support compiling OCaml to JavaScript.
== Differences from OCaml Syntax ==
While Reason compiles down to native code via OCaml's toolchain, it specifically differs in its syntax, [[Error message|error messaging]], and editor tooling.<ref>{{Cite web |title=What & Why · Reason |url=https://reasonml.github.io/docs/en/what-and-why |access-date=2025-02-08 |website=reasonml.github.io |language=en}}</ref> This allows Reason to provide an experience more similar to JavaScript or [[TypeScript]] for developers, which some may be more familiar with.
While OCaml often relies on [[Indentation style|Indentation]] and begin/end keywords, Reason tends to use curly braces to delimit blocks and semicolons for separation of expressions. Like JavaScript, Reason also defines functions via arrow-like syntax. Other notable differences include usage of a [[Switch statement|switch]] construct (instead of a match construct) and a reformatter for error messages.
== Example ==
|