CLI Reference

The bear binary is the single entry point for all BearVM operations.

Usage

bear <file.bear>              Run via interpreter
bear ast <file.bear>          Print AST as unicode tree
bear jit <file.bear>          JIT compile and run
bear qbe <file.bear>          Emit QBE IR
bear qbe <file.bear> -c       Compile with QBE + cc
bear llvm <file.bear>         Emit LLVM IR
bear llvm <file.bear> -c      Compile with llc + cc
bear version                  Show version and quit

Commands

bear <file.bear>

Runs the program through the interpreter. No external dependencies required.

bear ast <file.bear>

Parses the file and prints the AST as a unicode tree. Useful for inspecting how the parser has understood a program.

bear jit <file.bear>

JIT-compiles and runs the program. Only available on aarch64 macOS (Apple Silicon). See Backends.

bear qbe <file.bear>

Emits QBE IR to stdout. Requires QBE to be installed.

bear qbe <file.bear> -c

Compiles the program to a native binary using QBE and cc. Requires both QBE and a C compiler on PATH.

bear llvm <file.bear>

Emits LLVM IR to stdout. Requires LLVM to be installed.

bear llvm <file.bear> -c

Compiles the program to a native binary using llc and cc. Requires both LLVM and a C compiler on PATH.

bear version

Prints the BearVM version and exits.