ghul.repl.host
0.37.3
Prefix Reserved
dotnet add package ghul.repl.host --version 0.37.3
NuGet\Install-Package ghul.repl.host -Version 0.37.3
<PackageReference Include="ghul.repl.host" Version="0.37.3" />
<PackageVersion Include="ghul.repl.host" Version="0.37.3" />
<PackageReference Include="ghul.repl.host" />
paket add ghul.repl.host --version 0.37.3
#r "nuget: ghul.repl.host, 0.37.3"
#:package ghul.repl.host@0.37.3
#addin nuget:?package=ghul.repl.host&version=0.37.3
#tool nuget:?package=ghul.repl.host&version=0.37.3
ghul.repl.host
Runs a ghul.repl
session in the current process, on a machine that has ghul.compiler
installed. It compiles each cell with that compiler, loads the cell into a
load context that belongs to the session, and runs it. ghul.repl itself
compiles, loads and runs nothing. This package does that work, for a program
that runs cells in its own process.
using it
One call starts a session:
use Ghul.Repl.Host.HOST_SESSIONS
let session = HOST_SESSIONS.start(compiler_shim, runtime_assembly, true, true, line => report(line))
let result = session.submit("let x = 41\nx + 1\n")
// result.is_accepted, result.diagnostics, result.value, result.run_error
session.close()
compiler_shimis theghul-compilercommand to run.runtime_assemblyis theghul-runtime.dllbeside that compiler. The session copies it beside the cells so that the process can load them.- The first flag asks for a compile server. The second asks for
use defaultin every cell. - The session calls the last argument with anything the host should know about how it is compiling cells.
close() ends the session. To reset, call close() and then start again.
the compile server
The session starts one ghul-compiler --compile-server straight away, so that
the server warms up before the first cell, and keeps it running until
close(). If the server fails, stops answering or refuses a request, the
session starts the compiler once for each cell instead, and says so once.
what submit returns
submit writes nothing to the console. It returns the diagnostics in the form
the user should see, with each cell named by its label. For a cell that threw,
it returns the report in run_error, and the session keeps the definitions of
that cell.
Whatever a cell writes goes to the console as it stands while the cell runs. A
host that wants that output redirects the console around the call to submit.
checking whether text is complete
HOSTED_SESSION.check(text) says whether typed text is complete, is
incomplete, or cannot become valid whatever the user adds. When the compile
server is ready, it answers in a few milliseconds. Before that, and without a
server, COMPLETENESS_CHECK runs ghul-compiler --check-complete as a
separate process each time, which takes a few hundred milliseconds.
completion, hover and diagnostics
HOSTED_SESSION.complete(text, line, column), hover(text, line, column) and
diagnostics(text) answer questions about text that the user has not
submitted yet. They answer in terms of that text. Lines and columns count from
- Diagnostics name the cell that the text would become by its label. Nothing in the answer refers to the imports that the session writes in front of the text.
The first call starts ghul-compiler --analyse and gives it the assembly of
each accepted cell. The session closes the analyser when it closes.
These calls need ghul.compiler 59.9.0 or newer. With an older compiler they
return null, the session says once that they are off, and everything else
works.
building a session from its parts
HOST_SESSIONS.start assembles these public classes: SPAWN_BACKEND,
SERVER_BACKEND, SERVER_PROCESS, SESSION_FILES, SESSION_LOAD_CONTEXT and
HOSTED_SESSION. A host that wants a different arrangement can assemble them
itself, and can implement CompileBackend and ServerConnection. The default
check in CompileBackend leaves the check to the session.
requirements
The session compiles its cells with ghul.compiler 59.8.0 or newer. A host
that implements CompileBackend needs 59.8.2 or newer to build, because older
compilers do not inherit the default check from another assembly.
| Product | Versions 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. |
-
net10.0
- ghul.repl (>= 0.37.3)
- ghul.runtime (>= 21.12.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.37.3 | 31 | 9/22/2026 |
| 0.37.2 | 32 | 9/22/2026 |
| 0.37.1 | 47 | 9/21/2026 |
| 0.37.0 | 48 | 9/19/2026 |
| 0.36.1 | 46 | 9/19/2026 |
| 0.36.0 | 46 | 9/19/2026 |
| 0.35.0 | 47 | 9/19/2026 |
| 0.34.0 | 53 | 9/19/2026 |
| 0.33.1 | 50 | 9/19/2026 |
| 0.33.0 | 44 | 9/19/2026 |
| 0.32.0 | 47 | 9/19/2026 |
| 0.31.2 | 50 | 9/19/2026 |
| 0.31.1 | 60 | 9/19/2026 |
| 0.31.0 | 49 | 9/19/2026 |
| 0.30.0 | 48 | 9/19/2026 |
| 0.29.0 | 51 | 9/19/2026 |
| 0.28.0 | 46 | 9/19/2026 |
| 0.27.2 | 52 | 9/19/2026 |
| 0.27.1 | 48 | 9/19/2026 |
| 0.27.0 | 50 | 9/19/2026 |