On 29 October 2013 16:43, Niko Matsakis <[email protected]> wrote:
> But I've been watching the code I write now and I've found that many
> times a recursion-based solution is much cleaner. Moreover, since we
> integrate recursion specially with the type system in the form of
> lifetimes, it can also express things that are more awkward with a
> heap vector.

My "weak argument" was referring to the recursion that uses tons of
memory, not to the idea of using recursion at all. Clearly there are
some very practical cases like parsers where total recursion avoidance
is not an option if one wants to stay with maintainable code and yet
it is desirable to support deeply nested structures. The question is
how common those cases to justify a performance impact by default for
the rest of code. From the experience I suppose this is rare so it
should be fine to require special annotations and/or special setup
when calling into such code as long as the stack overflow in general
is not worse than an explicit abort.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to