Installing Herbie

Herbie supports Linux, macOS, and Windows. To start, install Racket. Then install Herbie, either from a package, from source, or via a Docker image.

Installing Racket

Install Racket either using the official installer or distro-provided packages. Versions as old as 8.10 are supported, but more recent versions are faster.

On Linux, we recommend against installing Racket via Snap. If you must install Racket from Snap, install from source and store that source directory in your home directory or another allow-listed directory.

Test that Racket is installed correctly and has a correct version:

racket
Welcome to Racket v8.17 [cs].
> (exit)

Installing Herbie from a package

Herbie can be installed as a binary package on x86 Windows and Linux and on x86 or ARM macOS. If you are on a more obscure platform, please install from source instead.

After installing Racket, install Herbie from a package with:

raco pkg install --auto herbie

Then check that Herbie works by running:

racket -l herbie -- --version
Herbie 2.2

If you'd like, you can run Herbie with the herbie command by adding the following directory to your PATH (example paths for Racket 8.17):

Once Herbie is installed and working correctly, check out the tutorial.

Installing Herbie from source

Installing Herbie from source is best if you are a Herbie developer, or if you use a more obscure hardware/OS combination. The instructions assume a standard Unix userland; on Windows, you may have to install tools like Make separately, or use WSL.

Install Racket as described above. Then install Rust 1.60.0 or later using rustup or some other means.

Once Racket and Rust are installed, download the Herbie source from GitHub with:

git clone https://github.com/herbie-fp/herbie

Change to the herbie directory; you should see a README.md file, a directory named src, a directory named bench/, and a few other files and directories. Install Herbie with:

make install

This command installs Herbie and its dependencies and compiles it for faster startup. Check that Herbie works by running:

racket -l herbie -- --version
Herbie 2.2

You can add herbie to your path, as described in the package-install instructions. Once Herbie is installed and working correctly, check out the tutorial.

Installing Herbie with Docker

Docker is a container manager, which is sort of like a virtual machine. We do not recommend using Herbie in Docker without prior Docker experience.

The Docker documentation describes how to install and run our uwplse/herbie image.