async_jsonata_rust
Async-first Rust crate for JSONata parser/runtime foundations.
Crate contract
Scope
parser: JSONata expression parsing into AST JSON (serde_json::Value), including recover mode.evaluator: stable facade exists (Evaluator), full runtime parity is in progress.async custom functions: supported throughJsonCallable/JsonataCallabletraits and async core operators (map,filter,single,foldLeft).compatibility level: parser and function runtime primitives are production-oriented; evaluator parity is explicitly tracked as in-progress.
Stable entry points
ParserExpressionEvaluatorFunctionRegistryError
Low-level internals are still available under parser::*, but product API should use the stable layer above.
Quick start
use Parser;
let parser = new;
let expr = parser.parse?;
println!;
# Ok::
JSONata references
- https://docs.jsonata.org/overview
- https://docs.jsonata.org/path-operators
- https://docs.jsonata.org/programming
Compatibility with JSONata-js
Reference engine: jsonata-js 2.1.0.
| Area / test groups | Compatibility | Evidence |
|---|---|---|
| Parser grammar (paths, predicates, functions, chains) | High | Rust parser tests + JS suite fixtures in repo |
| Built-in runtime helpers (math/core/string primitives) | Medium | tests/native_wrapper.rs + function module tests |
Async function execution (Pending -> Ready) |
High | async callable tests in tests/native_wrapper.rs |
| Full evaluator output parity across all suite groups | In progress | evaluator facade exists, runtime engine not finalized |
Detailed matrix and notes: docs/compatibility.md.
Known deviations
- Full end-to-end evaluator parity with
jsonata-jsis not claimed yet. - Stable
Evaluator::evaluatecurrently returns explicitE0001(not implemented) until runtime parity lands. - Some bridge-focused compatibility shims remain in
jsonata-js-rust/native.
MSRV policy
rust-version = 1.78.- MSRV is checked in CI and treated as part of release quality.
- MSRV bumps are allowed only in minor/major releases and documented in
CHANGELOG.md.
SemVer policy
- Public API:
Parser,Expression,Evaluator,FunctionRegistry,Error, public modules, and documented behavior. - Breaking change examples: removing/renaming public items, changing documented error codes/fields, altering stable semantics.
- Internal modules and undocumented internals are not covered by stability guarantees.
QA / CI gates
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-featurescargo test --doc --all-features- Cross-platform matrix: Linux, macOS, Windows
Examples
examples/basic_eval.rsexamples/async_function.rsexamples/custom_registry.rsexamples/error_handling.rs
Roadmap
Implemented
- Parser with recover mode.
- Async callable model and core async operators.
- Built-in function registry wiring.
- Stable public API facade and unified error type.
In progress
- Full evaluator runtime parity with JSONata-js.
- Differential test automation against JS reference engine.
Planned
- Full golden suites by expression groups.
- Cross-engine conformance dashboard.
- Automated release tagging and publish pipeline.
License
MIT