Herbie supports Linux, macOS, and Windows. To start, install Racket, which Herbie is written in. Then install Herbie, either from a package, from source, or via a Docker image.
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. We strongly recommend v8.7 or newer.
On Linux, we recommend against installing Racket via Snap. If you must install Racket from Snap, locate Herbie and all other packages 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.13 [cs]. > (exit)
Herbie can be installed from a binary package on Windows and Linux for x86-64, and on macOS on either x86-64 or ARM. If you are on a more obscure platform, please install from source instead.
First install Racket. Then install Herbie from a package with:
raco pkg install --auto herbie
Then check that Herbie works by running:
racket -l herbie -- --version Herbie 2.1
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.13):
AppData\Roaming\Racket\8.13\bin
in your user folder.Library/Racket/8.13/bin
in your home folder..local/share/racket/8.13/bin
in your home directory.Please note that the path of the binary will be different on Linux if you have opted (against recommendation) to use Snap. Once Herbie is installed and working correctly, check out the tutorial.
Installing Herbie from source is best if you plan to develop Herbie or Herbie plugins, 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. 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 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.1
You can also follow the install-from-package instructions to
add herbie
to your path, if you'd like.' Once Herbie
is installed and working correctly, check out
the tutorial.
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.