ELLIOTTCABLE / melange

A mixture of tooling combined to produce JavaScript from OCaml & Reason

Home Page:https://melange.re

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Melange

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.

Installation

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!

FAQ

How does this project relate to other tools?

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

Can I use ReScript syntax?

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).

Where has the refmt flag gone?

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.

Contributing

See CONTRIBUTING.md.

Acknowledgments

  • Thanks to the ReScript project, its author and maintainer @bobzhang, and its many contributors. Melange is a fork of ReScript, and continues to incorporate patches to ReScript on a regular basis.
  • Thanks to the OCaml team, obviously, without such a beautiful yet practical language, this project would not exist.
  • Thanks to Bloomberg and Facebook. The ReScript project began at Bloomberg and was published in 2016; without the support of Bloomberg, it would not have happened. ReScript was funded by Facebook since July 2017.

See also Credits.md concerning some individual components of Melange.

Licensing

See COPYING and COPYING.LESSER

See Credits for more details.

About

A mixture of tooling combined to produce JavaScript from OCaml & Reason

https://melange.re

License:Other


Languages

Language:OCaml 44.4%Language:C 32.0%Language:JavaScript 17.1%Language:PostScript 3.6%Language:TeX 1.2%Language:Coq 1.0%Language:Reason 0.4%Language:Standard ML 0.2%Language:C++ 0.1%Language:Makefile 0.1%Language:ReScript 0.0%Language:CSS 0.0%Language:Nix 0.0%Language:Shell 0.0%Language:HTML 0.0%Language:Gnuplot 0.0%Language:Python 0.0%