PeaBox Lab › PeaLang › Learn › Chapter 27 › Lesson 3

Part V — The Modern Experience Layer · Chapter 27 · Lesson 3 of 3

The modern builtin toolkit

The 1.0.0-experience release added more builtins than the language had before it. Nobody memorizes them; everybody learns the shape and discovers stdlib modules with pea stdlib; this lesson maps the builtins registered by the interpreter.

Iteration and shaping

Path and record operations

String and codec helpers

Pipes and application

let total = pipe(
  orders,
  function(o) { return filter(function(r) { return r.status == "paid" }, o) },
  function(o) { return sum_by(o, "amount") }
)

pipe threads a value through single-argument functions; apply(fn, args) invokes with a list of arguments. Use pipes for linear transforms; reach for plain code past three stages.

Numbers and correctness

clamp / format_number / floor / ceil / log / exp / pow / gcd / lcm / sign / is_even / is_odd / lerp / between cover the scalar case; parse_int / parse_float with explicit fallbacks replace ad-hoc coercion. The type predicates — is_null / is_list / is_dict / is_string / is_number / is_bool / is_empty — are the honest way to guard the boundary of anything external.

Version note. Everything on this list is additive over v0.63 — no v0.63 program changes behavior, but almost every hand-rolled loop in a v0.63 codebase can become a one-liner now.

Guided practice

Rule of thumb. Before writing a helper function, check the builtin list above and pea stdlib for module helpers. The most-missed builtin in review is always the one that already exists.

← Previous Next →