Why D is not popular enough?

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 18 19:59:40 PDT 2016


On Thursday, 18 August 2016 at 22:50:27 UTC, John Smith wrote:
> Garbage collector is in a few libraries as well. I think the 
> only problem I had with that is that the std.range library has 
> severely reduced functionality when using static arrays.

std.range is one of the libraries that has never used the GC 
much. Only tiny parts of it ever have,

Moreover, dynamic arrays do not necessarily have to be GC'd. 
Heck, you can even malloc them if you want to 
(`(cast(int*)malloc(int.sizeof))[0 .. 1]` gives an int[] of 
length 1).

This has been a common misconception lately... :(


> Well you could say the same for the same for int. Why isn't 
> "int + int = long"?

Yeah, if I was designing things, I'd make it promote the smaller 
size to the larger size in the expression. So byte + byte = byte 
and byte + short goes to short, and so on. Moreover, I'd make it 
check both sides of the equation, so int = byte + byte would 
convert the bytes to ints first too. It'd be quite nice, and I 
think it would work in most cases... it might even work the same 
as C in most cases, though I'm not sure.

(the one thing people might find weird is auto a = b + c; means a 
is a byte if b and c are bytes. In C, it would be an int. but who 
writes that in C anyway.)


Alas, C insisted on making everything int all the time and D 
followed that :(



More information about the Digitalmars-d mailing list