Skip to content

Fy-nite/Lattice

Repository files navigation

Lattice: ObjectIR Research Runtime

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.

Features

  • 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.

Project Structure

  • 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.

Getting Started

Prerequisites

Build

# From the project root
dotnet build Lattice.csproj

Publish

# Cross-platform publish script
./publish.ps1

Run

# Example: run a compiled ObjectIR module
dotnet run --project Lattice.csproj -- <module.or>

Usage

  • Place your ObjectIR modules in the appropriate format (see IR/ and libs/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.

Contributing

Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.

License

MIT


For more details, see the code in each directory and the inline documentation.

About

The CSharp variant of the Official ObjectIR Runtime: Experimental edition

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors