What ever happened to move semantics?
Timon Gehr
timon.gehr at gmx.ch
Wed Feb 28 22:20:51 UTC 2024
On 2/28/24 23:01, Don Allen wrote:
> As I've said in previous posts, I've written a lot of Rust and now a
> fair amount of D. I prefer D as it is, now that I've solved some issues
> with my own lack of knowledge about the available tools.
>
> I want to make a comment about all this chatter about move semantics. I
> freely admit that I have not read the proposal for doing this, if there
> is a fully-fleshed-out proposal, and I probably never will.
> ...
Well, suit yourself.
> My issue is this: Rust has led the move semantics charge.
Linear typing is a very old idea.
> Grafting move
> semantics onto feels to me like me-too-ism and just cluttering the D
> environment with yet another wart that it does not need.
No, the warts are here now. Move semantics is a way to get rid of
existing warts.
> Move semantics
> in Rust results in the programmer becoming an key part of the memory
> management system, whether they realize it or not.
It's just another tool. Use it when it is appropriate.
> Anyone who has
> wrestled with the borrow checker or gotten themselves into lifetime hell
> with Rust will understand (unless they've drunk the Kool-Aid) what I am
> talking about.
Move semantics is not the same as borrowing.
> ...
>
> So before cluttering the D environment with an unneeded me-too effort
> (my opinion!) and wasting scarce developer resources on this when there
> is so much else to be done that D needs more than a borrow-checker, I
> urge you to think very carefully about this.
You seem to confuse DIP1000 with move constructors. Move semantics is
one of the things D needs more than a borrow checker.
Anyway, move constructors _are_ among the top 10 priorities now for the
language.
More information about the Digitalmars-d
mailing list