diff options
| author | eunhhu <[email protected]> | 2026-09-30 16:16:08 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-30 16:16:08 +0100 |
| commit | 46c303a41e9dd9cd0e6bd50511e8d7253a0ef438 (patch) | |
| tree | 7564bf80ac43ff0964c64acd6a15f7299fa48997 /docs/research/025-native-authoring-shell.md | |
| parent | e02bfc916743a0327d76144b32b6ec6381e5907f (diff) | |
| download | pure-46c303a41e9dd9cd0e6bd50511e8d7253a0ef438.tar.gz pure-46c303a41e9dd9cd0e6bd50511e8d7253a0ef438.zip | |
Give i64 its own type in modules, lists, stores and the host (016 stage 2)
An i64 is an int64_t in a value's 8 bytes, its own stack type: CONST and
NUM_TEXT take argument 2 for one, eleven opcodes are appended (ADD, SUB
and MUL fail as overflow past its range, DIV and MOD floor and fail as
divide by zero, NEG, COMPARE with a relation, MIN, MAX, and I64_FROM and
NUM_FROM, which convert only where the value fits and else fail as
limit), and moves (LOAD, STORE, locals, items, FIELD, SEND) copy it as
they copy a number. Type codes: state 6, record field 3, message field 7
(8 bytes), view 4, local 3. v6 stays: all of it is added.
- Folds with PURE_FOLD_INTEGER sum (overflow fails), keep the most or
least of, or count the different i64s; distinct's set keeps an i64's
-1 apart from its free mark. Blocks with an i64 run item by item.
- A list's kinds are its stored header's (number, text, bytes, bool,
integer): integer columns are int64_t, ordered as integers as keys
(found without guide keys for now), stored in 8 bytes and logged as
zigzag varints of any size. Records name their fields' type in one
array (record_field_type) in place of text and bool flags.
- A number, a bool and an i64 carry over each other by one rule,
pure_cell_as, wherever one becomes another: a module replaced, a stored
value or item read by another module, a waiting send recast. A u32
field delivers to an i64 one.
- The host reads i64 fields from JSON, rows and queries as integer digits
in range and nothing else, and shows every digit in views, tables,
deliveries and pure-run. Faults are named by one function,
pure_fault_name, in place of three tables; overflow is new.
test-module: 28 arithmetic cases at the range's ends, relations,
conversions both ways, 14 refusals, a keyed i64 list app (order, a sum
that overflows, a failed add undone, messages and sends of 8 bytes, every
digit as text), recasts, replacement between numbers, bools and i64s, and
three stored runs against memory with restarts (46 images written).
Diffstat (limited to 'docs/research/025-native-authoring-shell.md')
0 files changed, 0 insertions, 0 deletions
