Safe mode in D?
Jonathan M Davis
jmdavisProg at gmx.com
Fri Oct 18 10:53:41 PDT 2013
On Friday, October 18, 2013 10:41:38 H. S. Teoh wrote:
> On Fri, Oct 18, 2013 at 01:38:12PM -0400, Jonathan M Davis wrote:
> What's the reason for refusing to implement flow analysis? Maybe I'm
> missing something obvious, but for the purposes of escape analysis,
> isn't it enough to just have a simple one-pass flow analysis? Do we
> really need full-scale flow analysis in order to do escape analysis?
I think that it's mainly a question of complexity. Walter doesn't want to add
that kind of complexity to the compiler - especially when that means making
the language requires it, because that makes writing tools for the language
harder. Given his stance on flow analysis, I'm actually kind of surprised that
scope ever made it into the language at all.
> > I don't know that Walter has any plans with regards to scope at this
> > point or not. At the moment, it seems to be relegated to delegates
> > only, and even there, it's not fully implemented. AFAIK, no plans
> > beyond that for scope have ever been announced. It's just that the way
> > that it's defined in the spec implies that it would work with any
> > reference type.
>
> [...]
>
> Well, then we should either change the spec, or make concrete plans on
> how to implement it. The current state of limbo that scope is only
> generates bad rep for D while offering nothing in return.
scope's future definitely needs to be sorted out. I find the fact that compiles
and is simply ignored when it's not valid particularly bad. And the fact that
in is an alias for const scope is probably going to cause a lot of problems
if/when scope is fully implemented because of how many people use in simply
because they like how it seems like the opposite of out, but they don't take
into account that the code in question won't work with scope.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list