Repository navigation
v0.4.0
Laws
lawdeclares a claim the compiler proves for every value of its parameters, and one it cannot prove is a compile error.- A false law is refused with a counterexample, and one nothing settles with the goal left open, the case it is in and what was known.
- A law cites another by calling it, and is an induction by calling itself on a part a pattern took apart; the compiler tries an induction on each vector parameter on its own.
- A generic law is proved at every set of types the program uses what it calls at, each copy on its own.
- A law reaches only code that ends and answers the same every time: no library call, no
async, no loop butfor eachand a counting loop the bounds pass trusts. - A law inside a type is kept by every value of it: each construction and each write is proved to keep it, from what that function knows there.
- A type's laws are known wherever a value of it is read, by function laws and by the bounds pass.
- A decoder refuses a value that breaks its type's law as
Broken, besideMismatchfor a document of the wrong shape. hive indentkeeps an empty line around a type's law, which touches only other laws.- A law
for table <name>is a SQL filter every query on the table carries, read off the query's SQL: in what it reads, changes and deletes, wherever the law'sifholds. - A row a query inserts or updates has to land inside a table law's filter, by writing one of its
column = valueparts. tableis a keyword only after a law'sfor, so a name spelledtablestill compiles.lawis a keyword, so a name spelledlawno longer compiles.axiomis reserved: any use of it is a compile error, so a later version can give it a meaning without breaking a name.
Fixes
- An assignment never lets a write through one name reach another:
rec.f = xscopies an immutablexs, as a binding does.
Breaking
| was | is |
|---|---|
a variable/parameter/field named law |
something else |
a variable/parameter/field named axiom |
something else |
hive.json.JsonError, hive.crypto.JwtError, hive.net.QueryParamsError and hive.term.FlagError as structs |
unions of Mismatch and Broken, sharing path, expected and found |
hive.sql.raw(connection, text) |
hive.sql.unsafe(connection, text), which no table law reads |
To bootstrap from this release, seed/pinned.txt becomes:
tag: v0.4.0
asset: hivec-linux-amd64
sha256: db824fdcce0b9c16ce7dc9a37015d5019c43204b7164e7d6f75813ef1f21bb04