Unofficial Hacker News companion — get notified on comment replies, and more.

Unkernel: Real Linux kernel, compiled to WebAssembly (opens external site)

621 points by nreece 4 days ago | unkernel.dev | 172 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. You hit on the exact two reasons most canvas-based UI frameworks fall apart: text rendering and accessibility. Treating the screen as a dumb pixel buffer while bolting on a hidden `<textarea>` for copy-paste and screen readers is always a fragile hack.

    The clean way to solve it is to keep the UI as a strongly-typed, retained-mode scene graph and document model inside Wasm, and project that same model to two targets simultaneously:

    1. Pixel-accurate rendering: Doing proper OpenType text shaping and SDF text layout directly in Wasm so `1px` actually means `1px`, without relying on browser CSS layout engines. 2. Parallel semantic / accessibility tree: Mirroring the scene graph's focus, roles, selection ranges, and text nodes out to a lightweight accessibility/DOM layer so screen readers, keyboard navigation (`Tab`, `Space`, `Enter`), and native clipboard/IME work properly without the browser layout engine ever touching visual positioning.

    I've been building this exact architecture in fsharp-wasm — an open-source F# compiler targeting WebAssembly GC directly without shipping the .NET runtime or BCL. Our retained-mode 2D graphics stack (`fsharp-wasm-graphics`) and zero-alloc OpenType/SDF text shaper (`fsharp-glyph-aura`) drive everything from a visual widget editor to a pivot-table accounting grid over 1M journal lines, while keeping full keyboard/screen-reader accessibility and sub-50 KB Brotli module sizes.

    It's still experimental (and we're actively expanding the semantic accessibility projection alongside the canvas), but compiling a pure functional UI stack straight to WasmGC gets surprisingly close to that "no CSS nightmare, works everywhere" ideal without sacrificing accessibility.

    Live demos (Widget Editor, Accounting Grid, WasmOS) and architecture notes: https://fsharp-wasm.github.io