I don’t think that’s the case. You can absolutely implement a type-erased language on top of the CLR. Your language will just have the same constraints of a type-erased language like Java.

Having reified generics in the CLR just lets you store more type information. There isn’t much of a trade off for CLR end-users.

Compare this to the constraints and workarounds that Kotlin and Scala have due to type-erasure on the JVM.

> Compare this to the constraints and workarounds that Kotlin and Scala have due to type-erasure on the JVM.

The creator of Scala disagrees: https://youtu.be/Xn_YpUtXWT4?t=850

I take back what I said. I do think Martin is right. He was a creator of Generic Java as well. Not having generics in the runtime is better for language developers, since you can implement different type systems in the language instead. Debugging for users is usually a nightmare though, since generics are usually monomorphized in the IL.

TypeScript is essentially C#, but with type-erasure and lacking the low-level struct & pass-by-reference features.

I do think the C#/CLR struct implementation is better though.

You CAN do it, but it's much more difficult.

And as far as I'm aware, both kotlin and Scala don't really suffer due to type erasure.

I mean, the language is what it is. But, it definitely constrains the language developers. Especially when considering interop with other JVM languages.

That being said, it is easier to write a language on top of the JVM with good interop, since there are less ways to implement features. Essentially, your language has to interop with Java.

And it is harder to have good interop between CLR languages because there are more ways to implement features. Essentially, your language has to interop with C#.