3 ms·
I don't understand why compilers can't simply emit global variables containing structural descriptions of types. It seems like such a trivial thing to do. It wo
by adrusi 12y ago
I don't understand why compilers can't simply emit global variables containing structural descriptions of types. It seems like such a trivial thing to do. It would increase the size of the binary, but it would be possible to disable in projects that aren't using reflection, even automatically if the code never imports the reflection package.
Maybe someone can explain this.
- sjrd 12y agoOh yes, compilers could do that. But because of the code explosion, everyone would actively stay away from that feature. And we, compiler writers, don't want to support a feature that's not used.
- tlarkworthy 12y agoa Scala Manifest? http://www.scala-lang.org/api/current/index.html#scala.reflect.Manifest http://www.scala-lang.org/api/current/index.html#scala.refle...
- Gurkenmaster 12y agoCeylon does this when compiling to JS because it has to support reified generics both on the jvm and in the browser. I don't like the size of the model though. It's huge.