nx_compile_wat.nx
buildroot/runtime/nx_compile_wat.nx
about
nx_compile_wat.nx -- SOVEREIGN source-file driver for the NishiLang WAT (WebAssembly) backend.
The NishiLang counterpart of nxc2.exe's --target wat path: reads a .nx (import-expanded), runs
lex_source -> parse_module -> opt_run -> wat_emit_module (nx_wasm.nx, now f32-capable), writes WAT to stdout.
This WIRES the sovereign wat emitter into a usable driver so the wat path is no longer C-only. The wat is then
fed to nx_wat_compiler (.wat -> .wasm, sovereign) for the browser. usage: nx_compile_wat <src.nx> > out.wat
license_tier: ORIGINAL
dependencies 12 imports · 0 importers
diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_types.nxnx_lex_kinds.nxnx_outbuf.nxnx_ir.nxnx_tokenizer.nxnx_parse.nxnx_opt.nxnx_ir_dump.nxnx_ir_validate.nxnx_import.nxnx_wasm.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
| 19 | const WAT_MAGIC_4096: i64 = 4096 |
| 20 | const WAT_MAGIC_262144: i64 = 262144 |
| 22 | const WAT_SRC_CAP: i64 = 2097152 |
| 23 | const WAT_OUT_CAP: i64 = 16777216 |
| 24 | const WAT_EXPAND_CAP: i64 = 4194304 |
functions
| 26 | func watd_log(msg: *u8, n: i64) -> i64 { return sys_write(2, msg, n) } |
| 27 | func watd_read_stdin(buf: *u8, cap: i64) -> i64 calls 1: sys_read |
| 49 | func main(argc: i64, argv: *i64) -> i64 |