llm-as-computerlisted
Install: claude install-skill oaustegard/claude-skills
# LLM-as-Computer: Compiled Transformer Stack Machine
A working computer built from transformer primitives. Every instruction fetch and stack read
is a parabolic attention head (dot-product → argmax → value extraction). The transformer's
weights ARE the interpreter — compiled analytically, not trained.
## What This Proves
Attention is lookup; feed-forward is routing. A vanilla transformer with compiled weights
can execute arbitrary programs: loops, recursion, arithmetic, memory access. 55 opcodes
covering WASM i32 semantics. 21M+ steps/second via the Mojo executor.
## Setup (once per session)
```bash
cd /mnt/skills/user/llm-as-computer/src && bash setup.sh
```
This installs Mojo (~20s) and compiles the executor binary (~6s). If Mojo is unavailable,
the skill falls back to a pure-Python executor (slower but functional).
## Usage
```python
import sys
sys.path.insert(0, '/mnt/skills/user/llm-as-computer/src')
from programs import make_fibonacci, make_factorial, make_gcd, make_multiply
from runner import run, setup
# Ensure Mojo is compiled (idempotent)
setup()
# Run a program — shows instructions, trace, result
prog, expected = make_fibonacci(10)
print(run(prog))
# Benchmark mode — measures throughput
print(run(prog, benchmark=True, repeat=200))
```
## Available Programs
From `programs.py` — all return `(program, expected_result)`:
| Generator | Description | Example |
|-----------|-------------|---------|
| `make_fibonacci(n)` | Iterative fib via SWAP+OVER+ADD+RO