Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
August 06, 2013 Is there an equivalent of Rust owned pointer in D? | ||||
---|---|---|---|---|
| ||||
Owned pointer in Rust is a good design IMO, how about D equivalent? |
August 06, 2013 Re: Is there an equivalent of Rust owned pointer in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Elvis | On 06/08/2013 06:26, Elvis wrote: > Owned pointer in Rust is a good design IMO, how about D > equivalent? I think this is about the closest ATM: http://dlang.org/phobos/std_typecons.html#.Unique |
August 09, 2013 Re: Is there an equivalent of Rust owned pointer in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Treleaven | On Tuesday, 6 August 2013 at 16:32:43 UTC, Nick Treleaven wrote:
> On 06/08/2013 06:26, Elvis wrote:
>> Owned pointer in Rust is a good design IMO, how about D
>> equivalent?
>
> I think this is about the closest ATM:
> http://dlang.org/phobos/std_typecons.html#.Unique
would be good to have it as language feature like scoped reference. this clear code (as from c++11 experience abundant std::unique_ptr<T> get me irritated). And of course unique idiom (ownership) get D usable for realtime (removed GC)
|
August 09, 2013 Re: Is there an equivalent of Rust owned pointer in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ruslan Mullakhmetov | On Friday, 9 August 2013 at 18:16:57 UTC, Ruslan Mullakhmetov wrote:
> On Tuesday, 6 August 2013 at 16:32:43 UTC, Nick Treleaven wrote:
>> On 06/08/2013 06:26, Elvis wrote:
>>> Owned pointer in Rust is a good design IMO, how about D
>>> equivalent?
>>
>> I think this is about the closest ATM:
>> http://dlang.org/phobos/std_typecons.html#.Unique
>
> would be good to have it as language feature like scoped reference. this clear code (as from c++11 experience abundant std::unique_ptr<T> get me irritated). And of course unique idiom (ownership) get D usable for realtime (removed GC)
While I'm convinced that unique pointers / types are a important concept, especially if combined with immutable. (What's transitive unique/immutable can be cast to immutable .. ), I don't think that just adding a new type modifier will lead D anywhere.
|
August 09, 2013 Re: Is there an equivalent of Rust owned pointer in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tobias Pankrath | On Friday, 9 August 2013 at 19:05:26 UTC, Tobias Pankrath wrote:
> On Friday, 9 August 2013 at 18:16:57 UTC, Ruslan Mullakhmetov wrote:
>> On Tuesday, 6 August 2013 at 16:32:43 UTC, Nick Treleaven wrote:
>>> On 06/08/2013 06:26, Elvis wrote:
>>>> Owned pointer in Rust is a good design IMO, how about D
>>>> equivalent?
>>>
>>> I think this is about the closest ATM:
>>> http://dlang.org/phobos/std_typecons.html#.Unique
>>
>> would be good to have it as language feature like scoped reference. this clear code (as from c++11 experience abundant std::unique_ptr<T> get me irritated). And of course unique idiom (ownership) get D usable for realtime (removed GC)
>
> While I'm convinced that unique pointers / types are a important concept, especially if combined with immutable. (What's transitive unique/immutable can be cast to immutable .. ), I don't think that just adding a new type modifier will lead D anywhere.
No, I didn't assert that. I just proposed a synthetic sugar =). Unique pointer/types are already in D (at the library level).
|
Copyright © 1999-2021 by the D Language Foundation