# [BuckleScript](https://bucklescript.github.io)

> A JavaScript backend for [OCaml](https://ocaml.org/) focused on smooth integration and clean generated code.

[![NPM](https://nodei.co/npm/bs-platform.png?compact=true)](https://nodei.co/npm/bs-platform/) [![Build Status](https://travis-ci.org/BuckleScript/bucklescript.svg?branch=master)](https://travis-ci.org/BuckleScript/bucklescript) [![Coverage Status](https://coveralls.io/repos/github/BuckleScript/bucklescript/badge.svg?branch=master)](https://coveralls.io/github/BuckleScript/bucklescript?branch=master)

## Documentation

Please see the [documentation site](https://bucklescript.github.io).

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## Acknowledgments

* Thanks to the [OCaml](https://ocaml.org) team, obviously, without such a beautiful yet practical language, this backend would not exist
* Thanks to [ninja-build](https://ninja-build.org), BuckleScript also comes with a blazing fast build tool on top of it, `ninja` is a truly [well engineered](http://aosabook.org/en/posa/ninja.html) scalable build tool
* Thanks to [Bloomberg](https://www.techatbloomberg.com)! This project began at Bloomberg and was published in 2016; without the support of Bloomberg, it would not have happened. Now that the project has grown and developed its own community, it has moved to its own GitHub organization.

## Licensing

See [COPYING](./COPYING) and [COPYING.LESSER](./COPYING.LESSER)

The [`ocaml`](ocaml) directory contains the official [OCaml](https://ocaml.org) compiler (version 4.02.3).
Refer to its copyright and license notices for information about its licensing.

The `vendor/ninja.tar.gz` contains the vendored [ninja](https://github.com/ninja-build/ninja).
Refer to its copyright and license notices for information about its licensing.

BuckleScript builds on parts of [js_of_ocaml](https://github.com/ocsigen/js_of_ocaml):

* [`jscomp/core/js_dump.ml`](jscomp/core/js_dump.ml) (pretty printer)

BuckleScript builds on parts of OCaml:

* [`jscomp/core/lam_pass_exits.ml`](jscomp/core/lam_pass_exits.ml)
* [`jscomp/core/lam_pass_lets_dce.ml`](jscomp/core/lam_pass_lets_dce.ml)

These modules were adapted from [`ocaml/bytecomp/simplif.ml`](ocaml/bytecomp/simplif.ml) for
JavaScript specific optimization purposes.

* [`jscomp/main/js_main.ml`](jscomp/main/js_main.ml)

`jscomp/main/js_main.ml` is adapted from [`ocaml/driver/main.ml`](ocaml/driver/main.ml). It is the main etry 
point of the underlying compiler.

* [`jscomp/stdlib-402`](jscomp/stdlib-402) [`jscomp/stdlib-406`](jscomp/stdlib-406)

`jscomp/stdlib-*` is copied from [`ocaml/stdlib`](ocaml/stdlib). It is compiled to JavaScript and
included with BuckleScript.

* [`jscomp/test`](jscomp/test)

`jscomp/test` is based on [`ocaml/testsuite`](ocaml/testsuite).

BuckleScript unittest builds on parts of [OUnit](http://ounit.forge.ocamlcore.org/)

* [`jscomp/ounit`](jscomp/ounit) is adapted from ounit, the unit test
  utilities are only used for dev purpose, they are not required for distribution
