Isn't it about time for D3?

Sebastien Alaiwan via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 15 10:06:31 PDT 2017


On Thursday, 15 June 2017 at 15:04:26 UTC, Suliman wrote:
> Should D really move to GC-free? I think there is already 
> enough GC-free language on the market. D even now is very 
> complected language, and adding ways to manually managing 
> memory will make it's more complicated.

We need automatic deterministic destruction (and we partially 
have it, using scope(exit) and structs RAII).

Memory management is only the tip of the iceberg of resource 
management ; it's the easy problem, where an automated process 
can to tell which resources aren't needed any more.

However, an instance of a class can hold a lot more than flat 
memory blocks: threads, file handles, on-disk files, system-wide 
events, sockets, mutexes, etc.

Freeing the memory of my "TcpServer" instance is mostly useless 
if I can't reinstanciate a new one because the TCP port is kept 
open by the freed instance (whose destructor won't be run by the 
GC).



More information about the Digitalmars-d mailing list