Puffins are auks with colorful features — Puffin is AWK with colorful features. A structured, modular language engineered for lexical scoping, first-class namespaces, actor-model concurrency, domain standard libraries, and native AOT compilation.
# Puffin: Lexical scoping, domain stdlib, typed collections & actor concurrency
:>inc "std/text/strings.pfn"
struct Metric { name: str, value: f64 }
namespace Telemetry {
HATCH {
static active_events = 0
}
export function record(name, val) {
active_events++
let tag = std.text.strings.upper(name)
# Typed collections (@Dict / @List) & variant constructors
return Ok(@Dict[
"id": active_events,
"metric": Metric(tag, val),
"tags": @List["production", "telemetry"],
"verified": true
])
}
}
BEGIN {
# Cooperative actor spawning over isolated message channels
let worker = hatch coop Telemetry()
# Functional pipelines with first-class arrow lambdas
let raw = @List["cpu_load", "mem_peak", "io_wait"]
let metrics = raw
|> map(x -> std.text.strings.lower(x))
|> filter(x -> Length(x) > 0)
# Typed non-blocking RPC with Result variant matching
case await worker.record("node_health", 99.8) {
Ok(report): {
print "Worker Ready -> Event ID:", report["id"]
for k, v in report {
print " ", k, "=>", v
}
}
Err(err): {
print "Worker Error:", err
}
}
}
Block-level scoping with let, persistent function-lifetime memory with static, assign-once final, deep immutability with freeze, and loop-scoped bindings (for (let i = 0; ...)).
Modular encapsulation via namespace, explicit symbol boundaries (export), private member protection (_prefix), and deterministic multi-file inclusion (:>inc).
First-class literal syntax for @List, @Dict, @Set, @Queue, and @Deque. Anonymous arrow lambdas (x -> expr), higher-order combinators, and functional pipelines (|>).
Isolated concurrency with hatch coop (coroutines) and hatch detached (processes). Thread-safe mailboxes (send/recv), typed channels, and async actor RPC (await).
150+ modules organized across 16 domain namespaces: std/text, std/encoding, std/crypto, std/net, std/sys, std/math, std/flow, std/archive, and more.
Transpile to native binaries with puffin build (via Nim/C), enforce style and semantic invariants with puffin lint, explore in puffin repl, or run POSIX AWK via pcawk.