[rust-dev] On Copy = POD

Nick Cameron lists at ncameron.org
Sat Jun 21 16:09:47 PDT 2014


Agreed. Post-1.0, I hope to put some effort into addressing this.

For now, the best solution I've found is to use borrowed references, arena
allocation and unsafe initialisation. This is far from perfect, and you end
up with _a lot_ of lifetime parameters, but it works if the problem fits
the constraints.


On Sun, Jun 22, 2014 at 11:02 AM, Cameron Zwarich <zwarich at mozilla.com>
wrote:

> On Jun 21, 2014, at 2:15 PM, Nick Cameron <lists at ncameron.org> wrote:
>
> > Ownership does not always work, graphs often appear in programming. When
> they do, you have to use Rc or Gc to cope. We shouldn't punish programmers
> who have these problems to deal with. Telling them to use ownership is
> pointless if your data is not hierarchical. In this situation, we are not
> encouraging users to use ownership instead of ref counting, we are
> encouraging them to use garbage collection, even when that is not the
> optimal solution for their problem.
>
> Rust doesn’t actually have a solution for general graph data structures
> besides “store the vertex data in arrays and pass around indices”. In many
> cases you can’t use Rc/Weak. I think this will be a significant limitation
> of Rust going forward.
>
> Cameron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140622/dd3caa72/attachment.html>


More information about the Rust-dev mailing list