FLUX constraint compiler toolchain — parse constraint expressions, lower to IR, optimize, verify, and emit code for native, AVX-512, CUDA, WASM, eBPF, and RISC-V targets.
- GUARD constraint parser — Parse range, domain, and exact constraints with AND/OR/NOT combinators (Pest PEG grammar)
- FLUX IR — Intermediate representation with verification, halt reasons, and constraint modules
- Multi-target codegen — Emit for native, AVX-512, CUDA, WASM, eBPF, and RISC-V
- Optimization passes — IR-level constraint optimization
- Verification — Prove translation correctness from source to compiled output
- CLI —
fluxccommand-line compiler with compile, bench, show, and verify subcommands
# Compile a constraint file
cargo run -p fluxc-cli -- compile -i constraints.guard -t native -o output.bin
# Show generated IR
cargo run -p fluxc-cli -- show -i constraints.guard
# Benchmark compiled constraints
cargo run -p fluxc-cli -- bench -i constraints.guard --iterations 10000
# Verify translation correctness
cargo run -p fluxc-cli -- verify -i constraints.guard --compiled output.bin| Crate | Description |
|---|---|
fluxc-parser |
GUARD constraint parser (Pest PEG grammar) |
fluxc-ast |
Abstract syntax tree for FLUX constraints |
fluxc-ir |
Intermediate representation with verification |
fluxc-optimize |
IR optimization passes |
fluxc-codegen |
Multi-target code generation |
fluxc-verify |
Translation correctness verification |
fluxc-cli |
Command-line interface |
use fluxc_parser::parse;
let expr = parse("x RANGE [0, 100] AND NOT (y DOMAIN 0xFF)")?;use fluxc_ir::IrModule;
let module = IrModule::from_ast(ast);
module.verify()?; // Validate IR invariantsuse fluxc_codegen::{codegen, Target};
let output = codegen(&module, Target::Native)?;Part of the SuperInstance constraint theory ecosystem. The FLUX compiler sits between high-level constraint specifications and executable constraint checks:
- Input: Constraint DSL or GUARD expressions
- Output: Optimized constraint checks for any target platform
- Related: constraint-dsl, flux-verify-api, constraint-theory-core
cargo test --workspace# Build from source
git clone https://github.com/SuperInstance/flux-compiler-workspace
cd flux-compiler-workspace
cargo build --release
# The CLI binary
./target/release/fluxc --helpRequires Rust ≥ 1.82.
Apache-2.0