Expand description
Registration point for the embedded Harn standard library.
The compiler and runtime read stdlib sources through this crate instead of
depending on harn-stdlib, which embeds every .harn source file. A crate
that embeds the sources changes whenever one of them does, and so does
everything compiled against it; keeping the catalog behind this small,
dependency-free crate means editing a stdlib module rebuilds only
harn-stdlib and the binaries that link it.
A host links harn-stdlib and calls harn_stdlib::install() once at
startup. Reading the catalog before that is a typed
CatalogNotInstalled error, never an empty standard library.
Structs§
- Catalog
Already Installed - A different catalog is already installed in this process.
- Catalog
NotInstalled - No stdlib catalog was installed before Harn code needed one.
- Stdlib
Catalog - Every embedded stdlib source a host provides.
- Stdlib
CliScript - Embedded
.harnscript that backs a CLI subcommand. Looked up by theharn-clidispatch wedge (see harn#2293 epic and harn#2294 G1) so subcommands can ship in Harn instead of Rust. - Stdlib
Prompt Asset - One embedded prompt template, addressed by its path under
std/. - Stdlib
Source - One embedded stdlib module, imported as
std/<module>.
Functions§
- builtin_
reexports - Builtins a stdlib module re-exports under its own name, so
import { assert_eq } from "std/testing"resolves. - install
- Install the process’s stdlib catalog. Installing the same catalog again is a no-op; a second, different catalog is refused.
- installed
- The installed catalog.