Reimplementing the bulk of std.meta iteratively

claptrap clap at trap.com
Mon Sep 28 21:08:25 UTC 2020


On Monday, 28 September 2020 at 16:57:19 UTC, Andrei Alexandrescu 
wrote:
> On 9/28/20 11:55 AM, Bruce Carneal wrote:
>> On Monday, 28 September 2020 at 14:16:20 UTC, Andrei 
>> Alexandrescu wrote:
>>> On 9/28/20 8:46 AM, Stefan Koch wrote:
>>>> On Monday, 28 September 2020 at 03:03:01 UTC, Andrei 
>>>> Alexandrescu wrote:
>>>>> On 9/27/20 10:58 PM, Bruce Carneal wrote:
>>>>>> Disclaimer: Andrei has stated, effectively, that I have 
>>>>>> little standing to opine on these issues.
>>>>>
>>>>> Sorry! Didn't mean to sound dismissive at all. Meant to 
>>>>> just say, don't shun templates, embrace them and thrive.
>>>>
>>>> In practice template can quite literally explode though.
>>>> Which could be a valid reason to shun them.
>>>> You can embrace them, of course, and thrive.
>>>> The question is for how long you will thrive.
>>>
>>> For a very long time judging by the success C++ is enjoying 
>>> with them.
>> 
>> As you note, by employing a variety of "best practices", of 
>> extra-language conventions, of one-level-of-indirection 
>> wrappers, of "human must certify this correct" mechanisms, the 
>> C++ community has indeed "thrived".
>> 
>> We've not settled for that meta programming drudgery, that 
>> friction, in the past.  You know better this better than 
>> anyone else on the planet.  I hope we don't "settle" going 
>> forward.
>
> (Not getting some of the uses of quotation marks.)
>
> That's a bit backhanded because it implies I promote settling 
> for meta programming drudgery. Did you mean to say that?
>
> On the contrary, I find type reification interesting exactly 
> because it takes you from said drudgery to familiar land - 
> first-class values that can be manipulated in traditional 
> manner. Should you need to get back to type-land, dereification 
> helps with that. We can now draw from a large body of existing 
> theory and practice.
>
> https://en.wikipedia.org/wiki/Reification_(computer_science)

Who's actually heard of reification outside of compiler writers? 
Ive been reading a ton of compiler related stuff lately, but not 
heard of it before now. It's seems like an implementation detail 
leaking out to me. Instead of first class types lets have 
whatever this stuff is cause we can get it on the cheap and its 
intellectually cool.

I guess my point is if you want meta-programming that just works 
as if it was regular programming, the reify / dereify just 
emphasises that it's two different domains because you have to 
move from one to the other. It's not unification, it's a bridge 
yes, but lets be honest the user shouldn't have to think about, 
it should just work. (Even if it makes the compiler writers job 
harder)




More information about the Digitalmars-d mailing list