Language Learning Protocol
5-Phase Protocol
| Phase |
Duration |
Goal |
Key Deliverables |
| 1. Exploration |
30 min |
Run first program |
Hello World, build system, basic syntax |
| 2. Patterns |
1-2 hr |
Map to known equivalents |
Comparison table, pattern mapping |
| 3. Ecosystem |
1 hr |
Set up toolchain |
Package manager, test framework, linter, LSP |
| 4. Idioms |
2-3 hr |
Learn community conventions |
Style guide notes, anti-patterns list |
| 5. Production |
Ongoing |
Ship production code |
Logging, monitoring, deployment, security |
Target: Zero to implementing small features in < 4 hours.
Run scripts/new-language.sh with the target language to execute interactively.
Phase 1: Exploration Checklist
Phase 2: Pattern Mapping
Complete this comparison for the new language:
| Concept |
Python |
JavaScript |
Go |
New Language |
| Variables |
x = 5 |
let x = 5 |
x := 5 |
? |
| Constants |
X = 5 |
const X = 5 |
const X = 5 |
? |
| Functions |
def f(): |
function f() |
func f() |
? |
| Error handling |
try/except |
try/catch |
if err != nil |
? |
| Null safety |
None |
null/undefined |
nil |
? |
| Iteration |
for x in list: |
list.forEach() |
for _, x := range |
? |
| Collections |
list, dict |
Array, Object |
slice, map |
? |
| Types/Classes |
class Foo: |
class Foo |
type Foo struct |
? |
| Imports |
import foo |
import foo from |
import "foo" |
? |
| Testing |
pytest |
jest |
go test |
? |
| Packages |
pip |
npm |
go mod |
? |
For each concept, ask: "What's the equivalent in languages I know?"
Phase 3: Ecosystem Setup
identify:
package_manager: cargo | go mod | npm | pip | ...
test_framework: built-in or external, conventions
linter_formatter: clippy/rustfmt | golint/gofmt | eslint/prettier | ...
lsp_server: name, IDE integration
Ecosystem checklist:
Phase 4: Idioms
- Read official style guide
- Study standard library patterns
- Review top 5 popular GitHub projects
- Capture anti-patterns from linter warnings
Phase 5: Production Readiness
Paradigm Recognition
Language Analysis
|
+-- Object-Oriented (Java, C#, Python, Ruby)
| Classes, inheritance, polymorphism
|
+-- Functional (Haskell, Elixir, Clojure, Scala)
| First-class functions, immutability
|
+-- Procedural (C, Go, Pascal)
| Functions as primary unit, explicit state
|
+-- Multi-Paradigm (Python, Rust, JavaScript, Kotlin)
| Developer chooses approach
|
+-- Declarative (SQL, HTML, CSS, Terraform)
Describe WHAT, not HOW
Quick Reference Template
For every new language, produce:
# [Language] Quick Reference
## Setup — install, project init, run, test commands
## Basics — variables, functions, control flow, errors
## Patterns — map, filter, reduce, null handling, async
## Ecosystem — package manager, testing, linting, formatting
## Idioms — language-specific best practices
## Anti-Patterns — common mistakes to avoid
## Resources — official docs, style guide, community
See references/learning-templates.md for full template.
Knowledge Transfer Format
knowledge_transfer:
language: "[Name]"
paradigm: "[OOP | FP | Procedural | Multi | Declarative]"
quick_reference: "[path to cheat sheet]"
gotchas:
- "Common mistake 1"
- "Common mistake 2"
production_notes:
- "Deployment consideration"
- "Performance characteristic"
confidence_level: "beginner | intermediate | proficient"
Learning Velocity Targets
| Metric |
Target |
| Hello World running |
< 30 min |
| Basic patterns mapped |
< 90 min |
| Ecosystem set up, tests passing |
< 3 hr |
| First real feature implemented |
< 4 hr |
| Pattern recognition accuracy |
> 85% |
| Anti-pattern avoidance (first 10 implementations) |
> 80% |
When NOT to Learn Everything
Decision Criteria
Learn what the task requires. Skip the rest until needed.
| Task |
Learn |
Skip (for now) |
| REST API in Go |
HTTP server, routing, JSON, errors, testing |
Generics, reflection, cgo |
| CLI tool in Rust |
Clap, file I/O, error handling |
Unsafe, macros, async |
| Data pipeline in Elixir |
GenServer, streams, Ecto |
NIFs, distributed Erlang |
Progressive Depth
| Layer |
Timeframe |
Scope |
| 1 |
Day 1 |
Core syntax, basic patterns |
| 2 |
Week 1 |
Ecosystem, idioms, testing |
| 3 |
Month 1 |
Advanced features, performance |
| 4 |
Month 3+ |
Internals, contributing |
Most tasks require Layer 1-2 only.
Reference Files
references/language-comparison-matrices.md - Comparison tables across 10+ languages
references/learning-templates.md - Setup scripts, quick reference templates
references/phase-guides.md - Detailed guides for each learning phase
scripts/new-language.sh - Interactive learning protocol script
1---2name: language-learning3description: Guides rapid acquisition of new programming languages, frameworks, and paradigms through a structured 5-phase protocol. ALWAYS trigger on "learn Rust", "learn Go", "new language", "pick up a language", "never used X before", "getting started with", "how does X work", "teach me Y", "unfamiliar technology", "language comparison", "evaluate language", "switch to X", "polyglot", "first time using". Use when encountering unfamiliar technology, evaluating language choices, or onboarding to a new stack. Delegates to Polyglot agent for execution.4---5<!-- Last reviewed: 2026-03 -->67# Language Learning Protocol89## 5-Phase Protocol1011| Phase | Duration | Goal | Key Deliverables |12|-------|----------|------|-----------------|13| 1. Exploration | 30 min | Run first program | Hello World, build system, basic syntax |14| 2. Patterns | 1-2 hr | Map to known equivalents | Comparison table, pattern mapping |15| 3. Ecosystem | 1 hr | Set up toolchain | Package manager, test framework, linter, LSP |16| 4. Idioms | 2-3 hr | Learn community conventions | Style guide notes, anti-patterns list |17| 5. Production | Ongoing | Ship production code | Logging, monitoring, deployment, security |1819**Target**: Zero to implementing small features in < 4 hours.2021Run `scripts/new-language.sh` with the target language to execute interactively.2223## Phase 1: Exploration Checklist2425- [ ] Install toolchain (compiler/interpreter/runtime)26- [ ] Hello World builds and runs27- [ ] Variable declaration (mutable vs immutable)28- [ ] Function definition and calling29- [ ] Control flow (if, for, match/switch)30- [ ] Error handling mechanism identified31- [ ] Entry point convention understood3233## Phase 2: Pattern Mapping3435Complete this comparison for the new language:3637| Concept | Python | JavaScript | Go | New Language |38|---------|--------|------------|-----|-------------|39| Variables | `x = 5` | `let x = 5` | `x := 5` | ? |40| Constants | `X = 5` | `const X = 5` | `const X = 5` | ? |41| Functions | `def f():` | `function f()` | `func f()` | ? |42| Error handling | `try/except` | `try/catch` | `if err != nil` | ? |43| Null safety | `None` | `null/undefined` | `nil` | ? |44| Iteration | `for x in list:` | `list.forEach()` | `for _, x := range` | ? |45| Collections | `list, dict` | `Array, Object` | `slice, map` | ? |46| Types/Classes | `class Foo:` | `class Foo` | `type Foo struct` | ? |47| Imports | `import foo` | `import foo from` | `import "foo"` | ? |48| Testing | `pytest` | `jest` | `go test` | ? |49| Packages | `pip` | `npm` | `go mod` | ? |5051For each concept, ask: "What's the equivalent in languages I know?"5253## Phase 3: Ecosystem Setup5455```yaml56identify:57 package_manager: cargo | go mod | npm | pip | ...58 test_framework: built-in or external, conventions59 linter_formatter: clippy/rustfmt | golint/gofmt | eslint/prettier | ...60 lsp_server: name, IDE integration61```6263Ecosystem checklist:64- [ ] Package manager configured65- [ ] Can write, run, and get coverage for tests66- [ ] Linter and formatter installed67- [ ] IDE autocomplete working68- [ ] Official docs bookmarked6970## Phase 4: Idioms71721. Read official style guide732. Study standard library patterns743. Review top 5 popular GitHub projects754. Capture anti-patterns from linter warnings7677## Phase 5: Production Readiness7879- [ ] Structured logging configured80- [ ] Error handling comprehensive81- [ ] Graceful shutdown implemented82- [ ] Health check endpoint83- [ ] Metrics/monitoring integrated84- [ ] Configuration externalized85- [ ] Secrets management configured86- [ ] Resource limits set87- [ ] Deployment documented88- [ ] Rollback procedure defined8990## Paradigm Recognition9192```93Language Analysis94|95+-- Object-Oriented (Java, C#, Python, Ruby)96| Classes, inheritance, polymorphism97|98+-- Functional (Haskell, Elixir, Clojure, Scala)99| First-class functions, immutability100|101+-- Procedural (C, Go, Pascal)102| Functions as primary unit, explicit state103|104+-- Multi-Paradigm (Python, Rust, JavaScript, Kotlin)105| Developer chooses approach106|107+-- Declarative (SQL, HTML, CSS, Terraform)108 Describe WHAT, not HOW109```110111## Quick Reference Template112113For every new language, produce:114115```markdown116# [Language] Quick Reference117## Setup — install, project init, run, test commands118## Basics — variables, functions, control flow, errors119## Patterns — map, filter, reduce, null handling, async120## Ecosystem — package manager, testing, linting, formatting121## Idioms — language-specific best practices122## Anti-Patterns — common mistakes to avoid123## Resources — official docs, style guide, community124```125126See `references/learning-templates.md` for full template.127128## Knowledge Transfer Format129130```yaml131knowledge_transfer:132 language: "[Name]"133 paradigm: "[OOP | FP | Procedural | Multi | Declarative]"134 quick_reference: "[path to cheat sheet]"135 gotchas:136 - "Common mistake 1"137 - "Common mistake 2"138 production_notes:139 - "Deployment consideration"140 - "Performance characteristic"141 confidence_level: "beginner | intermediate | proficient"142```143144## Learning Velocity Targets145146| Metric | Target |147|--------|--------|148| Hello World running | < 30 min |149| Basic patterns mapped | < 90 min |150| Ecosystem set up, tests passing | < 3 hr |151| First real feature implemented | < 4 hr |152| Pattern recognition accuracy | > 85% |153| Anti-pattern avoidance (first 10 implementations) | > 80% |154155## When NOT to Learn Everything156157### Decision Criteria158159Learn what the task requires. Skip the rest until needed.160161| Task | Learn | Skip (for now) |162|------|-------|----------------|163| REST API in Go | HTTP server, routing, JSON, errors, testing | Generics, reflection, cgo |164| CLI tool in Rust | Clap, file I/O, error handling | Unsafe, macros, async |165| Data pipeline in Elixir | GenServer, streams, Ecto | NIFs, distributed Erlang |166167### Progressive Depth168169| Layer | Timeframe | Scope |170|-------|-----------|-------|171| 1 | Day 1 | Core syntax, basic patterns |172| 2 | Week 1 | Ecosystem, idioms, testing |173| 3 | Month 1 | Advanced features, performance |174| 4 | Month 3+ | Internals, contributing |175176Most tasks require Layer 1-2 only.177178## Reference Files179180- `references/language-comparison-matrices.md` - Comparison tables across 10+ languages181- `references/learning-templates.md` - Setup scripts, quick reference templates182- `references/phase-guides.md` - Detailed guides for each learning phase183- `scripts/new-language.sh` - Interactive learning protocol script