Herb Sutter is planning to reduce C++'s complexity

claptrap clap at trap.com
Wed Oct 14 00:06:37 UTC 2020


On Sunday, 11 October 2020 at 11:46:36 UTC, Per Nordlöw wrote:
> At [1] Herb Sutter outlines his plans for simplifying C++'s 
> complexity. Good that they realize the importance of this.
>
> Specifically there's a plan to copy the meaning of D's 
> parameter qualifiers `in`, `out` and `inout` (`ref` in D).
>
> At 17:51 in [2], he interestingly mentions the rules for 
> passing `in` parameters where passing-type should be inferred 
> just like the newest update of `-preview=in` does.
>
> He also mentions more inference of pass-by-move similar to what 
> Walter has proposed at [3]

I think it's a pretty interesting way to measure complexity by 
counting how many guidelines there are for the feature. I guess 
it's sort of a more empirical version of Andrei's can you explain 
it in 30 seconds rule. Maybe a similar kind of metric could be 
applied to D features, explain the feature and account for all 
the corner cases, and see how much text you have.

It's also interesting that it seems pretty much accepted that the 
only way to simplify C++ is to add new things that allow ghosting 
of old wonky things. Even if it takes 10 to 15 years to happen. 
Its seems some feel D has gotten towards the large and unwieldy 
end of the design space, but adding more stuff is not the way 
forward. I wonder how else you can simplify but by replacing old 
with new. (Even if the old has to hang around in limbo.)

Also after watching the video and skimming the pdf there seems to 
be no mention of aliasing with 'in' parameters as was recently 
discussed in the newsgroup. I wonder if they/he just hasn't 
considered it or they dont think it's something to be concerned 
about, or maybe it's just not solvable and the net gain from 
simplifying parameter passing is worth that unlikely corner case.

https://github.com/hsutter/708/blob/main/708.pdf





More information about the Digitalmars-d mailing list