Live data from Hacker News

Yarn's Future – v2 and beyond

github.com

111–120 of 239 posts

Re: Yarn's Future – v2 and beyond

#111
post #88

Earlier quoted context omitted.

One huge thing we're giving up when moving from JS to TS is iteration speed though. The typescript compiler is not only an additional step, it's also ridiculously slow compared to other languages' compilers.

classic fallacy of speed lost by dynamic code “i can’t hit save and refresh the page” vs compiled “i can’t make changes without breaking 5 things”

Nah, my day job is writing C++ and most of my side projects are C. I have nothing against compiled languages, and if the compiler is fast enough, just having `make && ./whatever` in my shell history is almost indistinguishable from `node index.js`. It's just that it takes _over a second_ for tsc to compile hello world, and all javascript tooling feels similarly sluggish to me. I have similar issues with java; make starts compiling stuff in microseconds, while grade doesn't spawn a javac process in what feels like forever.

I probably shouldn't have lead with the "not only is it an extra step" thing.

Re: Yarn's Future – v2 and beyond

#112
post #104
post #88

Earlier quoted context omitted.

One huge thing we're giving up when moving from JS to TS is iteration speed though. The typescript compiler is not only an additional step, it's also ridiculously slow compared to other languages' compilers.

Disagree. The TypeScript compiler is quite fast even on large projects. Build systems that are unable to properly parallelize builds are common in the JS world these days so you are probably experiencing tsc much slower than it is. That said, Babel now supports TypeScript so you should get nearly the same performance with TypeScript as you did with Flow or even just plain ES transpilation. That way you can do typeche…

I haven't really ever seriously used flow or babel transpilation. My experience with compiled languages is mostly gcc which has initialized and started compiling in microseconds, or just writing plain JS which doesn't need transpilation. "Nearly the same performance as Flow/ES in Babel" isn't the benchmark I use.

Re: Yarn's Future – v2 and beyond

#113
post #83

Earlier quoted context omitted.

This is where I see a big difference between Flow / TS. With Flow, the type annotations are just stripped away, none of your Flow code affects runtime code. This is not so with TS since you have things like Enums, which will be compiled into objects and are part of your runtime code.

If you write type annotations in TS, they're stripped away. If you write type annotations in Flow, they're stripped away. There's no difference. TS has some additional features which are purely optional that don't get purely stripped out, but you're not mandated to use them.

Is there any compiler option or linter config that prevents the use of these extra features?

Re: Yarn's Future – v2 and beyond

#114

serious question, if you are starting a new project today why would you choose to use npm over yarn?

Because npm is a standard (default) package management tool that comes with node. After getting `package-lock.json` and `npm ci`, I would rather wonder why choose yarn instead of npm.

"npm ci" deletes node_modules directory every time. Try using that when you depend on some native modules. :(

Re: Yarn's Future – v2 and beyond

#115

Earlier quoted context omitted.

>And then there's... whatever this is: I respect Jamie for the things done and built, but his views tend to be a bit extreme. I agree that flow is not in a good place right now, but to say that they don't give a shit about the community just isn't true. Flow has been making significant strides in community outreach, inclusion, and detailing their roadmap lately. And Facebook dropping flow would bring us toward a mono…

> I respect Jamie for the things done and built, but his views tend to be a bit extreme. They might be in general, but these sound like some easily objectively checkable claims: "If you want visible proof of this [Flow not caring for the community], just look through the repo. PRs are never merged. Issues are never addressed. Pretty much all of the activity there is done by a couple people in the community. Critical…

PRs are never merged because the github repo isn't the source of truth for Flow, their internal systems are. They have this workflow where they will import PRs from github and apply them internally, then close the PR when it's done.

At a glance, it looks like all PRs are just closed, but looking at them individually shows a different story.

It's the same with React-Native, and several other OSS projects by facebook, and Jamie knows that, having worked at FB when that workflow was used.

It has its faults (I personally really hate the workflow they use, but I get why they use it. Github is where the people are, and Phabricator and other internal tools are difficult to integrate into it in a lot of cases, but I still hate it), but to say it's because they don't care about OSS or they do all their work internally isn't true. Plenty of FB employees and outside contributors both make PRs on github, discuss them on github, and just merge them internally closing the PR on github.

Flow has plenty of issues without needing to make them up or exaggerate them. Their errors still take weeks for many to understand and get used to, flowtyped is a mess compared to typescript's type distribution system, their fucking habit of single character type variables makes looking at built in type definitions extremely difficult, the flow binary still is extremely unstable on windows even after years, and the recent move of aliasing Object and Function to `any` seems like a misguided attempt to simplify some code and speed up some checking.

But at no point do I think they should can the whole thing, and I absolutely think they care about open source. Like I said in the comment above, Flow is in a bad place right now, but they are putting their money where their mouth is, the Flow team is reportedly growing at FB, and over the past few months I've seen a massive uptick in the number of releases, blog posts, external contributions, performance, and a significant decrease in the number of bugs I was hitting on a daily basis.

Re: Yarn's Future – v2 and beyond

#116

Earlier quoted context omitted.

>And then there's... whatever this is: I respect Jamie for the things done and built, but his views tend to be a bit extreme. I agree that flow is not in a good place right now, but to say that they don't give a shit about the community just isn't true. Flow has been making significant strides in community outreach, inclusion, and detailing their roadmap lately. And Facebook dropping flow would bring us toward a mono…

> I respect Jamie for the things done and built, but his views tend to be a bit extreme. They might be in general, but these sound like some easily objectively checkable claims: "If you want visible proof of this [Flow not caring for the community], just look through the repo. PRs are never merged. Issues are never addressed. Pretty much all of the activity there is done by a couple people in the community. Critical…

I agree. Flow's communication with the community has been so mediocre that even Dan Abramov resorted to tweeting his frustrations.

At this point, the attempts to pacify Flow users like myself feels an awful lot like when Silverlight developers were begging folks not to abandon ship. People have to defend their livelihood, I guess.

Re: Yarn's Future – v2 and beyond

#117
post #112
post #104

Earlier quoted context omitted.

Disagree. The TypeScript compiler is quite fast even on large projects. Build systems that are unable to properly parallelize builds are common in the JS world these days so you are probably experiencing tsc much slower than it is. That said, Babel now supports TypeScript so you should get nearly the same performance with TypeScript as you did with Flow or even just plain ES transpilation. That way you can do typeche…

I haven't really ever seriously used flow or babel transpilation. My experience with compiled languages is mostly gcc which has initialized and started compiling in microseconds, or just writing plain JS which doesn't need transpilation. "Nearly the same performance as Flow/ES in Babel" isn't the benchmark I use.

Apples to oranges. You can use TypeScript without ES* -> ES5/ES3 transpilation. The compilation process may not be as fast as not having one, but it will be similar in speed to running a few sed commands over your source code.

GCC startup time is going to be faster than Node.JS startup time, but that's irrelevant. We don't need to restart the compiler on each iteration. You can just use an auto reloader for that.

And since we're real developers writing real apps, hello world is not important to us. We want to organize our code into modules and bundle those to a single JS file that is minified in production. So we're going to process the source code one way or another.

C++ is a funny example to mention because it scales pretty poorly in the compilation time aspect, because it lacks modules. Compiler startup times are good... But it's not really that fun burning all 16 cores trying to compile Qt and still having it take forever. Compare to Go where compilation is so fast most people don't even talk about compilation speed.

All languages compile eventually anyways, even JS. It just compiles in the browser. If you really want a "zero compilation step" experience, you can just load the TypeScript compiler directly in the browser. It's been done in the past for demos.

Re: Yarn's Future – v2 and beyond

#118
post #52

The JS ecosystem has its flaws, but one has to appreciate the speed at which momentum shifts, making clear winners obvious. The move towards TypeScript 'winning' has been fast, and to everyone's benefit.

Do people typically prefer TypeScript over ES6?

I'd prefer Eiffel or Oberon, but almost anything is better than ES6. I just wish there was some kind of standard library movement to coincide with it, but even MS seems okay with left-pad.

Re: Yarn's Future – v2 and beyond

#119
post #112
post #104

Earlier quoted context omitted.

Disagree. The TypeScript compiler is quite fast even on large projects. Build systems that are unable to properly parallelize builds are common in the JS world these days so you are probably experiencing tsc much slower than it is. That said, Babel now supports TypeScript so you should get nearly the same performance with TypeScript as you did with Flow or even just plain ES transpilation. That way you can do typeche…

I haven't really ever seriously used flow or babel transpilation. My experience with compiled languages is mostly gcc which has initialized and started compiling in microseconds, or just writing plain JS which doesn't need transpilation. "Nearly the same performance as Flow/ES in Babel" isn't the benchmark I use.

[deleted]

Re: Yarn's Future – v2 and beyond

#120

Earlier quoted context omitted.

Do people typically prefer TypeScript over ES6?

It's a strange question. Writing in TypeScript is almost identical to writing in ES6. TypeScript is "just" ES6 with interfaces and static types. Do people prefer typed JavaScript over JavaScript tho? I know that I prefer typed JavaScript, especially to write long-term web applications or Node.js server applications, but I don't think there is yet an unanimous shift towards typed JavaScript.

> Do people prefer typed JavaScript over JavaScript tho?

I'd like dynamic typing but without the implicit and dubious type coercion. Like Python.

Post reply on HN