GithubHelp home page GithubHelp logo

coproduto / melange Goto Github PK

View Code? Open in Web Editor NEW

This project forked from melange-re/melange

0.0 1.0 0.0 1.1 GB

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

Home Page: https://melange.re

License: Other

Makefile 0.04% OCaml 52.32% Shell 0.01% Standard ML 0.13% JavaScript 14.82% HTML 0.01% C 27.32% C++ 0.06% CSS 0.01% TeX 0.98% PostScript 3.06% Gnuplot 0.01% Coq 0.89% Reason 0.34% Nix 0.01% ReScript 0.01% Python 0.01%

melange's Introduction

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 most straightforward way to use it is via Esy.

  1. Make sure you have Esy installed (npm install -g esy should cover most workflows)
  2. Use an esy.json file like the following:
{
  "name": "melange-project",
  "dependencies": {
    "ocaml": "4.12.x",
    "melange": "melange-re/melange",
    "@opam/ocaml-lsp-server": "*"
  },
  "esy": {
    "buildsInSource": "unsafe",
    "build": ["ln -sfn #{melange.install} node_modules/bs-platform"]
  },
  "installConfig": {
    "pnp": false
  }
}
  1. Run npm install (or yarn) followed by just esy and after they finish installing and building, you should be able to use bsb commands via esy esy bsb -make-world

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

See Credits.md.

Licensing

See COPYING and COPYING.LESSER

See Credits for more details.

melange's People

Contributors

bobzhang avatar evmar avatar nico avatar chenglou avatar anmonteiro avatar glennsl avatar sgraham avatar nicolasdespres avatar rickyvetter avatar joshaber avatar jchavarri avatar tfarina avatar ryyppy avatar riannucci avatar cristianoc avatar bsansouci avatar coobaha avatar pcc avatar ulrikstrid avatar mransan avatar jdeisenberg avatar syntheticpp avatar arnarthor avatar zploskey avatar fanael avatar nikgraf avatar qhuo avatar mchaver avatar bloodyowl avatar ngzhian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.