Editing Recursion
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 94: | Line 94: | ||
Despite languages slowly adding features from functional languages developed 40 years ago, tail call optimization is still unpopular. I'm guessing that the reason is because not many people see the use of recursion. | Despite languages slowly adding features from functional languages developed 40 years ago, tail call optimization is still unpopular. I'm guessing that the reason is because not many people see the use of recursion. | ||
Here's an incomplete list of languages that support it | Here's an incomplete list of languages that support it: | ||
* Lua (see [https://www.lua.org/pil/6.3.html Programming in Lua 6.3 - Proper Tail Calls]) | |||
* Clang C and C++ (see the [https://clang.llvm.org/docs/AttributeReference.html#musttail Clang musttail attribute]) | |||
* Tcl (see [https://www.tcl.tk/man/tcl/TclCmd/tailcall.html Tcl's tailcall manual page]) | |||
* Haskell | * Haskell | ||
* Erlang (and Elixir) | * Erlang (and Elixir) | ||
*Any Scheme implementation (Chez Scheme, Chibi Scheme, Chicken Scheme, TinyScheme) | *Any Scheme implementation (Chez Scheme, Chibi Scheme, Chicken Scheme, TinyScheme) | ||
*Steel Bank Common Lisp (See [http://www.sbcl.org/manual/#Debug-Tail-Recursion SBCL Debug Tail Recursion]) | *Steel Bank Common Lisp (See [http://www.sbcl.org/manual/#Debug-Tail-Recursion SBCL Debug Tail Recursion]) | ||
* | *OCaml (See [https://ocaml.org/manual/attributes.html OCaml's tailcall attribute]) | ||
*Racket (See [https://docs.racket-lang.org/guide/Lists__Iteration__and_Recursion.html#%28part._tail-recursion%29 The Racket Guide 2.3.3 - Tail Recursion]) | *Racket (See [https://docs.racket-lang.org/guide/Lists__Iteration__and_Recursion.html#%28part._tail-recursion%29 The Racket Guide 2.3.3 - Tail Recursion]) | ||
* Perl (See [https://perldoc.perl.org/functions/goto Perl's goto function], specifically the goto &NAME variant) | * Perl (See [https://perldoc.perl.org/functions/goto Perl's goto function], specifically the goto &NAME variant) | ||
*Unix (See [https://jeapostrophe.github.io/2012-05-28-exec-vs--post.html exec and Tail-call Optimization]) | *Unix (See [https://jeapostrophe.github.io/2012-05-28-exec-vs--post.html exec and Tail-call Optimization]) | ||
*Assembly (Instead of returning set up registers and jump) | *Assembly (Instead of returning set up registers and jump) | ||
*Squirrel (See [http://squirrel-lang.org/squirreldoc/reference/language/threads.html Squirrel's Threads page]) | |||
*Ruby (See [https://nithinbekal.com/posts/ruby-tco/ Ruby's tailcall_optimization compile option]) | *Ruby (See [https://nithinbekal.com/posts/ruby-tco/ Ruby's tailcall_optimization compile option]) | ||
*Zig (See [https://ziglang.org/documentation/master/#call Zig's always_tail call option]) | *Zig (See [https://ziglang.org/documentation/master/#call Zig's always_tail call option]) |