TypeFunction example: ImplictConvTargets

Daniel K dkm4i1 at gmail.com
Wed Oct 7 14:01:51 UTC 2020


On Wednesday, 7 October 2020 at 12:56:42 UTC, Adam D. Ruppe wrote:
> On Wednesday, 7 October 2020 at 12:37:48 UTC, Stefan Koch wrote:
>> On Wednesday, 7 October 2020 at 12:30:15 UTC, Andrei 
>> Alexandrescu wrote:
>>> Incumbency is a huge matter in programming language design. 
>>> Of course I would not propose another way of doing the same 
>>> thing.
>>
>> Perhaps you can say this in different words?
>
> Basically we just prefer to work with what we have before 
> adding new stuff to the language.
>
> So whatever features get added first have an automatic 
> advantage in any comparison just because they are already there.

I agree.

And existing features got added after already having their 
fundamental ideas, advantages, and deficiencies scrutinized.

The fact that we have meta-programming in the form we have, is 
not by chance. It is a super strong and capable design.
I am biased, but I would say "state of the art".

If we boil down the Type Function proposal to its fundamental 
idea, advantages, and deficiencies. What Do we get?

Fundamental idea:
Language level reification of a set of types, making a set of 
types mutable to enable imperative programming style, for what is 
essentially only changing that set of types.
But at that, only in the context of a special kind of CTFE-like 
function.
Other than mutating a set of types, This function cant do 
anything that cant already be achieved rather simply with 
existing language features. As has been demonstrated a number of 
times in this thread.

Advantage:
Mutating a set of types in an imperative style. Something that is 
already quite simple, and requires virtually the same, or even 
less code in practice when written with existing language 
features.

Disadvantage: A new feature people will have to learn and 
understand, document, maintain, bugfix.
No actual substantial future gain.

Is this wrong?
Or where is that striking idea nobody can spot, that we just must 
enable with language level complexity? If the best answer is 
"Imperative type set manipulation"… Geeezzz…

I would love to see an example, of the epitome of what goodness 
TypeFunctions could unlock. What I've seen so far is basically 
nothing, at the cost of far more than nothing. No Deal.

/Daniel K


More information about the Digitalmars-d mailing list