On heap segregation, GC optimization and @nogc relaxing
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Thu Dec 4 15:22:01 PST 2014
On Thursday, 4 December 2014 at 14:23:13 UTC, Dicebot wrote:
> Finally got a look at your proposal. While I do agree with many
> initial statements and, specifically, proposal for heap
> segregation, proposed semantics of `owned` does leave me
> skeptical. It is effectively a more refined/mature approach to
> "cooking of immutables" concept and Marc proposal, while being
> more complicated semantic-wise, allows for much more than that.
I don't think this is solving the same problem as Marc's proposal
so I'm not sure how comparing them make sense. Marc's proposal is
about manipulating data without having ownership. This defines
ownership.
This proposal add some complexity, but I do think this is a
winner. Right now we have various type qualifier (mutable, const,
immutable, shared, const shared, inout, inout shared). This come
at a cost, and, ultimately, as the proposal interact with this,
you want to compare the total complexity with the total benefit.
In one case, you have 7 qualifier. You get a mostly safe language
out of them.
With he proposal, you have 8 qualifiers. You get a safe language
out of it + many opportunities to optimize + added expressiveness
(ie interaction of GC and no gc code, ownership transfers, safe
reference counting, extension of possibilities in @nogc code in a
similar fashion as weakly pure allow for extra expressiveness in
pure code).
If you allow me for a non politically correct metaphor, would you
buy a 1$ condom with an hole in it or a 1.14$ one that do not ?
More information about the Digitalmars-d
mailing list