Hi Douglas, OCaml includes a feature to warn if your rec
function is not tail-recursive: https://caml.inria.fr/pub/docs/manual-ocaml-4.06/extn.html#sec260
“ocaml.tailcall” or “tailcall” can be applied to function application in order to check that the call is tailcall optimized. If it it not the case, a warning (51) is emitted.
E.g.
[@ocaml.tailcall] let rec f x = if x < 1 then x else 1 + tail (x - 2)
…should warn.
Btw @octachron, I don’t believe Bob was saying ‘port it to BuckleScript’, it was more ‘If you can port to BuckleScript’.