How vx-lang/vx works
Vx is a heterogeneous-systems language and compiler: users submit Vx programs and receive diagnostics, generated code, or JIT execution. The documented path runs through parsing, hardware-aware semantic checks, and code generation; the source index supports the compiler’s internal handoffs. Major language capabilities include placement and capacity checking, transfer reachability and routing, seam contracts, and borrow checking. The tree also shows a runtime for local and remote dispatch. Some implementation details are unsampled, so uncertain runtime connections are omitted.
Main entry points: pipeline.rs Compile pipeline · mod.rs Parser · main.rs Compiler CLI · flat.rs Code generation
Components 22
Language Front End
- Compiler CLI
src/main.rs - Lexer
src/lexer.rs - Parser
src/parser/mod.rs - Syntax AST
src/syntax/expr.rs - Name resolver
src/resolver.rs
Hardware Semantics
- Topology model
src/arch.rs - HIR checks
src/hir/check/calls.rs - Capacity admission
src/hir/check/capacity_fold.rs - Transfer checks
src/hir/check/transfer.rs - Seam contracts
src/hir/seam.rs - Borrow checker
src/borrow.rs
Compilation
- Compile pipeline
src/pipeline.rs - HIR flattening
src/hir/flatten.rs - Type registry
src/registry.rs - Code generation
src/codegen/flat.rs - MLIR lowering
src/dialect/VxLowering.cpp
Execution Runtime
- JIT execution
src/jit.rs - Device dispatch
runtime/cuda_dispatch.cpp - Remote worker
runtime/vx_worker_main.cpp - Remote client
runtime/vx_remote_client.h - Wire protocol
runtime/vx_wire.h
Other components
- Vx programmer
Connections 19
- Vx programmer → Compiler CLI: submits program
- Compiler CLI → Compile pipeline: compiles
- Compile pipeline → Parser: parses modules
src/pipeline.rs - Parser → Lexer: consumes tokens
src/parser/mod.rs - Parser → Syntax AST: builds AST
src/parser/mod.rs - Compile pipeline → Name resolver: resolves names
src/pipeline.rs - Compile pipeline → Topology model: uses topology
src/pipeline.rs - Compile pipeline → HIR checks: checks program
src/pipeline.rs - Compile pipeline → Capacity admission: checks capacity
src/pipeline.rs - Compile pipeline → Transfer checks: checks transfers
src/pipeline.rs - Compile pipeline → Seam contracts: checks contracts
- Compile pipeline → Borrow checker: checks ownership
- Compile pipeline → HIR flattening: flattens HIR
src/pipeline.rs - Compile pipeline → Type registry: builds registry
src/pipeline.rs - Compile pipeline → Code generation: generates code
src/pipeline.rs - Code generation → MLIR lowering: lowers to MLIR
- Vx programmer → JIT execution: runs program
- Remote worker → Remote client: uses client
runtime/vx_worker_main.cpp - Remote client → Wire protocol: uses protocol
runtime/vx_remote_client.h