4 ms·
"Worthless" is a bit strong. The Rust devs want to add TCO/TCE, but there are still problems left to solve. The "become" keyword is already reserved in anticipa
by rom-antics 4y ago
"Worthless" is a bit strong. The Rust devs want to add TCO/TCE, but there are still problems left to solve. The "become" keyword is already reserved in anticipation of guaranteed tail calls being added.
https://github.com/rust-lang/rfcs/issues/2691 https://github.com/rust-lang/rfcs/issues/2691
- masklinn 4y ago> "Worthless" is a bit strong. No, TCO is worthless, it’s an unreliable optimisation.
- anon291 4y agoIf given explicit support in a language then no it's not. Especially with the keyword approach rust is taking, the compiler will guarantee the semantics. Do you believe the exec system call is similarly unreliable at replacing your process image? Amazing that unix systems work at all
- masklinn 4y ago> If given explicit support in a language then no it's not. Especially with the keyword approach rust is taking, the compiler will guarantee the semantics. Then it's TCE not TCO. > Do you believe the exec system call is similarly unreliable at replacing your process image? Exec is entirely unlike TCO. If exec was a syscall which sometimes did and sometimes did not replace your process image, then it'd be like TCO, and it'd be similarly unreliable.
- tome 4y agoI think it would have helped if you'd defined your terms earlier. Wikipedia, for example, doesn't distinguish between the terminology TCO and TCE: https://en.wikipedia.org/wiki/Tail_call https://en.wikipedia.org/wiki/Tail_call
- rom-antics 4y agoCompiler optimizations are best-effort. -O3 gets you 90% of the optimization for 10% of the work of writing hand-rolled assembly. Individual optimizations are not guaranteed, and sometimes even regress in newer compiler versions, but everyone uses them because overall programs run much faster with optimizations than without. I don't see how TCO is any different. Would you say all optimizations are worthless because they're not guaranteed?
- masklinn 4y ago> Would you say all optimizations are worthless because they're not guaranteed? Context is relevant, the context here is language semantics, not things going faster. TCO is fine to make things go faster, like inlining, unrolling, LICM, .... TCO is hot garbage when you rely on it for program correctness.
- andrewflnr 4y agoWeird how none of that context was present in your first two iterations of the claim.