A teaching playground for Error-Lang — the programming language where code breaks intentionally.
Error-Lang Playground provides a structured learning environment for Error-Lang, a teaching-first language designed to teach how compilers and interpreters work by making errors the curriculum.
Errors are features, not bugs. Every error has a lesson.
Traditional programming focuses on avoiding errors. Error-Lang embraces them:
-
Intentional error injection in designated "gutter" blocks
-
Stability score that decreases with each error
-
Curriculum-mapped error codes (E0001-E0010+)
-
Error-tolerant parsing that continues after failures
# Clone the playground
git clone https://github.com/hyperpolymath/error-lang-playground
cd error-lang-playground
# Setup (install ReScript)
just setup
# Build
just build
# Run your first level
just run-hello
# Or run any level
just run levels/02-smart-quotes.err
# Learn about an error code
just explain E0007The playground includes progressive learning levels:
| Level | Topic | Error Codes |
|---|---|---|
01 |
Hello World |
(none) |
02 |
Smart Quotes |
E0007 |
03 |
Unterminated Strings |
E0002 |
04 |
Escape Sequences |
E0003 |
05 |
Missing Block Terminators |
E0005 |
06 |
Unmatched Parentheses |
E0006 |
07 |
Illegal Characters |
E0004 |
08 |
Variables and Types |
(none) |
09 |
Operators |
(none) |
10 |
Gutter Mastery |
(all) |
Run just levels to see all available levels.
| Code | Description |
|---|---|
E0001 |
Unexpected token |
E0002 |
Unterminated string literal |
E0003 |
Invalid escape sequence |
E0004 |
Illegal character |
E0005 |
Missing 'end' keyword |
E0006 |
Unmatched parenthesis |
E0007 |
Smart quote detected |
E0008 |
Invalid identifier |
E0009 |
Reserved keyword misuse |
E0010 |
Whitespace issue |
Use just explain <code> for detailed explanations.
The gutter block is Error-Lang’s signature feature:
main
println("This always works")
gutter
# Errors may be injected here
let broken = "unterminated
end
println("This still runs!")
end-
Code inside
gutter…endis an "error zone" -
The compiler may inject random errors (based on seed)
-
Each error decreases the Stability Score
-
The compiler recovers and continues after
end
error-lang-playground/
├── compiler/
│ └── src/
│ ├── lexer/ # Tokenization
│ ├── parser/ # Syntax analysis
│ ├── types/ # Type definitions
│ └── errors/ # Error injection system
├── cli/
│ └── main.js # Deno CLI entry point
├── levels/ # Learning levels (*.err)
├── examples/ # Additional examples
├── docs/ # Documentation
├── tests/ # Test suite
├── rescript.json # ReScript config
├── deno.json # Deno config
└── justfile # Task runner# Run a program
error-lang run <file.err>
# Explain an error code
error-lang explain E0002
# List levels
error-lang levels
# Check environment
error-lang doctor
# Show help
error-lang help-
Compiler: ReScript (compiles to JavaScript)
-
CLI: Deno (TypeScript-free, Node-free runtime)
-
Documentation: AsciiDoc
-
Task Runner: just
This follows the Rhodium Standard Repositories language policy.
-
error-lang - The Error-Lang language specification and core implementation
See CONTRIBUTING.adoc for guidelines.