Lattice is a research runtime and toolchain for executing and analyzing ObjectIR, a flexible intermediate representation (IR) designed for language-agnostic program analysis, transformation, and execution. It is part of the ObjectIR ecosystem and provides a managed runtime, IR manipulation utilities, and extensibility for custom tooling. Lattice is intended for both practical use and as a platform for research into IR design, program analysis, and runtime systems.
- ObjectIR Execution: Run ObjectIR modules and instructions in a managed environment.
- Extensible Tooling: Attribute-based metadata and plugin support for custom tools.
- IR Serialization: Load and save ObjectIR modules in multiple formats (JSON, BSON, etc.).
- Testing Support: Includes smoke tests for runtime and IR gap analysis.
- Cross-Platform: .NET 10+ support for Windows, Linux, and macOS.
Program.cs— Entry point for the Lattice runtime.IR/— Data transfer objects for IR modules and instructions.Runtime/— Core runtime logic (call frames, managed objects, signals, helpers).TextIR/— Lexer and parser for textual IR representations.libs/ObjectIR.Core/— Core ObjectIR library: IR definitions, builders, compilers, and serialization.ToolMetadataAttribute.cs— Attribute for tool/plugin metadata.ToolException.cs— Custom exception types for tool errors.RuntimeGapSmokeTests.cs— Basic runtime and compatibility tests.
# From the project root
dotnet build Lattice.csproj# Cross-platform publish script
./publish.ps1# Example: run a compiled ObjectIR module
dotnet run --project Lattice.csproj -- <module.or>- Place your ObjectIR modules in the appropriate format (see
IR/andlibs/ObjectIR.Core/Serialization/). - Use the runtime to execute, analyze, or transform IR modules.
- Extend with custom tools by implementing new attributes or exceptions as needed.
Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.
For more details, see the code in each directory and the inline documentation.