Re:Lightpanda migrate DOM implementation to Zig
by galangalalgol on Monday January 12, 2026 @07:29AM
(#46587548)
Too late now, but is the requirement for shared mutable state inherent in the problem space? Or is it just because we still thought OOP was cool when we started on the DOM design?
[ Parent
| on HN ]
Re:Lightpanda migrate DOM implementation to Zig
by pornel on Monday January 12, 2026 @09:55PM
(#46596850)
Yes. It is required for W3C's DOM APIs, which give access to parent nodes and allow all kinds of mutations whenever you want.
Event handlers + closures also create potentially complex situations you can't control, and you'll need a cycle-breaking GC to avoid leaking like IE6 did.
You can make a more restricted tree if you design your own APIs with immutability/ownership/locking, but that won't work for existing JS codebases.