So, I've been working hard to undermine tail calls. There's a pull request at https://github.com/graydon/rust/pull/849 that removes some of the tail-call-inspired awkwardness from our calling convention. I have two reasons for wanting to go in this direction:
- The alias-optimizing issues discussed earlier in this thread - The fact that, to have a sane ivec representation, the objects needs pointers into themselves. We were passing them by value, which removes them from llvm's memory model (they might be in registers), which makes it impossible to maintain internal pointers. The changes makes the compiler 5% smaller, and both patches remove more code than they add, so in terms of complexity, this is a definite win. If you have reasons to object to this patch that go beyond "but in <garbage-collected language of choice> tail calls are very important", let's hear them. Also, if LLVM allows, I'll probably work on supporting a limited form of tail calls (can only take garbage-collected values, immediate values, and aliases-passed-to-the-caller as arguments), which should cover a lot of sane cases without putting a heavy toll on our calling convention. _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
