News for hackers. Stuff that matters.
Re:TypeScript is terrible for library developers by jcparkyn on Tuesday August 23, 2022 @09:06PM (#32573795)
> Why are your types so complex?

The article (and ensuing discussion) are about _library_ code, which necessarily has types that are orders of magnitude more complex than application code (source: see some of the links in the article).

The reason this isn't a problem in Java, C# etc is that the things these libraries do simply _aren't possible_ in the Java type system, so no one does them, and users end up with (usually) clunkier libraries.

Re:TypeScript is terrible for library developers by bhawks on Tuesday August 23, 2022 @10:38PM (#32574358)
React has its roots in StandardML and it's showing them here. Java, C# (and ma y other languages) barely scrape the surface of what you can do with a type system.

Now there's definitely a question of when you start hitting diminishing returns but you can definitely do so much with and extract confidence from very strongly typed languages.

Re:TypeScript is terrible for library developers by GurnBlandston on Wednesday August 24, 2022 @09:42AM (#32579339)
> React has its roots in StandardML

Really? This is fascinating, is there anywhere with more on this?

Re:TypeScript is terrible for library developers by dvt on Wednesday August 24, 2022 @03:24PM (#32584485)
> The article (and ensuing discussion) are about _library_ code, which necessarily has types that are orders of magnitude more complex than application code (source: see some of the links in the article).

Are you somehow implying that C++ or Java don't have libraries? As a sidenote, React (and that entire ecosystem) is an architectural hellscape (see Vue for much more streamlined & cleaner code).

Re:TypeScript is terrible for library developers by jcparkyn on Thursday August 25, 2022 @12:38AM (#32589550)
No, I'm just saying the libraries in those languages tend to be designed differently, to accommodate the more limited type systems (but I don't use C++, so I'm sure templates can do a lot of things I'm not aware of).

I'm also not necessarily saying this is a good or bad thing overall, since it can so easily lead to extra complexity.

FWIW, I'd choose C#/Rust/Kotlin/etc over TS 100% of the time for projects that don't need to run in a browser.