ghul.repl 0.37.3

Prefix Reserved
dotnet add package ghul.repl --version 0.37.3
                    
NuGet\Install-Package ghul.repl -Version 0.37.3
                    
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="ghul.repl" Version="0.37.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ghul.repl" Version="0.37.3" />
                    
Directory.Packages.props
<PackageReference Include="ghul.repl" />
                    
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 ghul.repl --version 0.37.3
                    
#r "nuget: ghul.repl, 0.37.3"
                    
#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 ghul.repl@0.37.3
                    
#: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=ghul.repl&version=0.37.3
                    
Install as a Cake Addin
#tool nuget:?package=ghul.repl&version=0.37.3
                    
Install as a Cake Tool

ghul.repl

CI NuGet version (ghul.repl) License ghūl

The session behind a ghūl read-eval-print loop. It keeps track of the cells a user has submitted and works out what each new cell needs in order to see them. It compiles nothing, loads nothing, runs nothing and names no file: a host does those, so the same session works in a terminal, a browser page and a notebook kernel.

how a session works

A session is a list of accepted cells. A host compiles each cell as its own library assembly, in its own namespace, with references to the assemblies of the earlier cells.

The session writes a prelude of use lines in front of each new cell, so that the cell can see the names the earlier cells defined. The prelude has one use for each visible name, and that use names the cell that defined the name most recently. A new definition of a name therefore replaces the old one for later cells, and name lookup in the compiler works as it always does.

The prelude also repeats the use lines that earlier cells started with. It starts with use default, unless the host creates the session with SESSION(false). It leaves out any import that the new cell writes itself, so its length changes from cell to cell. Read the length from request.prelude_line_count.

using it

A host drives the session in three steps:

let request = session.prepare(source)

// compile request.source, with request.references naming the earlier
// cells whose assemblies it needs. if the result is written to disk,
// name it `<request.name>.dll`

let loaded = Ghul.Repl.CELL_EXPORTS.read(assembly)
let outcome = session.accept(request, Ghul.Repl.CELL_REPLY(diagnostics, loaded))

if outcome.is_accepted then
    let run = Ghul.Repl.CELL_ENTRY.run(loaded)
fi

CELL_EXPORTS.read takes an assembly that the host has already loaded. A host that holds its cells as bytes in one load context never writes them to disk.

The session accepts every cell that compiles, whatever the cell does when it runs. So run a cell after the session accepts it.

diagnostics

The host gives the compiler's diagnostics to the session in a CELL_REPLY. It can give them as CELL_DIAGNOSTIC values, or as the lines the compiler wrote, which the session parses.

accept returns the diagnostics in the form the user should see. Every location in a cell, including a related location, names the cell by its label (cell-3) and counts lines from the first line the user wrote. CELL_ERROR.describe does the same for an exception that a cell threw.

values

CELL_DISPLAY.format renders the value that a cell ended on, and returns nothing for a cell that ended on a statement. It prints nothing itself, so every host shows the same value in the same way.

Give it the runtime the cells run against with use_runtime. From ghul.runtime 21.8.1 on, it renders the value with that runtime's inspect, the same text a program gets from calling inspect itself. With an older runtime, or none, it renders a collection one level deep, up to a limit on the number of elements.

requirements

The compiler needs to support --submission, --reference and use default: ghul.compiler 59.8.0 or newer.

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 ghul.repl:

Package Downloads
ghul.repl.host

Hosts a ghūl REPL session on this machine: compiles each cell with an installed ghul.compiler, kept running as a compile server with a fallback to starting it per cell, loads the result into a load context of the session's own, and runs it.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.37.3 0 9/22/2026
0.37.2 0 9/22/2026
0.37.1 48 9/21/2026
0.37.0 53 9/19/2026
0.36.1 49 9/19/2026
0.36.0 49 9/19/2026
0.35.0 249 9/19/2026
0.34.0 90 9/19/2026
0.33.1 55 9/19/2026
0.33.0 45 9/19/2026
0.32.0 51 9/19/2026
0.31.2 50 9/19/2026
0.31.1 57 9/19/2026
0.31.0 53 9/19/2026
0.30.0 51 9/19/2026
0.29.0 52 9/19/2026
0.28.0 225 9/19/2026
0.27.2 50 9/19/2026
0.27.1 48 9/19/2026
0.27.0 56 9/19/2026
Loading failed