Re:Rust will likely not support tail call optimization
by pasquinelli on Wednesday April 10, 2013 @04:02PM
(#5527723)
"TCO doesn't slow programs down. If anything, it might even make them a tiny bit faster."
right, but i think they were saying that, in this case, because of dependencies out of the rust team's control, they would have to use a different, slower calling convention to support proper tail calls.
[ Parent
| on HN ]
Re:Rust will likely not support tail call optimization
by fhars on Wednesday April 10, 2013 @04:47PM
(#5528050)
Well, according to a quick perusal of the LLVM documentation, the only llvm calling convention that allows TCO on all platforms seems to be fastcc, whose main purpose is to have calls that are a fast as possible, at the cost of not being compatible with the slower, but more common calling conventions of C.
http://llvm.org/docs/LangRef.html#calling-conventions
Re:Rust will likely not support tail call optimization
by qznc on Wednesday April 10, 2013 @05:50PM
(#5528447)
What does fastcc do when there are more arguments than registers?
These cases are the reason for Pascal-convention according to Walton. https://mail.mozilla.org/pipermail/rust-dev/2012-January/001...
Re:Rust will likely not support tail call optimization
by jevinskie on Wednesday April 10, 2013 @09:04PM
(#5529272)
In that case you can clone the function. Internal linkage calls can use the fastcc calling convention while you leave either a whole clone with the non-fastcc calling convention or a non-fastcc wrapper of the fastcc function for calls from external linkage.