4 ms·
TypeScript Meta Type System – A Proposal
- haburka 3y agoWow that’s absurdly intimidating to wrap my head around. I do agree that types from libraries are pretty ugly but that’s just a result of complexity and sometimes poor API design. This would probably make it 10x worse by increasing complexity to understand what the type is.
- thworasdfq 3y agoThis is cool. It looks a lot like traits or associated types and OCaml modules. When you think about it, we only have ordinal/positional type parameters. Why not dict'd like type parameters as well (like named parameter passing)? I dislike the "meta" nomenclature. To me they are still types but more like product types of types.
- jauntywundrkind 3y agoI'd much rather have actual objects somehow. Building a whole new syntax structure for meta objects seems like a serious folly to me. And ideally types should (optionally) be available at runtime too. This whole idea here seems like such a halfway idea, solving some needs by inventing a ton of new "meta" ideas & syntax. Rather than accepting JavaScript's once string everything is an object spirit. "Typescript please give us types" showed up 2 months ago & captured the ask well. This here feels like such an overly complicated syntax-heavy half-measure versus that more pure ask. https://news.ycombinator.com/item?id=36637221 https://news.ycombinator.com/item?id=36637221 https://github.com/akutruff/typescript-needs-types https://github.com/akutruff/typescript-needs-types