Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nushell: Orientation

Structured shellIterators + Rayon + processesRevision 3876934

Nushell treats pipelines as transformations of structured values while still interoperating with byte-oriented Unix processes. Its architectural center is PipelineData: empty, one materialized Value, a lazy ListStream, or a ByteStream that may own a child process.

source text → parse/type shape → block/calls
                                  ↓
EngineState + mutable Stack → Command::run(PipelineData) → PipelineData
                                  ↕
                     external child pipes / plugins / Rayon

Design thesis

Nushell keeps structured pipelines lazy and synchronous by default, then introduces threads, Rayon, and child processes only at boundaries whose ownership and ordering consequences users can see.

  • PipelineData distinguishes repeatable values from consumable streams.
  • Pull-based iterators provide natural pressure and early termination.
  • par-each makes parallelism and its ordering tradeoff explicit.
  • ByteStream keeps child output and process completion in one lifecycle.

We preserve the value/stream distinction, lazy iterator pipelines, metadata and source spans, structured errors, cooperative signals, external-process bridges, bounded parallel mapping, explicit ordering policy, and cloneable command objects.