Re:Scala turns 10
by bad_user on Monday January 20, 2014 @06:28PM
(#7092369)
Yes, it also has TypeTags, allowing you to inspect exactly what the compiler saw at compile-time in detail.
That's not really what one uses in practice, e.g...
To be honest, tags are indeed needed for creating arrays, since they are reified by the JVM:
One common problem is that overriding of parameters doesn't work for containers due to type erasure, so you can't have overrides on type parameters, because the JVM gets in the way (i.e. the following does not work):
However, Scala has something more powerful (type-classes):
But wait, we can go much further with implicits that actually dictate the return type:
Scala in general allows for code that is much more generic than C#, without having the need for reified generics.
[ Parent
| on HN ]
And F* has dependent typing. I was never claiming that reified generics was necessary for stronger typing, but I'm also not convinced that it's an impediment.
At worst I could see how it could be a trivial implementation detail, but the fact that Scala went out of their way to use tokens and manifests suggests that the functionality is desired. Whether that's provided by the runtime or by the compiler writer is only a difference in effort (or rather, whose effort).
This is the first time I've heard of F*. Interesting. Is it usable?