PeaLang · v0.99.6 / 1.0.0-experience

The embeddable language for rules, data and automation you can actually trust in production

PeaLang is a readable, capability-safe language and portable execution environment for business rules, data workflows, integrations and AI pipelines — designed to sit inside your applications, not replace them.

26chapters in the guide
209kwords of documentation
500+conformance tests
4host ecosystems (Python, Java, TypeScript, browser)
let name = "PeaLang"
print "Hello " + name

fn discount(tier, subtotal) {
  if tier == "gold" and subtotal > 1000 {
    return 0.15
  }
  return 0.05
}

print discount("gold", 1250)   # 0.15

Real PeaLang. No ceremony required.

Why PeaLang exists

Most teams reach for a heavyweight host language to express a five-line business rule. PeaLang is the alternative: a small, readable language with an embeddable runtime, hard resource limits and capabilities granted by the host — so policy code can live close to your product without becoming a supply-chain risk.

Capability-safe embedding

The host decides what a script can touch — filesystem, network, logging, concurrency. Deny by default, grant narrowly, audit everything.

Two engines, one semantics

A tree-walking interpreter for development and a portable stack-based VM with a serialized PEAC format for production — kept in lockstep by differential testing.

Gradual rigor

Untyped programs are valid; optional annotations, semantic analysis, generics and Option/Result/Future types scale up when you need them.

Data, not just logic

DataFrames, lazy execution, SQL, connectors, time series, forecasting and ML foundations — the analytical stack is built in, not bolted on.

Structured concurrency

Async functions, task groups, cancellation scopes, deadlines and failure policies — with backpressure and bounded parallelism.

Governed ML lifecycle

Model bundles, registries, promotion gates, canary routing, drift monitoring, model cards and signed, encrypted artifacts.

Good fits

Business rules

Pricing, eligibility, routing, validation and policy decisions — readable by the people who own the policy.

Application extensions

Let customers or product teams ship constrained extensions instead of scripting against your whole codebase.

Data pipelines

CSV/JSON ingestion, schema inference, DataFrame transforms, SQL-backed analytics and time-series feature tables.

AI workflow glue

Prompt orchestration, tool-calling policy, evaluation harnesses and governed model promotion — inside one auditable runtime.

Integration logic

Connectors for SQLite, REST, GraphQL, OData, SFTP, Microsoft Graph, SharePoint and object storage (S3, Azure, GCP).

Untrusted scripts

User-uploaded rules executed in a hardened sandbox: admission checks, budgets, import allow-lists and audit records.

Get started in two minutes

git clone https://github.com/PeaBox-Lab/PeaLang.git
cd PeaLang
python -m venv .venv
.venv\Scripts\activate        # Windows
source .venv/bin/activate       # macOS / Linux
python -m pip install -e .
pea --version

printf 'let name = "PeaLang"\nprint "Hello " + name\n' > hello.pea
pea run hello.pea