News for hackers. Stuff that matters.
Re:Metaphysics and JavaScript by nemothekid on Wednesday September 04, 2019 @03:52PM (#20880780)
You're missing his actual walkthrough of Svelte, that he likely did in the demo. I've seen Svelte enough times on HN that I'm vaguely familiar with it.

Svelte, to me, at a very high level, is "Angular 1, but fast" - which might be easier to develop for, but doesn't provide the same "rails" that React does (and why I prefer it).

At the end of the day, all the hang wringing about hooks and purity is about making it simple to reason about a program locally. I haven't used Svelte so I can't say for sure, but the problem Svelte (and that the Virtual DOM) solves is an issue I don't think I have.

In any case his presentation was interesting enough from a FP/Programming theory POV.

Re:Metaphysics and JavaScript by kjksf on Wednesday September 04, 2019 @04:12PM (#20880946)
For what it's worth: to me Svelte is, for the lack of a better word, "better" React. It's another evolutionary step in the same direction.

I wouldn't compare it to Angular.

Svelte is both easier to use (productivity) and generates faster code.

To me React is 2 things: components (reusable pieces that combine state with rendering logic in JavaScript / HTML / CSS) and reactivity (rebuilding UI from state).

Virtual DOM is an implementation detail that makes rebuilding UI from state fast enough in React.

Svelte also provides components and reactivity but with less typing (for me, the programmer).

While I know some people complain about more magic, my experience is opposite: Svelte maps more intuitively to the final JavaScript / HTML / CSS than React.

And it has CSS that is scoped by default to the component which removes the need for CSS-in-JS solutions.

Re:Metaphysics and JavaScript by ng12 on Wednesday September 04, 2019 @04:39PM (#20881185)
Re:Metaphysics and JavaScript by lioeters on Thursday September 05, 2019 @09:43PM (#20892290)
For others who are curious, this is about TypeScript support in Svelte - an issue created a year ago.

The following comment by the author sounds hopeful, that they've been working in that direction, and eventually it will happen:

https://github.com/sveltejs/svelte/issues/1639#issuecomment-...

Re:Metaphysics and JavaScript by pier25 on Wednesday September 04, 2019 @04:51PM (#20881290)
I really don't see the comparison with Angular other than the use of templates. Can you elaborate?

Also, what "rails" does React provide?

Re:Metaphysics and JavaScript by nemothekid on Wednesday September 04, 2019 @04:56PM (#20881328)
>I really don't see the comparison with Angular

I haven't used Svelte so take my comparison surface level. templates, directives and the prop names all remind me of Angular.

>Also, what "rails" does React provide?

The "rails" that react provided that I found useful where more around opinionated data flow with props (especially with Flux).

Re:Metaphysics and JavaScript by pier25 on Wednesday September 04, 2019 @05:22PM (#20881557)
> templates, directives and the prop names all remind me of Angular

Yes, but those are commonplace in any library/framework that uses templates. Like you said, this is just a very superficial comparison. Angular is framework that comes with lots of abstractions, modules, dependency injection, etc. It's a very different beast than Svelte.

> The "rails" that react provided that I found useful where more around opinionated data flow with props (especially with Flux).

Right, but React is only the rendering part. You are probably refering to Redux.