Home

Awesome

Hemlock

Hemlock is a systems programming language that emphasizes reliable high performance parallel computation. Hemlock synthesizes the expressive type and module systems of ML-family languages, a unified parametric effects/mutability/type system, and the shared-nothing message-passing parallelism of Erlang.

Getting Started

Hemlock is a work in progress, and is not yet self hosting (i.e. it is written in OCaml rather than Hemlock). As such, Hemlock may interest researchers and programming language developers, but it is not yet suited for any sort of production use.

Prerequisites

There are two separate methods for building the bootstrap compiler (Docker and Native). Follow prerequisites for your preferred method.

Docker Prerequisites

Install docker.

Install docker compose.

Build the Hemlock docker image from the root of the Hemlock repo checkout.

docker compose build

Run a Hemlock docker container.

docker compose run

(Optional) Install binfmt_misc. This enables building and running cross-platform images.

docker run --privileged --rm tonistiigi/binfmt --install all
HEMLOCK_PLATFORM=linux/arm64 docker compose build
HEMLOCK_PLATFORM=linux/arm64 docker compose run

Native Prerequisites

The bootstrap compiler depends on OCaml and the Dune build system, as well as several ppx rewriters. opam is the recommended mechanism for installing and maintaining an OCaml development environment. To install the necessary dependencies into an existing opam repository, run

cd bootstrap
opam install --deps-only .

Building

To build the bootstrap hmc Hemlock compiler and invoke the test suite, run

cd bootstrap
dune build
dune runtest

See the Dune documentation for more details on building and interacting with hmc via the build system.

To build the bootstrap standard library documentation, run

dune build @doc

Use a web browser to open the documentation at _build/default/_doc/_html/index.html.

Pull Requests

Pull requests are required to pass tests before being merged to main. Pull request CI checks that tests passed as part of Hemlock's custom gh push process. Use our custom gh CLI extension to push, test, and record the test result status of branches.

License

This project is licensed under the MIT license; see the LICENSE.md file for details.