What's missing to make D2 feature complete?

via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 21 14:43:09 PST 2014


On Sunday, 21 December 2014 at 09:34:33 UTC, bearophile wrote:
> This sounds more ambitious than the hypothetical D3 language :-)

Feature complete should be ambitious! I am only asking for 
something a little bit better than C++ ;-) I am not asking for 
fringe features like "multiple alias this"...

> Modular arithmetics is handy, when you want it.

But you always get it… you can just use the modulo-operator.

> I don't understand enough some of your points, so you should 
> popularize better your ideas :-)

Which points? I assume point 1 was clear, more on point 2 and 3:

On point 2, AVX:

LLVM is getting AVX auto vectorization. AVX uses masks so that 
you can vectorize loops with conditionals, when the mask goes to 
zero then the instruction is turned into NOP. So with the proper 
constructs you can get branch-free vectorized inner loops.

If D wants to stay competitive as a system level language, D need 
to make sure that programs get efficient AVX auto vectorization 
out-of-the-box.

I find this poster from the last LLVM meeting interesting:

http://llvm.org/devmtg/2014-10/Slides/Nis-AVX-512ArchPoster.pdf


On point 3, allocators:

If you want reasonable and fast ref counting without code bloat 
you need to standardize how ref-counting is done. The simple 
solution is to put the ref count on a negative offset and make 
sure that all ref-countable class objects are allocated as 
separate objects.

Then you need a fast allocator. That means you need a pool where 
alloc/free is O(1) in the common case. By profiling allocation 
patterns the compiler can generate code that makes objects 
available when needed. Since most applications have uneven load 
you can initialize objects to defaults and restructuring the free 
memory in thread local/global heap when you are having cycles to 
spare.

If the compiler controls allocations it can also reuse objects 
when they are dead (by liveness analysis) rather than 
freeing/allocating, put it on the stack etc…


More information about the Digitalmars-d mailing list