Expand description
The Kernel (核) — the heart of kaish.
The Kernel owns and coordinates all core components:
- Interpreter state (scope, $?)
- Tool registry (builtins, user tools)
- VFS router (mount points)
- Job manager (background jobs)
§Architecture
┌────────────────────────────────────────────────────────────┐
│ Kernel (核) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Scope │ │ ToolRegistry │ │ VfsRouter │ │
│ │ (variables) │ │ (builtins, │ │ (mount points) │ │
│ │ │ │ user tools)│ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────────┘ │
│ ┌──────────────────────────────┐ ┌──────────────────┐ │
│ │ JobManager (background) │ │ ExecResult ($?) │ │
│ └──────────────────────────────┘ └──────────────────┘ │
└────────────────────────────────────────────────────────────┘Structs§
- Execute
Options - Per-call options for
Kernel::execute_with_options. - Kernel
- The Kernel (核) — executes kaish code.
- Kernel
Config - Configuration for kernel initialization.
- Overlay
Handle - Handle to an active overlay session, kept on the kernel and shared to
ExecContextso thekaish-vfsbuiltin can reach theOverlayFs.
Enums§
- Command
Kind - The category the kernel resolves a command name into.
- VfsMount
Mode - VFS mount mode determines how the local filesystem is exposed.
Constants§
- MAX_
RECURSION_ DEPTH - Maximum depth of dynamic statement-engine re-entry — command substitution
(
$(…)), shell-function calls, and.kaiscript sourcing — before a loud error is returned instead of letting the native call stack overflow (aSIGSEGV/abort with no diagnostic). Mirrors the intent of the alias re-entry cap (10) and the lexer’sMAX_PAREN_DEPTH(256): a runaway or mutually recursive script hits a catchable ceiling, not a signal. - RECOMMENDED_
STACK_ SIZE - Recommended native stack size (12 MiB) for any thread that drives kaish
execution — the REPL sizes its
block_onthread and tokio worker threads to this, and embedders that callKernel::execute(directly or via a tokio runtime) should do the same (runtime::Builder::thread_stack_size, and astd::threadstack for a non-worker driver).