News for hackers. Stuff that matters.
Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @08:33AM (#33773426)
Meh. Choosing to write something in JavaScript that is wildly supported on every platform via browsers without having to deal with transpilation doesn't seem that foolish to me. TypeScript solves a small sub-section of problems that can be solved in other ways too, like extensive unit tests, but that also comes with tradeoffs, just like using TypeScript comes with tradeoffs.

Assuming everyone should use TypeScript just because you happen to like it over JavaScript seems crazy. But I guess that makes me seem crazy to you, so here we are in a circle...

TypeScript seems to have entered the same hype cycle as Rust (if it didn't do it before Rust) where people seem to think that everything written in X should actually be written in Y instead (C/C++ => Rust and JavaScript/Any compile to JS => TypeScript). Doesn't mean every project have to follow that though.

Re:Complete Rewrite of ESLint by bugmen0t on Monday November 28, 2022 @08:37AM (#33773458)
ESLint does not even support the browser. I think your first sentence is (I'm assuming accidentally) creating a straw man argument.
Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @08:40AM (#33773505)
Yeah, you're right, it doesn't quite apply here. But I think the general idea applies. JavaScript is supported, used and known by more developers than TypeScript, no matter if it's in the browser or not.
Re:Complete Rewrite of ESLint by pritambaral on Monday November 28, 2022 @08:56AM (#33773680)
One of the stated goals of this rewrite is to support running in the browser.
Re:Complete Rewrite of ESLint by nerdbeere on Monday November 28, 2022 @09:00AM (#33773714)
From the github issue:

> Runtime agnostic. ESLint should be able to run in any runtime, whether Node.js, Deno, the browser, or other. Runtime agnostic. ESLint should be able to run in any runtime, whether Node.js, Deno, the browser, or other. […]

Re:Complete Rewrite of ESLint by cageface on Monday November 28, 2022 @08:53AM (#33773645)
I can't imagine maintaining a large JS codebase without types now. For places where you really need dynamic typing the any type is there for you.

I certainly would never take a job in a pure JS shop.

Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @08:58AM (#33773698)
I certainly wouldn't take a job in a place where they default to using TypeScript without thinking about the tradeoffs first. Cargo-culting never ends well, and there are no silver-bullets. I'm more afraid of those two "concepts" being a part of "company culture" than having to use JavaScript without TypeScript.
Re:Complete Rewrite of ESLint by EduardoBautista on Monday November 28, 2022 @09:06AM (#33773769)
I can't think of a single trade-off where choosing JavaScript would be better than having absolutely zero run-time errors in production, almost making error monitoring tools useless.

Could you please provide a list of these tradeoffs?

Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @09:12AM (#33773826)
Would of course depend on the situation, and also I'm not employed to evaluate your use of TypeScript vs JavaScript, you usually do this at the start of each project depending on the needs of what you're building.

But if I'd want something that is optimized for ease of install, ease of contributing to and minimal build tooling, choosing JavaScript over TypeScript is a no-brainer.

As a second tradeoff, choosing JavaScript over TypeScript tend to make codebases less complect and more modular, at least in the teams I've been in who maintained codebases with both languages.

Re:Complete Rewrite of ESLint by aew4ytasghe5 on Monday November 28, 2022 @09:30AM (#33773998)
Both are your personal experiences, neither of those are a valid tradeoff.

My experience with js-land is that choosing a typescript and make use of the @types packages is _the_ modern way of doing js dev. What you describe is basically do the same people did 15 years ago.

That is not a trade-off, but a refusal to re-evaluate the situation under changing conditions.

Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @09:52AM (#33774314)
I'm sorry but if you don't understand what tradeoffs are nor understand what tradeoffs are involved with choosing between JavaScript and TypeScript, I don't think there is much left for us to discuss.
Re:Complete Rewrite of ESLint by j-krieger on Monday November 28, 2022 @12:16PM (#33776314)
>I'm sorry but if you don't understand what tradeoffs are nor understand what tradeoffs are involved with choosing between JavaScript and TypeScript, I don't think there is much left for us to discuss.

You've yet to provide even a single example.

Re:Complete Rewrite of ESLint by camgunz on Monday November 28, 2022 @04:26PM (#33779940)
The typescript compiler is slow, and sometimes you have to escape hatch the type system, or use libraries that aren't typed. Type annotations can be pretty complicated, and at least sometimes are very noisy and make code less readable. You probably have tests anyway, and depending on your problem space, type errors may be such a small proportion of your errors that a using a type checker isn't justifiable. Finding an error in your typescript code from a JavaScript error message is hard and frustrating (there is always a source map bug).

As an aside, at least to me you're coming off as really combative in this thread. You might get more constructive responses to your posts if you adopted a more curious, open tone.

Re:Complete Rewrite of ESLint by j-krieger on Tuesday November 29, 2022 @11:38AM (#33789742)
Now that is a good example. I've encountered the problem of compile times myself. I've asked Daniel Rosenwasser about reimplementing the TSC compiler in a compiled language for a better speedup, but he said it wasn't worth the hassle because the compiler moves so fast and the spec is pretty vast at it's current state.

> type errors may be such a small proportion of your errors that a using a type checker isn't justifiable

This is a bit biased. The major advantage I see in using typescript is that you can be certain an interface is exactly what it says it is.

> As an aside, at least to me your posts are coming off as really combative in this thread

You are correct in this. Sorry. I will fix my comments to come off as less abrasive.

Re:Complete Rewrite of ESLint by camgunz on Tuesday November 29, 2022 @01:05PM (#33790955)
> I've asked Daniel Rosenwasser about reimplementing the TSC compiler in a compiled language for a better speedup, but he said it wasn't worth the hassle because the compiler moves so fast and the spec is pretty vast at it's current state.

Oh super interesting! I wonder if the solution is like, tsc becomes a reference compiler. I'm pretty sure people would absolutely love a Rust implementation that was fast but a little behind. A lot easier to daydream about than to do though, haha.

> This is a bit biased. The major advantage I see in using typescript is that you can be certain an interface is exactly what it says it is.

Yeah and I do miss this in dynamic languages. Interfaces (and typed data structures) have great descriptive power just on their own. There are run time packages for this (prop-types, etc) but... run time is worse haha.

Re:Complete Rewrite of ESLint by doix on Monday November 28, 2022 @11:12AM (#33775380)
> As a second tradeoff, choosing JavaScript over TypeScript tend to make codebases less complect and more modular, at least in the teams I've been in who maintained codebases with both languages.

[citation needed]... My experience is the exact opposite. Javascript code bases I've worked with had crazy mega functions that would accept any arbitrary input and try to return something. Typescript code bases (in my experience) tend to be more modular because the interfaces between things are clearly defined. If you want to use code written by someone else, it's immediately obvious what structure your data needs to have to work with their code.

> But if I'd want something that is optimized for ease of install, ease of contributing to and minimal build tooling, choosing JavaScript over TypeScript is a no-brainer.

I mean, they are talking about having parts written in rust:

> Rust-based replacements. Once we have a more well-defined API, we may be able to swap out pieces into Rust-based alternatives for performance. This could look like creating NAPI modules written in Rust for Node.js, writing in Rust and compiling to WebAssembly, creating a standalone ESLint executable written in Rust that calls into the JavaScript portions, or other approaches.

That looks like an _extremely_ complex build system setup compared to using the Typescript. They are also planning to document the types anyway:

> ESM with type checking. I don't want to rewrite in TypeScript, because I believe the core of ESLint should be vanilla JS, but I do think rewriting from scratch allows us to write in ESM and also use tsc with JSDoc comments to type check the project. This includes publishing type definitions in the packages.

The only possible trade-off I can think of is that type checking with tsc + JSDoc results in a faster build than using typescript directly. Personally, I find it a bit odd to use tsc + JSDoc instead of TS, but hey, they can do what they want.

Re:Complete Rewrite of ESLint by Aeolun on Monday November 28, 2022 @11:32AM (#33775689)
I’m not sure I’d say pure JS is easier to contribute to. Having type information around your codebase makes it much easier to know what comes from where, even if you haven’t traced the source of the variable all the way to the start.

Like, you are theoretically correct, but practically the extra complexity of using Typescript over Javascript is running ‘npm install typescript’ after installing node. You certainly have less build tooling without tsc, but the benefit there is tiny.

There’s some mild reasons to go for pure JS, and a lot of absolutely gigantic reasons to go for Typescript (in my opinion).

Re:Complete Rewrite of ESLint by ilikehurdles on Monday November 28, 2022 @09:54AM (#33774336)
Type-checking doesn’t take any serious codebase to “zero run-time errors in production.” It’s not a magic pill. Monitoring tools are useful for far more than telling about runtime errors.
Re:Complete Rewrite of ESLint by HelloNurse on Monday November 28, 2022 @11:00AM (#33775228)
Typescript type declarations check that the Rube Goldberg tooling du jour managed to process them, proving that the user managed to follow instructions.
Re:Complete Rewrite of ESLint by mplanchard on Monday November 28, 2022 @09:58AM (#33774398)
I’ve worked at several typescript shops and I have certainly never seen “absolutely zero runtime errors in production.”

Even Rust, which has a much stronger type system than TS, does not prevent all runtime errors. Types can prevent a certain class of bugs/errors, and that’s great, but zero runtime errors is overstating it by a wide margin.

Re:Complete Rewrite of ESLint by kajaktum on Monday November 28, 2022 @10:22AM (#33774693)
So you’d rather have more bugs than less? Given any piece of JS code, you can’t actually reason about it unless you also know its caller. Or you do defensive programming. At which point, why even bother.
Re:Complete Rewrite of ESLint by mplanchard on Monday November 28, 2022 @10:57AM (#33775183)
That's not what I said at all. I generally choose to work with languages with strong, static types, because I appreciate the added documentation and security the types provide. That said, I'm not going to sit here and pretend like I can just ignore the possibility of runtime errors because I write Rust and Typescript. I'm also not going to pretend like there's anything wrong with working in language without static typing. I'm an emacs user, so I write plenty of Emacs Lisp and have a great time with it. I used to write Python professionally before type annotations were introduced, and yet still somehow managed to produce software that worked. Types are great, but they're just one tool in the toolbox.
Re:Complete Rewrite of ESLint by kajaktum on Monday November 28, 2022 @11:57AM (#33776031)
>Types are great, but they're just one tool in the toolbox.

Of course, everything is just tool. Its up to us to decide if we want to use it or not. What I don't understand is why wouldn't you use it. I totally understand if its fun to cobble together some webserver using only bash scripts. But if you're writing something as big, complex, and widely used as ESLint, I am very surprised if you don't choose something that is more performant and maintainable. It is almost irresponsible. I have plenty of fun side projects that should never ever be used in production because I know its really bad.

I never claimed that using Rust will magically make all your sort implementation correct. Of course this is an insane claim. But like I said, if you take any snippet of JavaScript, you actually cannot reason about it without looking at all the calls to that function, plus all the functions that calls to that. Given any variable S, what is its value? Who knows. I guess you just have to run this massive test suite that we wrote. There's WAY more possible incorrect JavaScript code than there are Rust.

I have written webservers in TypeScript and Rust. The moment I get something out of serde in Rust, I know for a fact this is a string. If the key doesn't exist, its None. In TypeScript, I don't have the same confidence. Did they wrote the correct validator? Wait did they add a default value? Does this interface match what we have? Oh its a string...but its actually Date. Wait...why does this bool keep returning false...(https://stackoverflow.com/questions/59046629/boolean-paramet...)

I could have written 1000s of unit tests...Or just use type and fail the "test" at compile time.

>there's anything wrong with working in language without static typing

Yes there are. If Linux starts going backward (as in they are starting an effort to handwrite new drivers in assembly) and move in that direction, everyone else should rightly be really worried.

Re:Complete Rewrite of ESLint by mplanchard on Monday November 28, 2022 @01:22PM (#33777352)
Generally I agree with you about what the benefits of types are, which is why I generally choose to use typed languages.

> Yes there are. If Linux starts going backward (as in they are starting an effort to handwrite new drivers in assembly) and move in that direction, everyone else should rightly be really worried.

Frankly, I have a lot more confidence in something written in Python/Ruby/JS to not fail in a really dangerous way than I do something written in C. It's silly to pretend like all languages with types are equivalent, or that types are uniformly better for all use-cases.

Sure, the type systems in C/C++ will verify that you don't have type errors, but they can't verify that you don't have use-after-free errors, or out-of-bounds errors, or null pointer dereference errors, and so on. Even Java, which has an extensive and relatively modern type system, can't protect you from null pointer dereferences.

I never said "there's nothing wrong with working in a language without static typing for ANY PROJECT IN THE WORLD." Some projects need it, and some projects frankly don't. Linux, given its constraints, could not have been written in anything other than C. That's fine.

Very large projects in dynamic languages seem to eventually want type annotations, e.g. Dropbox (Python), Stripe (Ruby IIRC), and Facebook (PHP). But at the same time there are plenty of large, successful projects written in dynamic languages: GitLab (Ruby), Wordpress (PHP), much of emacs (Lisp), this very website (Lisp), Datomic (Clojure), CircleCI (Clojure). Sure, you can say that all of those projects should have been written in some statically typed language, but they have found success regardless, which is really the only metric that matters.

Re:Complete Rewrite of ESLint by j-krieger on Monday November 28, 2022 @12:15PM (#33776295)
They asked for trade offs, which you did not provide. Your only retort seems to be (for now) that it's not perfect. Care to try again?
Re:Complete Rewrite of ESLint by mplanchard on Monday November 28, 2022 @12:51PM (#33776857)
Is this comment meant to be responding to me? The comment I’m replying to said that TS prevents all runtime errors. That’s the only thing I’m responding to. There are certainly tradeoffs, but “eliminates all runtime errors” is not a valid pro for TS.
Re:Complete Rewrite of ESLint by ballenf on Monday November 28, 2022 @10:22AM (#33774690)
Inspecting deployed code without the transpilation noise is sometimes nice. Or maybe there's a workaround for that?
Re:Complete Rewrite of ESLint by mcluck on Monday November 28, 2022 @10:26AM (#33774744)
Source maps allow you to read your code exactly as it was written
Re:Complete Rewrite of ESLint by jwond on Monday November 28, 2022 @10:25AM (#33774729)
You could use source maps.

Besides, I’d imagine the deployed code would be minimized anyway regardless of whether TypeScript is used.

Re:Complete Rewrite of ESLint by postalrat on Monday November 28, 2022 @11:10AM (#33775360)
Are there any advantages to minimizing server code?
Re:Complete Rewrite of ESLint by cloverich on Monday November 28, 2022 @11:01AM (#33775243)
While it does reduce numerous errors, it does not enforce or even reveal exceptions like Java / Go / Rust. Typescript is my preferred language, but IMHO if reducing production errors is the goal I think there are better choices still.
Re:Complete Rewrite of ESLint by schwartzworld on Monday November 28, 2022 @09:34AM (#33774051)
At my job, we evaluated TypeScript and thought about the tradeoffs and decided to adopt it for all new front-end code, migrating older code when possible. The decision was considered and made. Do we really need to rehash the discussion every time a new front-end gets set up? How is that cargo culting?
Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @09:56AM (#33774362)
If the requirements and purposes are the same for every frontend project you do, it obviously makes sense to reuse previous planning and apply it without rehashing the discussions.
Re:Complete Rewrite of ESLint by schwartzworld on Monday November 28, 2022 @11:27AM (#33775614)
Of course they aren't the same, but the benefits of using TypeScript don't go away from one UI to the next.
Re:Complete Rewrite of ESLint by cdelsolar on Monday November 28, 2022 @09:41AM (#33774143)
there are no tradeoffs with TypeScript.
Re:Complete Rewrite of ESLint by capableweb on Monday November 28, 2022 @09:54AM (#33774337)
One day you'll want to be able to call yourself "senior" and then you'll realise, everything about software engineering is about balancing tradeoffs and every choice you make comes with tradeoffs.
Re:Complete Rewrite of ESLint by cdelsolar on Wednesday November 30, 2022 @01:08PM (#33804879)
... i've been a senior engineer for over 10 years. TS is one of the only technologies i have found where it is only positive, in relation to Javascript.
Re:Complete Rewrite of ESLint by matthewmacleod on Monday November 28, 2022 @09:18AM (#33773880)
I do understand where you are coming from, and I normally wouldn't say this about any technology – but Typescript is probably the closest thing to an actual silver bullet that has ever existed in front-end tech. In almost all cases it massively improves code quality at a low cost, and if I encountered an organisation that wasn't using it I would expect them to have evaluated it and have extremely clear justifications for that decision front-and-center.
Re:Complete Rewrite of ESLint by itsmeste on Monday November 28, 2022 @09:46AM (#33774223)
"How did you decide for TypeScript, and how do you benefit from it" is among my first questions in interviews for TS positions. It's ironic how rarely I get a good answer, but it offers a good insight into their tech philosophy, and mostly I'd pass on the position. (working in backend)
Re:Complete Rewrite of ESLint by Aeolun on Monday November 28, 2022 @11:34AM (#33775724)
If anyone asked me this I’d be kind of confused. If they really don’t know how choosing Typescript over Javascript benefits them I don’t want to hire them.
Re:Complete Rewrite of ESLint by sangnoir on Monday November 28, 2022 @12:23PM (#33776413)
Interviews are a two way street. What you've said is the equivalent of an interviewee saying "If a company has to ask me how to implement a zero-allocation sorting algorithm in an interview, they are clearly incompetent and I wouldn't work for them". In both cases, the person doing the asking knows the right answer(s) more or less - they are checking if the person across the table does too.
Re:Complete Rewrite of ESLint by nsonha on Monday November 28, 2022 @10:58AM (#33775199)
I certainly would not hire a dev who thinks about their own convenience (not having to write types), instead of the consumers of their code (to have types as a form of documentation). Programming is too hard?
Re:Complete Rewrite of ESLint by camgunz on Monday November 28, 2022 @04:29PM (#33779981)
Eng velocity is pretty precious isn't it? I would at least say the formula here is defects prevented by using typescript vs features delivered.
Re:Complete Rewrite of ESLint by nsonha on Tuesday November 29, 2022 @03:31AM (#33785043)
no one can count defects "prevented", even if it's possible that has not been done at a meaningful scale.

Which renders your formula meaningless.

Re:Complete Rewrite of ESLint by camgunz on Tuesday November 29, 2022 @12:54PM (#33790814)
Sure but, that's (one of my) point(s). I think type systems prevent some bugs, but I more view them as this analogy:

- code formatter :: style

- type system :: tests

...which is to say that mainstream type systems tend to just unify what people in dynamic languages are doing ad-hoc in their test suites. As a result, I think their contribution to safety is overstated.

All of which is to say that posts in this thread coming out swinging for all of Typescript's safety improvements, while also arguing that it has no trade offs seem pretty off base to me. We can't even tell it's working most of the time.

Re:Complete Rewrite of ESLint by nsonha on Tuesday November 29, 2022 @07:59PM (#33795542)
The point I was making is, there are a lot of things in software that have no empirical data, so suggesting data driven decision making such as benchmarking because you don't trust Big-O or quantifying typescript's benefits instead of actually thinking about them is a cop out.

> - type system :: tests

This is an oversimplification. To me types are also documents, and not a "here is the public/high level API, you don't need the details" kind of thing, it's document on public and private API.

Types are also tools that help you think about your system. I assume having a tool to think make you think more effectively, but I can't prove that.

Re:Complete Rewrite of ESLint by camgunz on Wednesday November 30, 2022 @04:48AM (#33798769)
> The point I was making is, there are a lot of things in software that have no empirical data, so suggesting data driven decision making such as benchmarking because you don't trust Big-O or quantifying typescript's benefits instead of actually thinking about them is a cop out.

Sure, empirical knowledge isn't the only knowledge there is, but this is what your proposal sounds like:

"Hi $TECHLEAD, I think we should use TypeScript because it's good documentation, and because it helps me think about the system."

My response would be: "that sounds like changing our whole development toolchain, which would be a lot of work and carries a lot of risk; what if we wrote some documentation instead?"

In A Philosophy of Software Design, John Ousterhout writes that (paraphrasing) because code is always an imperfect representation of a model, comments are required in order to fill in the gap. This rings true to me, and I'm skeptical that any type system--much less a mainstream one--could overcome what seems like a fundamental limitation of information. I'm more receptive to documentation: comments, code docs, arch docs, etc.

---

> so suggesting data driven decision making such as benchmarking because you don't trust Big-O

The reason people benchmark is because Big-O notation is incomplete: it doesn't describe n. You can't describe the performance of a system with Big-O alone. Maybe I'm digging into a poor example here, but I don't think it really fits in our discussion.

> quantifying typescript's benefits instead of actually thinking about them is a cop out

This is a little dismissive; I'm actually a person who likes types and misses them when I don't have them. I often move between languages (or the same language typed and untyped like Python or JS/TS). Consequently I have some experience across lots of different verification/validation/constraint/testing systems. My general take is that what your type system doesn't provide your tests can compensate for, and since you (should) have tests anyway, a type system's benefits are diminished. Further, tests can check things type systems can't, and can be traced to requirements. For example:

    int add(int a, int b) {
      return a - b;
    }
A type system can tell you a lot about this function: its domain/range, overflow/underflow risks, etc. What it can't do is tell you that the function has the wrong name.

Dynamic language communities have known about stuff like this for a long time. Indeed a lot of people are fans of TDD precisely for the reason you mention: tests are tools that help you think and reason about a code base. Types are not a silver bullet, there are always trade offs, software engineering is the agony of never really being sure but having to ship anyway.

Re:Complete Rewrite of ESLint by nsonha on Wednesday November 30, 2022 @05:40AM (#33799053)
No one says you have to stop writing test when you have types. You can have less tests when you have more types. There are type systems that requires an overhaul of the whole toolchain, but what we’re talking about typescript isn’t that. You can literally run plain js with jsdoc through tcs and make your comment being provably accurate documentation, rather than a decorative one. And im just too tired at that point to address the comment that having more types is somehow a burden on eng velocity while having more tests isn’t. In reality, you never have nearly as many tests as you ideally need, but you can add more types rather easily and it will help people reason about your system much easier.

Speaking of which, tests are often too verbose it hurt readability aka the ability to reason about your system

Re:Complete Rewrite of ESLint by camgunz on Thursday December 01, 2022 @05:23AM (#33814474)
> No one says you have to stop writing tests when you have types.

My point is that if you have tests, you probably don't need types, and since you really oughta have tests, the benefits of mainstream type systems are overstated. A lot of arguments in this thread are essentially "types have benefits you can't get anywhere else", but you can get them with tests. When it comes to verifying program correctness, tests are a super set of types' functionality.

> You can have less tests when you have more types.

Can you? In my dynamic language work the tests aren't doing type checks, usually there's some kind of validation library doing that. Generally the tests are doing work that types can't.

> There are type systems that requires an overhaul of the whole toolchain, but what we’re talking about typescript isn’t that.

I guess we can disagree about "overhaul", but IMO adding a compiler, new dependencies (types) and entirely new syntax to your toolchain qualifies. If that doesn't, what does?

> You can literally run plain js with jsdoc through tcs and make your comment provably accurate documentation

A few things foil this:

- using `any`

- using untyped libraries

- taking advantage of gradual typing

- unhelpful type soup

"Type soup" really bears expanding:

    subscribeToMore(
        options: {
            document: DocumentNode,
            variables?: TVariables,
            updateQuery?: Function,
            onError?: Function
        }
    ) => () => void
I like Apollo and use it a lot, but I would say this signature from their docs [0] tells you almost nothing. There are some nice things, in particular the "pass an object blob as args" persists in JS despite having default and optional parameter support for a long time now, so TS adds nice description there (of course it would be better to just use optional parameters). But like, surprise surprise `document` is a DocumentNode, `variables` is... `TVariables` (whatever "T" might mean here), and it returns a function that does... well who knows (docs say it terminates the subscription, which I never would have guessed). It could be called "deleteDocument", and the types don't contradict that in any way.

Further, these types don't verify any behavior. They can't prove to you that `onError` is called when an error occurs. They can't prove to you that you will continue to receive data when it's updated. They can't prove to you that you subscribed to the specified document. On and on. There's a reason that high-reliability environments use tests, even though they're using strongly typed languages like Ada and Eiffel, and that's because type systems cannot fully specify a program's behavior.

[0]: https://www.apollographql.com/docs/react/api/react/hooks/#su...

Re:Complete Rewrite of ESLint by blauditore on Monday November 28, 2022 @01:58PM (#33777930)
It's crazy how just a few years ago, many web (turned Node) devs insisted that static types are overrated and one can totally maintain large code bases without. Now with the TS hype, the same people preach hoe useful static types are. I think it was just a mix of stockholm syndrome and lack of experience what working with static types is like.
Re:Complete Rewrite of ESLint by Macha on Monday November 28, 2022 @02:15PM (#33778159)
I mean, if you're in 2012, comparing Java 6 or C# 2.0 or C++98 to Ruby or Python, you can see how people come to that conclusion. Local type inference has done wonders for the ergonomics of static typing, and while research-y languages have had it forever (and some like Haskell even allow the scope of inference to go further), it's a relatively recent addition to the mainstream.
Re:Complete Rewrite of ESLint by Aeolun on Monday November 28, 2022 @11:24AM (#33775572)
If you are not writing your new javascript projects in Typescript I think you are just willfully hurting yourself.
Re:Complete Rewrite of ESLint by spankalee on Monday November 28, 2022 @11:38AM (#33775768)
Unit tests and types don't have as much overlap as anti-type people claim. You need both, and you shouldn't write tests for most of what type errors cover.

TypeScript transpilation is easy and fast. You can emit JS even when there are type errors, and use tsc as just a type-checker while using esbuild to strip types from JS. Performance is not an issue in practice and the benefits are pretty far reaching.

Re:Complete Rewrite of ESLint by j-krieger on Monday November 28, 2022 @12:11PM (#33776240)
> Choosing to write something in JavaScript that is wildly supported on every platform via browsers

This statement makes no sense in two ways and shows you're not as accustomed to the problems at hand as you'd perhaps like to be. First, eslint is a developer tool and not intended to run in the browser. Second, you generally do not distribute typescript code but compiled js to target platforms.

> TypeScript seems to have entered the same hype cycle as Rust (if it didn't do it before Rust) where people seem to think that everything written in X should actually be written in Y instead (C/C++ => Rust and JavaScript/Any compile to JS => TypeScript). Doesn't mean every project have to follow that though.

No, TypeScript is a superset of JavaScript that can be enabled with little cost for the gigantic benefit of bringing type safety to a language which people have mocked for its unsafety for decades.

I really wish people on HN would hold back a little with their contrarian purism at all cost.

Re:Complete Rewrite of ESLint by riquito on Monday November 28, 2022 @12:21PM (#33776384)
> First, eslint is a developer tool and not intended to run in the browser.

from the linked article: "Yes, that means an officially supported browser version!"

Re:Complete Rewrite of ESLint by freshbakedbread on Monday November 28, 2022 @01:24PM (#33777392)
The point still stands that an officially supported browser version can still be typescript transpiled to JavaScript.