Skip to content

Build & Run

Enoch-199811 edited this page Aug 9, 2026 · 1 revision

Build & Run

Building from source

make                        # build → bin/bio (default profile: auto-detect)
make PROFILE=release        # -O3
make PROFILE=debug          # -O0 -g
make PROFILE=sanitize       # ASan + UBSan
make profiles               # list all available profiles
make PROFILE=x info         # show resolved toolchain for a profile
make install                # install to ~/.local/bin/bio

Switching profiles requires make clean — make tracks timestamps, not variable values.

Profiles: default, debug, release, sanitize, linux-gcc, linux-clang, macos, windows (experimental), zig (zig cc, cross-compiles to any target).

Running scripts

bin/bio examples/01-hello.bio        # interpret
bin/bio shell run file.bio           # explicit run
bin/bio -e <bytes[K|M|G]> file.bio   # memory limit (default 256M, 0 = unlimited)
bin/bio --tokens 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

bio shell build compiles into a self-contained native executable (source embedded + interpreter runtime linked via libbio.a). At runtime it needs neither bio 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) + .biolang/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/ + .biolang/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