ocaml / ocaml

The core OCaml system: compilers, runtime system, base libraries
https://ocaml.org
Other
5.19k stars 1.06k forks source link

Tail call optimisation not explicitely guaranteed by the manual #13115

Open Ekdohibs opened 3 weeks ago

Ekdohibs commented 3 weeks ago

After searching the entire manual, I wasn't able to find a guarantee that tail call optimisation occurs (searching for keywords tail call, last call, tailcall and lastcall). It is often discussed in the context of other features as if it was obviously present, but there is no explicit guarantee.

lthls commented 3 weeks ago

I'm aware of two indirect references: the section on builtin attributes mentions it, as well as the section on tail mod cons. Both of those could benefit from a dedicated section to link to.