std.allocator needs your help

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Sep 24 08:29:39 PDT 2013


On 9/23/13 11:32 PM, Jacob Carlborg wrote:
> On 2013-09-23 19:53, Andrei Alexandrescu wrote:
>
>> I talked Walter's ear off a while ago at an ACCU conference about the
>> notion that reference counting could be a switch passed to the compiler.
>> Recently he's authored a DIP about the compiler inserting refcounting
>> primitives in the generated code. Unfortunately I think the DIP is
>> awfully incomplete and superficial (to the extent it would bring more
>> damage to the language if any implementation effort would be invested in
>> it at this point).
>>
>> Can it be done? Probably. But it would be an absolutely major effort.
>
> I don't know if we're talking about the same things but a couple of us
> had a private email conversion about implementing ARC (Automatic
> Reference Counting) in the compiler as a result of my suggestion for
> adding support for Objective-C in D.
>
> A DIP was never created, at least I cannot find it at the wiki. If I
> recall correctly the conversation was never put in the public, which I
> think it should be.

I know of this idea and discussed it with Walter. Our provisional 
conclusion was that the matter is quite a bit more involved than we 
initially thought, and ensuring safety would be extremely difficult.

>> I think this is debatable. For one, languages such as Java and C++ still
>> have built-in "new" but quite ubiquitously unrecommend their usage in
>> user code. Far as I can tell that's been a successful campaign.
>
> Since when is it _not_ recommended to use "new" in Java?

http://goo.gl/KVmAom


Andrei




More information about the Digitalmars-d mailing list