Re:Show HN: Coi – A language that compiles to WASM, beats Re...
by io_eric on Saturday January 24, 2026 @06:58AM
(#46742852)
A C++ library could wrap DOM APIs (WebCC already does this), but achieving a fine-grained reactive model purely in library code involves major trade-offs
A dedicated compiler allows us to trace dependencies between state variables and DOM nodes at compile-time, generating direct imperative update code. To achieve similar ergonomics in a C++ library, you'd effectively have to rely on runtime tracking (like a distinct Signal graph or VDOM), which adds overhead.
Re:Show HN: Coi – A language that compiles to WASM, beats Re...
by rthrfrd on Saturday January 24, 2026 @08:28AM
(#46743349)
Thanks! WebCC looks interesting. I like the attempt to be lean, but in the context of running an entire browser, my personal choice would be for a little runtime overhead vs a new language and toolset.
All the best with it!
P.S. It would also be interesting to see how far it's possible to go with constexpr etc.
Re:Show HN: Coi – A language that compiles to WASM, beats Re...
by bobajeff on Saturday January 24, 2026 @09:01AM
(#46743612)
I've been looking into UI libraries lately like Qt and Slint and wondered why they chose to create a DSL over just using css, html and a little bit of js. But I imagine C++ generation from a small DSL is easier than js.
But do you think it would be possible to achieve similar results without a new language, but with a declarative API in one of your existing languages (say, C++) instead?
If possible, that would remove a big adoption barrier, and avoid inevitably reinventing many language features.