Live data from Hacker News

The Svelte Compiler Handbook

lihautan.com

51–60 of 139 posts

Re: The Svelte Compiler Handbook

#51
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…

Using 'evts' instead of events is a good way to get people to make mistakes

Re: The Svelte Compiler Handbook

#52
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…

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…

Yes, that's currently what I'm experimenting with.

This is very early stages and completely experimental.

The idea I'm experimenting is to compile typescript to another form, I completely see your point about too verbose though, but I'm also toying around with jsx.

Basically what I'm trying to do is a svelte where instead of this:

  {#each cats as { id, name }, i}
    
       
 {i + 1}: {name}
       
    
  {/each}
You have have the native JavaScript map functions and so on.

Again, this is completely in the early stages and just playing around until something feels right.

Any recommendations appreciated.

Re: The Svelte Compiler Handbook

#53
post #51
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…

Using 'evts' instead of events is a good way to get people to make mistakes

Thanks for the feedback :)

Re: The Svelte Compiler Handbook

#54
I like Svelte very much. My biggest struggle is with tooling, especially the lack of proper IDE support. I know there are several IDEs with plugins for Svelte, but they're either obsolete or lacking essential features. That's why I won't use it for me next project, just not worth it going against the wind.

Now, I am looking at Flutter. Seems to match my needs, and it's also actively maintained.

Never underestimate the power of proper tooling and abundance of documentation, better be productive rather than cool.

Re: The Svelte Compiler Handbook

#55

I like Svelte very much. My biggest struggle is with tooling, especially the lack of proper IDE support. I know there are several IDEs with plugins for Svelte, but they're either obsolete or lacking essential features. That's why I won't use it for me next project, just not worth it going against the wind. Now, I am looking at Flutter. Seems to match my needs, and it's also actively maintained. Never underestimate th…

Flutter web support is in beta. I've never heard of anyone using it. Don't you think you are swimming upstream there too?

Re: The Svelte Compiler Handbook

#56
How did Rich Harris, a "graphics editor," write Svelte? So many designers hardly know JavaScript at all. This one wrote one of the most advanced JavaScript frameworks I've ever seen. It's not just JavaScript. He wrote a compiler that takes a custom, declarative syntax and converts it to imperative JavaScript to surgically update the DOM.

Re: The Svelte Compiler Handbook

#57

How did Rich Harris, a "graphics editor," write Svelte? So many designers hardly know JavaScript at all. This one wrote one of the most advanced JavaScript frameworks I've ever seen. It's not just JavaScript. He wrote a compiler that takes a custom, declarative syntax and converts it to imperative JavaScript to surgically update the DOM.

Funny you mention this, Evan You, the author of VueJS was a graphic designer before writing VueJS

Re: The Svelte Compiler Handbook

#58

How did Rich Harris, a "graphics editor," write Svelte? So many designers hardly know JavaScript at all. This one wrote one of the most advanced JavaScript frameworks I've ever seen. It's not just JavaScript. He wrote a compiler that takes a custom, declarative syntax and converts it to imperative JavaScript to surgically update the DOM.

Programming is not a particularly difficult skill. During the 1980s, it was taught in grade schools. JavaScript may be a worse and more difficult language than the ones you could find in the micros scattered across schools, but it's not an order of magnitude more difficult to use effectively.

In a field that goes hand-in-hand with programming, which includes pretty much every artistic one, it shouldn't be all that surprising that people know how to use/are at least curious enough to learn the tools available to them.

Re: The Svelte Compiler Handbook

#59
post #58

How did Rich Harris, a "graphics editor," write Svelte? So many designers hardly know JavaScript at all. This one wrote one of the most advanced JavaScript frameworks I've ever seen. It's not just JavaScript. He wrote a compiler that takes a custom, declarative syntax and converts it to imperative JavaScript to surgically update the DOM.

Programming is not a particularly difficult skill. During the 1980s, it was taught in grade schools. JavaScript may be a worse and more difficult language than the ones you could find in the micros scattered across schools, but it's not an order of magnitude more difficult to use effectively. In a field that goes hand-in-hand with programming, which includes pretty much every artistic one, it shouldn't be all that su…

Actually JS is better: try writing a compiler in BASIC. In 2020 a graphic designer can do LISP style metaprogramming because of a number of subtle properties of the module system.

Re: The Svelte Compiler Handbook

#60
post #58

Earlier quoted context omitted.

Programming is not a particularly difficult skill. During the 1980s, it was taught in grade schools. JavaScript may be a worse and more difficult language than the ones you could find in the micros scattered across schools, but it's not an order of magnitude more difficult to use effectively. In a field that goes hand-in-hand with programming, which includes pretty much every artistic one, it shouldn't be all that su…

Actually JS is better: try writing a compiler in BASIC. In 2020 a graphic designer can do LISP style metaprogramming because of a number of subtle properties of the module system.

More complex ≠ better.

There are Lisps that are almost universally seen to be great. There are absolutely terrible Lisps as well.

Post reply on HN