3 ms·
In that sense, Java and C# both have control too. There are lots of cases in which escape analysis falls down. In particular, higher order control flow (closur
by pcwalton 10y ago
In that sense, Java and C# both have control too.
There are lots of cases in which escape analysis falls down. In particular, higher order control flow (closures/interfaces) will always cause it to fail, until Go implements some sort of higher order control flow analysis (which I doubt it will). Go uses interfaces a lot.
- weberc2 10y agoC# doesn't have escape analysis, but it has stack-allocated value types. Java doesn't have stack-allocated value types (yet), but it has escape analysis. It seems a lot harder to me to reason about escape analysis without value types, and I have no idea what happens in C# if you take a reference to a value type (i.e., is it moved to the heap?). I never meant to imply escape analysis was somehow perfect; only that it is (mostly) easy to reason about.