Start

Getting started

Clamp is not on crates.io yet, so you run it from source. It takes four clones and one command.

Why not cargo add? Publishing is disabled until licensing, registry ownership and the prototype API are reviewed. The package versions are 0.1.0 with publish = false.

Requirements

  • Rust 1.96.1 or newer — the tested minimum. Edition 2024, resolver 3.
  • git, and python3 for the check and measurement tools.
  • Nothing else. Every Clamp package has zero third-party dependencies, so the examples build with --offline.

1. Hello Clamp

The facade needs no other repository:

git clone https://github.com/rustclamp/rustclamp
cd rustclamp
cargo run --offline --example 00-pico
# Hello Clamp

This is the whole program:

use rustclamp::prelude::*;

fn main() {
    Clamp::run(|| {
        println!("Hello Clamp");
    });
}

Clamp::run calls the closure once on the current thread and returns its result unchanged. Captures may borrow local data or consume owned values; errors and panics behave like ordinary Rust. No Core, Kernel or Runtime is compiled in.

2. The full checkout

Examples 01 to 04 use Core and Kernel through path dependencies, so the four repositories sit side by side:

mkdir clamp && cd clamp
for repo in rustclamp core kernel runtime; do
  git clone https://github.com/rustclamp/$repo
done
clamp/
├── rustclamp/   # facade, examples, ADRs, evidence, tools
├── core/        # rustclamp-core
├── kernel/      # rustclamp-kernel
└── runtime/     # rustclamp-runtime

Each stays its own Git repository. For a combined Cargo workspace (shared target directory, one cargo test), generate one locally; it is never committed:

python3 rustclamp/tools/workspace.py

3. Run the examples

From clamp/rustclamp:

# Direct capability injection, no Kernel
cargo run --offline --locked --manifest-path examples/01-capability/Cargo.toml --example 01-capability

# Module requirement resolved through Kernel
cargo run --offline --locked --manifest-path examples/02-module/Cargo.toml --example 02-module

# Contributions assembled into a CLI command target
cargo run --offline --locked --manifest-path examples/03-contribution/Cargo.toml --example 03-contribution

# One blueprint, two processes
cargo run --offline --locked --manifest-path examples/04-process/Cargo.toml --example 04-process -- cli
WORKER_CONCURRENCY=4 cargo run --offline --locked --manifest-path examples/04-process/Cargo.toml --example 04-process -- worker
cargo run --offline --locked --manifest-path examples/04-process/Cargo.toml --example 04-process -- inspect cli

Examples explains what each one proves.

4. Run every check

The coordinated runner formats, lints, tests, builds docs and runs every example across the four packages:

python3 rustclamp/tools/check.py

Hosted CI is not running yet; this runner is the source of truth for “it passes”.

Next

  • Concepts — modules, capabilities, contributions and processes in one page.
  • Modules — write your first requirement and provider.