Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Compiler commands

These commands compile single files. plentyc accepts exactly these commands; plenty accepts them too, alongside the project commands.

CommandBehavior
plenty FILEReuse a cached executable or compile/link, run privately, then remove the temporary directory
plenty --check FILECheck an application without emitting or executing code
plenty --check-module FILECheck a module and imports without requiring main
plenty --compile FILE -o OUTProduce a native executable (dynamic dependencies remain)
plenty --compile FILE --dist DIRPublish a new application distribution with only reached engines and their notices
plenty --emit-object FILE -o OUTEmit one application object, including imported modules; requires main
plenty --dump STAGES FILE -o DIRWrite each function’s IR and machine code as text; --dump-std and --dump-filter TEXT select functions
plenty --fuzz FILE -o OUTProduce a coverage-instrumented libFuzzer executable that runs main once per input; --libfuzzer PATH selects libFuzzer
plenty --shared-library FILE --library-name NAME -o OUTBuild a shared C library with generated header and interface
plenty --static-library FILE --library-name NAME -o OUTBuild a static C library with generated header and interface
plenty --extract-interface LIBRARY --library-name NAME -o OUTExtract embedded source metadata without executing native code
plenty --verify-interface LIBRARY INTERFACEVerify a generated contract and compatibility symbol
plenty --runtime-interface FILE --library-name NAME -o OUT.plentyiGenerate a typed runtime loader from checked export source, without loading a library or invoking native tools
plenty --emit-runtime DIRExtract libplenty_runtime.a, link-args.txt, and target.txt
plenty --print-targetPrint the packaged runtime’s target and CPU baseline
plenty --version (-V)Print the compiler’s version and target: plenty X.Y.Z (x86_64-unknown-linux-gnu), where X.Y.Z is the installed version

Checking modes print warnings on stderr; they do not change the exit status.

--check-all-methods with --check or --check-module also checks every method of every instance the program creates of a generic class or enum it declares, including methods nothing uses, which are otherwise checked only when used. Types from std keep per-use checking. Other modes reject it: compiling would emit those methods, and a reused cached object would skip their check.

Code generation is optimized by default, including plentyc, object and shared library output, fuzz targets and dumps. --fast-compile skips speed optimizations for shorter edit-run cycles in large projects; it preserves all language checks. --release remains a compatibility alias for the optimized default. See profiles.

--unchecked MODE selects what plain unchecked: suites outside std do with their arithmetic and indexing preconditions: trap, the default, checks them; assume omits the checks, so a violation is undefined behavior. Assumed list, slice-view and Bytes indices must be nonnegative and in range; bounds checks and negative-index normalization are omitted. It applies to compiling modes, including plenty build, run, test and scripts; checking modes reject it.

--test-hooks with FILE or --compile enables failure injection in an ordinary executable. It does not arm failures automatically. Default builds have no hooks; library, object-only, fuzz, and checking modes reject this flag.

--compile and --shared-library output is stripped of its symbol table and debug sections; --no-strip keeps them.

Compiled functions are reused from the compile cache, and so is a whole program’s object when none of its sources changed. --no-cache compiles without it, --no-program-cache reuses functions but not programs or executables, --cache-stats reports its hits and misses after compiling, and plenty cache stats and plenty cache clean inspect and empty it.

With no arguments, plenty displays help. --module-root DIR selects the source root for file commands. --package-graph GRAPH instead resolves imports through a package graph file for FILE, --check, --check-module, and --compile. Library builds do not require main; their exported contracts follow the C interface rules.

Compile-and-run inherits standard streams, environment, and working directory. It propagates the child’s exit code; Unix signal termination becomes 128 plus the signal number. Temporary objects and runtime files are removed on success and failure. On supported Linux toolchains, single-file runs also reuse a cached executable by default, avoiding linking when its inputs match. Other runs link normally. Unix scripts can use #!/usr/bin/env plenty as their first line and be made executable with chmod +x FILE; hashbang launches use the same caches.

For argument forwarding, optional embedded manifests and isolated dependency resolution, use plenty script, with the Unix shebang #!/usr/bin/env -S plenty script. The compiler shortcuts above remain unchanged.