gen fn columns(module: String) -> String
Emits a module exporting the column layout of every record type module exports.
Type to search, or try , or .
1 export, from std/columns.vyrn.
A record type laid out as one array per field.
import { columns } from "std/columns" import { BodyColumns, bodyColumns, pushBody, bodyAt } from columns("./bodies")
columns is a gen fn that reflects a module and writes, for each record type T it exports:
type TColumns: one Array<F> per field f: F of T, under the same name, with a where rule that every column has the first one's length. c.f[i] reads a field and c.f[i] = v writes one in place.tColumns(capacity): empty columns with room for capacity rows.pushT(c, v): appends the row v to c in place. The pushes are one group of stores, so the rule is checked once, after the last column grows, and the check is proved.tAt(c, i): row i read back as a T.c.f.length counts the rows. Because of the rule, a loop bounded by one column's length indexes every column with no bounds check. A walk over one field of many rows reads only that field's bytes, and a layout of one array of records reads the whole row.
The import graph shows the whole library.
gen fn columns(module: String) -> String
Emits a module exporting the column layout of every record type module exports.
This module carries no test block of its own.
2 programs in examples/ import this module. Each runs as WebAssembly and as a native binary.