jonnify·bcs /bcs/ideas/system-substrate/the-owner-goroutine

B1.1 · dive — the owner goroutine

Same law, different clothing.

Go states the substrate's first clause as doctrine: do not communicate by sharing memory; share memory by communicating. A goroutine that owns a data structure guarantees sequential access by construction. The substrate translates directly.

Designed counterpart — the manuscript marks the Go store as landing as its own rung. The pure-Go contract package (brandedid) under runtimes/go/ already supplies parse and hash conformance. Source: content/bcs1.1.md · How (Go, as designed).

One op through the boundary. Step through the walk; the readout reads each stage.
caller builds an op ops channel gate at the receiving edge owner goroutine props map[string]any owned by this goroutine alone keys []string kept sorted: byte == mint reply chan any the result returns on the op’s own channel
readout · Step through the walk. Statically: send → gate → mutate → reply — the channel is the only crossing, and the gate sits at the one place identities enter.
§1

The design, verbatim

content/bcs1.1.md · How (Go, as designed)

One owner goroutine per store holding the map, a channel as the boundary, the namespace gate at the channel's receiving edge, and — because Go maps are unordered — an explicit sorted key slice so byte order keeps supplying mint order. The chapter's snippet, quoted as the manuscript labels it:

// Designed counterpart — lands as its own rung. The gate package exists.
type op struct {
	kind  byte      // put | get | page
	id    string    // 14-byte branded id; gated before the table
	value any
	reply chan any
}

func propertyStore(ns string, ops <-chan op) {
	props := map[string]any{} // owned by this goroutine alone
	var keys []string         // kept sorted: byte order == mint order
	for o := range ops {
		// gate via the existing pure-Go contract package (brandedid),
		// refuse wrong namespace, then mutate props/keys and reply.
		_ = ns
		o.reply <- nil
	}
}

Illustrative design, not shipped code: the comment in the first line is the manuscript's own label. The course returns to this store when its rung freezes a transcript of its own.

§2

Enforcement differs; the law does not

content/bcs1.1.md · How

The shapes differ in enforcement, not in law: the BEAM refuses the reach-through at the VM; Go removes the shared reference so there is nothing to reach through. Both put the gate at the one place identities enter.

The refusal matrix. Pick a crime and a runtime; the readout reports how that runtime refuses it.
BEAM a process owns a :private table the VM refuses outside access ArgumentError · FunctionClauseError · :namespace Go a goroutine owns the map the shared reference is removed channel-only crossing · gate at the receiving edge
readout · Pick a crime and a runtime. Statically: the BEAM answers with the transcript's errors (G1–G3); Go answers by construction — no shared reference, a string id in the op, the gate at the channel's receiving edge.
§3

Where it lands

content/bcs1.1.md · Where

In the tree, the Go counterpart targets runtimes/go/, where the pure-Go contract package (brandedid) already supplies parse and hash conformance. The store itself is designed in the written chapter and lands as its own rung — when that rung freezes its transcript, the course teaches it the same way this module teaches the Elixir build: line by line, verbatim.

§4

References

sources · related

Sources

Related