backporting features to D1

Christopher Wright dhasenan at gmail.com
Sun Oct 12 12:54:48 PDT 2008


Frank Benoit wrote:
> Christopher Wright schrieb:
>> Frank Benoit wrote:
>>> How can you guess anything here?
>>>
>>> Old behavior == just the direct call, no extra cost New behavior ==
>>>  same direct call plus a heap allocation with unbound cost
>> There are plenty of randomized algorithms with potentially unbounded 
>> cost that are still used. In practice, potentially unbounded things 
>> work in a reasonable amount of time or get replaced.
>>
> 
> You said it is just a thing of optimization.
> That would be true if the runtime would have been increased by a defined
> value, like double runtime. But it has changed from deterministic
> behavior to undeterministic behavior.
> => that means you can no longer use that in code that is made for high
> data rate or low latency. And optimizations will not change that.
> 
> There is also no sense in doing benchmarks, because you are
> measuring the GC performance, nothing more. And I already know, that I
> need the guarantee for no heap allocation.
> 
> My point is, the delegate are a D1 tool that can be used in high
> performance code. Shortly after the full closure feature was announced
> (Nov 07), it was shown that this brakes D1 runtime behavior. Still this
> is not fixed.
> 
>> While this does violate Tango's contracts about heap allocation, once
>>  scope delegates are available, it won't take much work to replace 
>> "delegate" with "scope delegate" everywhere in Tango.
> 
> I understand this as a confirmation, that with actual D2 you cannot port
> tango and expect it to work as it does with D1.
> Even an optimization cannot help. IMO the only two possible solutions are
> 1. Redesign the code -or-
> 2. Wait for scoped delegate

Okay, and for the 98% of people who don't mind having some extra heap 
allocation, we have to wait.

Though this isn't terribly relevant -- I think that, if D2 were less of 
a moving target, Tango would already have been ported and released for D2.



More information about the Digitalmars-d mailing list