waozi a231bc3fe5 Complete complex pow parity and sub-second datetime rendering
Complex powers now flow through goffice's go_complex_powx algorithm:
kryon's kry_quad gains the quad-precision machinery it needs — natural
log with scaling and a Newton step, hypot with over/underflow
protection, Carlson's AGM arcsin/arccos/arctan, atan2/atan2pi with
axis and diagonal special cases, reduce-half sinpi/cospi with Newton
refinement, mulmod1 modulo-one argument reduction, and the
correctly-rounded pi/2pi/pihalf/ln2/sqrt2 double-double constants.
IMIGAMMA (and every other complex-power consumer) is now bit-exact
for arbitrary complex arguments; the special_functions fixture gains
the five previously excluded rows.

Datetime cells with a fractional-second component now render
milliseconds like gnumeric (rounded, omitted when zero or carried
into the seconds), so UNIX2DATE handles sub-second timestamps
exactly; the datetime_functions fixture gains those rows too. All 27
fixtures remain 1:1 with ssconvert including round-trips, with the
456-function manifest fully dispatched.
2026-09-05 11:32:26 -03:00
2026-08-25 10:20:24 -03:00
2026-09-04 22:53:32 -03:00
2026-08-25 10:20:24 -03:00
2026-08-25 10:20:24 -03:00

workbook

Native spreadsheet editor authored in Kry, compatible with Gnumeric file formats and expressions. workbook.kry is the desktop application; src/engine.kry is the spreadsheet engine (grid model, formula evaluator, function library, .gnumeric/CSV I/O); k2c lowers both through KIR to generated C for the native Kryon runtime.

The engine reads and writes .gnumeric (Gnumeric XML, gzipped or plain), evaluates the Gnumeric expression language (references, ranges, sheets, operators, 120+ functions with Gnumeric semantics including errors and date serials), and is verified 1:1 against the installed Gnumeric by scripts/parity-test.sh — every fixture is evaluated by both engines and compared cell by cell, including round-trips through our own .gnumeric writer. Format notes: docs/GNUMERIC_PARITY.md.

build & run

make              # compile workbook.kry and build ./workbook
make cell         # build the headless engine driver ./cell
make test         # source audit, native UI smoke, 1:1 gnumeric parity
make parity       # 1:1 evaluation tests against the installed gnumeric
make run          # open ./workbook
./workbook        # generic workbook
cell eval FILE    # evaluate a .gnumeric/.csv file and print CSV
geld              # installed finance profile wrapper
make install      # install workbook, cell, and geld

editing

The desktop editor uses Kryon's native UI, layout, storage, and JSON APIs directly from workbook.kry.

up/down wheel     select / scroll
left/right Tab    move across cells
double click      focus the selected cell in the formula bar
Enter             commit the formula bar value
Delete            clear the selected cell
Ctrl+S            save
Esc               quit

Formula cells show their calculated value in the grid and their source in the formula bar. Arithmetic, cell references such as =D1*E1, and rectangular SUM ranges such as =SUM(G1:G8) are supported.

The toolbar provides save and row/column insertion and deletion. Cells accept text, numbers, or formulas. Free-form values are saved in workbook.json.

profiles

workbook is the generic profile. geld uses an independent data directory for finance rows. Both execute the same Kry application source:

D = units
E = rate
G = value, e.g. =D1*E1
H = diff, e.g. =(E1-OLD_RATE)*D1

The profiles/*.json files are profile metadata, not Kry source.

data

Data loads from the profile environment variable, then a workbook.json in the current directory, then the profile data directory.

WORKBOOK_DIR      generic workbook override
GELD_DIR          geld finance workbook override
~/.local/share/workbook
~/.local/share/geld

workbook.json holds private workbook data and is intentionally ignored by git. workbook.example.json is safe sample data for demos.

JSON remains the persisted data format. .kry is used only for executable Kry source code.

S
Description
Desktop spreadsheet editor.
Readme 0BSD
4.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
Ziran 97.3%
TypeScript 2.2%
Makefile 0.5%