Let's get the semantic around closure fixed.

Paul Backus snarwin at gmail.com
Thu May 20 11:00:55 UTC 2021


On Thursday, 20 May 2021 at 09:42:20 UTC, Ola Fosheim Grostad 
wrote:
> On Wednesday, 19 May 2021 at 20:56:10 UTC, Paul Backus wrote:
>> On Wednesday, 19 May 2021 at 19:01:59 UTC, Walter Bright wrote:
>> If closures causing "hidden" allocations is problematic, from 
>> a language-design perspective, then it's problematic whether 
>> it occurs inside a loop or not. Either we should (a) deprecate 
>> and remove GC-allocated closures entirely, or (b) make them 
>> work correctly in all cases.
>
> Or better, acknowledge that there is a difference between low 
> level and high level projects (or libraries), and let low level 
> programmers get warnings that they can silence while allowing 
> high level programmers to have an easy life.

Low-level programmers who want to find/avoid GC allocations in 
their programs already have plenty of tools to do so: @nogc, 
-vgc, and -profile=gc.


More information about the Digitalmars-d mailing list