Repository navigation
Releases
ledgermill 0.2.1
Fixed
- Beancount: an indented line after a blank line, a line of blanks, a comment at the margin, an
optionor the
like, or at the start of the file is aparse-error, asbean-checkreports it (unexpected INDENT).
ledgermill's parser folds the blank away and reads the line as metadata or a posting of the entry above, so
check()accepted it. A run of such lines is one error, on its first line, and the next run is an
error of its own after two blank or comment lines or a directive. This also closes the gap of an indented
plugin,option,includeorpushtagline. Seespec/beancount/format.md.
Release gate
From the release-gate workflow on commit 1d92961 (run 44120795267, 2026-11-17), CI on the same
commit (run 44120793208), and the owner's own runs. In that CI run rust, wasm, android and
hygiene pass; ios got no GitHub macOS runner in two attempts and never started, so its build
(cargo build --release --target aarch64-apple-ios -p ledgermill) was run on the owner's Mac on
1d92961 instead, and passed.
- Random hledger journals (5,000): 0 mismatches (2,263 that hledger accepts; the rest rejected by
both, 44 skipped, allconversion-postings) - Random Beancount journals (5,000): 0 mismatches (3,754 that bean-check accepts)
- Random price networks (5,000): 0 mismatches
- Random Beancount journals with pairs priced both ways (5,000): 0 mismatches
- Random sets of several ledgers (5,000): 0 mismatches (1,720 sets the reference accepts; 62
skipped, allconversion-postings) - Corpus comparison: 13,725 pass, 0 fail, 52 skip
- Desktop bench against 0.2.0 from npm (CI runner, 10,000 transactions): every operation within
0.86–1.07× of 0.2.0 (both ends are calls under 0.1 ms; above that, 0.92–1.02×, the 1.02 is hledger
load+transactions, 61.7 to 62.8 ms); load+transactions 62.8 ms (hledger), 125.5 ms (Beancount);
start 16.5 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 637.2 MB hledger, 611.5 MB Beancount)
- Similarity check score: max 0.088 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.251 (information only) - Real journals: pass (21 pass, 0 fail; two of the owner's hledger journals, each alone and as one set)
- Device targets: not met (Beancount load+transactions on the owner's phone, Android 10 and Chrome
157, on the build of1d92961: worst of 3 is 568.0 ms (runs 448.4, 562.0, 568.0), and 585.9 ms on a
second run (436.1, 476.0, 585.9); 0.2.0 from npm on the same phone, between the two: 460.0, 472.8,
450.8 ms). The desktop bench on the owner's Mac puts this call at 1.03× of 0.2.0 (79.8 to 81.9 ms, 10 runs), so most
of the gap is the phone's spread; 0.2.0 itself measured 542.2 ms there at its release. Every other
target met: hledger load+transactions worst 265.4 ms, start 33.6 ms, value 55.3 ms (Beancount,
worst), holdings 40.4 ms (worst), memory 42.9 MB hledger and 43.5 MB Beancount
ledgermill 0.2.0
Added
- Beancount: arithmetic in a number (
(1 + 2) * 3,10 / 4,-(2 - 5)) in a posting's units, a price, a
cost, abalanceand its tolerance, apricedirective and metadata. The values, places and exponents
are the reference's (28 digits, half to even); an inexact quotient has a tolerance of its own. A division
by zero is adivision-by-zerofinding that leaves out its entry. A malformed expression ((1 + )) is a
parse-errorand, like any parse error, leaves the file with no transactions. A sign in front of a sign and a~
tolerance that is a sum, both without parentheses, are still refused (number-expression).format()
aligns expressions asbean-formatdoes. Seespec/beancount/number-expressions.md. - Beancount:
plugin "beancount.plugins.auto_accounts"is built: every account used and never opened gets anopen
on the day of its first use, so a journal with noopenlines is valid. Every other plugin is still refused
(unsupported-syntax), and the finding now names it indetails.name. An indentedpluginline is
accepted, though the reference rejects it (a gap of every indented directive). See
spec/beancount/auto-accounts.md. - Beancount:
plugin "beancount.plugins.implicit_prices"is built: a price annotation (@,@@) and the
cost of a posting that opens a lot addpriceentries, on the transaction's date and line, soprices(),
value()andholdings()follow them. A price annotation wins over a cost, a cost that reduces a lot
makes no price (withNONEbooking every costed posting opens a lot, so each makes one), equal entries of
one run are dropped, and everypluginline of the root file runs it once more. A configuration string is still refused.
Seespec/beancount/implicit-prices.md. fuzz.ts --beancountwrites arithmetic in numbers now and then.fuzz.ts --beancountand--multiswitchimplicit_pricesandauto_accountson now and then (withauto_accounts, some or allopenlines
dropped) and the summary counts the journals that had each.- Beancount: a posting flag
*straight before the account (*Assets:Bank) is read.
Changed
- The Beancount files of one
loadare one ledger, read in the order given, as the reference reads a file
thatincludes the others: accounts,openandclose, pads, balance assertions, lots and prices apply
across the files. An account opened twice is aduplicate-openfinding on theopenthat comes second when the
entries of all the files are walked by date and then line; a
balance assertion in one file adds up the postings of all. The first file is the root: itsbooking_method
andpluginlines serve all the files, and those of the others do nothing. A refused construct in
any Beancount file makes the whole Beancount ledger refused. The hledger files are still one ledger of their own and
the two merge as before;format()still takes one file. Before, each Beancount file was a ledger of its
own. Seespec/beancount/several-files.md. The harness reads the reference through a root that includes the
files. format()reads the original file once. A Beancount file used to be loaded three times and parsed
once more, an hledger file parsed and then loaded again; a format is now two loads, the original
and the result. On 10,000 transactions, against 0.1.3 from npm on one desktop (median of 7 runs,
alternated): Beancount 287 ms to 179 ms, hledger 154 ms to 104 ms. The formatted text is the same.- hledger: a load copies less. The drafts of a transaction are built once, and a posting's amounts
are moved, not copied, into whatat_cost(),value()andholdings()keep; the lists of a
load get their size up front. A native load of 10,000 transactions takes about 9% less time
(45.6 ms to 41.6 ms); in the wasm the gain is within what the bench can tell apart (46.9 ms to
45.6 ms forloadandtransactions()). - hledger: a number whose mantissa fits in 64 bits is held as a machine integer, a larger one as a big integer
as before (the timings below were measured with a 128-bit integer; see the next entry), so the arithmetic on an ordinary amount needs no big integer and allocates nothing for
it. Against the commit before, on 10,000 transactions: a native load takes 11% less time (39.2 ms to 34.7 ms, median of 7
alternated rounds); in the wasmloadandtransactions()take 7% less (45.2 ms to 42.3 ms,
median of 11 runs) andholdings()12% less (5.41 ms to 4.75 ms); the wasm is 17 KB larger before
compression. Every answer is the same: eight probes with numbers on both sides of the limit
(inspec/hledger/probes/:decimal-across-64-bit, the fourdecimal-*-across-128-bit,decimal-inferred-prices-255,
decimal-many-placesanddecimal-small-around-zero) are compared with hledger. - hledger: a number is 24 bytes in the wasm, not 48. A 128-bit integer is 16-aligned on wasm32 and doubled
the size of every number a ledger keeps, so the wasm memory of a 10,000-transaction load grew by 15 MB
(memory.buffer.byteLength40.2 MB to 55.2 MB). The machine integer is 64 bits now and the big one is
boxed: 42.9 MB on the same ledger, under the 50 MB target. Every answer is the same. - Beancount: a load of several files builds the flat posting list after freeing what reading and
booking held, as it did before the files became one ledger. Built at the peak, the rows raised the wasm
memory of a 10,000-transaction load by 3.2 MB (43.5 MB to 46.7 MB); it is back to 43.5 MB. - hledger: a posting's amount is read once. It was read a second time only to find where it ends,
forformat(); the first read says so unless aDdirective could give the amount a commodity.
Balancing a transaction borrows the commodity names it used to copy. Against the commit before,
on 10,000 transactions: a native load takes 18% less time (36.7 ms to 30.1 ms, median of 9
alternated rounds); in the wasmloadandtransactions()take 13% less (42.0 ms to 36.7 ms,
median of 11 runs) andformat()12% less (103.5 ms to 91.4 ms). Every answer is the same.
Fixed
- Beancount:
holdings()of several files adds the postings in the reference's order, by date and then
line with the file not in the key. It added them by date and then file, so a sum held to 28 significant digits
that rounds at each step could end one digit off when files shared a day. See
spec/beancount/several-files.md.
Release gate
From the release-gate workflow on commit 50041d8 (run 43723414894, 2026-11-15), the head of the
merged memory PR when it ran, CI on that PR's last commit 898b6df (run 43725983534), and the
owner's own runs. The only code change between the two commits adds a drop, with tests and docs.
- Random hledger journals (5,000): 0 mismatches (2,212 that hledger accepts; the rest rejected by
both, 45 skipped, allconversion-postings) - Random Beancount journals (5,000): 0 mismatches (3,709 that bean-check accepts)
- Random price networks (5,000): 0 mismatches
- Random Beancount journals with pairs priced both ways (5,000): 0 mismatches
- Random sets of several ledgers (5,000): 0 mismatches (1,755 sets the reference accepts; 68
skipped, allconversion-postings) - Corpus comparison: 13,723 pass, 0 fail, 52 skip
- Desktop bench against 0.1.3 from npm (CI runner, 10,000 transactions): every operation within
0.48–1.09× of 0.1.3 (the 0.48 is hledgerformat, 185.5 to 89.5 ms; the 1.09 is Beancount
holdings, 7.69 to 8.38 ms); load+transactions 41.2 ms (hledger), 102.6 ms (Beancount); start
14.7 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 637.2 MB hledger, 611.5 MB Beancount)
- Similarity check score: max 0.088 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.251 (information only) - Real journals: pass (21 pass, 0 fail; two of the owner's hledger journals, each alone and as one set)
- Device targets: not met (Beancount load+transactions on the owner's phone, Android 10 and Chrome
157, on the build of50041d8: worst of 3 is 542.2 ms (runs 436.5, 421.7, 542.2); 0.1.3 from npm
on the same phone, alternated: 446.6, 440.8, 536.7 ms, also above 500 ms). Every other target met:
hledger load+transactions worst 263.9 ms, start 34.3 ms, value 51.5 ms (Beancount, worst),
holdings 39.1 ms (worst), memory 42.9 MB hledger and 43.5 MB Beancount (0.1.3 on the same phone:
48.3 MB and 43.5 MB)
ledgermill 0.1.3
Added
loadreads several Beancount files, and hledger files together with Beancount files, in one call.
Each Beancount file is its own ledger (includeis still refused) and all the hledger
files together are one.transactions(),postings()andprices()are merged by date, then by
the position of the item's file in the list;check()lists each ledger's findings by the position
of their file;at_cost()andvalue()are answered per ledger and line up withtransactions();
holdings()adds the rows of the same account and commodity. Theseveral-beancount-filesand
mixed-formatsrefusals are gone. A set of one ledger answers as before. See
spec/beancount/several-files.md.- Harness: sets of several ledgers are compared with the reference. The reference runs per
ledger (bean-checkandbean-queryon each Beancount file,hledgeron all the hledger files
together) and the harness merges the results by the rule of the note with an implementation of its
own; the wasm loaded with the whole set must give the same transactions,postings(),prices(),
at_cost(),value()andholdings()(rows of one account and commodity added by value) and the
same first error.compare.tshas 40 such sets (theseveral-filesprobes in every order, the
rejected and the refused ones, Plainledger's own journals);fuzz.ts --multiwrites random sets
(60 per push, 5,000 in the release gate); the summary has amulti-ledgerline. See
harness/README.md, "Several ledgers".
Fixed
- A Beancount currency of one capital letter glued to the next character (
{2 X},1 X,,X;,Xat
the end of a CRLF line or of the file) was accepted; bean-check saysInvalid token: 'X}'.
It is now aparse-erroron the line of the letter, the line bean-check gives. A letter followed by a
space, a tab or the end of the line, or by more currency characters (X1,X.B), is read as before.
fuzz.ts --beancountnow addsXto three journals in ten (seed 411, 1,000 journals: 0 fail; of 300,
79 useX, 49 accepted by bean-check, 25 refused on theX). - A Beancount date or time written with digits other than 0-9 (
٢٠٢٦-01-02,time: ١:٢٣) made the
parser panic, a crash in a browser or an app. It is now aparse-erroron its line, the
line bean-check gives, andformat()returns the file unchanged. The fix is in our parser fork
(ledgermill-beancount-parser0.16.4).fuzz.ts --beancountnow puts such a digit in one journal
in five. - hledger: in a transaction with a balance assignment, the postings are now taken in order of their
own dates (date:tag or[DATE]). A posting dated before the transaction comes before its
assignments and undated postings, wherever it is written, as hledger does. It used to be taken in
the order written, socheck()could report a different first failing assertion from hledger's
(fuzz--multi 500 908, case 289; 0.1.2 did the same). The block itself stays at the
transaction's date. Seespec/hledger/assignment-processing.md. - Beancount
format(): an account is now read with the character classesbean-formatuses. It
starts with an uppercase letter, a later component with an uppercase letter or a decimal digit
(5,٣,3), and components go on with letters, decimal digits and-. A posting on an
account with another kind of number in it (Assets:L²,Assets:LⅫ) used to be aligned and could
move the column of the whole file; it is now kept as written, asbean-formatdoes (fuzz
--beancount 500 905and909). Seespec/beancount/format.md, "Which characters". - The check for a glued one-letter currency (above) made a Beancount load about 15% slower than in
0.1.2 on the bench ledger. It now reads each line once: on a Pixel 7 Pro,load()and
transactions()on 10,000 transactions take a median of 505 ms, against 491 ms for 0.1.2 (12
runs each, alternated).
Release gate
From the release-gate workflow on commit ea9e776 (run 41521006303, 2026-11-02), CI on the same
commit (run 41513527166), and the owner's own runs.
- Random hledger journals (5,000): 0 mismatches (2,308 that hledger accepts; the rest rejected by
both, 43 skipped, allconversion-postings) - Random Beancount journals (5,000): 0 mismatches (3,735 that bean-check accepts)
- Random price networks (5,000): 0 mismatches
- Random Beancount journals with pairs priced both ways (5,000): 0 mismatches
- Random sets of several ledgers (5,000, new in this gate): 0 mismatches (2,259 sets the reference
accepts; 63 skipped, allconversion-postings) - Corpus comparison: 12,582 pass, 0 fail, 47 skip
- Desktop bench against 0.1.2 from npm (CI runner, 10,000 transactions): every operation within
0.78–1.07× of 0.1.2 (the 0.78 is Beancountprices, at 0.12 ms; the 1.07 is Beancountformat,
452 to 483 ms); load+transactions 95.9 ms (hledger), 138.0 ms (Beancount); start 20.6 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 930 MB hledger, 549 MB Beancount)
- Similarity check score: max 0.089 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.275 (information only) - Real journals: pass (21 pass, 0 fail)
- Device targets: not met (Beancount load+transactions on a Pixel 7 Pro: median 505 ms over 12 runs,
worst of 3 above 500 ms in 3 of 4 rounds; 0.1.2 on the same phone, alternated: median 491 ms, also
above 500 ms in 3 of 4 rounds). Every other target met: hledger load+transactions worst 312 ms,
start 19 ms, value 61 ms, holdings 36 ms, memory 48.2 MB hledger and 43.4 MB Beancount
ledgermill 0.1.2
Fixed
- hledger: a price on an amount whose quantity and cost are both zero (
0 X @ 3 EUR) no longer
stops a price from being inferred; that amount takes the inferred price, as hledger does. Such a
transaction was refused as unbalanced since 0.1.0 (c 0 X @ 3 EUR,a 1 X,b -4 EUR;
hledger gives0 X @ 4 EURand1 X @ 4 EUR). Found by a fuzz soak (seed 90006).
Release gate
From the release-gate workflow on commit f772a9e (run 40537425419, 2026-10-27), CI on the same
commit (run 40537426399), and the owner's own runs.
- Random hledger journals (5,000): 0 mismatches (2,236 that hledger accepts; the rest rejected by
both, 34 skipped, allconversion-postings) - Random Beancount journals (5,000): 0 mismatches
- Random price networks (5,000): 0 mismatches
- Random Beancount journals with pairs priced both ways (5,000, new in this gate): 0 mismatches
- Corpus comparison: 11,822 pass, 0 fail, 30 skip
- Desktop bench against 0.1.1 from npm (CI runner, 10,000 transactions): every operation within
0.73–1.11× of 0.1.1 (the 0.73 ischeck, at 0.02 ms; the 1.11 is hledgerholdings, 9.6 to
10.6 ms); load+transactions 92.5 ms (hledger), 132.6 ms (Beancount); start 19.8 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 930 MB hledger, 578 MB Beancount)
- Similarity check score: max 0.102 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.275 (information only) - Real journals: pass (21 pass, 0 fail)
- Device targets: not run again (the fix changes no timing or memory path)
ledgermill 0.1.1
Fixed
- hledger: a commodity that
==*or=*zeroed on an account, when one posting with a lot on a
sub-account made it, keeps that lot; zeroing it again gives the lot back, as hledger does.
0.1.0 dropped it (a:b 4 X {10 EUR},a 1 X,a ==* 3, thena == 2 EURgave4 X, not
4 X {10 EUR}). Found by the release gate run on thev0.1.0tag (random journal, seed 303). - hledger
--cost(atCost()): in a transaction with two conversion pairs, one that fits the
priced posting and one that does not, and a first plain posting that another repeats, the pair
that fits is dropped and the other kept, as hledger does. 0.1.0 kept both (so 7 postings where
hledger gives 5, and holdings followed). Found by CI's random journals (seed 21).
Release gate
From the release-gate workflow on commit 4643b81 (run 40479812101, 2026-10-27), CI on the same
commit (run 40479812678), and the owner's own runs.
- Random hledger journals (5,000): 0 mismatches (2,232 that hledger accepts; the rest rejected by
both, 42 skipped) - Random Beancount journals (5,000): 0 mismatches
- Random price networks (5,000): 0 mismatches
- Corpus comparison: 11,811 pass, 0 fail, 30 skip
- Desktop bench against 0.1.0 from npm (CI runner, 10,000 transactions): every operation within
0.74–1.06× of 0.1.0 (the 0.74 ischeck, at 0.02 ms); load+transactions 94.5 ms (hledger),
134.1 ms (Beancount); start 19.3 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 930 MB hledger, 578 MB Beancount)
- Similarity check score: max 0.102 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.275 (information only) - Real journals: pass
- Device targets: not run again (the fix changes no timing or memory path)
ledgermill 0.1.0
The first release. Two ledger engines, one for hledger journals and one for Beancount ledgers,
in a Rust core that compiles to WebAssembly. They compute with exact decimals, never read a file
or a clock, and answer through typed values.
Packages: ledgermill and ledgermill-wasm on crates.io, @ledgermill/wasm on npm (the wasm
and its glue).
Matches
- hledger 1.52.4
- Beancount 3.2.3, and beanquery 0.2.0 for the queries (
bean-query)
These are the reference tools the comparison harness runs on journals we wrote. A different
version may behave differently; ledgermill makes no promise about it.
The interface
load(files) reads { name, content } files in order, and never fails: every problem becomes a
finding. The format comes from the file name (.beancount and .bean are Beancount, anything else
is hledger). The loaded ledger answers:
transactions()– the booked transactions, with file and line (Beancount: padding included);postings()– one row per posting and commodity, with the fields of its transaction;prices()– thePdirectives (hledger) orpricedirectives (Beancount);check()– the problems found, as findings;atCost()– the transactions with every cost applied (hledger print --cost; Beancountcost(position));value(date, commodity)– every amount valued at the prices known on a date
(hledger print --value=DATE,COMMODITY; Beancountconvert(position, V, date));holdings(query)– per account and commodity, the units, cost, value and cost value;free()– releases the ledger held in wasm memory.
format(name, content) realigns the postings of a file, changing only whitespace: hledger
journals like hledger print lays them out, Beancount ledgers like bean-format. A file that
ledgermill refuses, or whose formatted text would not read as the same ledger, comes back
unchanged.
In Rust the same interface is the ledgermill crate (load, Ledger, format); the wasm
binding returns each answer as a JSON string in the core's own shape.
Both formats
- hledger: transactions, postings, virtual postings, costs and lots, balance assertions and
assignments,Pprices, aliases,apply account,D,decimal-mark,Y, and the errors
hledger gives for them, with the same first error (file and line). - Beancount: the transactions and every directive
bean-checkchecks (accounts,openand
close,balance,pad, currency constraints, duplicates, booking), booking of costs,price
directives and the same first error asbean-check.
Findings
check() returns findings: { code, severity, file, line, column?, details, message }. The
code and the keys of details are stable; message is a short English sentence for people and
may change. Errors are parse-error, unsupported-syntax, unbalanced-transaction,
assertion-failed, booking-error, account-not-open and others; warnings are
ignored-syntax. spec/README.md lists every code and its details.
What is refused or ignored
A construct ledgermill cannot reproduce is never guessed: it is an unsupported-syntax error on
the line (and the transaction is not returned), or an ignored-syntax warning when hledger
itself does nothing with it.
- hledger:
include, timeclock, timedot and CSV files, dates with no year when noYis in force,
and a few more are refused. Automated (=) and periodic (~) rules are read and then left
out, with a warning each, because hledger applies them only with--autoand--forecast.
spec/hledger/syntax.md lists every construct and its class. - Beancount:
include,plugin, options outside a harmless list, AVERAGE booking, arithmetic in
numbers, partial costs and a few more are refused, and several Beancount files, or Beancount
and hledger files, cannot be loaded together yet. A Beancount file with a refused construct
lists no transaction.documentdirectives are read and skipped with a warning.
spec/README.md and spec/beancount/syntax.md
have the details. formatand the valuation reads answer only for what ledgermill reads; see their spec notes.
Release gate
From the release-gate workflow on commit fe79e24 (run 40360104607, 2026-10-26) and the owner's
own runs.
- Random hledger journals (5,000): 0 mismatches (2,287 that hledger accepts, compared on
transactions, postings, prices and holdings; the rest rejected by both, 45 skipped) - Random Beancount journals (5,000): 0 mismatches (transactions, prices, cost, value and holdings)
- Random price networks (5,000): 0 mismatches
- Corpus comparison: 11,797 pass, 0 fail, 30 skip
- Every interface method compared: yes (
harness/interface.test.ts) - Desktop bench: first release, so this is the baseline (CI runner, 10,000 transactions):
load+transactions 80.1 ms (hledger), 118.3 ms (Beancount); start 15.4 ms - Stress test, 100,000 transactions: ok, no crash (peak wasm memory 930 MB hledger, 578 MB Beancount)
- Similarity check score: max 0.102 (JPlag against rustledger 0.24.0; fail at 0.15), 0 fail,
8 warn; copydetect max 0.275 (information only) - Real journals: pass
- Device targets: met