Tools and Backends#

I have several execution paths. They share syntax but not complete feature parity.

Tools#

ToolPurpose
bin/nanocCompile source and expose analysis or backend options
bin/nanoInterpret a source file
bin/nanolang-replInteractive evaluation
nano-fmtFormat source
nano-docsSearch local documentation
bin/nanolang-lspLanguage Server Protocol support
bin/nanolang-dapDebug Adapter Protocol support
bin/nano_virtLower source to NanoISA bytecode
bin/nano_vmExecute NanoISA bytecode
bin/nano_vmdRun the NanoVM daemon
bin/nano_copIsolate supported foreign calls in a co-process
bin/nvm2cTranslate a closed NanoISA subset to structured C11
bin/nanoisa_emitLower a pinned integer subset to NanoISA assembly (make nanoisa_emit)

Run each tool with --help where provided. The generated Compiler CLI page records the compiler's current help text.

Backends#

OutputCommandBoundary
Native executablenanoc source.nano -o programProduction path through generated C
C sourcenanoc source.nano --target c -o program.cStandalone generated C
NanoISAnano_virt source.nano --emit-nvm -o program.nvmShared typed VM representation
PTXnanoc source.nano --target ptx -o program.ptxGPU kernel subset
OpenCL Cnanoc source.nano --target opencl -o program.clGPU kernel subset
RISC-V assemblynanoc source.nano --target riscv -o program.sExperimental subset
NanoISAnano_virt source.nano -o program.nvmVirtual-machine path with isolated FFI support

Future LLVM and WebAssembly targets translate from NanoISA rather than branching from my source AST. C11 from NanoISA is bin/nvm2c on a closed subset (make test-nvm2c), not nano_virt's default native wrapper that still embeds the VM.

Diagnostics#

Machine-facing diagnostics include JSON and TOON forms. Useful compiler options include --llm-diags-json, --llm-diags-toon, --json-errors, --emit-typed-ast-json, and --reflect. I select a process locale with --locale <tag> (then NANO_LOCALE, POSIX LC_ALL/LANG, else en) and print the axes with --print-locale. JSON/TOON diagnostics stay English. Human stderr looks up UTF-8 catalogs under catalogs/messages/ or NANO_CATALOG_DIR, with English fallback. Pipeline compiler diagnostics use stable IDs (CIO01, CSRC01, L0003, P0001, E001–E035, LOG01, and the rest of src/diag_id.c). Typechecker titles that go through emit_context_error use unique E001–E034; unlabeled JSON fallback is E035. Identifiers are ASCII; a non-ASCII byte fails closed (L0003). I reject invalid UTF-8 in .nano source (CSRC01) and at JSON/TOON/module.json/docgen/log boundaries. I do not call the system internationalized. Consult the generated CLI page because flags change more often than prose should pretend they do not.

-pg and --profile-output wrap a native binary with the host profiler and emit JSON on stdout. That path is not --profile-runtime and is not --pgo. I document it in Performance Profiling.

NSI, capabilities, the POSIX fabric, and the trap journal are the secure-runtime tools. They are libraries and tests, not extra CLIs. See Secure Runtime.