BuckleScript

BuckleScript

  • 資料
  • 試す
  • API
  • コミュニティ
  • ブログ
  • Languages icon日本語
    • English
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • 中文
    • 繁體中文
    • 翻訳に参加する
  • GitHub

›上級者向け

はじめに

  • はじめに
  • インストール
  • プロジェクトの作成
  • Try
  • コンセプト

相互運用

  • 概要
  • チートシート
  • 生のJavaScriptの埋め込み
  • 基本的なデータ型
  • Externalの紹介
  • グローバル変数の束縛
  • Null・UndefinedとOption
  • オブジェクト
  • オブジェクト その2
  • クラス
  • 関数
  • Property access
  • Return value wrapping
  • ImportとExport
  • 正規表現
  • 例外
  • JSON
  • Pipe First
  • 変換と補助の生成
  • より良いデータ構造の出力 (デバッグモード)
  • NodeJSの特殊な変数
  • その他
  • ブラウザのサポートとポリフィル

ビルドシステム

  • 概要
  • 設定
  • インターフェースの自動生成
  • Interop with Other Build System
  • パフォーマンス
  • 上級者向け

標準ライブラリ

  • 概要

上級者向け

  • 条件付きコンパイル
  • コンパイラ拡張の為のオプション
  • 既存のOCamlのライブラリの使用
  • ネイティブのOCamlとの違い
  • コンパイラの設計と原則
  • Js_of_ocamlとの比較
Translate

Js_of_ocamlとの比較

Js_of_ocaml is a popular compiler which compiles OCaml’s bytecode into JavaScript. It is the inspiration for this project, and has already been under development for several years and is ready for production. BuckleScript’s motivation, like js_of_ocaml, is to unify the ubiquity of the JavaScript platform and the truly sophisticated type system of OCaml.

However, there are a few areas that BuckleScript approaches differently:

  • Js_of_ocaml takes low-level bytecode from OCaml compiler, BuckleScript takes the high-level rawlambda representation from OCaml compiler.
  • Js_of_ocaml focuses more on existing OCaml ecosystem (OPAM) while BuckleScript’s major goal is to target NPM/Yarn and existing JS workflows.
  • Js_of_ocaml and BuckleScript have slightly different runtime encoding in several places. For example, BuckleScript encodes OCaml Array as JS Array while js_of_ocaml requires its index 0 to be of value 0.

See also the What & Why page for more info on BuckleScript's emphasis.

← コンパイラの設計と原則