AWESOME-OS ENGINEERING BLOG

12 — Native HTML5, CSS Flexbox & Reactive JS Without Forking WebKit (b8g-html)

12 — Native HTML5, CSS Flexbox & Reactive JS Without Forking WebKit (b8g-html)

Anchored Code:
- Portable HTML5/CSS -> b8g-layout Core (zero node:*): intersections/b8g-html/index.mts
- Reactive Isolated JS DOM Runtime: intersections/b8g-html/runtime.host.mts
- Unified Host CLI (bin\b8g-html.ps1, pre-wrapped with host-debug-facade): intersections/b8g-html/cli.host.mts
- Run this post live: .\bin\notebook.ps1 run 12

1. Why We Chose Projection Over a 20M-LOC WebKit Fork

Forking full WebKit would mean maintaining 15–20 million lines of C++, ICU, HarfBuzz, Cairo/Skia, GStreamer, libxml2, and JavaScriptCore — duplicating our own faster b8g-abi-v8, $O(N)$ @awesome-os/b8g-layout, and native wgpu + glyphon b8g-gfx-host.

Instead, intersections/b8g-html/ projects real HTML5 + <style> CSS Flexbox + <script> / onclick directly onto Awesome-OS primitives in ~500 lines of zero-dependency TypeScript:


2. Live Executable alg Cell (.\bin\notebook.ps1 run 12)

blade HtmlDom     @sab-ring { nodeCount: int32, quadCount: int32 }
blade HtmlEvents  @sab-ring { interactionCount: int32, lastHitId: string(64) }
manifold NativeHtmlApp = HtmlDom ^ HtmlEvents
chart NativeHtmlGpu    = NativeHtmlApp |> host(diagnostic, 8000ms) -> wgpu

← Back to all 27 engineering posts