Maybe D is right about GC after all !

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Dec 30 17:24:10 UTC 2017


On Sunday, 24 December 2017 at 16:51:45 UTC, Patrick Schluter 
wrote:
> That's the biggest problem with C++, they pile on relentlessly 
> half baked feature after half baked feature in a big dump that 
> no one with a life can ever grasp.

I think D has more first class language features (and thus 
special casing) than C++.  For instance, C++ lambdas are just 
sugar over objects and most of the new stuff is primarily library 
features with some minor language tweaks to back it. So I don't 
think the core C++ language itself has changed dramatically.

Like, constexpr is mostly about allowing things that were 
forbidden, but it is opening new ways to structure code, which in 
turn "deprecates" some old clumsy idioms… Except those old clumsy 
idioms linger… both in online tutorials, in code bases and of 
course in the mentality of the programmers…

Since those "deprecated" idioms are built by combining features 
it cannot easily be detected and transformed into "modern" idioms 
by a tool either. Whereas a high level dedicated language feature 
could more easily be "deprecated" and dealt with in a language 
upgrade.

Which is one downside of using library-based constructs over 
language constructs.

So I am a bit torn on library vs language features.  From an 
aesthetics point of view having a small and expressive language 
seems like the better choice, but one can make good arguments for 
a low level oriented DSL as well.

With a well designed DSL the compiler author might more easily 
reason about the programmers intent and perhaps make better 
optimization choices… thus allowing the programmer to write more 
readable performant code…

I think the DSL approach makes more sense as computer 
architecture get less simplistic.

Although currently CPU vendors target C-like code, that might 
change in the future as less code is written in C-like languages…



More information about the Digitalmars-d mailing list