Specification

The law of Universlang. Any implementation deviating from this specification is non-conformant.

1. IR Structure
{
  "version": "1.0",
  "type": "Program",
  "body": [
    {
      "type": "ExpressionStatement",
      "opcode": "CALL",
      "args": [...]
    }
  ]
}

The IR is a JSON-based abstract syntax tree with deterministic opcodes. Each node has a type, opcode, and arguments. No interpretation layer exists between IR and execution.

2. Opcode Table
OpcodeSemanticsArity
CALLFunction invocation1+
BINDVariable declaration2
GETValue retrieval1
SETValue assignment2
LAMBDAFunction definition2
3. Validation Rules (P1–P5)
P1:Type consistency — All operations must respect declared types. No implicit coercion.
P2:Scope integrity — Variables must be declared before use within their scope.
P3:Arity matching — Function calls must provide exact argument count.
P4:Immutability — IR nodes cannot be modified after generation.
P5:Determinism — Same IR must produce identical output across all backends.
4. Determinism Guarantee

Given identical IR input, all conformant backends must produce:

  • • Identical semantic output
  • • Identical execution order
  • • Identical error states
  • • Identical hash fingerprint

This guarantee is mathematically enforced through the opcode semantics and validation rules.

5. What is Forbidden

The following are explicitly prohibited:

  • • Backend-specific optimizations that alter semantics
  • • Type coercion or implicit conversions
  • • Custom opcodes or extensions
  • • Interpretation layers above IR
  • • Non-deterministic execution paths

Any implementation deviating from this specification is non-conformant.