A proposal and project goal to stabilize explicit tail calls in Rust, targeting stabilization in 2027. The post explains what tail calls are, why they matter for low-level systems code (state machines, interpreters, parsers), and the key blocker: incomplete LLVM backend support across platforms like WebAssembly and PowerPC. The author details recent LLVM fixes for x86_64, loongarch, and riscv, outlines a phased roadmap (starting with extern "Rust" tail calls, then direct codegen, then computed goto via #[loop_match]), and discusses the ergonomic tradeoffs versus alternatives like computed goto. Funding is being sought to advance this work.

13m read timeFrom trifectatech.org
Post cover image
Table of contents
What are tail calls?Tail calls for efficient codegenLacking target supportRethinking the problemA path forwardConclusion

Sort: