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.
One-line install
Section titled “One-line install”macOS and Linux
Section titled “macOS and Linux”curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | shWindows (PowerShell)
Section titled “Windows (PowerShell)”irm https://github.com/beans-lang/beans/releases/latest/download/beans-install.ps1 | iexThen open a new terminal (so the updated PATH is picked up) and check it:
beansc --versionbeansc doctorWhat the installer does
Section titled “What the installer does”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
sudoor admin needed, and - adds the
bindirectory to your PATH.
Re-running the installer is safe. If a download fails, an existing install is left untouched.
Where it installs
Section titled “Where it installs”Default locations:
| Platform | Default 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 sourceslib/std/ the standard librarylib/encoding/ the std.encoding bridge and its vendored sourceslibexec/ the checked installer used by `beansc upgrade`toolchain/ bundled Clang, LLD, and llvm-ar (full packages only)VERSION the installed versionThe layout is stable, and you can move the whole directory after installing — every path inside is resolved relative to the launcher.
Full vs slim packages
Section titled “Full vs slim packages”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, andbuild --emit irall work with nothing to install. A nativebuildneeds 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.checkandrunwork 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.
Choosing a version, location, or target
Section titled “Choosing a version, location, or target”Pass options to the installer after -s --:
curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | sh -s -- --version 0.1.18 --prefix /opt/beansPick a specific build target with the BEANS_TARGET environment variable:
BEANS_TARGET=x86_64-unknown-linux-musl curl -fsSL https://github.com/beans-lang/beans/releases/latest/download/beans-install.sh | shOther installer options:
--force: reinstall even if a version is already present.--no-modify-path: install without touching your PATH.--help: list every option.
Uninstalling
Section titled “Uninstalling”There is no uninstaller. Delete the install directory and remove the PATH line the installer added.
Installing from source
Section titled “Installing from source”If you would rather build the compiler yourself:
- Install a release compiler first (with the one-liner above). You need a
working
beanscto build the self-hosted one. - Clone and build:
git clone https://github.com/beans-lang/beans.gitcd beansmake./build/beansc --versionWith Beans installed, verify the install and then write your first program. To move to a newer release later, see Upgrade beansc.