Skip to content

vzarytovskii/interactive-ilkernel

Repository files navigation

IL Kernel for .NET Interactive

Description

An experimental preview verision of MSIL/CIL kernel for the .NET Interactive, using @kkokosa's Mobius.ILasm as an IL compiler.

Usage

First, new kernel should be loaded into the interactive session:

// Optional, uncomment the following line, if you need to include additional paths to reference libraries from, for example, if you're building it locally.
// #i "C:\Users\user\Downloads"
#r "nuget:DotNet.Interactive.Extensions.ILKernel,0.1.0-pre"

You should now be able to run IL, for example:

#!il
.assembly ConsoleApp
{
}

.class public auto ansi abstract sealed beforefieldinit Program
    extends System.Object
{
    .method public hidebysig static
        void Main () cil managed
    {
        .entrypoint
        .maxstack 8

        ldstr "Hello, world from IL!"
        call void[System.Console]System.Console::Write(string)
        ret
    }
}

Example of running code above:

image