On 31/07/2013 9:54 AM, "Jonathan S. Shapiro" <[email protected]> wrote: > > On Tue, Jul 30, 2013 at 4:44 PM, David Jeske <[email protected]> wrote: >> >> I also don't like the last-in-first out discipline, since it seriously limits what regions can do (as I mentioned in my practical examples). > > > Understood. But that's one of the defining characteristics of regions. In order to type them sensibly, you need a region subtyping relation. LIFO order ensures that.
And it means that for a large body of code, the compiler can entirely place a limit on the lifetime of a value. So you mostly write code as you always have, and malloc/free are placed correctly such that the result is almost as if you had allocated on the stack, except that structure return values don't need to be copied. The reason I say "large body" is that, in the ML kit, region capture was considered so unusual that it emits a big warning at compile time if you do it. That isn't at all empirical on my behalf, but after a while of working in regions you start to see lifetimes in your own code very clearly, and most of them seem successfully inferred by a region system.
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
