Skip to main content

Module eval_kernel

Module eval_kernel 

Source
Expand description

Persistent eval kernels — the reference EvalKernel implementations behind the coding-omp-v1 “Eval kernel” extension.

  • PythonEvalKernel: one long-lived python3 -q -u -i process. Each cell ships inline — triple-quoted with backslash escaping, wrapped in exec(compile(...)) — so multi-line and indented cells work verbatim; namespace state persists across cells.
  • JavaScriptEvalKernel: one long-lived node -i --no-warnings (or bun -i) REPL. Cells are fed through stdin; top-level declarations persist in the REPL context. Cells must be complete statements (an unclosed brace would swallow the trailing marker line).

Both delimit a cell with a stdout marker line, bound output, surface interpreter diagnostics on error, and support explicit reset (child killed; respawned lazily on the next cell).

Structs§

JavaScriptEvalKernel
Persistent JavaScript REPL kernel. Prefers node, falls back to bun.
PythonEvalKernel
Persistent python3 -q -u -i kernel.