Yin.VM and Symmetry

Most programming systems start from languages. Yin.VM starts from invariance. This difference sounds subtle, but it shifts the perspective from viewing the AST as a transient artifact to be discarded after compilation, to viewing it as the permanent foundation from which all execution models are projected.

Symmetry Is Relational

An object is a singular thing (not in the object-oriented sense, but as an abstract entity). Symmetry is not a property that lives inside it. Instead, symmetry appears when we discover a transformation that leaves the object unchanged. The space of possible transformations is unbounded; therefore, the space of possible symmetries is never fixed.

What we often call an intrinsic property is actually a relationship between an object and a chosen transformation space. Change the transformation set, and the symmetry changes, even if the object does not. Symmetry is discovered, not embedded.

Scalars, Values, and Invariance

In physics, a scalar is a quantity that remains unchanged under coordinate transformations. The components of a vector may shift as the axes rotate, but the scalar length is invariant. Its defining property is not its simplicity, but its persistence.

This is more than a mathematical convenience; it is a biological necessity. The human mind evolved to detect persistent invariants in a chaotic, noisy world. Identifying what stays the same while everything else moves is how we distinguish objects from background noise, and signal from entropy.

Invariance is not limited to physics or biology:

  • Data structures can be invariant under memory reorganization.
  • Semantic graphs can be invariant under structural rewrites.
  • Programs can be invariant under compilation.

Anything can be a value if it is held invariant. In Yin.VM, the AST is that value: the scalar that survives the transformations of compilation.

The Core Insight Behind Yin.VM

Yin.VM applies this relational logic to code: the AST is the invariant. Constructed from immutable datoms, it serves as the fixed point from which multiple execution models are projected. In this model, languages and compilers are merely transformations that act upon the substrate.

This removes the primacy of syntax. The AST is semantic structure. If two surface languages map to the same datom-constellation, they are the same program. The representation may change, but the value persists.

Compilers as Symmetry Preserving Transformations

In Yin.VM, a compiler is not defined by its output format. A compiler is defined by a single constraint: does it preserve the AST invariant?

Stack machines, register machines, bytecode interpreters, and native code generators are not targets. They are representations of the AST. The compilers that map between them are the elements of the symmetry group. If a transformation preserves meaning, it belongs. If it mutates meaning, it is not compilation. It is a semantic change.

Why There Is No Symmetry Enumeration Algorithm

Given an arbitrary object, there is no algorithm that can enumerate all symmetry preserving transformations. This is not a limitation of tooling. It is a fundamental boundary of computation.

Instead, symmetry is found by:

  • Defining a transformation language.
  • Defining what invariant means.
  • Solving the constraint:

interpret ∘ transform = interpret.

This is the fundamental definition of a compiler in Yin.VM: a transformation that leaves the interpretation (the meaning) invariant. Symmetry is characterized, not listed. Because we cannot enumerate all possible symmetries in advance, Yin.VM must remain open-ended. It embraces this reality by:

  • Keeping the invariant explicit.
  • Allowing multiple interpreters.
  • Refusing to privilege a single execution model.

Continuations as Control Invariants

The same principle explains why everything in Yin.VM is a continuation. A continuation is invariant across:

  • Stacks.
  • Registers.
  • CPS.
  • Suspension.
  • Distribution.

Execution strategies differ. The control structure does not. Continuations are the symmetry preserving core of control flow. Because both the AST and the continuation state are stored as immutable datoms, this invariance is not an abstraction: it is a property of the data itself.

Symmetry Breaking Is Optional, and Reversible

Symmetry is the foundation of structure, but the breaking of symmetry is where structure is built. In its perfectly symmetric state, the AST is pure potential. While it can be walked and executed directly by an interpreter, it remains independent of any specific machine model.

To build specialized structure, we must choose. We must break the symmetry of the invariant to manifest the specific reality of a register machine, a stack frame, or a native binary. Optimization and specialization are the necessary acts of symmetry breaking that translate abstract value into concrete performance.

Yin.VM treats this break as a reversible projection. By delaying the collapse as long as possible and keeping the invariant intact, we allow the same foundation to build multiple independent structures. We preserve the beauty of the basis while enabling the utility of the break.

What Yin.VM Is Actually Claiming

Yin.VM is not claiming to be faster, smaller, or simpler. It is claiming something more basic: programming languages are views. The AST is the invariant. Compilation is the act of building specialized structure by breaking the symmetry of the invariant while preserving its semantic value.

Once you adopt that framing, multilingual input, distributed execution, and semantic mobility stop being features and start being consequences.

The Foundation of Invariance

Symmetry does not belong to objects. It belongs to relationships. Yin.VM is built on that premise. Everything else follows.

Related Reading: