Quickstart & installation
PeaLang is a Python package with two console entry points, pea and pealang. Python 3.10 or newer is required. Runtime dependencies are cryptography>=42 and, on Python 3.10, tomli>=2.0; everything else in std.* ships with the package.
Install from source
git clone https://github.com/PeaBox-Lab/PeaLang.git
cd PeaLang
# Windows
py -m venv .venv
.venv\Scripts\activate
# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .
pea --help
pea doctor
pip install -e ".[fastapi]" for the embedded HTTP server, plus jupyter, onnx or torch for model-oriented workflows.Your first program
# hello.pea
let name = "PeaLang"
print "Hello {name} from v3.1.36"
let xs = [1, 2, 3, 4]
print [x * 2 for x in xs if x > 1]
pea run hello.pea
pea check hello.pea
pea eval -e "print sum([1,2,3])"
String interpolation uses {expression}; escape literal braces by doubling them: {{ and }}. Comments start with # or //.
Project structure
Small scripts need no manifest. Applications use pea.json; libraries and published packages prefer pea.toml. Workspaces coordinate multiple packages.
my-service/
pea.toml
src/app.pea
tests/app_test.pea
# pea.toml (library / package)
[project]
name = "pricing-rules"
version = "0.1.0"
entry = "src/app.pea"
[library]
exports = ["evaluate"]
# pea.workspace.toml
[workspace]
name = "platform"
members = [
"libs/core",
"apps/api",
]
Installed libraries resolve from .pea_modules; lockfiles are pea.lock and pea.workspace.lock. Use pea install <name>, pea lock --check and pea deps to manage the dependency graph.
Debug loop
pea fmt src/ --check # style gate, no rewrite
pea check src/ # static analysis / diagnostics
pea lint src/ --json # machine-readable lint
pea test tests/ --coverage
pea run src/app.pea # tree-walking interpreter
pea compile src/app.pea # emits .peac bytecode
pea vm app.peac # run the bytecode artifact
pea dis app.peac # inspect instructions
pea doctor # environment self-check
Op.AWAIT for AwaitExpr but rejects InterpolatedString. Write VM-targeted hot paths with plain concatenation and explicit function calls, and compare pea run with pea vm when diagnosing divergence.Next step
Continue with the core language showcase, then apply the first pattern in the code library.