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 <zwar...@mozilla.com>
wrote:

> On Jun 21, 2014, at 2:15 PM, Nick Cameron <li...@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
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to