Live data from Hacker News

Rich Harris joins Vercel to work on Svelte full time

twitter.com

461–470 of 571 posts

Re: Rich Harris joins Vercel to work on Svelte full time

#461

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

“ - The faster runtime speed in no way made up for any of the above. Bad Svelte code is still slow compared to good React code.” What? Can you expand on that? Makes no sense.

I read it as: Svelte is faster in theory, but since people write bad Svelte code, it is slower than the React code the same developers would write.

My interpretation is that this can be attributed to either svelte being hard to write, or people being used to React. Both of which are a challenge to companies looking to switch to Svelte.

Re: Rich Harris joins Vercel to work on Svelte full time

#462

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

> - Special syntax for reactivity is not javascript

Well, JSX syntax isn't JS either. And hooks semantics is not JS.

Learning new syntax is easy but we should consider how much the new semantics cause mistakes and to what extent they are incompatible with tools such as linters.

Re: Rich Harris joins Vercel to work on Svelte full time

#463

Earlier quoted context omitted.

JSX is JS. Nested brackets are simply converted to nested function calls & objects, attributes convert to properties. This is evident when comparing conditionals, loops, etc. Instead of learning template syntax you simply use JS syntax, albeit a declarative subset (no branches). JSX is simply syntactical sugar for nested JS, you can use it without, but it's prettier with. One could add this syntactical sugar natively…

I agree 100%... Adding JSX to the language spec would be interesting. It might be too heavy to include within the language spec as many JS applications do not involve the DOM at all, so then you have to essentially bundle DOM functions into every application... or common.js would omit this subset of the language.

Mozilla Xulrunner and Rhino (a JavaScript interpreter implemented in Java) used to support E4X: ECMAScript for XML, the ISO/IEC standard 22537:2006, and it was removed in 2014.

https://en.wikipedia.org/wiki/ECMAScript_for_XML

>ECMAScript for XML (E4X) is the standard ISO/IEC 22537:2006 programming language extension that adds native XML support to ECMAScript (which includes ActionScript, JavaScript, and JScript). The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible. Before the release of E4X, XML was always accessed at an object level. E4X instead treats XML as a primitive (like characters, integers, and booleans). This implies faster access, better support, and acceptance as a building block (data structure) of a program.

>E4X is standardized by Ecma International in the ECMA-357 standard. The first edition was published in June 2004, the second edition in December 2005.

>The E4X standard was deprecated by the Mozilla Foundation in 2014.

https://bugzilla.mozilla.org/show_bug.cgi?id=695577#c1

>Mark S. Miller, 10 years ago

>"use strict" is currently our one real opt-in boundary for simplifying the language and reducing threats by dropping legacy complexity that is generally no longer needed. As Brendan said somewhere "E4X is crazyland", and FF's implementation of E4X deviates from the spec in ways that are not written down anywhere. Until we encountered this issues, it looked like SES could bring ocap security to ES5.1 without doing an accurate lex or parse. With this restriction, we could regain this economy.

>Besides, no one wants to upgrade the E4X semantics to be compatible with ES5 or ES.next, so this seems a good time to impose this opt-in restriction.

https://news.ycombinator.com/item?id=8266648

>bastawhiz on Sept 4, 2014 | parent | context | un‑favorite | on: JSX: XML-like syntax extension to ECMAScript – Dra...

>So..uh...this was a thing. And nobody wanted it. So it was deprecated and killed. See the "Prior Art" section at the bottom of the page.

http://en.wikipedia.org/wiki/ECMAScript_for_XML

>Brendan Eich was quoted as saying something along the lines of "E4X is crazyland". Parsing it is hard as hell to do right. Think of all the tooling that's out there for JavaScript right now that will either a.) not support JSX code or b.) bloat up beyond belief as it takes into account the suddenly absurd requirements necessary to deal with a similar-but-not-quite-XML-or-even-HTML-for-that-matter syntax. Oh, you want to lint that JavaScript? Bless your heart! You want to add syntax highlighting? Love will find a way. You want to use other static analysis tools, sweet.js macros, or anything else non-trivial? How cute!

>So essentially, it's a great way for Facebook to push React.js without making React.js a standard.

https://stackoverflow.com/questions/33642820/why-was-e4x-dep...

>It was deprecated and removed from the only browser that ever supported it because it was a poorly implemented language feature that was causing all sorts of problems.

>As Brendan said somewhere "E4X is crazyland", and FF's implementation of E4X deviates from the spec in ways that are not written down anywhere. — Mark S. Miller

>The only way for it to come back would be via a new edition of ECMA-357, which Adobe and Mozilla were going to work on. Until then, it's out. — Brendan Eich

>The idea behind it wasn't bad, but the way it was integrated into the language was. SpiderMonkey was the only JS engine that ever implemented it, and there were endless problems caused by that and severe complications of the engine's implementation required for this support. — Till Schneidereit

Re: Rich Harris joins Vercel to work on Svelte full time

#464
post #170

Earlier quoted context omitted.

Even if Vercel came out and said “we’ve bought Rich Harris’s voice, every choice will be controlled by us” (which they haven’t!) they still wouldn’t control the project because Rich isn’t a BDFL.

Good point and I agree about Rich but I rather trust healthy markets and competition more than people.

If we have such trustworthy markets and competition, then how the hell did we end up with React and Angular, huh?

Ayn Rand sucks at software design, as much as she sucks at philosophy and economics and social design and writing. Your trust in her is certainly misplaced.

Anyway, why do you have such a huge problem with Rich acting in his own best self interest, that you found a need to personally attack him so viciously and often as you did in this discussion for all that he's done for himself and the Svelte community?

Don't you believe the invisible hand of the market, which you trust so much, will prosecute your vengeance on Rich, who you find so untrustworthy?

Re: Rich Harris joins Vercel to work on Svelte full time

#465
post #207

Earlier quoted context omitted.

For all the use cases I deal with on a regular basis, Svelte looks more like vanilla HTML/JS than any equivalent React code. And the reason these things change is because that's what needed changing . One of the topline features of Svelte is that is has less boilerplate than React, and it achieves that quite handily. Unless you're criticizing particular constructs in Svelte that are unjustifiably different, I don't t…

> but the idea of having to learn different language constructs for loops and the like doesn't seem that herculean of a task. I agree. As long as you understand the basic concepts, it's only a matter of learning the syntax, which is really not as big of a deal as the person you replied to is making it out to be.

100% - Common guys we are programmers in a field that is know for changing consistently (probably a lot faster than other careers). If you see learning new "syntax" for the basics (loops,conditionals etc) then you going to have problems down the road. Weather you use svelte, or some other new tech. If you really never want to learn another syntax.. learn LISP and be done with it.

You are a programmer, you will need to learn new syntax a few times in your career.

If some of the "biggest" complaints are "oh no I have to learn how to write for-loops again" - I guess svelte is doing the important stuff right.

Wayyyy back in the day(ok not that long ago - 80/90's) when I was learning a new lang (Pascal,C, C++) I used to tell myself If I can get an working example of:

1) "user-input (readline,scanf etc)"

2) "printing input/output"

3) "calling functions/procedures"

4) "Do the loops + conditionals"

5) "file I/O"

6) "Memory schematics"

You basically mastered the "building blocks/mrk(min-req-knowledge)" of the new lang and like maths you only need now practice or a good project.

TL;DR If you are a professional-career-programmer, learning "new syntax (we used to call them keywords)" is a requirement.

Re: Rich Harris joins Vercel to work on Svelte full time

#466
post #207

Earlier quoted context omitted.

> but the idea of having to learn different language constructs for loops and the like doesn't seem that herculean of a task. I agree. As long as you understand the basic concepts, it's only a matter of learning the syntax, which is really not as big of a deal as the person you replied to is making it out to be.

It's not a herculean task... I agree, until you've learned 10+ (angular, vue, svelte, wordpress/php, jade templates, laravel, underscore/lodash, handlebars/mustache, hugo, etc..) of these "super simple templating languages"! And keep them all straight. I have no problem learning a new language if there is a compelling reason. But If it's just additional shit I have to remember for no clear reason... No thanks... We c…

>It's not a herculean task... I agree, until you've learned 10+ (angular, vue, svelte, wordpress/php, jade templates, laravel, underscore/lodash, handlebars/mustache, hugo, etc..)

So you want all of these to be a universal-template-language - (D)HTML ?

Re: Rich Harris joins Vercel to work on Svelte full time

#467

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

Much of this I would have expected, but this was less obvious:

> There are major tradeoffs made by doing things at compile time. Things that are easy in React at runtime turn out to be surprisingly difficult in Svelte

What are some examples of this?

Re: Rich Harris joins Vercel to work on Svelte full time

#468

Earlier quoted context omitted.

Eslint will ensure all dependencies are listed in the array. Is there something more you’re wishing for?

The ESLint plugin helps. But it depends on static analysis. And static analysis is fundamentally incapable of taking advantage of any information only available (or more easily accessible) at runtime. One limitation that pops up fairly frequently in my experience: Only React's first party hooks can get exceptional treatment by the plugin, i.e. the setState function returned from useState can be assumed to never chang…

I agree with all of this except your terminology: static analysis of javascript can't solve this problem because of the limitations of the language semantics. Static analysis in general could, I think. It just might require a different language with different semantics.

Re: Rich Harris joins Vercel to work on Svelte full time

#469
post #289

Earlier quoted context omitted.

It's not a herculean task... I agree, until you've learned 10+ (angular, vue, svelte, wordpress/php, jade templates, laravel, underscore/lodash, handlebars/mustache, hugo, etc..) of these "super simple templating languages"! And keep them all straight. I have no problem learning a new language if there is a compelling reason. But If it's just additional shit I have to remember for no clear reason... No thanks... We c…

You need to stop insisting that a wheel has been reinvented with Svelte. It shares 95% of the same DNA as other frameworks, with multiple improvements over them. So with that in mind, what you're actually suggesting is that the existing offerings were somehow perfect, and we don't ever need to improve on anything again. That is an absurd notion, especially given that the other frameworks have gone through MASSIVE cha…

100% agree !

Re: Rich Harris joins Vercel to work on Svelte full time

#470

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

I am really curious to hear about specific examples of some of these points. Specifically: > The abstraction leaks and when it does, it requires a good mental model of Svelte's magic. Maybe because I have familiarized myself with how Svelte works I haven't noticed anything like that. > Things that are easy in React at runtime turn out to be surprisingly difficult in Svelte I suspect this is from trying to use React p…

Not the GP, but here's an example of abstraction leaking straight from their intro tutorial:

> A simple rule of thumb: the name of the updated variable must appear on the left hand side of the assignment. For example this...

  const foo = obj.foo;
  foo.bar = 'baz';
> ...won't trigger reactivity on obj.foo.bar, unless you follow it up with obj = obj.

This looks like a huge footgun to me, and it's not even an exotic usecase. It's in the very first page talking about reactivity in the docs.

Post reply on HN