Skip to content

jasone/Hemlock

 
 

Repository files navigation

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 prod docker image from the root of the Hemlock repo checkout.

docker compose build prod

Run a Hemlock prod docker container.

docker compose run prod

(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 prod
HEMLOCK_PLATFORM=linux/arm64 docker compose run prod
(Optional) Building Dotfiles Into dev Image

Set a DOTFILES_URL environment variable to include your dotfiles in the Hemlock dev image.

export DOTFILES_URL=https://github.com/<you>/dotfiles.git
docker compose build dev
docker compose run dev

Note that cloning dotfiles via SSH is not supported due to current docker compose limitations.

You may include an install.sh script at the base of your dotfiles repo to automatically execute dotfiles setup during docker compose build dev.

Set an additional environment variable, DOTFILES_HASH if you need docker compose build dev to rebuild dotfiles whenever the hash changes. This is useful when making upstream changes in your dotfiles repo. You may find it best to set DOTFILES_* variables programmatically via your shell setup script like so.

pushd $YOUR_DOTFILES_PATH > /dev/null
export DOTFILES_URL=$(git remote get-url origin 2> /dev/null || :)
export DOTFILES_HASH=$(git rev-parse origin/main 2> /dev/null || :)
popd > /dev/null

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.

About

Programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • OCaml 94.7%
  • C 4.6%
  • Other 0.7%