<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Fri., 19 Oct. 2018, 6:10 am Dominikus Dittes Scherkl via Digitalmars-d, <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Friday, 19 October 2018 at 06:25:00 UTC, rikki cattermole <br>
wrote:<br>
> On 19/10/2018 7:09 PM, Norm wrote:<br>
<br>
> [0] <br>
> <a href="https://github.com/rikkimax/DIPs/blob/shared/DIPs/DIP1xxx-RC2.md" rel="noreferrer noreferrer" target="_blank">https://github.com/rikkimax/DIPs/blob/shared/DIPs/DIP1xxx-RC2.md</a><br>
<br>
This document provide no reasoning about what usecases it <br>
supports:<br>
<br>
Is it possible to create objects that are shared just for short <br>
periods during their livetime and guarantee that they can be used <br>
threadsave like Manu want it to be?<br>
<br>
Does it prohibit misuse any better than Manus proposal (that <br>
requires the "Expert" to implement all theadsave API)?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No, a key misunderstanding. My proposal is @safe. The only thing an expert must do is write the few @trusted implementations that live at the very bottom of the stack.</div><div dir="auto"><div dir="auto" style="font-family:sans-serif">That would always be in a lib. When was the last time you rewrote std::map because you thought you could do better?</div><div dir="auto" style="font-family:sans-serif"><br></div></div><div dir="auto">The whole stack from there on up (the user stack) is safe, and you can have confidence in the @safe-ty.</div><div dir="auto">My goal is to make it safe, clearly communicate how a user interact with the API, and mechanically confirm that users do the right stuff.</div><div dir="auto">My proposal is specifically structured to not require *any* unsafe interactions at the user level. Only core machinery that is @trusted needs expert attention. </div><div dir="auto"><br></div><div dir="auto">I don't think it's possible to invent a proposal with a higher degree of verifiable safety.</div></div>