Commands
Every peeper command, its options, and how a project is laid out.
Run peeper with no arguments to print its usage.
path is a project folder or a single .peep file. It defaults to the current
folder.
| Command | What it does |
|---|---|
peeper check [path] | Reports the program's errors. |
peeper fix [path] | Applies the fixes the errors suggest, then reports what is left. |
peeper build [path] | Checks the program and links it into an executable. |
peeper run [path] [arguments] | Builds the program to a temporary file and runs it with the arguments. |
peeper init [name] | Makes the current folder a project. |
peeper lsp | Serves editors as a language server over standard input and output. |
Options
-o program, onbuild, names the executable. Without it, the executable is named after the project or the file.-release, onbuildandrun, builds an optimized program without debug info.-target name, oncheck,fix,buildandrun, checks and builds for another machine. For example,-target i686-linuxbuilds 32-bit x86 Linux programs, which a 64-bit x86 Linux runs once its 32-bit C library is installed (on Fedora:glibc-devel.i686). An unknown name lists every target.-dump, oncheckandfix, also writes each module's THIR, MIR and LLVM IR tobuild/debug/dumps.-dump thir,-dump miror-dump llwrites only that one. The home page's compile story shows these dumps for one program.
Projects
peeper init makes the current folder a project. It writes a peeper.toml
that names the project, and a src/main.peep that holds main. It asks for
the name, with the folder's name as the default, unless you give one.
mkdir hello_peeper
cd hello_peeper
peeper init hello_peeper
peeper runThe generated src/main.peep:
fn main() {
Write(Stdout, c"Hello from Peeper!\n", 19);
}The name is lowercased, and spaces and - become _. init stops when the
name is not a valid package name (a letter, then letters, digits and _), when
it is the name of a bundled library, or when a peeper.toml already exists.
An existing src/main.peep is kept.
Each file in src is a module of the project. See Modules.