The substrate of flow

DaoStream

The Way That Flows

In Datom.World, everything begins and ends with the DaoStream — the unified interface that connects all things.

The DaoStream generalizes Plan 9's revolutionary insight. Plan 9 discovered that everything is a file —a unified interface where processes, networks, and devices become readable and writable resources. DaoStream extends this: everything is a stream . Files are streams. APIs are streams. Databases are streams. Messages are streams. Graphics are streams. Devices are streams. UI is a stream.

Like the Dao (道) in Taoist philosophy, it maintains a simple, constant form—the stream interface—yet adapts to infinite contexts. The same operations work everywhere: open, read, write, close . Local or distributed. Static or flowing. Finite or infinite. The DaoStream carries meaning not by dictating structure, but by allowing interpreters to emerge around it.

In Datom.World, DaoStream replaces countless specialized APIs, message queues, and database protocols with a single, universal stream interface:

Everything is a stream.

Applications don't "call services" or "query databases." They open streams at paths, read datoms, write datoms, close streams. Every resource in Datom.World—whether file-like or flow-like—is accessible as a stream in a hierarchical namespace.

Every resource is a stream at a path: [:entity :attribute]

Every operation flows datoms: [e a v t m]

Every interaction is open, read, write, close.

Through the DaoStream, software returns to first principles—the Unix philosophy perfected. Not just files, but streams. Not just pipes, but datom flows. Everything is a stream. Everything flows.

The Stream Protocol

Building on Plan 9's file metaphor, DaoStream defines a universal stream protocol. Every resource—databases, messages, sensors, services, files—is a stream that supports four operations. To understand how DaoStream simplifies Plan 9's 9P protocol while preserving its elegant philosophy, see DaoStream: Inspired by Plan 9, Simpler Than 9P .

(defprotocol Stream
  (open [this path]
    "Open a stream at the given path in the datom namespace.
     Path examples: [:user :alice :messages], [:sensors :temperature]")
  (read [this params]
    "Read datoms from the stream. Returns [e a v t m] tuples.")
  (write [this datoms params]
    "Write datoms to the stream. Append-only semantics.")
  (close [this]
    "Close the stream and release resources."))

open

Open a stream at a path in the datom namespace. Paths are hierarchical vectors: [:user :alice :chat] , [:db :products] , [:sensor :temp] .

Opening establishes the stream—whether to a static file, a live feed, or a remote resource. The path is the only required parameter.

read

Read datoms from the stream. Returns a lazy sequence of [e a v t m] tuples.

Streams are pull-based and asynchronous. Whether reading a finite file or an infinite flow, the interface is identical.

write

Write datoms to the stream. All writes are appends—datoms are immutable once written.

Streams are append-only logs. Apps like DaoDB interpret these streams as queryable databases.

close

Close the stream and release resources. Ensures clean shutdown and proper cleanup.

This protocol is universal. Every resource in Datom.World—chat, database, API, sensor, file—is a stream with the same interface. Learn open/read/write/close once, access everything. No versioning, no REST vs GraphQL debates, no integration glue. Just streams.

Everything Becomes a Stream

The innovation isn't the API— open/read/write/close has existed since Unix. The innovation is what becomes accessible through this simple interface.

Plan 9's genius wasn't inventing file operations. It was making processes, networks, and devices reachable through those operations. Read from /proc/1234/status to see a process. Write to /net/tcp to open a connection. The same four operations, but now they touch everything.

DaoStream extends this principle: all resources become streams in a unified namespace:

  • Messages[:chat :alice] is a stream you read and write
  • Databases[:db :users] is a stream; apps like DaoDB build indexes from it
  • Sensors[:sensors :temperature] is an infinite stream of measurements
  • Devices[:devices :printer] is a stream you write to
  • Graphics[:display :screen] is a stream of rendered frames
  • UI[:ui :events] is a stream of clicks and gestures
  • APIs[:api :weather] is a stream you read for data
  • AI agents[:agents :assistant] is a conversational stream
  • Process state[:process 1234 :status] is a stream of runtime metrics
  • Files[:files :document.txt] is a finite stream of content

The power emerges from universality of access , not novelty of operations. Every resource—local or remote, static or flowing, finite or infinite—presents the same interface. Open a path. Read datoms. Write datoms. Close when done.

You're not learning new APIs. You're discovering new resources that speak the language you already know. The namespace expands infinitely. The operations stay simple.

No impedance mismatch. No protocol translation. No API clients. Just streams, all the way down.

Streams as Infrastructure

DaoStream isn't just an API—it's infrastructure. Inspired by Plan 9's philosophy, it defines how resources appear and behave:

Append-only semantics

Streams are append-only logs. Datoms are never modified or deleted. This enables time travel, audit trails, and undo—for free.

Location transparency

Streams can be local or remote—the path syntax is identical. Open [:db :users] and DaoStream handles routing, connection, and entanglement transparently.

Local-first by default

All streams exist locally first. Writes propagate to entangled nodes when connected. Offline operation isn't a special case—it's the foundation.

Every app is a stream interpreter. DaoDB interprets streams as queryable indexes. DaoFlow interprets streams as reactive UIs. Shibi interprets streams as economic signals. Your app interprets streams according to your domain.

This extends Plan 9's insight to distributed, temporal systems: a unified namespace where interpretation happens at the edges, and the substrate—streams of datoms—remains beautifully simple.

One Truth, Many Perspectives

The power of DaoStream comes from separation of data and interpretation. Streams contain datoms— [e a v t m] tuples that represent facts. Apps interpret those facts according to their needs.

The same stream can serve many interpreters simultaneously:

  • Your email client reads [:messages :inbox] as conversations
  • Your calendar reads it as scheduled events
  • Your analytics tool reads it as behavioral patterns
  • Your AI agent reads it as training examples

No data duplication. No schema migrations. No ETL pipelines. Just streams of datoms, and interpreters that extract meaning. This eliminates the structural decoherence that causes the trillion-dollar leak in traditional software.

This is schema-on-read taken to its logical conclusion: streams carry universal datoms, interpretation happens at read time. Add new interpreters—no database changes required. One stream, many perspectives. Many streams, composed freely.

Why Streams Instead of APIs?

Modern software drowns in accidental complexity:

  • Every service exposes a different API
  • Every database speaks a different protocol
  • Every resource requires specialized client libraries
  • REST, GraphQL, gRPC, WebSockets, SQL, NoSQL—each with unique semantics

Plan 9 showed that everything is a file eliminates this complexity. DaoStream extends this insight: everything is a stream . Files are streams. So are databases, sensors, APIs, and conversations.

This isn't just pragmatic—it's fundamental. The pi-calculus proves that computation can be entirely reframed as communication. It's Turing complete: anything computable can be expressed as interacting processes exchanging messages. This is why streams—communication channels—are more powerful yet simpler than traditional APIs. We're not choosing a convenient abstraction. We're aligning with the mathematical structure of computation itself. For the deep connection between pi-calculus, reflection principles, and communication complexity, see Large Cardinals and π-Calculus .

Uniform interface

Learn open/read/write/close once. Use it for databases, messages, sensors, APIs, files. No framework churn. No versioning hell. No integration glue.

Hierarchical namespace

Resources live in paths expressed as vectors: [:user :alice :messages] , [:db :products] . Familiar, composable, and naturally organized.

Temporal by default

Streams are append-only logs. History is preserved automatically. Time travel, replay, and audit trails emerge naturally.

When everything is a stream, the boundaries between database, filesystem, API, and message queue dissolve. There are only paths in a namespace, and datoms flowing through time.

The Flow of the Dao

In Taoist philosophy, the Dao is the natural order—the way things flow when not forced. Water doesn't fight its way downhill; it follows the path of least resistance.

DaoStream embodies this principle, extending Plan 9's elegant simplicity to flowing data:

  • No central authority — Streams exist on peers, not servers. Read and write directly.
  • Natural composition — Paths compose naturally. [:user :alice] contains [:user :alice :messages] .
  • Effortless distribution — Open [:remote :server :db] and entanglement handles routing transparently.
  • Emergent behavior — Complex systems arise from simple stream operations.

This is stigmergy applied to data: apps leave traces (datoms) in streams, other apps interpret them, collective intelligence emerges. No orchestrator. No coordinator. Just streams and interpreters.

Plan 9 showed that unified interfaces unlock emergent power. DaoStream extends this insight: when every resource is a stream of datoms—whether file-like or flow-like— the entire distributed system becomes a single, coherent namespace of flowing truth.

To understand why stream-based systems work across distributed nodes without global coordination, read Unitarity and Communication Limits . To see how distributed systems are quantum systems with no global state, explore DaoDB and the Collapse of the Wave Function . To see why interpretation is fundamental, explore Structure vs Interpretation . To understand why distributing entropy to system boundaries creates resilient architectures, read Code Entropy and Evolution .

See how Yin agents consume and produce streams, or explore DaoDB to understand stream interpretation as queryable indexes.