3 ms·
Ok for real, is Typescript going to collapse one day from the complexity of its type system? Typescript's type system became Turing complete years ago, and hil
by throwaway189262 6y ago
Ok for real, is Typescript going to collapse one day from the complexity of its type system?
Typescript's type system became Turing complete years ago, and hilariously, someone linked that issue to the new types mentioned in this post :)
https://github.com/microsoft/TypeScript/issues/14833 https://github.com/microsoft/TypeScript/issues/14833
I've been using Typescript for years, and I still like it. But I'm starting to get frustrated by the sheer amount of "stuff" they keep adding to the type system. My coworkers are too. They don't want to spend weeks reading about "advanced types", just want TS to be a nice wrapper around JS.
Typescript doesn't have a standard library or a runtime, so eventually can't they just call it done? Just do occasional maintenance releases to keep up with new JS features
- mekster 6y agoWhat is wrong just using what you're comfortable with? Why are you asking TS to halt any new feature development because you don't want to keep up?
- gmac 6y agoOn the one hand, yes, the code examples in that PR thread are kind of terrifying. On the other, the ability to map mechanically between type names would be really useful, and is something I’ve previously wished for. It would, for example, enormously simplify type generation for Zapatos[1], which currently creates multiple long object mappings for this purpose, such as: export type SelectableForTable<T extends Table> = { accounts: accounts.Selectable; appleTransactions: appleTransactions.Selectable; authors: authors.Selectable; books: books.Selectable; emailAuthentication: emailAuthentication.Selectable; employees: employees.Selectable; identityTest: identityTest.Selectable; stores: stores.Selectable; tags: tags.Selectable; tableInOtherSchema: tableInOtherSchema.Selectable; }[T]; [1] https://jawj.github.io/zapatos/ https://jawj.github.io/zapatos/
- Kinrany 6y agoSince you're generating types anyway, can't this be simplified to `tableTypes[T]['Selectable']`?
- gmac 6y agoNice thought, thanks, but I don't think so. The way things are set up, your `tableTypes[T]` would need to map table names to namespaces, and this gives errors like "Cannot use namespace 'X' as a type". Would be pleased to be proved wrong, though. :)