Plan for D
Ola Fosheim Grostad
ola.fosheim.grostad at gmail.com
Tue May 18 16:49:13 UTC 2021
On Tuesday, 18 May 2021 at 16:32:01 UTC, dogman wrote:
> a. can we make language more secure and memory safe(like rust)
> with and without GC.
With, obviously. Without, only if add RC, but RC without ARC is
not going to be popular. You cannot have safe borrowing like
Rust without tedium. Anyway, the real problem is having to do RC
eveywhere on the heap, because proving anything about pointers on
the heap is a HARD problem. So unless you want everything to be
an acyclic tree datastuctures, you will then be forced to use RC
for backpointers, which is moronic!
So, no, the theoretical knowledge is not where it has to be to
write efficient safe code. It is not possible, in the general
case, as of today.
> b. can D without GC use hashmaps, stdlib and other libraries.
> Libraries can be used with or without GC. Is it technically
> possible.
The problem is, what about cleanup? D does not have fully precise
collection.
Destuctors on the GC heap cannot follow pointers to GC objects
safely...
More information about the Digitalmars-d
mailing list