BetterC and TypeInfo Question
sarn via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jun 22 17:41:11 PDT 2017
Currently a lot of language features generate dependencies on
TypeInfo, arguably more than needed, but this is changing. Some
examples are in this DConf 2017 talk:
https://www.youtube.com/watch?v=endKC3fDxqs
Also, the way the language is designed right now, all modules are
responsible for containing TypeInfo instances for all their
types, in case other modules *might* need them. So, if you
define a plain old data struct, for example, you get TypeInfo and
its runtime dependencies. This isn't a requirement, and Adam has
just patched DMD to make -betterC leave out the TypeInfo.
> But, even in C++, RTTI is necessary for dynamic casting... so
> how is D going to address that? I think it is necessary, but
> can prolly be quite minimal. I will think about it more later.
Does it matter? C++ programmers already accept that RTTI is
needed for certain dynamic features.
More information about the Digitalmars-d-learn
mailing list