Build from source
Set up the toolchain, build the compiler and run a program.
Peeper is built from source for now. The build puts the compiler, its bundled
library, its runtime and its own LLVM toolchain in the build/ folder.
Requirements
- A Rust toolchain (
cargo, withrustfmtandclippy). curl,tarandjqforscripts/setup.sh; on Windows, PowerShell forscripts/setup.ps1.- On macOS, Xcode's command line tools (
xcode-select --install): their SDK holds the C library and headers programs are built with. - On Windows, Git Bash, which runs
scripts/build.sh. - Git.
Build
Get the source
git clone https://github.com/PeeperLanguage/compiler.git
cd compilerSet up the toolchain
bash scripts/setup.sh # on Windows: pwsh scripts/setup.ps1This downloads the LLVM toolchain pack CI built for your machine, checks it
against the size and SHA-256 pinned in toolchains/toolchains.lock.json, and
puts it in build/toolchains/native. Peeper runs only that toolchain, never a
clang on your PATH. Without a pack for your machine, the script links an
installed LLVM 23 or newer instead.
Build the compiler
bash scripts/build.shRun a program
build/bin/peeper run examples/01_functions.peepPlatforms
CI builds and tests the compiler on each of these, and builds a toolchain pack for it:
| System | Architecture | Toolchain |
|---|---|---|
| Linux | x86-64 | LLVM |
| Linux | ARM64 | LLVM |
| macOS | ARM64 | LLVM |
| Windows | x86-64 | LLVM through llvm-mingw |
On x86-64 Linux, -target i686-linux builds 32-bit programs too, with the
32-bit C library installed.
Commands
Commands lists every command and its options.