Learning Guide
Mastering PeaLang
The complete, open learning guide for PeaLang — 210,511 words across 35 chapters and 161 lessons. Start at Orientation and Setup, or jump to the part you need. Every lesson ends with guided practice, a hands-on lab, review questions and an applied challenge — designed to be worked through, not skimmed.
Guide v1.1 · updated for PeaLang v2.3.0 · 210,511 words · 35 chapters · 161 lessons
Guide currency: the core text was written against PeaLang v0.63; the runtime is now at v2.3.0 (Nov 2026). Part V — The Modern Experience Layer covers everything added since: Chapter 27 (ergonomics), 28 (web), 29 (analysis/stats), 30 (DX tooling), 31 (host bindings & SDKs), 32 (v2 VM), 33 (supply-chain & performance, v2.1.0), 34 (JIT, v2.2.0), 35 (AI/ML primitives, v2.3.0). Version-difference callouts throughout flag behavior that changed.
Part I — Foundations
- Lesson 1: What PeaLang Is—Design Goals, Use Cases, and Safe Extensibility 7 min
- Lesson 2: Installing and Verifying the Toolchain 7 min
- Lesson 3: The Command-Line Workflow—Run, REPL, Format, Check, Docs, Debug, and DAP 8 min
- Lesson 4: Your First .pea Program 6 min
- Chapter 1 Checkpoint: Build and Run a Small Command-Line Rules Program 6 min
7,695 words · 5 lessons · Chapter overview →
- Lesson 1: Source Files, Lexical Structure, Comments, Identifiers, and Literals 10 min
- Lesson 2: Values, Variables, let, const, Assignment, and Scope 9 min
- Lesson 3: Operators, Expressions, Precedence, and Evaluation 8 min
- Lesson 4: Input, Output, String Interpolation, and Basic Diagnostics 7 min
- Chapter 2 Checkpoint: Unit Converter 5 min
8,595 words · 5 lessons · Chapter overview →
- Lesson 1: Boolean Logic and Conditional Branches 9 min
- Lesson 2: while Loops and Loop Invariants 8 min
- Lesson 3: for Loops, Ranges, and Collection Iteration 9 min
- Lesson 4: break, continue, Nesting, and Defensive Termination 8 min
- Chapter 3 Checkpoint: Validation and Scoring Engine 8 min
9,093 words · 5 lessons · Chapter overview →
- Lesson 1: Declaring and Calling Functions 8 min
- Lesson 2: Parameters, Return Values, Defaults, and Reusable Contracts 9 min
- Lesson 3: Local Scope, Closures, and Higher-Order Patterns 10 min
- Lesson 4: Decomposition, Naming, and Error-Resistant Design 10 min
- Chapter 4 Checkpoint: Modular Pricing Rules Library 7 min
9,653 words · 5 lessons · Chapter overview →
- Lesson 1: null, Booleans, Numbers, Strings, Lists, and String-Keyed Maps 10 min
- Lesson 2: Indexing, Slicing, Mutation, Copying, and Equality 10 min
- Lesson 3: Traversal, Transformation, Filtering, and Aggregation 10 min
- Lesson 4: Portable-Value Boundaries Between PeaLang and Hosts 8 min
- Chapter 5 Checkpoint: Inventory Analyzer 8 min
10,247 words · 5 lessons · Chapter overview →
Part II — Intermediate Development
- Lesson 1: Failure Categories and Useful Error Messages 10 min
- Lesson 2: Structured Exception Handling and Recovery 10 min
- Lesson 3: Assertions, Invariants, and Boundary Validation 10 min
- Lesson 4: Debugging with the CLI, Debugger, and Debug Adapter Protocol 10 min
- Chapter 6 Checkpoint: Fault-Tolerant Import Processor 8 min
10,514 words · 5 lessons · Chapter overview →
- Lesson 1: Variable, Parameter, and Return Annotations 7 min
- Lesson 2: Inference, Compatibility, and Gradual Adoption 9 min
- Lesson 3: Generics and Substitution 8 min
- Lesson 4: Structural Protocols and Project-Wide Contracts 8 min
- Lesson 5: Option, Result, and Future Types 9 min
- Lesson 6: Flow-Aware Semantic Checks and Type-Checking Commands 8 min
- Chapter 7 Checkpoint: Typed Employee-Rules Service 6 min
12,123 words · 7 lessons · Chapter overview →
- Lesson 1: Stable std Namespace and Compatibility Conventions 8 min
- Lesson 2: Collections, Strings, Mathematics, and Date-Time Operations 13 min
- Lesson 3: JSON, CSV, and Regular Expressions 11 min
- Lesson 4: Files, Paths, HTTP, Cryptography, Logging, Testing, and Concurrency 10 min
- Lesson 5: Capability Permissions and Safe Usage Patterns 5 min
- Chapter 8 Checkpoint: Permission-Aware Data Utility 5 min
11,625 words · 6 lessons · Chapter overview →
- Lesson 1: Module Boundaries, Imports, Exports, and Initialization 6 min
- Lesson 2: Cross-Module Contracts and Dependency Direction 6 min
- Lesson 3: Project Layout, Configuration, and Documentation 6 min
- Lesson 4: Formatting, Checking, and Maintainability Conventions 7 min
- Chapter 9 Checkpoint: Multi-Module Business-Rules Project 6 min
6,570 words · 5 lessons · Chapter overview →
- Lesson 1: Native Test Syntax and Expectations 7 min
- Lesson 2: Filtering, Watch Mode, and Coverage Baselines 9 min
- Lesson 3: Fixtures, Deterministic Tests, and Boundary Cases 8 min
- Lesson 4: Interpreter/VM Differential Testing, Fuzzing, and Conformance 9 min
- Lesson 5: Performance Gates and Regression Prevention 8 min
- Chapter 10 Checkpoint: Production-Grade Test Suite 9 min
10,826 words · 6 lessons · Chapter overview →
- Lesson 1: pea.toml Manifests and Semantic-Version Constraints 9 min
- Lesson 2: Deterministic Locks and Reproducible Builds 9 min
- Lesson 3: Local, Git, and Registry Sources 6 min
- Lesson 4: Permission Manifests, Archives, Installation, and Auditing 5 min
- Lesson 5: Checksums, Signatures, Trusted Keys, and Registry Policy 4 min
- Chapter 11 Checkpoint: Publish and Consume a Signed Package 4 min
7,968 words · 6 lessons · Chapter overview →
Part III — Advanced Systems
- Lesson 1: From Source Text to Tokens, Syntax Trees, and Semantic Checks 5 min
- Lesson 2: Tree-Walking Interpretation 5 min
- Lesson 3: Stack Bytecode, Constants, Code Objects, and Instructions 5 min
- Lesson 4: PEAC Format, Versioning, Validation, and Portability 5 min
- Lesson 5: VM Execution, Stack Behavior, Calls, Closures, Modules, and Exceptions 5 min
- Lesson 6: Disassembly, Profiling, and Execution Comparison 4 min
- Chapter 12 Checkpoint: Inspect and Optimize Compiled Execution 4 min
7,291 words · 7 lessons · Chapter overview →
- Lesson 1: async Functions, await, and Cooperative Suspension 5 min
- Lesson 2: Host Awaitables and Asynchronous Boundaries 4 min
- Lesson 3: Cancellation Tokens, Scopes, Deadlines, and Propagation 4 min
- Lesson 4: Task Groups, Structured Gathering, and Failure Handling 4 min
- Chapter 13 Checkpoint: Bounded Concurrent Workflow 3 min
4,522 words · 5 lessons · Chapter overview →
- Lesson 1: Capability-Safe Execution and Least Privilege 4 min
- Lesson 2: Time, Instruction, Memory, Recursion, Stack, Collection, Output, HTTP, and File-Read Limits 4 min
- Lesson 3: Resource Budgets, Snapshots, and Auditability 8 min
- Lesson 4: Running Untrusted Scripts Safely 11 min
- Chapter 14 Checkpoint: Hardened Policy Sandbox 16 min
9,535 words · 5 lessons · Chapter overview →
- Lesson 1: Embedding Architecture and Exported-Function Contracts 9 min
- Lesson 2: Python Host Integration and Boundary Validation 7 min
- Lesson 3: Java 17 Sidecar Runtime and Client 8 min
- Lesson 4: TypeScript Client and React Integration 7 min
- Lesson 5: FastAPI Integration Patterns 16 min
- Lesson 6: Typed Embedding Contracts and Host-Specific Object Conversion 18 min
- Chapter 15 Checkpoint: Polyglot Extension Service 17 min
18,013 words · 7 lessons · Chapter overview →
- Lesson 1: DataType, Field, Schema, DataFrame, and LazyFrame 12 min
- Lesson 2: Schema Inference and CSV, JSON, and JSONL Interchange 17 min
- Lesson 3: Select, Filter, Calculated Columns, Drop, Rename, Sort, Limit, and Distinct 11 min
- Lesson 4: Joins, Grouped Aggregations, Nulls, Pivots, Unpivots, and Windows 12 min
- Lesson 5: Lazy Execution and Dependency-Light Design 4 min
- Chapter 16 Checkpoint: Reusable Analytics Pipeline 3 min
13,085 words · 6 lessons · Chapter overview →
- Lesson 1: SQLite and Optional Database Adapter Contracts 8 min
- Lesson 2: Parameterized Queries, Transactions, Discovery, Batch Inserts, and Upserts 8 min
- Lesson 3: Connector SDK, Transport Injection, Retries, Errors, and Pagination 7 min
- Lesson 4: REST, GraphQL, OData, SFTP, Microsoft Graph, and SharePoint 7 min
- Lesson 5: Object Storage Across S3, Azure, and Google Cloud 5 min
- Lesson 6: Secret Providers, Token Caching, Health Checks, and Certification 5 min
- Chapter 17 Checkpoint: Secure Multi-Source Ingestion Service 3 min
9,376 words · 7 lessons · Chapter overview →
- Lesson 1: Date Features, Resampling, Lag, Lead, Differences, and Percentage Change 9 min
- Lesson 2: Rolling, Expanding, and Exponentially Weighted Statistics 7 min
- Lesson 3: Interpolation, Grouped Analysis, and Seasonal Decomposition 7 min
- Lesson 4: Train/Test Splits and Error Metrics 7 min
- Lesson 5: Trend, Moving-Average, and Exponential-Smoothing Baselines 7 min
- Lesson 6: Grouped Forecasts, Confidence Bands, and Chart-Ready Output 8 min
- Chapter 18 Checkpoint: Monitored Demand Forecast 3 min
10,501 words · 7 lessons · Chapter overview →
Part IV — Expert Production Engineering
- Lesson 1: Seeded Splits, Preprocessing, Scaling, Imputation, and Encoding 8 min
- Lesson 2: Linear and Logistic Regression 7 min
- Lesson 3: Regression and Classification Metrics 6 min
- Lesson 4: Cross-Validation, Regularization, and Hyperparameter Search 6 min
- Lesson 5: Multiclass Classification, Calibration, and Threshold Selection 7 min
- Lesson 6: Pipelines, Persistence, Schema Validation, and Reproducibility 6 min
- Chapter 19 Checkpoint: Reproducible Classification Pipeline 3 min
9,333 words · 7 lessons · Chapter overview →
- Lesson 1: Integrity-Checked Model Bundles and Registries 5 min
- Lesson 2: Lifecycle States, Promotion, Canary Routing, and Rollback 5 min
- Lesson 3: Prediction Audits, Monitoring Stores, and Structured Logs 5 min
- Lesson 4: Drift, Fairness Diagnostics, Alerting, and Acknowledgement 6 min
- Lesson 5: Model Cards, Intended Use, Limitations, and Governance Review 5 min
- Lesson 6: Secure Serialization, Signing, Encryption, and Key Handling 5 min
- Chapter 20 Checkpoint: Governed Model Release 3 min
7,400 words · 7 lessons · Chapter overview →
- Lesson 1: Portable Pipeline Loading and Serving Commands 4 min
- Lesson 2: Authentication, Request Bounds, Concurrency, Timeouts, and Rate Limits 2 min
- Lesson 3: Liveness, Readiness, Metrics, Tracing, and Audit Retention 2 min
- Lesson 4: Graceful Reloads, Deployment Plans, and Automatic Rollback 2 min
- Lesson 5: Distributed Limits, Shared State, Deterministic Routing, and Load Testing 2 min
- Chapter 21 Checkpoint: Resilient Prediction Service 1 min
2,680 words · 6 lessons · Chapter overview →
- Lesson 1: Deployment, Service, Autoscaling, and Monitoring Resources 2 min
- Lesson 2: Non-Root Execution, Read-Only Filesystems, seccomp, and Dropped Capabilities 2 min
- Lesson 3: Network Policies, Disruption Budgets, Topology Spread, and Anti-Affinity 2 min
- Lesson 4: Graceful Drain, Manifest Validation, Soak Testing, and Operational Adaptation 2 min
- Chapter 22 Checkpoint: Secure Production Deployment 1 min
1,725 words · 5 lessons · Chapter overview →
- Lesson 1: Browser-Safe Capabilities and Execution Constraints 2 min
- Lesson 2: WASM v1 Containers and PeaLang Custom Sections 2 min
- Lesson 3: Building and Inspecting Artifacts 2 min
- Lesson 4: Browser SDK Integration and Secure Defaults 2 min
- Lesson 5: Preview Limitations and Portability Strategy 2 min
- Chapter 23 Checkpoint: Browser-Hosted Rules Demo 1 min
2,004 words · 6 lessons · Chapter overview →
- Lesson 1: API Stability, Deprecation, Compatibility, and Semantic Versioning 2 min
- Lesson 2: Source Inventory, Release Manifests, Hashes, and Reproducible Evidence 2 min
- Lesson 3: SBOMs, Provenance, Checksums, Dependency and License Review 2 min
- Lesson 4: Cross-Platform CI, Conformance Gates, and Release-Candidate Validation 2 min
- Lesson 5: Migration Planning, Smoke Testing, Backups, and Rollback 2 min
- Lesson 6: Threat Modeling and External Release Gates 2 min
- Chapter 24 Checkpoint: Auditable Release Candidate 1 min
2,320 words · 7 lessons · Chapter overview →
- Lesson 1: Lexer, Parser, Syntax Tree, Semantic Pass, and Compiler Architecture 2 min
- Lesson 2: Interpreter and VM Implementation Boundaries 2 min
- Lesson 3: Extending Syntax Without Breaking Compatibility 1 min
- Lesson 4: Adding Standard-Library Capabilities Safely 2 min
- Lesson 5: Testing Language Changes Across Engines and Hosts 2 min
- Lesson 6: Documentation, Migration Notes, and Contribution Discipline 2 min
- Chapter 25 Checkpoint: Implement and Validate a Language Enhancement 1 min
2,306 words · 7 lessons · Chapter overview →
- Lesson 1: Architecture Brief and Threat Model 1 min
- Lesson 2: Typed Multi-Module PeaLang Application 2 min
- Lesson 3: Data Ingestion, Analytics, and Optional ML Pipeline 2 min
- Lesson 4: Secure Package and Reproducible Build 2 min
- Lesson 5: Embedded or Sidecar Integration 2 min
- Lesson 6: Observed, Resilient, Cloud-Native Deployment 2 min
2,046 words · 6 lessons · Chapter overview →
Part V — The Modern Experience Layer
- Comprehensions and match expressions
- Optional chaining, null coalescing and destructuring
- The modern builtin toolkit
New · 3 lessons
- Routing, request helpers and responses
- Validation, auth, rate limiting and security headers
- OpenAPI 3.0 generation and typed SDKs
New · 3 lessons
- Profiling, cleaning, joining and reshaping
- SQL over records, reports and charts
New · 2 lessons
- The language server and editor tooling
- Formatter, linter, codemods and scaffolding
New · 2 lessons
- Generating Python, TypeScript and Java exports
- React hooks, data grids and OpenAPI import
New · 2 lessons
- Signed packages, SBOMs and provenance
- Caches, connection pools, profiling and fast hashing
New · 2 lessons
- Tracing, unrolling and strength reduction
- A numerics fast path you can actually use
New · 2 lessons
- Tokenization, embeddings and attention in PeaLang
- AutoML random search and ONNX export
New · 2 lessons
- Constant folding, loop unrolling and bytecode v2
- The 1.0 gate and what to re-verify in your projects
New · 2 lessons
Appendices (syntax quick reference, CLI reference, standard-library module map, type-system reference, bytecode reference, playbooks) are in preparation and will land here as they are approved. Foundations are complete.