Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

Brevi v0.23.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 09:37
2b5dc10

Closes the last big-int gaps from v0.22.0: // and % now work on big integers, and growing numbers shared between functions (closures, nonlocal, global) grow as in Python. bench/compare still matches CPython on all 591 saved agent programs, 13 of 13 traps and 18 of 18 large programs. brevi build x.py --standalone now puts CPython inside the binary, so a program that uses Python libraries runs on a machine without Python. A new architecture doc explains how a file becomes a native program.

  • Standalone builds of programs that use Python libraries. brevi build x.py --standalone puts CPython inside the binary: libpython, the shared libraries it and the extension modules need (the C library aside), the standard library, and the installed packages the program imports with everything they require. The binary runs on a Linux machine with no Python installed. It unpacks once into ~/.cache/brevi/py (or $BREVI_PY_CACHE), about 1 to 3 seconds on first run, then starts as fast as before. Results stay CPython's own: numpy, pandas, sqlite3/hashlib/zlib, BeautifulSoup with lxml, Pillow, Jinja2 and openpyxl programs, plus one reading argv and stdin, print exactly what python3 prints when run in an empty root holding only the C library. Sizes: about 13 MB with only the standard library, 31 MB with numpy, 42 MB with pandas. Linux only for now.
  • from PIL import Image (a from-import of a submodule the package does not import itself) failed with "module 'PIL' has no attribute 'Image'" in every build that calls Python libraries; it now imports the submodule, as Python does.
  • The last big-int gaps closed. // and % work on big integers with Python's floor and sign rules. Examples: fact(50) % MOD, a digit-sum loop s += x % 10; x //= 10 over a 40-digit number, and -h // 7. Top-level int constants such as MOD = 1000000007 join big arithmetic. A growing number shared between functions builds over dynamic values, where it grows as in Python. This covers a closure reading it, nonlocal acc; acc *= v, global total; total = total * 7 + k, and a top-level hash that a function prints. Before, these stopped with an overflow error.
  • Architecture doc. docs/ARCHITECTURE.md explains, with diagrams, what Brevi does between a .bv or .py file and a native program: front end, typed build, the guard that sends Python to the dynamic build, src/dynpy, library calls through pybridge, rustc and the build cache, and the CPython fallback.

Prebuilt brevi compiler for Linux, macOS and Windows. brevi still needs rustc on the PATH to build programs; sh install.sh fetches it and picks the right download.