Proposal : aggregated dlang git repository

weaselcat via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 10 19:20:57 PST 2015


On Tuesday, 10 February 2015 at 17:47:59 UTC, Andrei Alexandrescu 
wrote:
> On 2/10/15 9:44 AM, weaselcat wrote:
>> Again I apologize for the briefness, I'll try to reply to this 
>> later
>> with better details.
>
> Much appreciated, thanks. -- Andrei

To continue from earlier,

Once again, my POV is that from a *user* of D, not a *developer.* 
I realize that a solid 9 out of 10 of the people on the newsgroup 
actively contribute to D and I don't want to offend anyone : ).

I was just using RefCounted!T as one example of a major headache 
I've had with D. To follow up upon earlier,
https://issues.dlang.org/show_bug.cgi?id=2757

This issue was filed in 2009 and succinctly covers why someone 
might need deterministic resource management(i.e - RAII.) 3 
months ago it was marked WONTFIX with a statement to just use 
Refcounted. Great. Except the issue wasn't fixed because 
Refcounted has serious issues and IMO it shouldn't have been 
closed. I'd harp on this - but a feature request for it already 
exists. https://issues.dlang.org/show_bug.cgi?id=13983
Not just one either... 
https://issues.dlang.org/show_bug.cgi?id=13972 
https://issues.dlang.org/show_bug.cgi?id=9998 (2013) (I don't 
think any of them address that refcounted is unusable on classes, 
abandon polymorphism all ye who attempt to work around the GC.)

So pretty much the only way to handle resources that require 
cleanup is to use a struct. Using the destructor of an object 
for... well, nearly anything is undefined AFAICT. I have a fun 
game, walk up to a random person at the next CPPcon and tell them 
that they're no longer allowed to use destructors to manage 
resources and see what kind of face they make ;)

At this point I start to realize that _most_ of the code I'm 
attempting to port requires this type of management. Suddenly I 
feel like I've been thrown a few decades in the past and get to 
use C with fancy semantics like slicing. The one thing the 
language has basically been designed around is completely 
unusable to me because I can't rely on the GC's non-deterministic 
behavior.

I'd love the GC if it could actually _manage_ my garbage for me, 
but instead I feel like D has delegated me to the position of 
garbage collector in a much more serious way than C++ _ever_ 
has... well, C++11 and forward anyways.

FYI, this thread has a great discussion on these issues. 
http://forum.dlang.org/thread/20140430231745.GA1125@quickfur.ath.cx?page=3#post-bqweskwediwlijuzfdts:40forum.dlang.org

I'm sure I'll get a response from ketmar( ;-) ) or another D 
superuser who will scoff at my issues and how they know how to 
work around the warts in D by using arcane hacks and custom 
patches... but honestly I don't think I'm the first person to 
make these sort of complaints. Hell, the blog that started two(? 
one?) of the bug requests linked above mentioned the same issue.

I made these two posts not to cry about the language, but to say 
"Hey, D is kind of really lacking here!" I'd love to just submit 
a PR, but it is above my paygrade to fix a major feature like 
RefCounted.

I'm sorry if this is off-topic, I did not mean to derail your 
thread Dicebot. I just wanted to share my experience of trying to 
ease into D as someone who can't just open up phobos and begin 
hacking away enhancements like most of the people here.

I hope this was the sort of reply you were looking for, Andrei.


More information about the Digitalmars-d mailing list