Live data from Hacker News

The Svelte Compiler Handbook

lihautan.com

41–50 of 139 posts

Re: The Svelte Compiler Handbook

#41
post #3

Having a hard time choosing between Svelte and Elm. For a lone in house dev, any recommendations?

I'd say Svelte is much closer to "regular" programming. You will have to bend your thinking a bit with Elm. Svelte seems great, but it seems to be developed by one person primarily. Also, that person lives in NY and the project looks paused at the moment.

That person is also a jerk (in my experience)

Re: The Svelte Compiler Handbook

#43
post #31
post #29

I'm surprised Apprun nor Solid have been mentioned yet. Are there any TypeScript reactive frameworks? I know you can use TS with the others, but finding tutorials can be a pain since it all these are JS first frameworks.

I'm actually working on one. I don't know what will come out of it, but it's an interesting endeavor. As soon as it's shareable I will share it on Github. I'm basically trying to do a superset of typescript where you create elements so: const root = c({ el: 'div', children: [ `hello, ${store.user.name}` ], attr: { class: 'bold smart', id: 'abc', bla: true, }, evts: { click: () => { console.log("Clicked") } } }); And…

That is awfully verbose.

Re: The Svelte Compiler Handbook

#44

Earlier quoted context omitted.

I'd say Svelte is much closer to "regular" programming. You will have to bend your thinking a bit with Elm. Svelte seems great, but it seems to be developed by one person primarily. Also, that person lives in NY and the project looks paused at the moment.

That person is also a jerk (in my experience)

Elaborate please.

Re: The Svelte Compiler Handbook

#45
post #21

Earlier quoted context omitted.

The problem with Svelte is it doesn't support Typescript. You pretty much need that on any reasonable size project unless you are happy to spend your life tracking down runtime bugs. Vue has a similar problem (it sort of supports Typescript, but not properly and templates aren't type checked). I've not used Elm so maybe that is better. React has good support for type checking. I would use that.

> Typescript. You pretty much need that on any reasonable size project unless you are happy to spend your life tracking down runtime bugs I'd say it depends on your teams skill set and level of disciple. The best defence against a buggy codebase isn't a programming language or framework, its good all fashioned discipline.

It's not just about bugs. Static typing is crucial for productivity whenever the codebase overflows your brain's working memory.

Navigating through code, refactoring, or simply figuring out what to pass as function input can become a challenge in the absence of types.

Re: The Svelte Compiler Handbook

#46
post #3

Having a hard time choosing between Svelte and Elm. For a lone in house dev, any recommendations?

The problem with Svelte is it doesn't support Typescript. You pretty much need that on any reasonable size project unless you are happy to spend your life tracking down runtime bugs. Vue has a similar problem (it sort of supports Typescript, but not properly and templates aren't type checked). I've not used Elm so maybe that is better. React has good support for type checking. I would use that.

People who are going to go out of their way to use some hipster framework aren’t really going to be concerned with such practical matters as tooling and ecosystem.

Re: The Svelte Compiler Handbook

#47
post #31
post #29

I'm surprised Apprun nor Solid have been mentioned yet. Are there any TypeScript reactive frameworks? I know you can use TS with the others, but finding tutorials can be a pain since it all these are JS first frameworks.

I'm actually working on one. I don't know what will come out of it, but it's an interesting endeavor. As soon as it's shareable I will share it on Github. I'm basically trying to do a superset of typescript where you create elements so: const root = c({ el: 'div', children: [ `hello, ${store.user.name}` ], attr: { class: 'bold smart', id: 'abc', bla: true, }, evts: { click: () => { console.log("Clicked") } } }); And…

What you’ve written there couldn’t possibly be reactive without compilation or wrapping it in a function. Is there something else wrapping it (a function), or is it being compiled into a different form? If it’s being compiled (so that the code means something other than it seems to), then I see no particular advantage to using TypeScript syntax, given it’s more verbose than need be.

For reference, in Svelte that’d be something like this, which is shorter and more obvious:

   { console.log("Clicked") }>
    hello, {store.user.name}
  

Re: The Svelte Compiler Handbook

#48
This is so awesome! I wonder if it would be useful to have this knowledge “overlayed” on top of the Svelte compiler source itself. That way, contributors could clone the repo and get an annotated tour of the compiler process, directly from their editor.

I’ve been working on a side-project, that allows recording and playing back interactive, guided walkthroughs of a codebase. This seems like an excellent “test case“ for that experience, which I might have to experiment with :)

https://aka.ms/codetour.

Re: The Svelte Compiler Handbook

#49
post #31

Earlier quoted context omitted.

I'm actually working on one. I don't know what will come out of it, but it's an interesting endeavor. As soon as it's shareable I will share it on Github. I'm basically trying to do a superset of typescript where you create elements so: const root = c({ el: 'div', children: [ `hello, ${store.user.name}` ], attr: { class: 'bold smart', id: 'abc', bla: true, }, evts: { click: () => { console.log("Clicked") } } }); And…

That is awfully verbose.

I'll hopefully add jsx eventually that will help with the visual aspect of the verbosity.
Post reply on HN