Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tail call
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== In a paper delivered to the [[Association for Computing Machinery|ACM]] conference in Seattle in 1977, [[Guy L. Steele]] summarized the debate over the [[GOTO]] and [[structured programming]], and observed that procedure calls in the tail position of a procedure can be best treated as a direct transfer of control to the called procedure, typically eliminating unnecessary stack manipulation operations.<ref name="aim-443">{{Cite book|doi=10.1145/800179.810196|isbn=978-1-4503-2308-6|hdl=1721.1/5753|chapter=Debunking the “expensive procedure call” myth or, procedure call implementations considered harmful or, LAMBDA: The Ultimate GOTO|title=Proceedings of the 1977 annual conference on - ACM '77|year=1977|last1=Steele|first1=Guy Lewis|pages=153–162 |s2cid=9807843}}</ref> Since such "tail calls" are very common in [[Lisp (programming language)|Lisp]], a language where procedure calls are ubiquitous, this form of optimization considerably reduces the cost of a procedure call compared to other implementations. Steele argued that poorly-implemented procedure calls had led to an artificial perception that the GOTO was cheap compared to the procedure call. Steele further argued that "in general procedure calls may be usefully thought of as GOTO statements which also pass parameters, and can be uniformly coded as [machine code] JUMP instructions", with the machine code stack manipulation instructions "considered an optimization (rather than vice versa!)".<ref name="aim-443"/> Steele cited evidence that well-optimized numerical algorithms in Lisp could execute faster than code produced by then-available commercial Fortran compilers because the cost of a procedure call in Lisp was much lower. In [[Scheme (programming language)|Scheme]], a Lisp dialect developed by Steele with [[Gerald Jay Sussman]], tail-call elimination is guaranteed to be implemented in any interpreter.<ref name="r5rs">R5RS Sec. 3.5, {{Cite journal |author1=Richard Kelsey |author2=William Clinger |author3=Jonathan Rees |date=August 1998 | title = Revised<sup>5</sup> Report on the Algorithmic Language Scheme | url = http://www.schemers.org/Documents/Standards/R5RS/ | journal = Higher-Order and Symbolic Computation | volume = 11 | issue = 1 | pages = 7–105 | doi = 10.1023/A:1010051815785 |s2cid=14069423 |display-authors=etal| url-access = subscription }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)