Reason is a collaborative open source project released by Facebook today - and we are incredibly excited to be part of it! Reason is a new approachable interface to the OCaml language, with the long-term goal of improving the developer experience by providing a functional syntax and toolchain for writing, building and sharing code quickly and easily.
OCaml is used widely in large-scale projects by a wide range of users; within Facebook to build scalable infrastructure (Hack, Flow, and Infer); providing performance-sensitive applications for Jane Street; and a modular system as part of MirageOS. We are excited to be collaborating on the Reason project which provides the opportunity to employ the benefits of OCaml (such as type inference, fast runtime and bare metal compilation) whilst removing the blockers to progression that have previously existed.
Reason, OCaml Labs and wider collaboration
Reason complements and extends the work of the OCaml Platform project at OCaml Labs. Our focus has been on syntax and editor support, documentation and adding isolated development and testing environments. These features are part of the initial open-source release of Reason, and we will continue to contribute to this collaboration.
Reason aims to reimagine the build process, and create an integrated build system. Progress in this area has been made using a combination of Jenga build rules and containers utilizing the existing OPAM workflow and features.
Docker containers provide the developer a sandboxed environment, equipped with all of the development tools, distributed as a Docker image. This provides the ability to quickly build, test and deploy applications on multiple architectures and operating systems, without having to locally install cross-compilers and manage virtual machines.
Jenga is an expressive and scalable build system used in production at Jane Street, and Atom support for Reason is built using Jenga and js_of_ocaml. We envisage a build experience that combines Atom, Docker containers and Jenga to provide sandboxed builds, automatic namespacing and autogeneration of Merlin files.
opam local project’s goal is to enable developers to create
isolated development and testing environments for their OPAM packages.
Associating a switch with a directory via the
opam local create
command overrides the globally-configured switch, ensuring that
associated commands are then isolated to that switch and directory, thus
leaving the global OPAM state unchanged. Developers
can access development lifecycle events defined in their project’s OPAM
files via the `opam package [build|test|doc]` commands. PRs for this
feature are awaiting review:
Merlin provides semantics-driven editing features for OCaml in Vim and Emacs. A Reason frontend has been developed to edit Reason files and report information in Reason syntax. An Atom/Nuclide integration enhances the Reason editing experience with features such as context sensitive completion, jumping to definition and reporting of type information and errors.
Rtop and OCaml 4.03 support
Keeping Reason up-to-date with OCaml, we contributed to 4.03 syntax
support for Reason, modifying the OCaml printer to build Reason with
4.03. We contributed to
rtop (a REPL for Reason, an extension of the
utop) to print results in Reason syntax, rather than OCaml.
We also added the ability to easily switch between Reason and OCaml mode
rtop with the
To ensure high interoperability between OCaml and Reason, documentation
Redoc is a tool to generate html documentation in Reason
syntax from OCaml sources. It wraps
ocamldoc by adding a custom html
generator for printing in Reason syntax. Example: Reason documentation
of OCaml standard
odoc from Jane street will further support this feature.
- Intel Hyper-Threading Bug Uncovered by OCaml Developers
- Unsigned Integers as Built-In Types or as a Library?
- A Week of Platform Releases: Odig, Odoc, Opam Bundle and More!
- Why Jbuilder? Demonstration and Discussion
- OCaml Compiler Hacking May 2017 - Activity Summaries
- Opam 2.0.0 beta 3
- Multicore OCaml ARM64 Backend
- Cambio, OCaml and Karaoke at the MirageOS Marrakech Hack Retreat 2017
- Using Menhir to Build Grammar Attributes
- OCaml 4.04.1 Released