A clean-room TypeScript front-end engine, its Rust twin for headless back-end work, and a headless-Excel protocol shell on top. One function library, verified byte-identical across languages — if a cell can be drawn, it can be clicked back. clean-room TypeScript 前端引擎、同功能 Rust 无头后端引擎,以及建在其上的无头 Excel 协议壳。同一套函数库,跨语言实测 byte-identical——画得出来,就一定点得回去。
A zero-dependency, clean-room spreadsheet engine shipped as the <cmx-megasheet> custom element. Grid rendering, the formula engine, merges, named ranges, whole-column A:A refs, and {1,2;3,4} array literals — 26 milestones (M0–M26) of shared-geometry "draw = click-back" invariants, all in the browser with nothing to install.
零依赖、clean-room 的电子表格引擎,以 <cmx-megasheet> 自定义元素交付。网格渲染、公式引擎、合并、命名区域、整列 A:A 引用与 {1,2;3,4} 数组字面量——26 个里程碑(M0–M26)贯穿「画=点」共享几何不变式,全在浏览器里,无需安装。
The Rust twin — every non-rendering layer of megasheet reforged as a pure library (RS-M0→M26 full parity). Same 335 functions, verified byte-identical against the TS engine on cross-engine cases. Unlike the browser build it embraces mature crates — serde, zip, flate2, quick-xml, printpdf, rayon — for server-side XLSX / PDF work.
Rust 孪生体——把 megasheet 的所有非渲染层用 Rust 重铸为纯库(RS-M0→M26 全对等)。同样 335 函数,跨引擎实测与 TS byte-identical。与浏览器构建不同,它拥抱成熟 crate——serde、zip、flate2、quick-xml、printpdf、rayon——服务端 XLSX / PDF 由此而来。
A protocol-and-transport shell around cmx-rust-sheet that turns it into headless Excel — drive a spreadsheet over CLI or HTTP the way a headless browser drives headless Chrome. Neutral-JSON verbs (setValue, setFormula, recalc, export); every engine call is quarantined in spawn_blocking so the !Send core never crosses a thread boundary.
套在 cmx-rust-sheet 外的「协议 + 传输」壳,把它变成无头 Excel——像无头浏览器驱动无头 Chrome 那样,用 CLI 或 HTTP 远程驱动电子表格。中性 JSON 动词(setValue、setFormula、recalc、export);每次引擎调用都关进 spawn_blocking,让 !Send 内核绝不跨线程边界。
Hard constraints carried from M0 to M26 — the reason a TS front-end and a Rust back-end can share one function library and produce identical cells. 从 M0 贯穿到 M26 的硬约束——正是它们让 TS 前端与 Rust 后端能共享同一套函数库、算出同一格值。
src/ tree of cmx-megasheet stays browser-pure — no Node types, no third-party runtime. The Rust side is free to pull mature crates because it never ships to a browser.
cmx-megasheet 的 src/ 保持浏览器纯净——无 Node 类型、无第三方运行时。Rust 侧因永不进浏览器,可自由引入成熟 crate。
Drop the custom element in a page在页面里放入自定义元素
<!-- registers <cmx-megasheet> -->
import 'cmx-megasheet'
<!-- then, anywhere in your HTML -->
<cmx-megasheet></cmx-megasheet>
# 335 functions · 0 runtime deps
Drive it headless over CLI / HTTP用 CLI / HTTP 无头驱动
# start the HTTP server (localhost)
sheetwright serve
# or pipe neutral-JSON verbs via CLI
sheetwright run ops.json --export xlsx
# setValue · setFormula · recalc · export
Twenty-five real demo pages, the full function reference, and the M0–M26 milestone story — every cell you can draw, you can click back. 25 个真机演示页、完整函数参考,以及 M0–M26 里程碑全程——每一格能画出来,就一定能点回去。