Contributing to Vex
A useful contribution connects an observable behavior to a focused change and its verification. Language and standard-library changes should update the public examples that teach that behavior as well as the implementation tests.
Building from Source
Use a source checkout you can access. Compiler packages are distributed through the official release repository; that repository is not itself a compiler source checkout. Check the source revision's build instructions before installing dependencies.
Prerequisites
| Component | Requirement for the inspected 0.4.0 source line |
|---|---|
| Rust and Cargo | Rust 2024 edition support; the release workflow selects the stable Rust toolchain. No lower minimum Rust version is declared here. |
| LLVM | LLVM 23.1, matching llvm-sys 231 and the configured LLVM backend. |
| Native toolchain | A C compiler, linker, SDK or development headers appropriate to the host and target. |
| Git | Access to the checkout and its required submodules or local dependency forks. |
Cargo.toml owns compiler dependency selection. .github/workflows/release.yml records the concrete release build environments. A distribution package called llvm may install a different major version; inspect llvm-config --version from the selected installation rather than assuming the package name is enough.
Select LLVM
Set LLVM_SYS_231_PREFIX to the LLVM 23.1 installation directory, not its bin subdirectory. For example, in a POSIX shell:
export LLVM_SYS_231_PREFIX=/absolute/path/to/llvm-23.1
export PATH="$LLVM_SYS_231_PREFIX/bin:$PATH"
llvm-config --version
clang --version
rustc --version
cargo --versionThe macOS release workflow uses Homebrew's llvm@23 and the platform SDK. The Linux workflow installs versioned LLVM/Clang 23 development packages. The Windows workflow uses an identified LLVM 23.1 toolchain and the Windows native build environment. These are build recipes, not evidence that an arbitrary host or cross target has passed the release tests.
Build the command-line tools
From the checkout root:
cargo build -p vex-cli --target-dir target
target/debug/vex --version
cargo build --release -p vex-cli --target-dir target
target/release/vex --versionUse .exe on Windows. The explicit target directory keeps these paths predictable; without it the checkout currently defaults to .vex/cargo-target and an environment override may select another location. Keep separate build directories when working in multiple checkouts.
For editor integration, build vex-lsp with the same toolchain. A debug profile may be configured without debug symbols in this checkout; inspect the selected Cargo profile before relying on source-level debugger information.
Project Structure
| Path | Responsibility |
|---|---|
crates/vex-lexer, vex-parser, vex-syntax | Tokens, concrete syntax, and syntax-tree APIs. |
crates/vex-hir | Typed representation, inference, ownership, borrowing, and compile-time semantics. |
crates/vex-sir | Data-parallel representation, transformations, and backend lowering. |
crates/vex-compiler | Compilation orchestration and code generation. |
lib/runtime/VexArch | Runtime and prelude sources used by the compiler. |
lib/std | Standard-library packages and their tests. |
tools/vex-cli | User-facing commands and their execution paths. |
tools/vex-pm, vex-doc, vex-lsp | Package management, API documentation, and editor services. |
web/documentation/docs | Public language, library, and tooling documentation. |
tests, examples, docs | Integration/regression cases, examples, and internal design records. |
Running Tests
Begin with the component that owns the behavior. For example:
cargo test -p vex-parser --target-dir target
cargo test -p vex-hir --target-dir target test_name
cargo test -p vex-compiler --target-dir target test_name -- --nocaptureReplace test_name with the relevant Rust test filter and inspect how many tests actually ran. A filtered command that selects zero tests is not a passing regression check.
For Vex test files, use the compiled CLI:
target/release/vex test --run '^test_add_bonus$' tests/lib_test.vxThis command illustrates path selection and test-name filtering; use an actual file in the checkout or the example from Your first project. The testing guide explains assertions, context tests, timeouts, and result reporting.
Broaden testing according to the change: syntax changes affect parser and semantic users; ownership changes need accepted and rejected examples; code-generation changes need native execution; platform changes need the actual target. Consult the current repository checks rather than a fixed historical test count.
Debugging the Compiler
Keep the smallest input that preserves the behavior and record the phase that fails: analysis, object generation, linking, or program execution.
target/debug/vex lint problematic.vx
target/debug/vex compile --emit-llvm problematic.vx
RUST_BACKTRACE=1 target/debug/vex run problematic.vxThe last environment-assignment form is for POSIX shells. Set the equivalent environment variable in your shell on other platforms. Backtraces describe the compiler process; they do not replace a debugger or runtime diagnostic for the compiled Vex program.
Contribution Workflow
- Reproduce the behavior on an identified source revision and compiler.
- Agree on the expected language or API contract using the relevant tests and design record. Record ambiguity before changing observable behavior.
- Keep the change focused and preserve unrelated work in the checkout.
- Add a regression that distinguishes the old behavior from the intended one.
- Run the affected checks and report their scope, including any untested targets or blocked commands.
- Update the public examples and reference text affected by the change.
- Submit a description of the problem, resulting behavior, and validation.
Follow the checked-out repository's contribution and AGENTS.md instructions for style and workflow. A public tutorial does not override those local rules.
Documentation
The public documentation repository contains the website and these guides. Use it for documentation changes; compiler source access is separate from this repository and the binary release repository.
A complete example should say where its files go, which directory commands run from, what stdout and exit status to expect, and which inputs or failure paths it demonstrates. Mark schematic fragments before the code block and identify application-provided names. Do not label Rust or pseudocode as executable Vex.
From web/documentation, the website provides these existing checks:
bun run docs:bundle:check
bun run build
bun run docs:fragments:checkThe build regenerates documentation output and checks generated local page and fragment targets. It does not establish native example behavior or external link availability. The website README lists the focused example checks; the verification guide explains how to retain their compiler identity and results.
Reporting a problem
Include the source or a minimal reproduction, exact command, compiler version, source revision when available, operating system and architecture, and complete stdout/stderr. For a website issue, include the page URL, fragment, and the navigation path that failed.
For documentation and website problems, search the documentation issue tracker before opening a report. Include the incorrect text or example, its expected behavior, and any compiler result that helped identify the discrepancy.
For compiler, runtime, or library implementation problems, use the issue or feedback channel supplied with the relevant release or source access. The documentation repository is not presented as the compiler's issue tracker.