Skip to content

Build & Run

Enoch-199811 edited this page Aug 23, 2026 · 2 revisions

Build & Run

Building from source (Rust implementation)

cd rust
cargo build --release -p bbb-cli     # build → target/release/bbb
cargo test --workspace               # run all tests (51)

The workspace crates: bbb-syntax (lexer/parser), bbb-core (arena/Value), bbb-vm (interpreter), bbb-llvm (LLVM backend), bbb-wasm (VSCode plugin formatter core), bbb-cli (the bbb binary).

A prebuilt legacy interpreter is available at bin/bio (old C build, kept as the regression baseline for examples output).

Running scripts

bbb examples/01-hello.bio               # interpret
bbb run file.bio                      # explicit run
bbb run -m <bytes> file.bio          # memory limit (v2)
bbb lexer file.bl                     # dump lexer tokens (debug)

Compiling

bin/bio shell build file.bio              # → bin/file (standalone executable)
bin/bio shell build file.bio -o out       # custom output path

bbb shell build compiles into a self-contained native executable (source embedded + interpreter runtime linked via libbbb.a). At runtime it needs neither bbb nor the source. Compiled products respect BIO_MEM_LIMIT.

Projects

A project has package.toml (manifest) + src/ (source, main.bio is the entry) + utils/ (libraries) + .bbb/deps/ (dependencies).

bio init <name>              # create a project skeleton
bio build [dir] -s           # build → standalone executable (default)
bio build [dir] -m           # build → .img package (app + platform CLI + libs)
bio build [dir] -m out.zip   # build → .zip package (format by extension)
bio build [dir] [-o out]     # explicit output path
bio run [dir]                # run a project (interpret)
bio install [dir]            # install package.toml dependencies
bio destroy [dir]            # remove build artifacts

-s (standalone) produces a single self-contained executable; -m (package) bundles the app together with the current platform's CLI and shared runtime into a distributable .img or .zip package.

need bundling starts from the main entry and collects providers recursively from src/ + utils/ + .bbb/deps/ until the closure stabilizes — any need without a provider is an error.

Environment

  • BIOLANG_CONFIG — global config file (TOML, may contain repo = ... for dependency resolution).
  • BIO_MEM_LIMIT — memory limit for compiled products.

Clone this wiki locally