My Long Term Vision for the D programming language

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Nov 24 17:43:34 UTC 2021


On Tue, Nov 23, 2021 at 07:22:11PM +0000, Araq via Digitalmars-d wrote:
[...]
> As long as D doesn't distinguish GC'ed pointers from non-GC'ed
> pointers and allows for unprincipled unions I fail to see how it's
> "good news".

Hmm you're right, unprincipled unions throw a monkey wrench into the
works. :-/  I don't see GC'ed vs. non-GC'ed pointers as a problem; the
collector could tell them apart from their values (whether they fall
into the range of GC-managed heap), just like is done with today's D's
GC.


> Multi-threading is also a problem, in Nim we can track global
> variables and pass "isolated" subgraphs between threads so that the RC
> ops do not have to be atomic.
[...]

Having thread-local heaps would solve this, except for immutable which
is implicitly shared.  Well, that, and the mess with `shared` and
passing stuff between threads... Hmm.

I wonder if this could be addressed by repurposing `shared` to qualify
data that could have references from multiple threads. This would make
it a LOT more useful than it is now, and would let us do ORC-like memory
management with tracing of non-shared data without locks. Shared stuff
would have to be handled differently, of course.


T

-- 
English is useful because it is a mess. Since English is a mess, it maps well onto the problem space, which is also a mess, which we call reality. Similarly, Perl was designed to be a mess, though in the nicest of all possible ways. -- Larry Wall


More information about the Digitalmars-d mailing list