code wiki / _hdl_build / nx_builder_authors_huffman.nx

nx_builder_authors_huffman.nx source

↩ module page · 13 lines · 747 B

1// nx_builder_authors_huffman.nx -- the BUILDER authors a canonical Huffman decoder (Claude tutored the template; 2// the Builder composes the bit-reader it learned in cycle 1). Engineer verifies via nx_build_run. 3import "nx_module_author.nx" 4import "nx_syscalls.nx" 5func _b(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 6func main() -> i64 { 7 _b("BUILDER authors a canonical Huffman decoder (composes the bit-reader)\n" as *u8) 8 let fd: i64 = sys_openat_wr("runtime/_hdl_build/_huffman_authored.nx" as *u8, 0x1a4) 9 ma_emit_huffman(fd, "hdecode" as *u8) 10 sys_close(fd) 11 _b(" -> runtime/_hdl_build/_huffman_authored.nx authored; Engineer verifies next\n" as *u8) 12 sys_exit(0); return 0 13}