Opportunities for D

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 8 14:22:28 PDT 2014


Distilling the discussions about D that are elsewhere than this forum, some 
consistent themes emerge which we need to address to broaden the appeal of D. 
All of them require some organization and focussed effort to complete.

There's been enough jawboning about them. I figure all of them can be smartly 
blown to smithereens if we just line up 3 or 4 cannons on each.


1. Ref Counting

I believe that ARC is a pipe dream for D, as we've discussed extensively here. 
But a ref counted object should work, and would be very attractive, much like 
C++'s shared_ptr<T>.


2. Unique References

unique_ptr<T> is another big success for C++. 2.066 has already made big strides 
in inferring uniqueness of expressions, but it doesn't go so far as creating a 
Unique!T type.


3. 'ref' means 'borrowed', to use Rust's terminology

We're almost there with this. This means better escape analysis, too.


4. Eliminating gratuitous use of GC in Phobos

This means allocations that are not transmitted back to the user. Here's an 
example of such: https://github.com/D-Programming-Language/phobos/pull/2014


5. Precise and Concurrent GC

There's been a lot of work on this, but I don't know where we stand on it.


6. Pushing decisions about storage allocation upwards out of Phobos

By having functions write to OutputRanges instead of to GC allocated buffers, 
the user can decide how to allocate the storage.


7. "D-Routines" - goroutines for D

Goroutines are the killer feature of Go for a number of sensible people. We 
pretty much have this already with fibers, but what is lacking is a scheduler, 
which will take some effort, and a "Channel" type, which should be easy.


8. NotNull!T type

For those that want a non-nullable reference type. This should be doable as a 
library type.



More information about the Digitalmars-d mailing list