Melange

OCaml for JavaScript developers

Melange is a backend for the OCaml compiler that emits JavaScript. Melange strives to provide the best integration with both the OCaml and JavaScript ecosystems. To know more about it start by reading the introductory tutorial, then check the Learn section for more information.

Features

A Solid Type System

Melange leverages OCaml's powerful type system to catch more bugs at compile time. Large, complex codebases become easy to maintain and refactor.

First-Class Editor and Tooling

Melange fully utilizes the power of the OCaml Platform to provide integrations with editors such as VSCode, Vim, or Emacs, with features like type inspection, autocomplete, and more. It also has first-class integration with Dune, OCaml's most used build system.

JavaScript Integration

Whether you want to use existing JavaScript packages from NPM, or use your own JavaScript libraries in your projects, Melange has you covered. With an expressive bindings language, and an ergonomic compilation model, Melange can help you build robust applications that leverage functionality from the JavaScript ecosystem.

Stable and Industry Backed

Melange builds on top of decades of type system research, compiler engineering and tooling development to provide a polished developer experience. Companies like Ahrefs use Melange daily to deploy web applications for their users.