italics is a typed IR playground with row-polymorphic type inference and a C backend.
The project demonstrates:
- register-based IR construction
- constraint generation and unification
- open-row extension (
load/storecan grow record shape) - code generation from inferred types to runnable C
From repository root:
cargo test
cargo run --example irbuilder
cargo run --example pipeline
cargo run --example functions
cargo run --example controlExamples that emit C write generated sources under target/.
Notable outputs include:
target/generated.c
target/generated_pipeline.c
target/generated_functions.c
target/generated_control.c
functions and control also compile and run the generated C automatically
through CBuild.
Display formatting options for printing types and constraints are documented in Display Modes.
- IR builder and instructions:
src/builder.rs,src/instructions.rs - Types and row representation:
src/types.rs,src/variables.rs - Constraint generation and inference pipeline:
src/infer.rs - Constraint solver:
src/solver.rs,src/constraints.rs - Display/symbol formatting:
src/display.rs - C code generator:
src/codegen.rs; runtime prelude table:src/prelude.rs - Build/compile/run harness:
src/build.rs
examples/irbuilder.rs: end-to-end single-function inference and C emission demoexamples/pipeline.rs: stage-by-stage pipeline demo (IR -> constraints -> solving -> inferred types -> C)examples/functions.rs: program-level demo (Program+ the stagedCBuildpipeline) with internal function calls and parameter passingexamples/control.rs: structured control-flow demo (if/for) lowered to C
- Architecture and design reference:
ARCHITECTURE.md - Roadmap and upcoming work:
PLAN.md - Display symbol/formatting options:
DISPLAY_MODES.md