-
Notifications
You must be signed in to change notification settings - Fork 52
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.
- To contribute to Hazel, you should read through the Reason tutorial.
- The beginning of the book Real World OCaml, available online, is also an excellent introduction to typed functional programming in OCaml.
- You can use this comparison between Reason and Ocaml will help you translate the concepts in that book to Reason.
- 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.