Installing Herbie

Herbie supports Linux, macOS, and Windows (though, on Windows, you will need to install Make). It can be installed from a package or from source. To start, install Racket, which Herbie is written in. Then install Herbie. (Herbie can also be installed 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.0 are supported, but more recent versions are faster.

Please note: on Linux, we recommend the official Racket installer over installing Racket via Snap. If you must install Racket from Snap, make sure Herbie and all packages are located 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.9 [cs].
> (exit)

Installing Herbie from a package

This installation method supports Windows, macOS, and Linux for x86-64. It won't work for ARM computers, including recent Apple computers. You may also need a working version of make; on Windows, that might have to be installed separately.

First install Racket, as above. Then install Herbie from a package with:

raco pkg install --auto herbie

This command installs Herbie and its dependencies, compiles it for faster startup, and places the herbie executable in your Racket user path (example paths for Racket 8.9):

You can run herbie from that directory, or add it to your executable path. Please note that the path of the binary will be different on Linux if you have opted to use Snap. Once Herbie is installed and working correctly, check out the tutorial.

Installing Herbie from source

Installing Herbie from source is best if you plan to develop Herbie or Herbie plugins, or if you are on an ARM machine.

Install Racket. Then install Rust, using rustup or via some other means. Versions as old as 1.60.0 are supported.

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

git clone https://github.com/uwplse/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 directories. Install Herbie on your system with:

make install

This command installs Herbie and its dependencies, compiles it for faster startup, and places the herbie executable in your Racket user path, just like the package installation. 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. Herbie in Docker is more limited; we do not recommend using Herbie through Docker without prior Docker experience.

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