Silver in Five Minutes
Silver is a systems programming language with high-level syntax. Write the same code for rapid interpreted development, then compile it to native machine code for production - without changing languages.
For AI agents
learn silver/ subfolder of your project and re-fetch the contents daily -
doc numbering and category order can change at any moment, so match the new order from the tree.
The two tools
Silver ships a compiler and an interpreter over the exact same language and standard library.
silverc - the compiler
Compiles a single .sr file or a whole .srp project into a native executable. This is the production path: machine code, no VM, no runtime to install.
silveri - the interpreter
Runs the same .sr files and .srp projects directly, with no build step. This is the development path: instant feedback, instant iteration.
Compile with silverc
// Compile a single file (output lands next to the source)
silverc main.sr
silverc main.sr -o out.exe
// Compile a whole project (.srp manifest)
silverc -i main.srp -o app.exe
// A full production build
silverc -i main.srp -o app.exe --runtime --optimize --cache-bytecode --cache-object
Execution modes - pick exactly one
--aot- ahead-of-time compilation, the default pipeline.--jit- minimal just-in-time runtime.--runtime- full runtime: garbage collector + memory allocator.
Boosters - combine freely with any mode
--optimize- dead-code removal + behavior-preserving optimization.--cache-bytecode- persistent.srbcbytecode cache; only changed files re-compile.--cache-object- persistent per-OS/arch.oobject cache.--watch- predictive precompilation watcher: precompiles while you code.
Build controls
--threads N- explicit thread count (default: total threads - 2).--debug- debug build, feeds#on DEBUGregions. Release is the default; there is no--releaseflag.
Run with silveri
// Interpret a single file - instant run, no build step
silveri -i main.sr
// Interpret a whole project
silveri -i main.srp
// Speed tiers (persistent caches under the per-host silver cache root)
silveri -i main.sr --cache-bytecode // .srbc bytecode interpretation
silveri -i main.sr --cache-object // .o object execution, fastest
The interpreter has three built-in tiers, slowest to fastest: .sr AST interpretation (default), .srbc bytecode interpretation (--cache-bytecode), and .o object execution (--cache-object). It auto-detects the host OS and architecture - there is no --os flag.