feat(cli): ludic build --check / ludicc --check - check without building

The parse, the types and the module rules (export, uses, layers, ports,
registries) run and nothing is emitted or linked: about three seconds
on Maroon Lake. In this mode the checker asks vis_check at each
reference it resolves, with a global's initializer and a registry's
entries seen from the files the emitter would use. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 13:13:42 +03:00
parent 7ef6c7ec75
commit 8892f51096
12 changed files with 15546 additions and 14721 deletions

View file

@ -1841,6 +1841,7 @@ ludic test # compile and run the project's `test`
ludic test tests/math.ludic --test adds # just the test named "adds" (-v: every result line)
ludic test -j 4 # four tests at once (default: one per CPU)
ludic test packages/ludic.base # the test programs under a directory (a package's)
ludic build --check # only check: types, modules, uses and ports - nothing emitted
ludic deps # how tangled the modules are, as the compiler resolved them
ludic deps --check tests/deps-baseline.txt # fail when a number rose (--baseline FILE writes them)
@ -1848,6 +1849,12 @@ ludicc app.ludic -o build/app # the compiler directly: a native binar
ludicc app.ludic --emit-llvm -o app.ll # stop at LLVM IR
```
`ludic build [file] --check` (the compiler's `ludicc --check`) runs everything the compiler checks
before it writes code - the parse, the types, `export`, `uses` and layers, ports and binds, registries
- and stops: no IR, no link. On Maroon Lake it takes about three seconds where a build takes about a
minute, for iterating on `uses` lines. Two checks belong to the code writer and only a build makes
them: a function that can reach its end without its result, and a local declared twice in a block.
`ludic deps` compiles the program (the package's entry, or a file) with the compiler recording every
reference its visibility pass resolves - from the module it is written in to the module of what it
names - and every assignment to another module's global. It prints five numbers: `modules` (the