- 1. The Vision
- 2. Core Principle: Consequence Amplification, Not Arbitrary Difficulty
- 3. The Stability Score: Quantifying Code Quality
- 4. Language Archaeology: Debugging as Exploration
- 5. Structured Loss: Decomposition Made Visible (Echo)
- 6. The Paradigm Shift
- 7. Real Programs, Real Power
- 8. The ReScript IDE: Archaeology Tools
- 9. Success Criteria
- 10. Non-Goals
- 11. The Ultimate Goal
"After Error-Lang, debugging becomes archaeology, not busywork."
Error-Lang is not designed to be hard. It’s designed to be educational through consequence amplification. Every design decision in programming has tradeoffs - most languages hide them. Error-Lang makes them visible, immediate, and measurable.
Traditional languages abstract away consequences: - Mutable state causes bugs far from mutation → hard to connect cause and effect - Type errors appear at runtime, distant from source → slow feedback - Performance cliffs are invisible until production → no learning opportunity - Memory leaks accumulate slowly → delayed consequences
Error-Lang amplifies consequences immediately: - Mutate state → stability drops instantly, affected code highlighted - Type mismatch → cascade visualized in real-time - O(n²) algorithm → performance penalty applied and explained - Memory leak → immediate feedback, not gradual degradation
Every Error-Lang program has a Stability Score (0-100):
Stability = Base(100) - Σ(Decision Costs)
Where Decision Costs include:
- Mutable state: -10 per mutation, -5 per reader
- Type instability: -15 per dynamic reassignment
- Null propagation: -20 per unchecked nullable
- Global state: -30 per global mutation
- Unhandled errors: -25 per unhandled failure path
- Algorithm complexity: -(time_ms / 10) for O(n²)+
- Memory leaks: -10 per KB leaked
- Race conditions: -40 per unsynchronized shared accessKey insight: High stability is not achieved by avoiding features - it’s achieved by understanding their costs and using them wisely.
Error-Lang contains intentional design contradictions that students must discover:
Keywords become identifiers based on context (depth, position, run number).
main
let end = 42 # 'end' is identifier here (depth 1)
println(end) # prints: 42
end # 'end' is keyword here (depth 0)Learning outcome: Context matters. Token meaning isn’t always fixed.
Operators behave differently based on file position.
main
let a = 1 + 2 # Line 2, col 13: Addition → 3
let b = 1 + 2 # Line 3, col 13: Concatenation → "12"
endLearning outcome: Position affects semantics. Code organization matters.
Variables exist in multiple types until "observed" (used).
main
let x = 42 # x is Int|String|Float (superposition)
println(x) # Collapses to String: "42"
endLearning outcome: Type inference is not magic - context determines types.
Variables leak out of scope on prime-numbered runs.
main
if true
let secret = "leaked"
end
println(secret) # Error on run #1,2,4,6,8...
# Works on run #3,5,7,11,13... (primes!)
endLearning outcome: Scope rules are conventions, not laws of physics.
The contradictions above show meaning decaying. Echo types show information decaying — but deliberately, observably, and irreversibly.
Error-Lang is a dissembling, decompositional language: programs, syntax, semantics, and types can decay or destabilise, and the language exposes that decomposition rather than hiding it. Echo gives that idea a first-class shape:
| Form | Meaning |
|---|---|
|
a retained witness |
|
the residue after irreversible erasure — the witness is gone, only the output survives |
|
the explicit decomposition step that destroys the witness and debits stability |
The governing invariant is decomposition must be visible: echo_to_residue
is never a silent cast, EchoR is not an Echo with a missing field, and the
stability debit (consequence amplification, applied via the [Stab-Erase] rule)
is never hidden. A learner should be able to see the exact moment structured loss
becomes non-recoverable residue.
Learning outcome: Loss can be structured — but structure is not free, and the type system refuses to let you pretend the residue is still recoverable.
See docs/Echo-Decomposition.adoc for the full narrative and the three
decomposition planes (syntactic, semantic/runtime, type-checking), and
spec/type-system.md §7 for the formal rules.
After Error-Lang, students will think differently:
❌ Before: "Ugh, another error to fix…" ✅ After: "This error reveals a design flaw - let me trace the root cause"
❌ Before: "Variables hold values" ✅ After: "State creates dependencies. Minimize it, contain it, make it explicit"
❌ Before: "Types are annotations the compiler wants" ✅ After: "Types are contracts that prevent entire classes of errors"
❌ Before: "Make it work, then optimize" ✅ After: "Algorithm choice IS design. O(n²) vs O(n) is not a micro-optimization"
Error-Lang is Turing-complete and fully featured:
-
✓ Async/await for concurrent programming
-
✓ Pattern matching for control flow
-
✓ First-class functions and closures
-
✓ Generics and type parameters
-
✓ Modules and namespaces
-
✓ FFI for calling other languages
-
✓ Standard library (collections, I/O, networking)
You can build: - Web servers - Compilers - Games - CLI tools - Data processors - GUIs
The difference: You’ll understand WHY your code works, not just THAT it works.
The tooling makes invisible things visible:
"Your code has stability 60. Here’s the same logic with stability 100."
A student has "completed" Error-Lang when:
-
They can write programs with 95+ stability consistently
-
They understand the tradeoffs of mutability, typing, async, memory management
-
They debug by reasoning about causality, not trial-and-error
-
They see errors as information, not obstacles
-
They’ve had the "paradigm shift" moment
Error-Lang is NOT:
-
❌ A production language (it’s pedagogical)
-
❌ Designed to be easy (it’s designed to teach)
-
❌ Arbitrary difficulty (every challenge has a lesson)
-
❌ A puzzle language like Malbolge (it’s practical and powerful)
"After Error-Lang, you’ll never look at a stack trace the same way. You’ll see debugging as intellectual archaeology - uncovering layers of causality, understanding systems, connecting means to ends. You might not love debugging, but you’ll respect it as the craft it is."
Error-Lang: Where errors are not bugs - they’re lessons waiting to be discovered.