CommonIR 1.2.0

dotnet add package CommonIR --version 1.2.0
                    
NuGet\Install-Package CommonIR -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommonIR" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommonIR" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="CommonIR" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommonIR --version 1.2.0
                    
#r "nuget: CommonIR, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CommonIR@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommonIR&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=CommonIR&version=1.2.0
                    
Install as a Cake Tool

CommonIR

Intermediate representation to generate code for various different platforms.

This project has recently just started, and as such, is not yet complete.


Documentation will be added as the project progresses.

For a live demonstration of the IR in use, see the current implimentation in Common C.

For more about how to use CommonIR, see the usage examples.

For more info about target development philosophy, see the general target spec.

Using CommonIR (with examples)

To understand how to use CommonIR, we must first establish the fundamental facts about the IR and how it lowers into target code.

CommonIR consists of a hirearchical structure of objects, which are used to represent the program in a target agnostic way.

  • IRModule
    • IRFunction
      • IRLocal
      • IRBlock
        • IRInstruction
    • IRFunctionImport
    • IRGlobal

Each created instruction will keep its value if used multiple times. To create new values, you must build a new instructions.

To keep things simple, aggregates have their own way of being built. You do not need to manually allocate and construct your own aggregates. This is also to later maintain compliance with ABIs.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CommonIR:

Package Downloads
CommonIR.App

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 49 9/12/2026
1.1.8 81 9/3/2026
1.1.7 80 9/1/2026
1.1.6 89 8/26/2026
1.1.5 87 8/24/2026
1.1.4 104 8/17/2026
1.1.3 99 8/11/2026
1.1.2 91 8/11/2026
1.1.1 94 8/11/2026
1.1.0 89 8/10/2026
1.0.1 98 8/7/2026
1.0.0 92 8/7/2026

Implimented support for loops and expanded Usage.md. CommonIR's structure and architecture is now satisfactory enough to be used in compilers. The WASM target is now considered partially complete.