What ever happened to move semantics?

Manu turkeyman at gmail.com
Tue Feb 27 02:28:32 UTC 2024


I've started writing some code for the first time in years; and the time
away and distance really gave me some fresh perspective.

I started writing D because that's what I prefer, and I was shaken with the
realisation that the situation is just so much worse than I was ever
willing to admit to myself.
This is a small greenfields app, and I want to develop it quickly... so I
told myself that I'd try and use phobos.
...but it needs to run on microcontrollers, so I need to compile tiny code
and avoid GC and stuff. Better-C seems like a good plan, except that phobos
is just not compatible.
So, I figured I'd just use phobos and worry about fixing up allocation
semantics later when I want to release on hardware, so I can dev the
business logic on PC quickly.
Seems like a plan, except phobos is just BAD. API's are inconsistent and
mostly horrible. Nothing is intuitive, and also I realise I'm writing
myself into a huge overhaul when I want to forge a microcontroller build
later.

The biggest slap in the face though, which is honestly unexcusable 20 years
on, is that D still has no real meaningful container library! How can a
modern language not have a library of containers that let me organise my
data?!

I realised that the best and most usable containers are actually the stdcpp
containers I was implementing years ago! But the thing that held up that
work was that we STILL don't have any way to implement move semantics!
There was a SAOC project to implement rvalue references which would open D
up to implementing container libraries; but sadly the author just
disappeared one day never to be seen again. Nobody else ever moved on that
issue.

Walter: It's been too long, there are still no containers, which is
embarrassing and stdcpp is still blocked on this. I strongly urge you to
drop whatever you are doing and finally implement an rvalue reference so we
can *finally *implement move semantics, and with that, we can have a
container library worthy of the language (I'll even start by finishing
stdcpp which is blocked on that issue).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20240227/d7b16438/attachment.htm>


More information about the Digitalmars-d mailing list