Swift does away with pointers == pervasive ARC

eles via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 17 02:31:51 PDT 2014


On Tuesday, 17 June 2014 at 09:10:14 UTC, Walter Bright wrote:
> On 6/17/2014 1:59 AM, Nick Sabalausky wrote:
>
> Oh, I totally understand where it's coming from. I'm trying to 
> point out that ARC is not a magic zero-cost system. Its costs 
> are SUBSTANTIAL. But in order to understand those costs, it is 
> necessary to understand how exception handling works.

It is not (only) about cost, it is about determinism. Exceptions 
are on the error recovery path, so they are less important to be 
deterministic.

What is really critical is not that the execution time of such or 
such function, but the moment when it is called. And on the 
normal execution path.

This is what manual memory management (and, to a degree, ARC) and 
the GC fails to do: determinism of the calls on the normal 
execution path (and in the call of finalizers).

Yes, both ARC and manual memory management may be 
non-deterministic, but not on the normal execution path and not 
with respect to the calls (a malloc is nedeterministic, but its 
call is; you could always statically allocate beforehand).


More information about the Digitalmars-d mailing list