Skip to content

Implementation Overview

Hilbert Chen edited this page May 27, 2022 · 3 revisions
  • Hazel is currently implemented in Reason (sometimes written ReasonML), which is an alternative syntax for OCaml, a powerful typed functional programming language.
  • Hazel is compiled to JavaScript using the js_of_ocaml (sometimes written jsoo) compiler, via the dune build system. You shouldn't need to know too much about Javascript or these tools to begin contributing.
    • There is another popular OCaml to Javascript compiler called Bucklescript. Bucklescript translates OCaml source code to Javascript, whereas js_of_ocaml translates OCaml bytecode to Javascript. OCaml's bytecode format does not change frequently, so by using js_of_ocaml, we can use the latest version of OCaml. Moreover, going from bytecode to JS also makes it possible for js_of_ocaml to apply some aggressive optimizations.
  • The GUI is implemented using Jane Street's incr_dom library, which interacts with the document object model (DOM) in the browser via the Dom library from js_of_ocaml.
Clone this wiki locally