News for hackers. Stuff that matters.
Re:Rich Harris joins Vercel to work on Svelte full time by joppy on Thursday November 11, 2021 @06:08PM (#29194431)
Because Svelte can look through the template, and at compile-time determine exactly which parts of the output need to be "surgically updated" in the DOM when some of the inputs change, without needing any runtime like a virtual DOM implementation. I don't know how you could implement such a thing (with good ergonomics) without a template language.
Re:Rich Harris joins Vercel to work on Svelte full time by richeyryan on Friday November 12, 2021 @06:46AM (#29198332)
SolidJS[https://www.solidjs.com/] does exactly that. That ability is more about fine grained reactivity than it is about templates. The use of templates and single file components is a stylistic choice by the Svelte team. You could argue Solid has poor ergonomic compared to Svelte I guess.
Re:Rich Harris joins Vercel to work on Svelte full time by Aeolun on Thursday November 11, 2021 @08:04PM (#29195220)
> I don't know how you could implement such a thing (with good ergonomics) without a template language.

Parse Javascript? I don’t see how it would be any different, except you have more constructs to work through.

Re:Rich Harris joins Vercel to work on Svelte full time by tshaddox on Thursday November 11, 2021 @08:24PM (#29195343)
The "more constructs to work through" is precisely the problem. Without restricting JavaScript to some subset, you're not going to be able to statically determine the behavior of any given program.