logoalt Hacker News

rthrfrdtoday at 11:20 AM1 replyview on HN

Sounds interesting!

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.


Replies

io_erictoday at 11:58 AM

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.

show 2 replies