nx_math_serve.nx
buildroot/runtime/nx_math_serve.nx
about
nx_math_serve.nx -- /math AS A TOOL, NOT A BROCHURE.
WHY THIS EXISTS. The operator asked for a UI where you can DO mathematics; what shipped first was a page
whose formulas were typeset at publish time and whose worked solutions were three hardcoded equations.
Their words: "/math is just static output how does that match what i asked for". It did not. A page that
DEMONSTRATES a capability is a different artifact from one that PROVIDES it, and only the second is a UI.
WHAT MAKES IT INTERACTIVE, AND WHY THIS SHAPE. A visitor types an equation into a PLAIN GET FORM. There
is no script, no fetch and no client runtime: the estate's document portal reached the same conclusion
(portal actions as plain forms), and a GET form has three properties a script cannot match here -- it
works with JavaScript off, every solved equation gets a SHAREABLE URL a teacher can hand to a class, and
there is no third-party anything in the path.
ONE RENDERER, TWO ENTRY POINTS. This daemon calls mp_render from nx_math_page, the SAME function the
static build calls. Two renderers for one surface is the duplicate-ruler defect wearing HTML, and it
would drift the moment either was edited. The static file remains as the fallback a reader gets if this
daemon is down, and it is byte-identical to what this serves for an empty form.
⚠BINDS LOOPBACK, DELIBERATELY. A daemon binding INADDR_ANY is on the LAN the instant it starts; the
estate has measured that. The edge proxies to it, so it is never directly exposed.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: syscalls.nxnx_http_server.nxnx_math_page.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
| 27 | const MS_PORT_DEFAULT: i64 = 18131 |
| 28 | const MS_REQ_CAP: i64 = 16384 |
| 29 | const MS_EQ_CAP: i64 = 1024 |
| 30 | const MS_BACKLOG: i64 = 64 |
| 33 | const MS_HDR_RESERVE: i64 = 512 |
functions
| 35 | func ms_slen(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { i = i + 1 } return i } |
| 37 | func ms_hexval(c: i64) -> i64 called by 1: ms_urldecode |
| 47 | func ms_urldecode(src: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 73 | func ms_extract_eq(path: *u8, plen: i64, out: *u8, cap: i64) -> i64 |
| 94 | func ms_put(b: *u8, off: i64, s: *u8) -> i64 |
| 101 | func ms_num(b: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 114 | func main(argc: i64, argv: *i64) -> i64 |