Universal Causal Language

TL;DR
Universal Causal Language (UCL)
is an experimental intermediate representation that treats every meaningful statement as a causal operation. The same JSON schema can encode a Ruby function call, an English sentence, a contract clause, a piano note, or a DNA transcription event.

UCL currently runs on three “substrates”: compiled to Ruby, simulated on a Brain VM, and interactively “executed” on your actual brain in Production mode. Some UCL programs are universal and can run on all three.

GitHub - ndbroadbent/universal_causal_language: Universal Causal IR (UCI)
Universal Causal IR (UCI). Contribute to ndbroadbent/universal_causal_language development by creating an account on GitHub.

I'm not an expert in any of these fields and this blog post might be completely wrong, or at least misguided. Please send me a DM or tag me on X with any improvements or corrections and I'll update it. And feel free to send a PR on GitHub.


Introduction

Cursor CEO Michael Truell recently said: “Our goal with Cursor is to invent a new type of programming. It looks like a world where you have a representation of the logic of your software that does look more like English.”

That vision echoes the motivation behind Universal Causal Language (UCL), an experimental intermediate representation that treats every meaningful statement as a causal operation. But not just the idea that you can write a program using English. The idea that English itself is a programming language.

UCL explores what might come after natural language programming: how we might encode intent and causality directly.

Language is code. Meaning is a state change. Any sentence, instruction, clause, or behavior can be represented as a structured causal operation that maps one world state to another. If that is true, we should be able to:

  • Represent diverse domains with one minimal schema
  • Preserve semantics during translation and compilation
  • Execute the same causal program on many different computational substrates
  • Write a causal program that executes in parallel across multiple substrates

From Electrons to Intent

If you trace the history of programming, it’s a chain of abstraction:

transistors  
→ logic gates (AND/OR/NOT/XOR)  
→ machine code  
→ assembly  
→ interpreter / JIT / compiler
→ programmin language  
→ AI coding agent  
→ natural language instructions  
→ ???

Each layer pushes human intent further from the physical substrate while increasing expressiveness. What comes next might be a system that models or captures your intent directly.

  • Thought-to-code: decoding brain activity or latent intent into structured logic.
  • Goal specification: defining outcomes (“build a tool that detects fraud and improves over time”) and letting the system infer the steps.
  • Context fusion: merging your domain, style, and constraints into a shared workspace of understanding.
  • Self-assembling systems: agents that not only code from goals but evolve their own architectures.

Prior Art

Cucumber

People have been writing code in "natural language" well before we started prompting AI coding agents with instructions. Cucumber can turn natural language text scenarios into tests that software can run.

Each step ("Given," "When," and "Then") maps human intent to machine actions.

UCL extends this idea beyond testing: it could be a universal intermediate representation that can encode any causal process in any domain.

UCL could even interoperate with Cucumber, or serve as the foundation (or intermediate representation) for a next-generation acceptance testing framework.

HyperTalk

HyperTalk was created for Apple in 1987 by Dan Winkler, and was used in conjunction with the HyperCard hypermedia program (now discontinued). It's another very early example of programs that resemble English sentences:

  put the value of card field "typehere" into theValue
  repeat with i = 1 to the number of card fields
    hide field i
  end repeat

Introduction to UCL

The Action schema

Each instruction is an Action:

{
  "actor": "String",
  "op": "Operation",
  "target": "String",
  "t": 0.0,
  "dur": 0.5,
  "params": { "k": "v" },
  "pre": "predicate",
  "post": "predicate",
  "effects": ["tags"]
}

Primitive ops cover CRUD, communication, logic, temporal, legal, biological, and programming operations.


Same schema, different domains

Natural language

“The cat is black.”

Can be translated to:

{ 
  "actor": "listener",
  "op": "StoreFact",
  "target": "memory",
  "params": {
    "entity": "the cat", 
    "color": "black"
  } 
}

Programming

result = 2 + 3
{
  "actor": "VM",
  "op": "Call",
  "target": "+",
  "params": { 
    "lhs": 2, 
    "rhs": 3, 
    "receiver": "a" 
  },
  "effects": ["CPU"]
}

Music

{
  "actor": "Piano1",
  "op": "Emit",
  "target": "Note",
  "t": 0.0,
  "dur": 0.5,
  "params": {
    "pitch": "C4",
    "velocity": 80
  },
  "effects": ["Audio"]
}

Legal

{
  "actor": "Buyer",
  "op": "Oblige",
  "target": "Buyer",
  "params": {
    "duty": "Pay",
    "amount": "1000 USD",
    "by": "Delivery+5d"
  },
  "pre": "Goods delivered and inspected",
  "effects": ["Legal"]
}

Biology

{
  "actor": "RNA_Polymerase_II",
  "op": "Transcribe",
  "target": "DNA:MYC",
  "params": {
    "product": "pre-mRNA:MYC",
    "location": "nucleus"
  },
  "pre": "Promoter accessible",
  "post": "Pre-mRNA synthesized",
  "effects": ["Bio", "Nucleus"]
}

Prototype Execution Environments

  1. Compile to Ruby
    Same causal logic, silicon runtime.
ucl run examples/hello_world.json --target ruby
  1. Brain VM (simulation)
    Executes UCL as cognitive operations. Tracks beliefs, working memory, emotions, thoughts, goals, and output. Unknown ops trigger a natural confusion response.
ucl brain examples/natural_language.json --verbose
  1. Production Brain (you)
    Interactive session where you execute each operation mentally, then report thoughts and emotions. It is a literal “human-as-runtime” mode.
ucl brain examples/brain_test.json --production

Universal Execution

multiply_universal.json - A single UCL program that can run on three execution environments.

The program:

  1. Generates a random number (A)
  2. Generates another random number (B)
  3. Multiplies them
  4. Outputs the result

This same "program" can run on multiple environments:

Running on Ruby VM:

A = rand(0..9)
B = rand(0..9)
result = A * B
puts result  # Output: 35 (varies each run)

Running on Brain Simulator:

🧠 Starting brain simulation...

Step 1: GenRandomInt - executor → A
  🎲 Generated: A = 7

Step 2: GenRandomInt - executor → B
  🎲 Generated: B = 8

Step 3: Write - executor → result
  🧮 Calculated: result = 56

Step 4: Emit - executor → result
  🗣️  Output: "56.0"

Running on "Production" Brain (aka a real human):

→ Think of a random number between 0 and 9
→ Remember it as 'A'
[You think: 7]

→ Calculate: A × B
→ Store the answer in: result
[You calculate: 7 × 4 = 28]

Output: "28"

Robotics and AI

UCL provides a single causal schema that can describe any process, from making a cup of tea to running a distributed system. This universality might make it especially powerful for robotics and AI.

Example: Making a Cup of Tea

A UCL program could be written that describes the causal sequence for preparing a cup of tea. (View the example program on GitHub.)

This same causal sequence could be executed across multiple substrates:

  • A human executing each step physically to record training data for an AI.
  • A mocked LLM (a simple interpreter with hard-coded rules) and a mocked robotic arm (a simple state machine), providing a foundation for causal unit tests.
  • A mocked LLM interacting with a virtual robotic arm in a 3D simulation.
  • A real LLM interacting with a virtual robotic arm in a 3D simulation.
  • Finally, a real LLM interacting with a robotic arm in the real world.

One UCL program running across many possible layers of abstraction, but each with their own purpose: transfer of knowledge (training data), fast feedback loops, or making an actual cup tea.

The causal structure remains identical; only the computational substrate changes, where various components are either mocked or simulated.


UCL Quick Start

# Build
cargo build --release

# Validate and inspect
ucl validate examples/natural_language.json
ucl display examples/music.json
ucl analyze examples/biology.json

# Compile and run on Ruby
ucl run examples/hello_world.json --target ruby

# Run on the Brain VM
ucl brain examples/natural_language.json --verbose

# Run on your actual brain
ucl brain examples/brain_test.json --production

# Demos
./demo.sh
./demo_advanced.sh

Use it as a library:

use ucl::{Action, Operation, Program};

let action = Action::new("VM", Operation::Call, "add")
    .with_time(0.0)
    .with_effects(vec!["CPU".to_string()]);

let mut program = Program::new();
program.add_action(action);

let json = program.to_json()?;
let parsed = Program::from_json(&json)?;

Possible use cases to explore

  • Train LLMs on UCL graphs to learn explicit cause-effect
  • Translate across domains: English → UCL → legal logic → smart contracts
  • Explainable AI via executable traces instead of opaque tokens
  • Cognitive research on working memory limits and execution time
  • Cross-substrate compilation: code, law, music, and biology

Possible Roadmap

  • Domain adapters for Python, JavaScript, MIDI, and contract templates
  • More targets: Python, JS, maybe a neural interpreter
  • Richer Brain VM: episodic memory, dreaming, planning
  • Visual editor and REPL
  • UCL datasets for model training
  • Tooling for visual editors, REPLs, and UCL-to-UCL translators

Try the elephant test

Run this example in --production mode and notice what happens to your actual thoughts and emotions as you StoreFact(elephant, {color: gray, size: large})

ucl brain examples/brain_test.json --production

Check out the code on GitHub

Repo: https://github.com/ndbroadbent/universal_causal_language
License: MIT

Issues, ideas, and PRs welcome.