Kobold, a new web UI crate with zero-cost static DOM(maciej.codes) |
Kobold, a new web UI crate with zero-cost static DOM(maciej.codes) |
You need either granular reactivity or diffing (or perhaps both), or else your framework's performance will easily be trash
Those numbers aren’t _the best_, but given the improvement in TTI from only needing 3kb of framework that seems like a pretty good tradeoff.
> I need to look closer. It does appear that the Millions implementation will get flagged as manual manipulation. So that might get changed to one a bit slower. I can't imagine anyone writing this code
> Kobold does not have a concept of a stateful component. The view rendering part is relatively unopinionated about state management. It is entirely feasible to implement React-esque hooks like in Yew or Dioxus as a 3rd-party crate. Reactive signals like in Sycamore or Leptops should also interact nicely with the View trait.
In fact he mentions this at the end :
> It is entirely feasible to implement React-esque hooks like in Yew or Dioxus as a 3rd-party crate.
Looks like leptos could actually enhance this idea of `View`.
Sycamore is much closer to that 0 cost Rust frontend framework, but has gone through many improvements.
https://en.cppreference.com/w/cpp/language/Zero-overhead_pri...
Although:
https://www.youtube.com/watch?v=rHIkrotSwcc
I'm not sure whether Rust people consistently use it with precisely the same sense.
Some folks use “zero overhead abstraction” to try and make the concept a bit more clear, since everything has some cost somewhere. “Zero cost” can feel incorrect.
Creating and adding DOM nodes is definitely not free, but I can see how this is very low overhead compared to VDOM diffing.
> What you don’t use, you don’t pay for (in time or space) and further: What you do use, you couldn’t hand code any better.