Skip to content

dnzl

dnzl turns ned’s reactive streams into a message passing actor model in pure Nix. Actors are plain functions. Wiring is lazy stream composition.

  • Stateful stream processing, each actor keeps state across messages through closures; state threads through scanl, with no mutable or global state
  • Behaviour switching, an actor can replace itself with a new behaviour after each message, so state machines are just functions calling functions
  • Either routing, tag replies right (success) or left (failure). outbox.right / outbox.left are sub streams of bare values
  • Lazy pipelines, wire one actor’s outbox as another’s inbox; Nix laziness resolves evaluation order
  • Capability refs, a cycle-c is a Nix value. Returning it as a reply grants the receiver permission to invoke that actor
  • Fan out and scatter gather, spawn N actors with builtins.map, collect with merge, deterministically
  • Content-based routing, when-c filters a shared stream into per-actor slices

dnzl is the concurrency and messaging layer of the streams stack, sitting directly on ned. It demonstrates how far pure-Nix stream composition can be pushed, actors, supervision, and routing without any imperative machinery.

Source Code Documentation Support this project