My Long Term Vision for the D programming language

Paulo Pinto pjmlp at progtools.org
Fri Nov 19 15:37:04 UTC 2021


On Friday, 19 November 2021 at 15:20:06 UTC, IGotD- wrote:
> On Friday, 19 November 2021 at 12:22:05 UTC, Paulo Pinto wrote:
>>
>> Swift as natural evolution from Objective-C, with 1:1 
>> interoperability goals with the Cocoa ecosystem and 
>> Objective-C runtime, naturally had double down on ARC.
>>
>> The alternative with a tracing GC would require an engineering 
>> effort similar to how .NET interops with COM,
>>
>> https://docs.microsoft.com/en-us/dotnet/standard/native-interop/cominterop
>>
>> So beware when discussing what D should adopt from other 
>> languages, usually there is more to the whole story than just 
>> RC vs tracing GC.
>
> I think it is besides the point whatever is the best, tracing 
> GC or reference counted GC or whatever. The truth is that both 
> have their advantages and disadvantages.
>
> The problem for D is that the language is limited to tracing GC 
> and I think it is a mistake. The goal should be to create a 
> language that can potentially support any GC type, preferably 
> with as little change as possible when switching between them. 
> This also might include the support for compacting the heap.
>
> It's challenging to create a language that supports all these 
> different types but I think D should have gone a step higher in 
> the abstraction in order to be more versatile.
>
> It is also clear that memory management is something that is 
> still evolving and maybe in the future someone might come up 
> with an even better method that is interesting for D to adopt. 
> That's why the language design should take that into 
> consideration.

That would be affine/linear types, the best ergonomics for them 
is to combine a tracing GC, with such types.

Instead of having them all around the program, only make use of 
them when performance requirements so demand them.

This is the approach being taken by Swift, Haskell, OCaml, and 
even D with @life.

It would be interesting to see @life + GC settle all discussions 
on D's approach to memory management, but somehow I feel it won't 
happen.





More information about the Digitalmars-d mailing list