Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Roadmap history

What each plan of the roadmap set out to do and what it shipped, one paragraph per release. The changelog lists every change. Item numbers cited elsewhere, such as “0.27 #6” in an ADR or a performance note, are rows of the plan’s table: the roadmap at the release’s tag holds it (git show v0.27.0:docs/src/architecture/roadmap.md), and each item’s commits name it (git log --grep "Roadmap 0.27 #6").

How 0.1 was built

jlens was built in phases. A phase was complete only when its documentation was written.

#DeliverableDefinition of done
0Workspace, CI, documentation skeleton, conformance harnessCI green; conformance report
1Lexer, Pratt parser, AST post-processing, spans, recover mode, annotations; jlens ast / jlens checkSyntax groups of the suite and the parser-recovery cases pass
2Value model and evaluator (paths, sequences, predicates, operators, lambdas, closures, tail calls, sort, group-by, parent operator, transform, limits)Suite groups that don’t depend on functions pass
3Function library, signatures, regex, date/time and number formatting100% of the suite minus documented overrides
4Evaluation logging and auditing (tracer, audit tree, levels, annotations, explanations)Snapshot tests; under 3% overhead with the tracer off
5jlens-schema: inference, overrides, JSON Schema, static typing, completion/diagnostics/hoverTable-driven language-service tests
6Full CLICLI snapshot tests
7WebAssembly package (browser ESM), TypeScript types, web editor exampleHeadless browser tests; working demo
8Documentation consolidation, benchmarks, publishingDoc examples verified; link check green; published to crates.io and npm

0.1.0 was the first release: the engine, audits, schemas and the language service, the CLI and the WebAssembly package. 0.1.1 moved the examples, fixtures and web editor to an online store order. (0.1.0, 0.1.1)

0.2

Host functions in Rust and WebAssembly (ADR 0006), and their declarations in the language service; the web editor’s example selector. (Changelog)

0.3

A machine contract and core guardrails. The first plan after the priorities were set. It shipped the language server jlens lsp and jlens.json (ADR 0007), the CLI’s machine contract (ADR 0008): eval --json, --now and --seed, check over several files, jlens errors; and cancellation and size caps in jlens-core. (Changelog)

0.4

Catching mistakes before they run. check warns about unknown functions, wrong argument counts and types, and undeclared variables, and reads jlens.json; jlens test runs files of test cases; prebuilt binaries install with cargo binstall. (Changelog)

0.5

Safe releases, enforced limits and proven compatibility. A cap on the size of a result (U1001); the size caps, clock and seed in the WebAssembly package and the CLI; differential testing against jsonata-js (cargo xtask differential); every binary built before a release publishes anything; a security policy. (Changelog)

0.6

Bounded regular expressions, wider differential tests, signed packages. Regular expressions bounded by the timeout and cancellation (ADR 0009), on jlens-regress, a fork of regress 0.12.0; differential tests that reach regular expressions, pictures and decoders; npm provenance and build attestations for the binaries. (Changelog)

0.7

No plan of its own: three jsonata-js quirks that expose JavaScript stopped being reproduced (a regular expression applied to a value that is not a string, irregular grouping in $formatNumber, $substringBefore and $substringAfter without chars), as compatibility records. (Changelog)

0.8

Proven robustness and fast single evaluations. Coverage-guided fuzzing in a weekly workflow, and the panics, stack overflows and slow cases it found fixed; jlens lsp survives a panicking request; evaluate reads its input lazily, one level at a time (ADR 0010), and evaluate_source reads other representations. (Changelog)

0.9

Numbers and dates at the edges, and tools for the next steps. A number that overflows to infinity and a date beyond JavaScript’s range fail with D1001 where they arise; $formatNumber and $formatBase write every digit of a large number; loops over floating-point numbers end on NaN and infinity; cargo xtask fuzz-replay replays fuzz inputs on any platform. (Changelog)

0.10

Performance and robustness debts, taken as explorations that end in a fix or in the cause written down. A recursion through a higher-order function fails with D1011 instead of overflowing the stack; WebAssembly’s default maxDepth is 500; cargo xtask ab compares the speed of two revisions. (Changelog)

0.11

Faster evaluation of common shapes. A comparison with jsonata-core, another Rust port, found it 2 to 5 times faster on five cases, which eval.rs traced to work no result depends on. Each item removed one such cost, measured with cargo xtask ab and with no change to results, errors or evaluation order: field lookups on a single value, comparisons with a string literal, order-by keys evaluated once, blocks without frames, the result converted to JSON in one pass, less set-up per evaluation. jsonata-core’s second evaluator for simple expressions was left out, as two evaluators of one language can disagree. 0.11.1 made $fromMillis and $now fail with D3150 on a timezone that is not a number. (0.11.0, 0.11.1)

0.12

jlens online. The book and the web editor published on GitHub Pages at each release tag, built from the tag’s files, so that the editor runs the engine its book describes; the editor evaluates in a Web Worker, everything in the browser, and shares expressions by address. (Changelog)

0.13

Host functions that call back. A host function can call the JSONata function it receives, in Rust (HostCall::function, Callable) and in WebAssembly, within the evaluation’s limits (ADR 0011), without changing the functions written against ADR 0006. (Changelog)

0.14

More ways to install the CLI, in order of reach, each published by release.yml from the attested archives, never rebuilt: npm (jlens-cli, ADR 0012), Homebrew, Scoop and the container image ghcr.io/thkprado/jlens. (Changelog)

0.15

jlens in VS Code, and a faster CLI allocator. The extension thkprado.jlens on the Marketplace and Open VSX, with the release binary bundled (ADR 0013), and mimalloc as the allocator of the jlens command. (Changelog)

0.16

The last gaps with jsonata-core, and string literals. Measured again after 0.15.0, jlens led on seven of ten cases. Group-by stopped copying each group at every item, and paths of names, literal group keys and names mapped over many items got faster, closing the gaps. (Changelog)

0.17

A Python package. The package jlens on PyPI, in beta (ADR 0014), following the WebAssembly package: the same objects, the same errors. A path step reads its one field of an input object, and values nested thousands of levels deep no longer overflow the stack. (Changelog)

0.18

The fields an expression reads, from the expression alone (ADR 0016), in Rust, WebAssembly, Python and the CLI, for one expression or the union of several: an upper bound, exact for the paths, comparisons and aggregations rules are mostly made of, tested by evaluating each suite case on its input cut to the fields reported. JSON text is parsed without the fields no evaluation reads. (Changelog)

0.19

Closing on jsonatapy, which was faster on four of twelve Python cases. Profiles found three causes, each removed: results are written straight into Python and JavaScript values (ADR 0017); predicates of literals are evaluated once, object constructors over one item skip grouping, and $formatNumber is faster; in Python, keyword-only options, interned keys and mimalloc. (Changelog)

0.20

A deterministic step limit. The timeout reads the clock, so the same evaluation can pass on one machine and fail on another. max_steps (U1006) gives the same answer everywhere, with or without a tracer, in Rust, WebAssembly, Python and the CLI (ADR 0018); the timeout now reads the clock every 256 steps; $eval lets the limits of its text through; WebAssembly options are read without JSON. (Changelog)

0.21

Documents built from Rust values. An application that rebuilt its document often spent more on serde_json::Value and Document::new than on evaluating. Document::from_serialize builds the document straight from Rust values, and evaluate_document_with binds documents or parts of one to variables without converting them (ADR 0019). 0.21.1 published the command on npm, npx jlens-cli, once npm allowed the name of its Windows package, and 0.21.2 moved the npm packages to trusted publishing, without a token. (0.21.0, 0.21.1, 0.21.2)

0.22

Regular expressions on jlens’s own terms. jlens-regress kept as jlens’s own fork (ADR 0020), with upstream’s fixes ported; checked against V8 by a corpus of test262’s answers and a differential test, which found ten bugs; a benchmark of the engine, and a cheaper interrupt. (Changelog)

0.23

Faster lookarounds, the cases of the engine’s benchmark furthest from V8: the matcher reuses their backtracking stacks and saved groups instead of allocating them each time, halving their time. (Changelog)

0.24

Reading the application’s values faster, two costs of jlens-core that ADR 0021’s spike found. An index into a long array reads the items it picks, alone, through Source::read_item, in Rust, WebAssembly and Python, whether it is a number or held in a variable; a predicate reads its array without copying it; a group-by on a tail call applied. 0.24.1 moved the Python package to mimalloc 2 outside Windows. (0.24.0, 0.24.1)

0.25

A Java package. io.github.thkprado:jlens on Maven Central, in beta, for Java 25 and later (ADR 0021): one JAR with the libraries of seven targets, over a C API that Java calls through Panama, with a benchmark against the JVM implementations in the repository; host functions looked up when an expression names them. (Changelog)

0.26

What measuring 0.25 left open: a regression in recursion, a case slower than jsonata-js, and the cases where the JVM comparison put jlens behind. A lambda’s frame is kept in a list that shares its arguments, recursion 21 to 25% faster; $clone copies without the JSON text, the transform 40 to 52% faster; WebAssembly and Java read the fields an expression reads, in one call; Java threads find their handles without a shared lock. Every comparison runs a new copy of each build at each run, and what such a comparison can settle was measured on Windows and Linux. How it was measured is in docs/notes/perf-0.26.md. (Changelog)

0.27

What use asked for, and what 0.26 left open. Applications met variables that cost more against a Document, a quadratic $distinct and a WebAssembly package that a page opened from disk could not load. Linear where the square of the input showed: $match, $replace and $split on long texts, $distinct, $keys, $substring, & in a loop, in and the URL functions, found in use and by cargo xtask growth; variables against a Document converted as far as the expression reads them; the Java and WebAssembly packages built with link-time optimization; the WebAssembly package as one classic script, jlens.global.js; three new engines in the comparisons. How it was measured is in docs/notes/perf-0.27.md. (Changelog)

0.28

What 0.27 left in $distinct and $match, and the regex flags u and v. $distinct follows the first fields of its items into the levels below them when the items share a field or are arrays, 25 records of 100 KB that differ there 15 µs against a Document where they took 12 ms, and compares numbers and short strings inline, 100,000 items of eight values 312 µs where they took 2.2 ms; the searches of a text keep the backtracker’s storage, and matches without groups share one empty array, $match 6.5 → 4 allocations a match and regex over a long text 36% faster. The regex flags u and v, an extension that jsonata-js rejects, bring the Unicode properties and the set operations on classes; their emoji example found a bug in jlens-regress, fixed. How it was measured is in docs/notes/perf-0.28.md. (Changelog)

0.29

Completing values, and domains the application provides. The language service, which completed fields, variables, functions and operators but never a value, completes the values of an enum or const on the right of =, != and in, inside quotes too, and warns as W0206 about a literal outside a declared one; an enumeration inferred from samples is marked x-jlens-enum-inferred and never warned about. A field whose values only the application can fetch names an open domain (x-jlens-domain, or domain in the overrides), and completion returns a value request for the application to answer. The web editor gained a schema overrides panel and a “Free shipping” example that uses labels, a hidden field and an open domain; an override whose path the samples lack, often a misspelt one, is listed with the path it most likely meant. jlens_core::Offsets made public the conversion between byte and UTF-16 offsets that the Wasm package kept to itself. No evaluation code changed, and the tables moved within the floor. How it was measured is in docs/notes/perf-0.29.md. (Changelog)

0.30

Value requests with their context. 0.29’s value request said which field’s domain to fetch, but not what the expression already said about it. A request now carries its conditions: the fields compared with literals by = or in and joined to the value by and in the same predicate, read from the unfinished expression by the recovering parser, so that a domain can depend on another (categories[group = 'X' and subgroup = '| asks for the subgroups of X). It says whether the value is an element of in [...], where several may be inserted, and lists the literals the array already holds, which the application leaves out as the service leaves out declared values. The web editor’s “Open domains” example shows each. A schema override’s type takes one type name, as JSON Schema writes it, besides a list. No evaluation code changed, and the tables moved within the floor but for cases that draw one of two speeds. How it was measured is in docs/notes/perf-0.30.md. (Changelog)

0.31

A small map for objects. Every object jlens built or converted was an IndexMap, a vector and a hash table over it, though no object of the benchmark workload has more than 6 fields. 0.31 gave jlens-core a map of its own (ADR 0022): the fields in a vector, in insertion order, searched by length and then text, with a table of positions only past 8 fields, where a search in order stops being faster than hashing. Every object, tuple and $match result uses it, one allocation fewer each; two objects of one shape are compared field by field, looking a key up only from the first pair whose keys differ; and an object constructor keeps its literal keys and strings by node id for each evaluation, 2 allocations for each object where it took 6. Against 0.30.0, object constructor is 7 to 25% faster, transform 6 to 15%, tuples 7 to 14% and distinct items 5 to 21%, and the Python and Java packages 5 to 35% on those cases; nothing public changed. Before the tag, the property tests found that $merge’s T0412 showed its argument cut against a Document, as the analysis read it only needed since 0.24; it reads it whole since. The tables were measured on an Apple M1 as well, which ranks the engines the same and is quieter; from 0.32 they are measured there. How it was measured is in docs/notes/perf-0.31.md. (Changelog)

0.32

The tables on the M1, and what each node costs. The engines that compile an expression to their host’s code are 3 to 5 times faster than jlens where an expression does much work per item, and a profile of 0.31.0 put most of that time in what every node costs: the dispatch, the check of its result and the guards. 0.32 lowered that cost in jlens-core, one measured item at a time, each kept only past the floor: the stack checked by one comparison of addresses, and a source and a cancellation token by one test; a lambda’s call that reuses a frame whose scope ended unshared, and the list of arguments a call before it gave back; a variable in a lambda’s body that carries its parameter’s place; a value’s tag a word wide, which removed the stall 0.27 had found in a path step; $sum, $average, $max, $min and $count over a field of each item without the array; and the frames of a tuple stream kept for reuse, after a count showed that they, not the copies of the tuples, were most of the allocations of tuples. A profile in Node explained why WebAssembly gained little at first: there eval is now inlined into its caller. Against 0.31.0 on the M1, recursion is 35% faster natively, 30 and 34% in Python and Java and 16 to 18% in WebAssembly, the shipping rule 10 to 20%, names over items 16 to 39%, and nothing is slower; jsonata-jvm-compiler and jsonata2js stay ahead, and compiling an expression to its host’s code is not planned. The differential tests run on each item found four places where jlens and jsonata-js differ, each now told by a row of the compatibility page; one was a jsonata-js quirk copied without a row, and dropped: a position after an order-by that follows a tuple step is bound. They also led to a cycle through a transform’s copy that kept its memory after the evaluation, older than the plan and fixed, and the property tests to T0410’s value cut against a Document. Attrs gained a private field, the release’s one breaking change. From this release the performance page’s tables are measured on the Apple M1 alone, and x86_64 keeps a comparison with the release before, in the release’s notes. How it was measured is in docs/notes/perf-0.32.md. (Changelog)

0.33

Expressions checked again when their schema changes. An application that keeps expressions written against a schema another system sends it has two questions when a new version arrives: does each expression still pass the diagnostics, and did anything it uses change, even if it does? 0.33 answers both where the schema is read. The Java package gained Schema and LanguageService over the C API (ADR 0023): a schema and a service are objects by handle, shared by every thread, and the diagnostics cross as JSON text; completion, hover and signature help stay out of it. LanguageService::uses lists each path an expression reads with what the schema says there, following the analysis of the reads and not the typing, and Uses::changes compares two such answers: the paths added, removed and changed, {} when nothing the expression uses changed. The Rust crate, the WebAssembly package, the Java package and the CLI (jlens schema uses, jlens schema changes) give the same JSON, pinned by shared cases, and a host function declared to the service counts as reading its arguments alone. Two kinds of schema that jlens refused whole now load: a recursive one, whose $ref is kept as a reference by name to a definition (ADR 0024), and one whose $ref leads to another document, which the application gives by URI, as jlens never fetches (ADR 0025); a $ref that cannot be followed leaves its place unknown, and the load reports it at every end. On the way, the diagnostics were found quadratic in the fields of an object, and the load exponential in definitions that each refer twice to the next: both are bounded now. In the C API and the Java package, JSON text evaluated with host functions is cut by what the bindings read. The library of the C API grew by 17.2% on Windows, three times the estimate, of which the comparison of two answers is looked at in 0.34. jlens-core did not change, and no case of the tables moved past 3.5%. How it was measured is in docs/notes/perf-0.33.md. (Changelog)

0.34

The types the diagnostics know. The diagnostics checked a function’s arguments and the fields an expression reads, but not the operands of an operator, and not the type of a result: with total a string, total > 1000 fails with T2009 only when it runs, and a rules engine learns that a condition is not always a boolean only from the document that makes it undefined. 0.34 warns about operands whose types the operator cannot take (W0207 to W0211) and about one that may be several values (W0215: items.qty > 1 is true for an order of one item and fails for two), where the types are known and never without a schema. The typing tells a value that is always there from one that may be undefined, at the operand that makes it so, and a path that gives one value or an array from an array; built-ins are typed by their signatures and a table checked against the engine. An application declares the type a result must have, and gets W0212 (never), W0213 (another type too) or W0214 (maybe undefined), and the result’s type as a value; over the suite, 805 results proved always defined were each checked against the case’s result. An expression may be the body of a step, typed with an item as its context and the parent operator followed. The typing stopped less often at the schema: objects open to other fields, then/else, dependentSchemas, tuples and nullable read, anyOf and oneOf read as one branch or another instead of merged as allOf (found on the way, a change in what is warned), and the keywords left unread reported by the load. The result type and the context reach jlens.json, the CLI (jlens schema result), the language server, the VS Code extension and the WebAssembly and Java packages, alike on a shared fixture. Measuring found the typing had made the diagnostics up to 21% slower; a copy of the catalog of built-in functions at each call removed, they ended faster than 0.33.0’s on every case. Two date bugs of jsonata-js 2.2.2 are fixed as its open pull requests #855 and #856 fix them. jlens-core changed only in parsing a body and in the dates; the tables moved only with the M1’s newer Rust (transform 18% faster, for 0.33.0’s code as well). How it was measured is in docs/notes/perf-0.34.md. (Changelog)

0.35

The choices of 0.34 reviewed. 0.34 left choices that no one had reviewed before its release, and four of them changed. The result type and the context took the names resultType and contextPath everywhere, as result and context meant other things elsewhere, with no deprecated alias, since 0.34 had had no time to be adopted; the WebAssembly LanguageService took one object of options in place of five positional arguments, and throws a TypeError for the old form; jlens schema result kept exit code 1 on a syntax error, now documented. The items of a tuple are typed by their position, open tuple or closed, and the load reports the tuples that leave the items after them open (LoadReport::open_tuples), in every package and as one warning of the CLI and the language server. Two items were not reviews. The Java package evaluates with documents as variables (jlens_evaluate_document_with in the C API), so that two documents received as JSON text are compared with neither made into Java objects: a field of a 100,000-item table read in 0.8 µs from a document, 8.3 ms from Bindings. And jlens took three fixes of jsonata-js made after 2.2.2, ahead of its release: #861 and #841 from its main branch, from which the suite was vendored (46 cases more), and #838, approved and not merged, whose cases live in jlens-core’s tests; the differential test runs against a checkout of jsonata-js too (--jsonata-js). Measuring #7 found that the variables of an evaluation went on the list of frames that may be part of a cycle: off it, an array or object as a variable costs about 15 ns less in every package. Nothing in the tables moved past 2.6% slower; recursion is 6 to 8% faster natively. How it was measured is in docs/notes/perf-0.35.md. (Changelog)

0.36

What adoption asks. jlens had its first users outside its own repository, and the plan took what they asked for. W0215 tells an operand that is always an array from one that may be several values, and its hint writes the expression with in, as the old hint taken to the letter gave another wrong one. For an application in Java that evaluates large documents from a pool of threads, the native memory of a document was measured at its peak and while it lives, the C API took the package’s buffer as the document’s text, so that a document needs its text’s memory once while it is made (a 16 MB document’s peak from 150 to 133 MB), and the Java guide says what a document costs per thread. jlens-regress got a version of its own, 0.35.1, raised only when the crate changes, with searches of UTF-16 and UCS-2 text that an interrupt stops, for a crate that uses it alone; it took the 20 commits of regress after 95c0404. Releases got a cadence, a minor every two or three weeks, and their channels two tiers. Most of the plan followed jsonata-js: three of 2.2.2’s bugs reported after its main’s 6d9d829, then its main branch as it moved, $formatNumber from the shortest decimal digits (#868), a regular expression that starts a block (#860), the date/time pictures rewritten (#869), with $toMillis matching in linear time and no picture running past an evaluation’s timeout, and transforms and ** (#870, #871, #873). jsonata-js 2.3.0 was released during the plan, with those fixes, and became the behaviour target in place of 2.2.2; the section “Next: the jsonata-js release after 2.2.2” left the roadmap, its item done. Its template strings («...») are the one feature jlens lacks: of 2.3.0’s 1,972 cases, jlens passes 1,901. An outside review of the code found six gaps, fixed with tests (JSON text read 1,000 levels deep, $formatNumber with a long grouped picture in linear time, the host’s $clone under a name no expression can bind, among them), and four more items for 0.37. Two items moved to 0.37 to wait for the Java adoption: a result kept as a Document, and ADR 0015. In the tables, number formatting takes 4 to 32% less in every package and $toMillis with a picture 62 to 67% less; a field #18 added to the evaluator slowed Python’s object constructor in some environments, and #21 removed it. The release’s check on x86_64 found nothing to change. How it was measured is in docs/notes/perf-0.36.md. (Changelog)

0.37

What adopters need before they evaluate. The applications adopting jlens were to judge it with this plan, so it took what they would meet first. Template strings («Hello {name}!»), the one feature of jsonata-js 2.3.0 that 0.36 left out, are read as 2.3.0 reads them, and jlens passes 1,970 of the 1,972 cases of its suite; the other two are documented differences. For editors built on jlens, the language service lists a schema’s fields with what completion and hover know of them and their own x- keywords, after the JSON Schema reader’s gaps that the list would show were fixed (required in allOf, beside a $ref or alone, closed tuples). From the two lists, an application builds a table of paths when a schema’s new version renames or moves fields, and rename rewrites the expressions stored against the old one, the rest of the text kept, with the places it cannot be sure of; a second outside review, of the code at 285e0b7, found where that rewrite could change what an expression means, fixed before the release. An outside review of the code at 7b69a6e gave the fixes: the size limits stop a result while it is built ($replace, $split, $match, $pad, $fromMillis, and a filter that repeats a position), a regular expression literal is compiled once per expression (regex 7 to 18% faster on every platform, $toMillis of an ISO text 88%), the Java package holds up under threads and failures (a document’s conversions swept, no critical downcall, Options that evict), and the Python package calls no method of its input’s values while it holds their lock. jlens-regress 0.35.2 keeps the searches of &str fast under its utf16 feature, which had made them up to 128 times slower, with four more commits of regress. New fuzz targets cover what applications send to the language service; the workflows pin their actions by commit, and the release workflow drafts the GitHub release once the libraries are published, without waiting for the tools’ channels. The WebAssembly guide says how to serve the module under a Content-Security-Policy, and what the module is made of was measured for 0.38’s ADR: without the language service it is a quarter smaller. Three items moved to 0.38: a result kept as a Document, ADR 0015 and a binding of a block’s predicate. The release’s check on x86_64 found nothing to change. How it was measured is in docs/notes/perf-0.37.md. (Changelog)