lodo1995 / experimental.xml

A replacement of Phobos std.xml
https://lodo1995.github.io/experimental.xml
Boost Software License 1.0
20 stars 8 forks source link

Implement CORRECT reference counting for the DOM #16

Closed lodo1995 closed 8 years ago

lodo1995 commented 8 years ago

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.

burner commented 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?

d-random-contributor commented 8 years ago

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 Nodes without much classes.

lodo1995 commented 8 years ago

@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 Nodes, which have to be handled someway, and standard refcounting won't work.

But maybe I'm misunderstanding what you said...

lodo1995 commented 8 years ago

Closing, as another direction has been taken.

wilzbach commented 6 years ago

This issue was moved to dlang-community/experimental.xml#5