pkl-rs
A pure-Rust implementation of Apple Pkl 0.32.0 — zero Java runtime required, unsafe_code = "deny" across the entire workspace, and a single shared evaluation engine powering native CLI tools, a Rust library, WebAssembly, and Node.js N-API bindings.
[!NOTE] Release Candidate (
0.32.0-rc.3): Language, standard library, CLI,pkldoc, Rust API (pkl-lang),@openedges/pkl-wasm,@openedges/pkl-napi, and Official Apple Pkl0.32.0native-imageperformance parity (15/15 <= 1.00xtime & peak RSS) have been verified on local macOSarm64. Cross-platform hosted CI release verification (linux-*,darwin-x64,win32-x64) and final GA0.32.0sign-off remain in progress (release_ready: false). See CHANGELOG.md and docs/development-history.md for exact verification scope.
Products & Capabilities
pklCLI &pkldoc(crates/pkl-cli,crates/pkl-doc): Drop-in native binaries (~14–15 MiB) supportingeval,repl,server,test,project resolve,project package,download-package,analyze imports,format,run,shell-completion, and HTML documentation generation (pkldoc).- Rust Evaluator API (
crates/pkl): Ergonomic embedding API (Evaluator,EvaluatorBuilder,ModuleSource,PklValue/FromPklValue,ModuleSchema,Project,Analyzer,SecurityManager,HttpClient, customModuleKeyFactory/ResourceReader, cancellation, and timeouts). - Node.js Native Addon (
@openedges/pkl-napi): Dual ESM/CJS bindings with TypeScript types, non-blocking libuv worker threads (Promise) plus*SyncAPIs, full native Host I/O (filesystem, HTTP/HTTPS,PklProject,package:, external readers), and custom JS extensions across 7 target platforms. - WebAssembly Package (
@openedges/pkl-wasm): Browser and Node.js ESM package (<= 2.50 MiBgzip-9.wasm), pure-WasmVirtualFileSystem, cooperative async Host callbacks,createRepl(),analyzeImportGraph(),evaluateSchema(),evaluateTest(),format(), and losslessdecodePklBinary(). - Full Pkl
0.32.0Core: All 23pkl:*standard library modules (542 builtins), all 9 renderers (pcf,json,yaml,xml,properties,plist,jsonnet,textproto,pkl-binary),output.bytes,output.files,pkl:test, andpkl:Command.
Installation
For full platform matrices, checksum verification, shell completions, and build options, see docs/installation.md.
Homebrew (macOS & Linux)
(Installs both pkl and pkldoc, bundled license/notices, and bash/zsh/fish shell completions.)
Prebuilt CLI Binaries (pkl & pkldoc)
Download the archive for your platform from GitHub Releases, verify against SHA256SUMS.txt, and place pkl / pkldoc on your PATH:
# Example: macOS Apple Silicon (replace version/target for your platform)
Supported prebuilt CLI targets:
- Linux (
x64,arm64): portable glibc>= 2.28(*-gnu.tar.gz) and static musl (*-musl.tar.gz) - macOS (
arm64,x64):*-darwin-{arm64,x64}.tar.gz - Windows (
x64):*-win32-x64.zip
Rust Crates (crates.io)
[]
= "0.32.0-rc.3" # Imports as `use pkl::...;`
Or install CLI binaries from crates.io:
Node.js (@openedges/pkl-napi) & WebAssembly (@openedges/pkl-wasm)
# Node.js native bindings (Node >= 18, full native Host I/O)
# Browser & Node.js WebAssembly bindings (Node >= 20.16, sandboxed VFS + async Host)
(Release candidates are published under the npm next dist-tag via .github/workflows/release.yml; GA 0.32.0 uses latest. To build local tarballs from source, see docs/installation.md.)
Build from Source
Requires Git and rustup (toolchain pinned to 1.98.1 in rust-toolchain.toml):
(Building pkl and pkldoc does not require initializing the upstream test submodules. For contributor verification and Java differential testing, initialize submodules with git -c core.autocrlf=false submodule update --init --recursive.)
Quick Start
CLI
# Evaluate Pkl source to JSON
|
# Format Pkl files and run Pkl tests
# Generate HTML documentation
Rust API (crates/pkl)
use ;
Node.js (@openedges/pkl-napi)
import from '@openedges/pkl-napi';
const evaluator = await ;
try finally
Browser & Node.js (@openedges/pkl-wasm)
import from '@openedges/pkl-wasm';
await ; // Required once in browsers; optional in Node.js
const vfs = ;
const evaluator = await ;
try finally
Compatibility & Performance
- Compatibility baseline: Targets Apple Pkl
0.32.0raw-byte output, diagnostics, source positions, generated files, and exit codes. Java/Kotlin code generation (pkl-codegen-java,pkl-codegen-kotlin) and JVM public API adapters are explicitly excluded from scope (INTENT.md). - Performance (local macOS
arm64): All 15 CLI, server, andpkldocworkloads run at0.073x–0.761xexecution time and0.130x–0.551xpeak RSS compared against Official Apple Pkl0.32.0native-image(<= 1.00xacross every workload) with 100% raw-byte parity.@openedges/pkl-wasmcompiles to2.03 MiB(2,124,981 B) gzip-9 (<= 2.50 MiBbudget). - Full milestone metrics, differential test counts, soak/fuzz records, and raw evidence archives are preserved separately in docs/development-history.md.
Testing & Verification
Standard Rust checks:
Unified local verification runner (covering Rust workspace, manifests, Python unit tests, platform Node.js tests, standalone npm packages, M0–M6 Java 0.32.0 differential suites, and M7 fuzz/soak/benchmark suites):
See TESTING.md for the complete verification contract and docs/ci.md for the GitHub Actions vs. local verification split.
Versioning
All distributable components (Cargo.toml workspace crates, pkl/pkldoc binaries, @openedges/pkl-wasm, @openedges/pkl-napi, and Git release tags) follow a unified 0.32.0 versioning policy aligned with the Apple Pkl compatibility baseline. See docs/versioning.md and CHANGELOG.md.
Documentation
| Category | Document | Description |
|---|---|---|
| Users & Release | docs/installation.md | Prebuilt binaries, checksum verification, npm packages, source builds |
| docs/versioning.md | Versioning, branch & tag policy, upgrade rules, release checklist | |
| CHANGELOG.md | User-facing release notes and known pre-release boundaries | |
| SECURITY.md | Vulnerability reporting and Pkl security boundaries | |
| THIRD-PARTY-NOTICES.md | Embedded assets, vendored regex data, and crate licenses | |
| Contributors | CONTRIBUTING.md | Development workflow, principles, and PR guidelines |
| TESTING.md | Complete test inventory and compatibility verification contract | |
| docs/ci.md | GitHub Actions CI/Release workflows and local_verify.py suites |
|
| docs/architecture.md | Engine, VM, heap, Host, and cross-target architecture | |
| docs/oracle.md | Bootstrapping pinned JVM, Native Image, and GraalVM oracles | |
| History & Roadmap | docs/development-history.md | M0–M7 milestone checkpoints, metrics, and evidence archives |
| docs/README.md | Complete index of all repository documentation | |
| INTENT.md | Project goals, scope, and performance requirements | |
| PLAN.md | Roadmap, execution plan, and work status (Korean) |
License & Trademarks
pkl-rs is licensed under the Apache License, Version 2.0 (Copyright 2025–2026 The pkl-rs Authors).
pkl-rs is an independent open-source project and is not affiliated with, sponsored by, or endorsed by Apple Inc. "Pkl" is a trademark or product name of Apple Inc., referenced solely to describe language and specification compatibility.
Attribution and third-party notices for embedded Apple Pkl 0.32.0 standard library modules, pkldoc web assets/fonts, FDLIBM, SnakeYAML Engine, TimSort, Unicode 15.0.0 UCD data, and statically linked crate dependencies are provided in NOTICE and THIRD-PARTY-NOTICES.md.