Contributing
- One compiler. A change to the language (syntax, checking, diagnostics) goes into
voltc/srcalone; the tests run stage1, voltc built bybootstrap/. The bootstrap is stage 0 and frozen: it only builds voltc, sovoltc/src, the parts of std it uses andsite/genstay within what it compiles (Bootstrapping), and clear of what it compiles wrong: an owned local as a??fallback (x ?? name) is still deleted twice there. - Both backends. A change to code generation keeps the C and LLVM backends in agreement: run the bootstrap check.
- std stays a library. The compiler knows as few of std’s names as it can (
@derive’s fallback tostd::derive;std::vecandstd::stringin bindings and C++ imports); what std needs from the compiler goes through attributes any library can use, such as@intrinsicand@owns. - Tests first. A fix starts with a failing golden test (
tests/run,tests/fail) or suite test. - Fuzzing.
cargo test --test fuzzchecks 1500 broken variants of the test programs (voltc checkmust answer with diagnostics, never crash or hang) and runs 37 generated programs through both backends, debug and release (all four must print the same).VOLT_FUZZ=20000runs more andVOLT_FUZZ_SEED=Nothers; what fails stays intarget/tmp/fuzzandtarget/tmp/fuzz-backends. - Formatting.
bootstrap/isn’t run through rustfmt; follow the style around the code you change. Comments say why, in plain words. - Docs. A user-visible change updates this site (
site/src/content/docs); its code blocks are compiled bycargo test --test docs, andcargo test --test sitebuilds it and checks every link. To look at it, build it intosite/distand serve that directory under/volt-bootstrap/:voltc-bootstrap run site/gen/*.volt --std std -- site site/dist.
cargo build && cargo testcd voltc && VOLTC=../target/debug/voltc-bootstrap ../target/debug/bolt build bootstrapCI (.github/workflows/ci.yml) runs on every push to main and every pull request, and any job
that fails fails the run:
- Linux x86-64 and arm64: the whole
cargo test, with LLVM 23, lld, qemu, g++ 15 from the toolchain PPA (as$CXX, for C++23 headers and the std moduleimport std;needs) and Node’s types (for the TypeScript checks) installed. A build that warns fails. Failing tests are listed on the run’s summary page. - The editor extension: its grammar and extension tests.
- macOS (arm64, x86-64) and Windows (x86-64, arm64): build the compilers, and build and run a few programs through the C backend; the test suite itself runs on Linux only for now.