News for hackers. Stuff that matters.
Re:Virtual DOM is pure overhead (2018) by dahfizz on Sunday May 19, 2019 @08:43AM (#19953036)
> There's a lot of what I'd consider to be non-trivial transformation going on between the code you pass to the Svelte compiler and what comes out of it and runs in the browser. Personally, I'm less comfortable with that...

How is this different than the "non-trivial" transformations that V8 makes to actually compile and run your code? Does svelte do unpredictable / unexpected things? Don't you make runtime calls to the react lib where they can do whatever they want? I'm genuinely confused.

I don't care one way or the other - I'm not a web dev. It seems from this comment that you're just scared of compilers, which is strange. No matter what you're relying on third party libs in your code. Why is it somehow safer for that third party code to be used at run time rather than compile time? I would probably argue the opposite. Why the strong aversion to compilers?

Re:Virtual DOM is pure overhead (2018) by Lowkeyloki on Sunday May 19, 2019 @02:03PM (#19954540)
I don't actually have a strong aversion to compilers. I use tools like Babel and Webpack regularly. However, I've seen the types of transformations the Svelte compiler does and they tend to hide complexity, making it harder to trace and debug code at runtime. Source maps can only do so much. It's much harder to debug code that doesn't resemble what you wrote in the first place.
Re:Virtual DOM is pure overhead (2018) by atan on Sunday May 19, 2019 @09:16PM (#19956792)
> However, I've seen the types of transformations the Svelte compiler does and they tend to hide complexity, making it harder to trace and debug code at runtime.

Are you saying the original source code hides complexity that is present in the generated code? If so, I guess that's the whole point, but then a runtime framework also hides lots of complexity that your code doesn't have to manage (which, again, is the entire point of using a framework).

> It's much harder to debug code that doesn't resemble what you wrote in the first place.

With a runtime framework, there's lots of code running that isn't your code, which can also make debugging difficult. With Svelte, at least the generated code is fairly straightforward and easy to step through. In many case, I think it's actually easier, not harder to debug.

Re:Virtual DOM is pure overhead (2018) by robocat on Sunday May 19, 2019 @04:46PM (#19955420)
On the other hand, VDOM is a type of transformation that makes it extremely difficult to debug events sometimes.