Breviv0.24

Project

Contributing and license

View as Markdown

Brevi is open source under the Apache License 2.0. Bug reports, failing programs and fixes are all welcome.

Build and test#

git clone https://github.com/ets-public/brevi
cd brevi
cargo build --release
tests/check.sh            # sample programs and error cases against their expected output
sh tools/ci_local.sh      # the same checks a pull request runs, locally

You need Rust stable and python3 (the tests compare Brevi's output with CPython's).

CheckWhat it guards
tests/check.shEvery program in tests/run, tests/errors, tests/typed, tests/dyn, tests/fallback and tests/standalone matches its expected output.
bench/verify.sh OLD NEWEvery saved benchmark solution prints the same with a new compiler.
tools/compat.py checkEvery solution in compat/baseline.txt keeps building on new Rust and Python releases. Never remove a line to make it pass.
tools/parity_probe.pyShort Python probes run with CPython and Brevi; lists silent differences and refusals.

Where things are#

PathWhat it is
src/main.rsThe command line, the build driver, rustc and error mapping
src/lexer.rs, src/parser.rs, src/ast.rsSource to syntax tree, for both Python and Brevi
src/infer.rs, src/emit.rs, src/moves.rsType inference and checks, Rust generation, ownership
src/dynpy/The dynamic build and its runtime
src/pybridge.rs, src/pyrt.rsLibrary calls through CPython
src/prelude.rsThe runtime of typed builds
src/mcp.rsThe MCP server
runtime/brevi_tkThe tkinter runtime, headless and windowed
bench/Benchmarks, logs and saved solutions
docs/ARCHITECTURE.mdHow it all fits together (also on this site as Architecture)
site/This website

AGENTS.md in the repository has the working notes for coding agents changing the compiler.

Reporting a bug#

The most useful report is a short Python file and its input where brevi run --native prints something different from python3, or refuses a program you think it should build. Open an issue on GitHub with the file, the input, both outputs and brevi --version. Wrong output is the highest priority.

Please report security problems privately, as described in the repository's SECURITY.md, not in a public issue.

Pull requests#

License#

Brevi is licensed under the Apache License, Version 2.0. You may use, modify and distribute it, including commercially, under its terms. Contributions are accepted under the same license. The fonts on this site are IBM Plex, under the SIL Open Font License.