Why is D unpopular, redux.

Walter Bright newshound2 at digitalmars.com
Tue May 24 23:47:20 UTC 2022


On 5/24/2022 3:55 PM, Timon Gehr wrote:
> On 24.05.22 19:10, Walter Bright wrote:
>> On 5/24/2022 12:45 AM, Timon Gehr wrote:
>>> No. The correct behavior when a delegate literal outlives captured variables 
>>> is to allocate a closure. This case is not an exception...
>>
>> But it isn't a safety problem, as it won't compile.
> 
> Well, it's still a memory safety problem in @system code, it's just that it's 
> not a soundness issue for @safe.

The whole point of @system is to remove the safety checks.

I'm more interested in soundness than in replicating closure semantics of other 
languages. Especially since the workarounds are simple:

Replace `int x` with `int* px = new int()`

I.e. one can always make a closure manually. It's not the end of the world if 
the compiler doesn't provide a spoonful of sugar for it.

Don't get me wrong, I'm still interested in adopting good semantics from other 
languages, it's just that soundness is much more of a priority.

I do enjoy and appreciate your contributions, too, even if it seems like I'm 
always arguing with you :-/


More information about the Digitalmars-d mailing list