Re:Rewriting TypeScript in Rust? You'D have to be
by solarkraft on Wednesday December 14, 2022 @07:21PM
(#33993043)
What's bad about using clever types? My (limited) experience is that if they're done well they just work. I don't know why React-Query's types work the way they do, but I quite like that they do. Developing an intuition for it was a bit hard, but I believe this might rather be a failure of the documentation.
[ Parent
| on HN ]
Re:Rewriting TypeScript in Rust? You'D have to be
by wruza on Wednesday December 14, 2022 @08:16PM
(#33993637)
And if they aren’t, good luck debugging it. I remember recently some typing issue in a webpack config where a correct key was marked as a type error in a presence of another construct, despite being documented and having an effect.
Also try exploring npm/telegraf classes (auto-documented) by looking at their type definitions. The whole bot api could have been written as simple repeated definitions, but someone chose the clever way of multi-level type mutations and derivatives.
Typescript will soon need secondary community-maintained type contracts that are human-readable and cross-checked with those in libraries. Something like @humane-types/*.