Reimplementing the bulk of std.meta iteratively

rikki cattermole rikki at cattermole.co.nz
Tue Sep 29 00:58:16 UTC 2020


On 29/09/2020 1:22 PM, Stefan Koch wrote:
> On Tuesday, 29 September 2020 at 00:03:14 UTC, rikki cattermole wrote:
>> On 29/09/2020 12:37 PM, Stefan Koch wrote:
>>> I _could_ give  the alias a physical form at runtime.
>>> (By doing the same thing that the reify template does (or rather will 
>>> eventually do), that is exporting _all_ the properties of the type 
>>> into an object)
>>>
>>> However I am not actually sure what the use of this would be.
>>> All usage that I have seen, is in generating code, which is kindof 
>>> useless if it does not happen at compile time.
>>>
>>> Perhaps there are others?
>>
>> Serialization!
> 
> Well that one you would kindof have to do in a template anyway, no?

No.

Pointer arithmetic alone could do most of the work.

But if the end abstraction produced had UDA's and methods available (so 
full blown reflection), you could do pretty amazing things.

This sort of stuff really doesn't need template instances to perform.

Same goes for web routers. You really don't need much info beyond some 
UDA's and to confirm the parameters/return type are correct. The rest is 
all better off being done at runtime.


More information about the Digitalmars-d mailing list