Escape analysis

Sean Kelly sean at invisibleduck.org
Tue Oct 28 20:08:30 PDT 2008


Walter Bright wrote:
> Sean Kelly wrote:
>> I think the cost/benefit of this could probably be argued either way. 
>> I've never encountered a bug related to this, for example, so to me 
>> the benefit is entirely theoretical while the cost is immediate.
> 
> I have. Not often in my own code because I am very careful to avoid it, 
> but it frequently happens in 'bug' reports I get sent. This trap does 
> happen to programmers who are less familiar with how the underlying 
> stack machine actually works.

I tend to ask a question along these lines to entry-level interviewees 
and it's surprising how often they get it wrong.  So I agree that this 
is a fair point.  I mostly brought up this argument because C++ is 
unapologetically designed for experts and I'm occasionally inclined to 
view D the same way... even though its goal is really somewhat different.

> The real problem is there is no way to verify that this isn't happening 
> in some arbitrarily large code base. I strongly believe that it is good 
> for D and for programming languages in general to work towards a design 
> that can provably eliminate certain types of bugs.

I agree, which is why I'm actually in favor of this despite what I said 
above.


Sean



More information about the Digitalmars-d mailing list