archetypic.dev

foundational forms in code

"In the depth of code there are figures that no programmer invented —

they were waiting, the way ruins wait beneath a city,

the way certain dreams wait beneath the day."

II.

Codex of Crystallised Forms

Six fragments preserved as code. Each cell is a slab of midnight holding a small recurrence — read them as inscriptions.

Strategy

const route = strategies[mode];
const result = route(input);
return narrate(result);
// algorithm chosen at the seam

Visitor

tree.traverse(node =>
  visitor.visit(node)
);
// behavior detached from shape

Mediator

hub.broadcast(event);
// many parts speak through one
// none knows the others

Memento

const past = state.snapshot();
state.mutate(now);
state.restore(past);
// memory as a portable artefact

Command

const op = new Command(target);
queue.push(op);
op.undo();
// intent reified as object

Proxy

const veil = new Proxy(real, {
  get: (t, k) => observe(t, k)
});
// a stand-in that gates access

Patterns are not invented; they are remembered.