On 2011-12-23 02:10, Michel Fortin wrote:
On 2011-12-22 17:22:59 +0000, Jacob Carlborg <d...@me.com> said:

On 2011-12-22 16:56, Michel Fortin wrote:
The benefit of referencing classes within module info: you can
instantiate them using Object.factory, if they have a default
constructor. We pay a heavy price compared to what we get with this very
limited runtime reflection.

It's a really nice feature to have when implementing serialization.

True, for serialization and other things. I'm not arguing against the
feature.

What I am observing is that the the capabilities of D's runtime
reflection are quite small compared to the footprint it has. We often
hear on this list about how adding more information about functions and
fields to typeinfo would bloat executables, yet I am under the
impression the biggest part of that bloat (the code of all the virtual
functions and whatever they call, even if you don't use those functions
or even the class) is already part of each and every D executable, only
we don't realize this because it is not exposed in the API, it just sits
there in a mostly non-interpretable form (the vtable).


If that's the case I think we should take advantage of the already available data in the executables to implement better runtime reflection.

--
/Jacob Carlborg

Reply via email to