A mixture of tooling combined to produce JS from OCaml / Reason.
This project is a fork of the ReScript compiler with a focus on compatibility with the wider OCaml ecosystem. A small write-up with more details on the motivation behind this project can be found in this blog post.
This project is currently unreleased. Currently, the easiest way to get started
is to clone the
basic template. Before
you do, make sure you have Esy installed (npm install -g esy
should cover
most workflows).
Please reach out on the ReasonML Discord if you can't figure it out!
Name | Purpose | Dependencies | Notes |
---|---|---|---|
Esy | Package manager | Installed with NPM | Obtaining dependencies (e.g. dune or reason ) |
Dune | Build tool | Installed with esy |
Well-known OCaml build tool; supports custom rules that can be composed to build anything |
Reason | Syntax | Installed with esy |
a library that implements an alternative syntax to OCaml |
Melange | Compiler that emits JavaScript | Esy (to install), Dune (to build), Reason (used as a library) | Supports OCaml, Reason and ReScript syntaxes; derived from ReScript, focused on compatibility with the wider OCaml ecosystem |
ReScript | The brand around a syntax and a compiler that emits JavaScript | None | Distributed via NPM as prebuilt binaries; previously called BuckleScript |
Yes! ReScript syntax is supported, but beware that it's stuck on an ancient
OCaml version (4.06, released in 2018), and it won't have as many features as
the OCaml or Reason syntaxes
(e.g. letop
binding operators,
generalized module open expressions,
or local substitutions in signatures).
Upstream removed the refmt
flag, which used to allow configuring the path to a custom Reason binary. This
was a welcome change for this repo too, so we cherry-picked it. The rationale:
this project uses Reason as a library,
so you can simply depend on the Reason version that you'd like in the usual way,
via your preferred package manager.
See CONTRIBUTING.md.
See Credits.md.
See COPYING and COPYING.LESSER
See Credits for more details.