nxc.nx
buildroot/runtime/nxc.nx
about
nxc.nx -- the full NishiLang sovereign-compiler driver.
Chains every piece of our stack in pure NishiLang:
source (.nx) -> import-expand -> lex -> parse -> opt
-> regalloc -> riscv -> nxasm (assemble)
-> elf_writer (wrap) -> sys_write(stdout)
Output is a self-contained RV64 Linux ELF executable. Zero third-
party code on the program path: no gcc, no binutils `as`, no ld,
no libc, no external crt0. The only external thing is the Linux
kernel ABI, which NishiOS replaces 1:1.
CLI: `nxc <path>.nx` reads the file, runs the import expander to
inline `import \"...\"` directives into a single source blob, then
drives the compile pipeline and writes the ELF to stdout. Pipe
to a file + chmod +x to run:
nxc hello.nx > hello && chmod +x hello && ./hello
With no args it compiles a baked-in demo source so `./nxc` still
exits successfully for smoke-testing the chain.
Status (2026-04-22): parse.nx has full monomorphization for
generic struct + enum; the earlier \"syntax accepted but no
substitution\" gap is closed. Outstanding work to fully retire
gcc from the compiler bootstrap is QEMU/real-RV64 verification of
the produced ELF (Phase 5 roadmap).
dependencies 15 imports · 0 importers
diagram shows first 10 each side; +5 more imports, +0 more importers in the complete lists below.
imports: syscalls.nxtypes.nxlex_kinds.nxoutbuf.nxir.nxir_validate.nxlex.nxparse.nxopt.nxregalloc.nxnx_riscv.nxcrt0.nximport.nxnxasm_v2.nxelf_writer.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 255 | const EXPAND_OUT_CAP: i64 = 4194304 |
functions
| 59 | func nxc_compile(src: *u8, fd: i64) -> i64 {
called by 1: main calls 12: lex_sourceparse_moduleir_validate_moduleopt_inline_moduleout_newemit_crt0_start+6 |
| 257 | func main(argc: i64, argv: *i64) -> i64 { |