My Long Term Vision for the D programming language

Paulo Pinto pjmlp at progtools.org
Fri Nov 19 12:22:05 UTC 2021


On Friday, 19 November 2021 at 10:47:12 UTC, Ola Fosheim Grøstad 
wrote:
> On Friday, 19 November 2021 at 10:13:02 UTC, Paulo Pinto wrote:
>> -- Dennis M. Ritchie on 
>> https://www.bell-labs.com/usr/dmr/www/chist.html
>>
>> Dennis knew what he created, C advocates to this day 
>> apparently not.
>
> Thanks for the link! Important quote, take notice Boehm 
> GC-defenders:
>
> **«C is hostile to automatic garbage collection.»**
>
> HOSTILE! Nothing less. And I agree.
> ...

This is why D community should take care when celebrating designs 
in other languages like Objective-C and Swift's ARC.

As I already mentioned a couple of times, Objective-C ARC did not 
came out being the best technical option for Objective-C just 
like that, rather due to the failure of making Objective-C GC 
with a tracing GC based on Boehm work without issues.

Still available on the documentation archive,

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/GarbageCollection/Introduction.html#//apple_ref/doc/uid/TP40002431

Check "Architecture", "Design Patterns to Use, and to Avoid", 
"Inapplicable Patterns", just for starters.

So when Apple rebooted their design, they followed up on what 
Visual C++ extensions already did for COM (e.g. _com_ptr_t), and 
made Objective-C compiler perform the retain/release Cocoa 
messages itself.

Coined their reference counting approach as ARC, and made a whole 
marketing message how ARC tops tracing GC, and the world of App 
devs cluessless of compiler design issues cheered in unison.

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.


More information about the Digitalmars-d mailing list