Skip to content

Install Beans

Beans ships as one tool, beansc. There is a one-line installer for each platform. It needs no admin rights and installs under your home directory.

Terminal window
curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | sh
Terminal window
irm https://github.com/beans-lang/beans/releases/latest/download/beans-install.ps1 | iex

Then open a new terminal (so the updated PATH is picked up) and check it:

Terminal window
beansc --version
beansc doctor

The installer:

  • detects your OS, CPU, and C library (libc),
  • picks the right package for your machine,
  • verifies its SHA-256 checksum before unpacking,
  • installs under your home directory, with no sudo or admin needed, and
  • adds the bin directory to your PATH.

Re-running the installer is safe. If a download fails, an existing install is left untouched.

Default locations:

PlatformDefault location
macOS / Linux$HOME/.beans
Windows%LOCALAPPDATA%\Beans

Override the location with the BEANS_HOME environment variable or the --prefix option.

Inside the install directory you get:

bin/ the beansc launcher, the compiler, and the runtime C sources
lib/std/ the standard library
lib/encoding/ the std.encoding bridge and its vendored sources
libexec/ the checked installer used by `beansc upgrade`
toolchain/ bundled Clang, LLD, and llvm-ar (full packages only)
VERSION the installed version

The layout is stable, and you can move the whole directory after installing — every path inside is resolved relative to the launcher.

The installer picks one of two package kinds for you:

  • Full packages bundle Clang, LLD, and llvm-ar, so native builds need no extra tools. They ship for Linux x86-64 and ARM64 (GNU), and Windows x64, ARM64, and x86 (LLVM-MinGW).
  • Slim packages ship everywhere else. With a slim package, --version, doctor, check, run, llvm, and build --emit ir all work with nothing to install. A native build needs a C compiler (Clang) on your PATH.

Two platform notes:

  • macOS: native builds need Apple’s Command Line Tools. Install them with xcode-select --install. check and run work without them.
  • Git is only needed if you pull in Git package dependencies.

The C++ bootstrap compiler, beansc0, is never installed. You do not need it.

Pass options to the installer after -s --:

Terminal window
curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | sh -s -- --version 0.1.18 --prefix /opt/beans

Pick a specific build target with the BEANS_TARGET environment variable:

Terminal window
BEANS_TARGET=x86_64-unknown-linux-musl curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | sh

Other installer options:

  • --force: reinstall even if a version is already present.
  • --no-modify-path: install without touching your PATH.
  • --help: list every option.

There is no uninstaller. Delete the install directory and remove the PATH line the installer added.

If you would rather build the compiler yourself:

  1. Install a release compiler first (with the one-liner above). You need a working beansc to build the self-hosted one.
  2. Clone and build:
Terminal window
git clone https://github.com/beans-lang/beans.git
cd beans
make
./build/beansc --version

With Beans installed, verify the install and then write your first program. To move to a newer release later, see Upgrade beansc.