BuckleScript

BuckleScript

  • Docs
  • Try
  • API
  • Community
  • Blog
  • Languages iconEnglish
    • 日本語
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • 中文
    • 繁體中文
    • Help Translate
  • GitHub

›Intro

Intro

  • What & Why
  • Installation
  • New Project
  • Try
  • Concepts Overview
  • Upgrade Guide to v7

Interop

  • Overview
  • Cheatsheet
  • Embed Raw JavaScript
  • Common Data Types
  • Intro to External
  • Bind to Global Values
  • Null, Undefined & Option
  • Object
  • Object 2
  • Class
  • Function
  • Property access
  • Return value wrapping
  • Import & Export
  • Regular Expression
  • Exceptions
  • JSON
  • Pipe First
  • Generate Converters & Helpers
  • Better Data Structures Printing (Debug Mode)
  • NodeJS Special Variables
  • Miscellaneous
  • Browser Support & Polyfills

Build System

  • Overview
  • Configuration
  • Automatic Interface Generation
  • Interop with Other Build System
  • Performance
  • Advanced

Standard Library

  • Overview

Advanced

  • Conditional Compilation
  • Extended Compiler Options
  • Use Existing OCaml Libraries
  • Difference from Native OCaml
  • Compiler Architecture & Principles
  • Comparison to Js_of_ocaml
Edit

New Project

Once you've installed BuckleScript from the previous section, you can generate a lightweight project template:

bsb -init my-new-project

Alternatively, to start a new Reason project:

bsb -init my-new-project -theme basic-reason

To compile & run the project you just created:

cd my-new-project
npm run build
node src/Demo.bs.js

And that's it! You've just built the project once and ran the JS output. Feel free to inspect the js output, add a few files in my-new-project/src, etc. Hopefully we've delivered on our promise of being a lean toolchain with clean output =).

We'll explain bsb, the build system called by the above npm run build, in a later section.

Editor Integration

We share the same editor integration as Reason. See the setup here then here.

Last updated on 4/13/2020
← InstallationTry →
  • Editor Integration