3 ms·
Swift is missing a lot of features, and that's why you can see a lot of type operators and type-level programming in some TypeScript code. For example, there is
by namelosw 7y ago
Swift is missing a lot of features, and that's why you can see a lot of type operators and type-level programming in some TypeScript code. For example, there is no Higher-Kind type support in TypeScript, but with some primitives from TypeScript, it's not hard to hack it out yourself. I doubt it's viable in Swift.
Among those mainstream languages, not many of them having such an advanced type system, with very few exceptions like Scala - even with GADT, dependent types ahead. It's light years ahead of its peers.
But I believe there are still some abstractions can be expressed in TypeScript but not Scala because the gradually/dynamically typed languages start from the opposite side from the spectrum.