Skip to content

API Reference

XPR is available for JavaScript, Python, and Go. All runtimes share the same expression language and pass the same conformance test suite.

Runtimes

RuntimePackageStatus
JavaScript / TypeScript@xpr-lang/xpr✅ Available
Pythonxpr-lang✅ Available
Gogithub.com/xpr-lang/xpr-go✅ Available

Common API Shape

All runtimes expose the same conceptual API:

engine = new Engine()
result = engine.evaluate(expression, context)
engine.addFunction(name, fn)

The method names follow each language's conventions (evaluate / Evaluate, addFunction / add_function / AddFunction).

Conformance

All runtimes pass the same conformance test suite — covering literals, arithmetic, comparison, logic, collections, strings, functions, access patterns, pipe operator, let bindings, spread operator, and all v0.5 features.