Programming Language · v3.1.36 · MIT Licensed

PeaLang

A production-grade, readable language for rules, data engineering, AI orchestration, enterprise automation and backend interoperability. PeaLang runs on a tree-walking interpreter or a portable bytecode VM, carries an optional static type system, and works alongside Python, Java, Rust, TypeScript and Go rather than replacing them.

3.1.36tagged release line
35 / 175guide chapters / lessons
29permissioned std.* modules
196global names
10generated host SDK targets
Why PeaLang

One readable layer across the whole stack

Enterprise logic is usually scattered across YAML policies, Python glue scripts, Java services, TypeScript clients and shell automation. PeaLang gives teams one reviewable scripting layer that can be embedded in a host application, executed in a capability sandbox, compiled to .peac bytecode, or exposed to other languages over a generated RPC client. It complements existing systems: keep your data platform, model runtime and service mesh, and put the decision logic in a language domain experts can read.

Data & analytics

Comprehensions, group_by, CSV/JSON IO, SQL over records and quality gates via std.analysis.

AI & LLM workflows

Reviewable prompt pipelines, tool permissioning, eval gates and deterministic retries for agent steps.

FinTech & risk

Structured errors with codes and context, precise numeric helpers and auditable rule functions.

Enterprise backend

web.app() routing, JSON responses, OpenAPI generation and service orchestration.

DevOps & CLI

File, path, regex, env and command helpers for local-first automation and log processing.

Systems interoperability

Native library calls, WASM artifacts, Python bridge stubs and generated host SDKs.

v3.1.36 at a glance

CapabilityWhat ships in the release lineWhere to go deeper
Structured errors v2Typed error(kind, message, code, cause, context), typed catch, trace frames and a stable error value schema.Production patterns
Generics v2 & protocolsStatic <T: Printable> bounds, inference, structural protocols and marker traits, erased before runtime.Type system
Iterators & async v2Explicit iter/next/has_next/peek, async function, await, concurrency.gather/timeout and structured task groups.Async & concurrency
Modules v2 & resource scopesQuoted module imports with aliases, using name = resource { ... } and bounded child scopes via scopes.*.Release notes
Safe metaprogrammingValidated safe macros expanded before bytecode compilation; no arbitrary code generation at runtime.CLI & projects
Packaging & workspacespea.toml, pea.lock, signed packages, registries, namespaces and multi-package pea.workspace.toml.Project structure

Version note: this product page documents the tagged v3.1.36 release line (Phase 68, resource scopes). The local repository now also carries tagged v3.1.39 (Phase 72, fast interpreter); the release notes record the full milestone history. The language specification version is tracked separately and need not match the product number.

A ten-line service

let app = web.app()

function home(req) {
  return web.json({"message": "Hello from PeaLang", "path": req["path"]})
}

function health(req) { return web.json({"status": "ok"}) }

app.get("/", home)
app.get("/health", health)
app.serve("127.0.0.1", 8080)

Run with pea run app.pea. Validate first with pea check app.pea; compile a portable artifact with pea compile app.pea.

Interop, precisely

PeaLang does not claim source-to-source translation of Python, Java, Rust or TypeScript into PeaLang. Interop is delivered through embedding, native calls, HTTP/RPC and generated clients/SDKs. This distinction matters when you design a production boundary.

EcosystemSupported directionMechanism
PythonPeaLang → Python calls; Python host → PeaLang runtimeinterop.call_python, import_python, bridge stubs, PeaRuntime
JavaHTTP service → generated Java client; Java host → runtimeinterop.generate_java, generated SDK sidecar
RustPeaLang functions → generated Rust SDK; native FFI availablepea sdk generate rust, interop.load_library/call_native
TypeScript / Node / browserPeaLang functions → typed TypeScript client; browser host via WASMinterop.generate_typescript, generated SDK, browser SDK
GoHTTP service → generated Go client; go_run from PeaLanginterop.generate_go, interop.go_run
Bytecode / WASMPeaLang source → .peac → PEAWASM artifactpea compile, pea wasm-build
Read the sourceZero to production