Closed lodo1995 closed 8 years ago
I think we should have, a chat about that. I think you should not spend to much time on solving a problem (GC problem) that the D community has not solved in a lot of time. I know I said a DOM without GC allocated memory would be nice, but not to an extend that you don't get the DOM done or anything else. I think we have to find a reward effort balance. Do you have time to talk today tonight?
If DOM is not @nogc-friendly, it's probably ok to leave it relying on gc, if there can be a more @nogc-friendly API, it can be also simpler, e.g. there's an xml API that uses just Node
s without much classes.
@d-random-contributor maybe I'm not getting your point. Are you talking about the DOM Specification explicitly stating that Node
can be used to do everything without classes and polymorphism? The problem is that you still have circular references between the Node
s, which have to be handled someway, and standard refcounting won't work.
But maybe I'm misunderstanding what you said...
Closing, as another direction has been taken.
This issue was moved to dlang-community/experimental.xml#5
The main superiority of garbage collection wrt to reference counting is the ability to easily collect objects with circular references, like, for example, the Document Object Model classes.
Thus, to make the DOM usable without resorting to gc, a slightly modified rc approach must be used, as the current one leaks most of the allocated objects.