catalog: a positional query IR and its compiler to the VM (engine transition step 1)
This begins moving the SQL engine into ocaml-catalog so any backend runs it and
the tree-walker can eventually be deleted there. The blocker has been that the
SQL AST aliases the B-tree value type, so it cannot move into catalog; the seam
is a positional, alias-free IR over Catalog.Value that the compiler turns into a
Vdbe.program, with the frontend lowering its AST to the IR (resolving names to
(cursor,column) positions, literals to Value.t) at the boundary.
Catalog.Ir models a single-cursor scan / filter / project -- expressions
(column/literal/param/arithmetic), an AND of comparisons and IS [NOT] NULL, and
a projection -- and compiles them to the register VM (label resolution included),
storage- and dialect-agnostic. Tested end-to-end over a list_cursor:
scan/filter/project, AND + IS NOT NULL, and a bound parameter.
Next on this seam (parallelisable): joins (nested loops), the injected scalar
function/value layer, aggregation/window post-passes, and the Ast->Ir lowering
in ocaml-sqlite that lets it call this compiler instead of vdbe_run.