<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Sun., 21 Oct. 2018, 2:05 am Walter Bright 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 10/20/2018 11:30 AM, Manu wrote:<br>
> You can write an invalid program in any imaginable number of ways;<br>
> that's just not an interesting discussion.<br>
<br>
What we're discussing is not an invalid program, but what guarantees the type <br>
system can provide.<br>
<br>
D's current type system guarantees that a T* and a shared(T)* do not point to <br>
the same memory location in @safe code.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">My proposal guarantees that too, but in a more interesting way, because it opens the door to a whole working model. And it's totally @safe.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To get them to point to the same memory location, you've got to dip into @system <br>
code, where *you* become responsible for maintaining the guarantees.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">My model preserves that property. Why do you think I'm running that static guarantee?</div><div dir="auto"><br></div><div dir="auto">It's all irrelevant if you don't express any mechanism to *do* anything. Shared today does not have any use. It simply expresses that data *is* shared, and says nothing about what you can do with it.</div><div dir="auto">If you don't express a safe mechanism for interacting with shared data, then simply expressing the distinction of shared data really is completely uninteresting.</div><div dir="auto">It's just a marker that's mixed up in a bunch of unsafe code. I'm no more satisfied than I am with C++.</div><div dir="auto"><br></div><div dir="auto">Shared needs to do something; I propose that it strictly models operations that are threadsafe and semantic restrictions required to support that, and then you have a *usage* scheme, which is safe, and API conveys proper interaction.. not just an uninteresting marker.</div><div dir="auto"><br></div><div dir="auto">I'm genuinely amazed that you're not intrigued by a @safe shared proposition. Nobly likes @safe more than you.</div><div dir="auto"><br></div><div dir="auto">I could run our entire SMP stack 100% @safe.</div><div dir="auto"><br></div><div dir="auto">I am going to fork D with this feature one way or another. It's the most meaningful and compelling opportunity I've seen in ever. If there's ever been a single thing that could truly move a bunch of C++ programmers, this is it. C++ can do a crappy job of modelling most stuff in D, but it simply can't go anywhere near this, and I've been working on competing C++ models for months.</div><div dir="auto">SMP is the future, we're going all-in this generation. Almost every function in our codebase runs in an SMP environment... And I was staggered that I was able to work this definition through to such a simple and elegant set of rules.</div><div dir="auto">I can't get my head around why people aren't more excited about this... fully @safe SMP is huge!</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>