3 ms·
My biggest pet peeve with typescript is how it never explains most of this stuff officially. The docs try to dumb things down but in my opinion it just makes i
by Klathmon 3y ago
My biggest pet peeve with typescript is how it never explains most of this stuff officially.
The docs try to dumb things down but in my opinion it just makes it harder to understand these more complex pieces. Like the article mentions, the typescript handbook no longer even mentions the term homomorphic!
After working with typescript heavily for a few years I kind of had a bit of an intuition for some of the details here, but the article helped finally explain it in a way that I can truly understand.
- epolanski 3y ago> My biggest pet peeve with typescript is how it never explains most of this stuff officially. From my anecdotical experience, 99 % of people cannot even define a mapped type or other core TypeScript concepts.
- resoluteteeth 3y agoI could be wrong, but I think it's maybe because the creators of typescript aren't that interested in actively encouraging people to use this kind of stuff as an end to itself? Typescript's type system is extremely advanced, but it mostly only has such an advanced type system because that's the only way to support patterns that people are already using in javascript. So for example, typescript has stuff like row polymorphism, because you may need to be able to add and remove properties to javascript objects, and row polymorphism is the only way to make that type safe, but it's not a language like purescript where the whole language is oriented around using row polymorphism for the effect system and the documentation is going to actively encourage you to use row polymorphism if you weren't already as a new pattern that you should use for your code. The official documentation is simply going to tell you, if you try to look up how to add/remove properties in a type safe way, how you can do that within the type system. Unfortunately I think this leads to a situation where only people who are already familiar with some of these ideas from other languages are really interested in experimenting with it, which may be a bit of a missed opportunity.
- wavemode 3y agoEven PureScript ultimately ditched the whole row-polymorphic Eff thing and now uses one big IO monad (called "Effect"). The juice ended up not being worth the squeeze, so to speak.
- resoluteteeth 3y agoOh I didn't even know that, huh. I'm still hoping people eventually get the effect system approach to be sufficiently ergonomic for it to make it's way into more languages.
- miiiiiike 3y ago> My biggest pet peeve with typescript is how it never explains most of this stuff officially. All of it is in the documentation.. And saying that, I ordered two books on Typescript this week exclusively to brush on on stuff like this. So, yep.