Terminal
The CLI, with nothing installed
Each command here calls the same library function as the installed viv binary:
main.rs only parses the command line, and the wasm module exports the functions it
calls. So hash, diff, canon and the rest print byte for
byte what the installed compiler prints on the same file. The terminal has
37 files loaded: the
33 example programs and the
4 files of the standard library.
The Viv compiler, running in your browser. Try help, ls, or hash control.viv to see a hash of each definition.
viv
Four commands to try first
- hash control.viv
- Per-definition content addresses: a node hash (name included) and a body hash (the code alone). Reformat a definition and neither moves; rename it and only the node hash does. Because the body hash ignores the name, a diff can report a rename without guessing.
- canon scf_water.viv
- The program reordered into canonical dependency order, which is idempotent — run it on its own output and nothing moves. Try it on this 400-line Hartree–Fock program.
- features
-
What Viv can do, by area: syntax, types, arrays, autodiff, correctness, the lenses, tools,
performance, libraries, and the builtins, phrases and modules generated from the compiler's
own tables.
features value-and-gradshows one entry: what it does, when to use it, and a minimal example and its output;features --search sortfinds entries by words. The installed binary addsviv features --usage, which counts how often a corpus uses each feature and lists code that does by hand what a feature does. - doc fem_poisson.viv
- The structured annotations as JSON: per-definition what/how/why, tags, and the variable glossary. It is the JSON a code browser renders.
wasm <file> compiles the file with the direct wasm backend, without C, and
runs the module in your browser. It prints what run prints.