feat(cli): ludic deps - the module graph as the compiler resolved it

With LUDIC_DEPS=<file> the compiler records every reference the
visibility pass resolves (from module, to module) and every assignment
to another module's global. ludic deps prints the modules,
dependencies, largest cycle, cross writes and globals written from
outside, with --graph, --dot, --writes, --uses MOD, --check FILE and
--baseline FILE. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 11:16:34 +03:00
parent 69352babfd
commit e738741521
17 changed files with 44510 additions and 41589 deletions

View file

@ -29,6 +29,7 @@ program Ludic {
import "pack.ludic"
import "bundle.ludic"
import "scripts.ludic"
import "deps.ludic"
function usage() -> void {
print("ludic — the toolchain for the Ludic language")
@ -42,6 +43,8 @@ program Ludic {
print(" compile to build/<name> (a native binary, nothing to ship beside it)")
print(" test [file...] [-v] [--test NAME]")
print(" compile and run the project's tests (-v: every test's line)")
print(" deps [file] [--graph|--dot|--writes|--uses MOD|--check F|--baseline F]")
print(" the module graph as the compiler sees it, and how tangled it is")
print(" clean remove build/")
print("")
print("packages:")
@ -93,6 +96,7 @@ program Ludic {
if (cmd == "build") { return cmd_build() }
if (cmd == "run") { return cmd_run() }
if (cmd == "test") { return cmd_test() }
if (cmd == "deps") { return cmd_deps() }
if (cmd == "clean") { return cmd_clean() }
if (cmd == "fmt") { return cmd_fmt() }
if (cmd == "lsp") { return cmd_lsp() }