2 ms·
> Many programming languages have a variant or object type. In C#, any instance of a class will also say that it is of type System.Object. That does nearly make
by lmm 9mo ago
> Many programming languages have a variant or object type. In C#, any instance of a class will also say that it is of type System.Object. That does nearly make that a type of all types.
That's a type of all values, not a type of all types.
In richer programming languages, you can do operations on types much like you can do operations on values. E.g. in C# you can write "List<String>", but you can't do something like "var x = List; var y = String; x<y>". (Which might seem pointless, but it allows you to do things like write a conversion from x<Int> to x<String> that you can reuse with different x types). So then you need a type for x and y, which is conventionally type, and you have to ask what the type of type is. (And if it's type, then that's very natural and makes some things very easy - but at the cost of making typechecking undecidable, as per the article).
- da_chicken 9mo agoNo, it's not that. You can actually do those things in C#. You just can't do them at compile time. You have to use introspection or the dynamic keyword and do it at runtime. In order to do what you're suggesting at compile time, you'd need a type of types, and then you'll run into the decidability paradox.