A NIF lens for tooling, in nimony — the nimony port of the (Nim 2) aiflens.
A thin CLI over Nimony's own NIF libraries that reads nimcache/*.nif artifacts
with the real parser and emits compact JSON for a host tool (e.g.
aowllsp, the aowl-code plugin) to consume.
Because it links the compiler's NIF libraries (nifprelude / nifstreams /
symparser / nifindexes), its line-info decoding, symbol handling and tag
vocabulary always match the toolchain that produced the file, and it tracks NIF
format bumps for free — no regex approximation.
Why nimony? The whole aowl stack is nimony-native and JS-compilable. The Nim-2 aiflens shelled out from a Nim-2 process; aowllens is nimony, so the same NIF-reading logic can eventually run in-process inside a nimony tool (or a browser IDE) instead of as a subprocess.
aowllens decls <file.s.nif> [symbol] declaration sites {sym,name,kind,file,line,col}
aowllens render <file.nif> [needle] pseudo-Nim rendering of top-level nodes
aowllens index <file> interface index (.s.idx.nif): checksum/exports/converters
aowllens outline <file> top-level named nodes (names only)
aowllens query <file> <needle> subtrees whose tag or symbol matches
aowllens serve line-oriented stdio daemon (one JSON req/resp per line)
aowllens versiontests/difftest.sh generates a real .s.nif with nimony check and compares
every command against the Nim-2 aiflens it replaces:
decls,outline,query,index— byte-identical.render— identical modulo the hex-case of\u00XXescapes for control-character literals in the heuristic pretty-printer (aiflens is itself inconsistent there; aowllens is consistent lowercase, matchingstd/json).
bash build.sh # -> bin/aowllens
bash tests/difftest.sh # differential test vs aiflensLinks Nimony's NIF libraries from $NIMONY_SRC (default $HOME/nimony/src) and
the shared aowlkit lib (json).
| file | role |
|---|---|
src/aowllens.nim |
CLI entry + dispatch |
src/aowllenspkg/core.nim |
NIF loading + shared helpers (JSON via aowlkit) |
src/aowllenspkg/decls.nim |
declaration sites |
src/aowllenspkg/outline.nim |
outline + query |
src/aowllenspkg/index.nim |
interface index reading |
src/aowllenspkg/render.nim |
NIF → pseudo-Nim renderer |
src/aowllenspkg/serve.nim |
stdio daemon |