← Back to context

Comment by hgomersall

2 months ago

No, it should move properly when passing by value (as in, essentially the rust move semantics). If you want a copy, that should be explicit.

Moving by default would be too much of a footgun without a borrow checker imo.

  • I think using a language without a borrow checker is already a massive footgun (albeit less of one for GC/RC languages). More sensible move semantics would still be a big ergonomic improvement.

  • I think the language allowing use-after-move is honestly a smaller footgun than allowing using uninitialized memory or use-after-free. C++ already has the latter.