A betterC base

Seb seb at wilzba.ch
Thu Feb 8 11:40:44 UTC 2018


On Thursday, 8 February 2018 at 11:06:15 UTC, ixid wrote:
> How difficult would it be for D at this point to move towards a 
> pay for what you use system that out of the box is betterC and 
> requires the garbage collector to be explicitly imported?

https://github.com/dlang/druntime/pull/2057

> It feels like D has not overcome at least two major issues in 
> the public mind, the built-in GC and, more ludicrously, the D1 
> library split. Would there not be significant value in making 
> this a D3 transition? As non-breaking as possible but moving 
> the run time elements into libraries

One of Andrei's student is working on this.
I think she has been focusing on templated ==, <= and AAs so far 
and is now recently getting more into the GC business:

https://github.com/dlang/druntime/pulls?utf8=%E2%9C%93&q=is%3Apr+author%3Asomzzz

> and potentially taking the opportunity to invert the defaults 
> for things like safe and pure.

I think someone (Petar?) is working on a DIP for package-wide 
defaults.
The idea is simple, you tell the compiler once:

"Hey yo, listen up. I know that old code still needs to XXX (e.g. 
@system by default), but don't be a bad boy and let me opt-in 
into the cool new stuff by default, please"

I don't recall the exact details though.
Ideally it's like the -std=c++11 flag, i.e. you set it once in 
your dub.sdl and don't have to think about it again.

> The story of this D3 transition to the public would then 
> address the 'issues' head on, creating an easily conveyable 
> story that these have been resolved. This appears to be the 
> level on which a lot of language adoption works, at least 
> between hearing about and trying a language. At the moment it's 
> painful to see the endless criticisms of the GC and library 
> split crop up whenever D is discussed. D is progressing 
> technically but needs a 'story'.

I don't think D3 is going to happen anytime soon (except someone 
forks the language).
Breaking changes are only done for critical things, e.g. when the 
compiler learns to detect new errors in your code.
Regarding the 'story', there's e.g. the excellent GC Series now 
(https://dlang.org/blog/the-gc-series) and things are moving 
forward though of course PR has always been one of D's weakest 
points.

---

Though if there's ever a D3, my list of things to be addressed is 
big

- no auto-decoding
- fix shared
- attribute bloat
- wrong defaults (e.g. @safe or final by default)
- C behavior without compiler warnings
- tuples (though it looks like they can be retro-actively added 
now that the use of the return of the comma operator is finally 
gone)
- Redesign Phobos with @nogc in mind
- remove the bloat from Phobos
- std.io (with streams)
- proper naming and structuring in Phobos (e.g. why is 
doesPointTo or RangePrimitive in std.exception), or "hello 
super-messy std.traits"
...

Some of these actually can be fixed with little or no breakage, 
but for most - if addressed - hell would break loose.


More information about the Digitalmars-d mailing list