Re: Safe Memory Management and Ownership.

2018-07-16 Thread Chris M. via Digitalmars-d
On Friday, 13 July 2018 at 20:03:37 UTC, jmh530 wrote: On Friday, 13 July 2018 at 17:12:26 UTC, Atila Neves wrote: [...] Hmm, thinking on this a little more...it does seem difficult...but I don't think the problem is with immutable borrows. I think the issue is with the exclusivity of

Re: Safe Memory Management and Ownership.

2018-07-13 Thread jmh530 via Digitalmars-d
On Friday, 13 July 2018 at 17:12:26 UTC, Atila Neves wrote: Rust can do that because it enforces it at compile-time. A D solution wouldn't be able to do anything more with immutable borrows. Hmm, thinking on this a little more...it does seem difficult...but I don't think the problem is

Re: Safe Memory Management and Ownership.

2018-07-13 Thread Atila Neves via Digitalmars-d
On Friday, 13 July 2018 at 14:47:59 UTC, jmh530 wrote: On Friday, 13 July 2018 at 12:43:20 UTC, Atila Neves wrote: The only thing I got from this are that "smooth references" are like Rust's borrows. Which just gave me the idea to add this member function to `Unique`: scope ref T borrow();

Re: Safe Memory Management and Ownership.

2018-07-13 Thread jmh530 via Digitalmars-d
On Friday, 13 July 2018 at 14:47:59 UTC, jmh530 wrote: Sounds interesting. I imagine you could specialize this depending on mutability. Rust allows only one mutable borrow, but eliminated I swear I must have dyslexia or something. Eliminated should be unlimited.

Re: Safe Memory Management and Ownership.

2018-07-13 Thread jmh530 via Digitalmars-d
On Friday, 13 July 2018 at 12:43:20 UTC, Atila Neves wrote: The only thing I got from this are that "smooth references" are like Rust's borrows. Which just gave me the idea to add this member function to `Unique`: scope ref T borrow(); I have to think about @safety guarantees but it should

Re: Safe Memory Management and Ownership.

2018-07-13 Thread Chris M. via Digitalmars-d
On Thursday, 12 July 2018 at 21:31:04 UTC, xray wrote: On Thursday, 12 July 2018 at 14:13:25 UTC, Chris M. wrote: On Wednesday, 11 July 2018 at 22:59:50 UTC, xray wrote: [...] I feel the following should be disallowed, since we've moved some checking to runtime. Ideally this system would

Re: Safe Memory Management and Ownership.

2018-07-13 Thread Atila Neves via Digitalmars-d
On Wednesday, 11 July 2018 at 22:46:45 UTC, xray wrote: [ .. ] After watching the Dconf 2018 session about "Safe Memory Management", I told myself that, if D can guarantee an exception in the case we delete an already deleted object, then it's a major step forward. So let's assume that.

Re: Safe Memory Management and Ownership.

2018-07-12 Thread xray via Digitalmars-d
On Thursday, 12 July 2018 at 14:13:25 UTC, Chris M. wrote: On Wednesday, 11 July 2018 at 22:59:50 UTC, xray wrote: The message above is repost of : https://forum.dlang.org/post/pfjotkcazuiuhlvzi...@forum.dlang.org So I can reply to Chris M. here.

Re: Safe Memory Management and Ownership.

2018-07-12 Thread Chris M. via Digitalmars-d
On Wednesday, 11 July 2018 at 22:59:50 UTC, xray wrote: The message above is repost of : https://forum.dlang.org/post/pfjotkcazuiuhlvzi...@forum.dlang.org So I can reply to Chris M. here. -- Yes, Chris, I got inspired by Rust :)

Re: Safe Memory Management and Ownership.

2018-07-11 Thread xray via Digitalmars-d
The message above is repost of : https://forum.dlang.org/post/pfjotkcazuiuhlvzi...@forum.dlang.org So I can reply to Chris M. here. -- Yes, Chris, I got inspired by Rust :) But Rust goes too far and it lowers the productivity.

Safe Memory Management and Ownership.

2018-07-11 Thread xray via Digitalmars-d
Hi there, I have been through the discussions on the forum regarding scope, ownership, GC and so on. After a serious thought about this, I'd like to discuss about a possible solution for this matter. My concern is to know if my solution could work and to discuss the possible impact on the