> redefining “=“ to mean linear move is JavaScript level why the fuck did we do that.
IMNSHO this is another place where C++ has the defaults wrong. If you have both copy and move assignment, then move is the correct default. C++ didn't start out having move semantics at all, so this wasn't practical, but too bad.
From a pedagogic point of view the Rust choice is much easier to teach. Having taught move assignment, Copy is just an optimisation in Rust. Whereas in C++ you need to teach both separately, and it's understandable when people don't "get it".
Eh, fair enough. Frankly it would probably be better to do new operators anyways.
The “=“ operator meant copy for a long time, and everything from Java to Python technically kept those semantics by calling pointers “handles” or whatever.
I write a lot of C++ and type “std::move” too much, for some kinds of code it is in fact the default you want.
But there are plenty of punctuation characters in ASCII alone. Hell Pascal has been dead long enough we could bring “:=“ back.
“=“ meaning move is the worst kind of pun: it violates 30+ years of intuition, masks that there is still often some code-gen involved, and generally flexes the “Rust vibe” that whatever you knew before is irrelevant because we fixed computing.
Rust is a cool language in some ways. Rust attitude is: “we brigade HN. And you will do nothing, because you can do nothing.” I got into Rust despite the community.