Repository navigation
Tags: bpr/mojito
Tags
Integrate compiler MIR artifacts with CLI and conformance tests Cache ownership-verified MIR in CompiledProgram and use its shared drop- elaborated form for backend execution and canonical artifact emission. Add the emit-mir CLI producer, direct-to-artifact pipeline tests, and byte- stable execution equivalence contracts for every runnable conformance case. Keep direct interior loans in the invalidation owner domain: the shared direct_borrow_interior helper roots member/index and iteration borrows at the canonical owner slot (the domain InvalidateInteriors facts resolve through) and records the reference hop as the place's through reference when the executable root is a reference binding. This replaces the place-root splice that silently accepted use-after-mutation through nested ref-row iteration, and deterministically settles the nested-comprehension interior-loan flake. Pin the rule with a MIR phase test and an ownership_error corpus fixture. Synchronize the architecture, feature matrix, symbol map, README, changelog, and remove the completed textual-assembly task from the roadmap. Refocus the README into a ~110-line landing page and move its usage material (CLI, programs, fixtures, conformance, library API) to docs/usage.md and its narrative material (status, Mojo gaps, semantics tour, direction) to docs/overview.md without dropping content. Reorient the documented native-backend direction: Pliron first (staged per docs/pliron_plan.md), then Cranelift, with a C or C++ source backend as a possible addition; direct LLVM/MLIR lowering and eBPF are deprioritized. Stop describing the textual MIR/VM assembly as human-readable.
Complete MIR value typing and standalone semantic verification - type every register: expression results record checked types at lowering, synthetic handles, markers, and control-flow/iterator temporaries are typed at their emission sites, and a `close_register_types` pass fills the rest by copying facts already in the instruction stream — operand and slot types, place storage, inline element types, declaration returns — never by re-implementing checker inference; loan and consumption markers use the documented `Ty::None` convention, and untyped registers are invariant errors naming their defining instruction - record checked declaration contracts — return types, raising contracts, ref-returns, and exact callable types — as `AnnotationSite` facts, carry them on `MirFunction` and `MirFunctionDeclaration` with per-slot `var_tys`, type the `try` handler binding from its body's raising facts, and remove the last source-annotation reads from MIR lowering - source parameter slot types from checked declaration facts instead of name-matched body expressions, fixing same-named bindings from other functions leaking into a method's `self` type - grow `mir::verify` into the semantic verifier of record over MIR plus declaration metadata alone: place and projection consistency, register bounds and type completeness, store/binding/return/call-argument type consistency through the checker's coercion predicate, CFG-edge validity with `FallOff`/`EscapeJump` confined to try regions, effect protection for raising sites in nonraising functions, and reference write-back invariants - gate the pipeline: `Compiler::compile_linked` adds a verification stage (`CompilerError::Verify`) and runs the now-public `check_ownership_program` on the same lowered program, the VM re-verifies the drop-elaborated MIR it executes, and the CLI `check`/`own` commands consume the checked pipeline instead of silently re-checking - pin behavior with a whole-corpus verification test (every executable fixture lowers fully typed and re-verifies after drop elaboration), hand-built malformed-MIR negative tests per check class, declaration contract assertions, and a pipeline verification test; update the architecture, symbol-map, and CLAUDE invariant docs and check off both roadmap task-3 subtasks - replace the `Box<dyn Backend>` trait object with a statically dispatched `Backend` enum over concrete implementations; `BackendKind` recognizes the planned `vm`/`cranelift`/`ebpf`/`llvm`/`mlir` seams, `make` parses a backend name and constructs it, and recognized-but-unimplemented backends refuse construction instead of pretending to execute - release mojito 0.2.0: bump the crate version and date the changelog section covering everything since 0.1.0