-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.13.0~alpha1: change of behaviour of [@tailcall]
annotation under sequencing operators
#10507
Comments
After a bit more investigating, I found that the change is not caused by #10379 but by #10081. To sum up:
I think the 4.13 behaviour is more consistent than the 4.12 one, but it would make even more sense for all three cases to produce the same behaviour. |
The third case only raises a warning when |
Yes; without debug events, none of the cases raise a warning (both in 4.12 and 4.13), I think. |
It is bit disturbing that some of those warnings only exists while compiling with |
If I'm not mistaken, this will remove the ability to stop the debugger after the function was applied to its first argument but before it's applied to the second one. I haven't used |
My summary of the issue is that before 4.13 It seems fine to align the behavior between application and application operators in 4.13: we can wait for 4.14 for an eventual improvement of this behavior. |
Compiling in If we agree that application operators should produce the same bytecode as normal applications, including the multiple-application optimization, this should also be true in |
As reported in ocaml/ocaml#10507 and as long as ocaml/ocaml#10508 is not merged, the operators `( @@ )` and `( |> )` do not play well with the `ocaml.tailcall` annotation. Unfortunately, the Michelson operator makes a heavy use of both. Despite the absolute superiority of `@` over parentheses in these circumstances, we need to alter the aesthetic of the original code to prepare the use of OCaml 4.13 with Tezos.
As reported in ocaml/ocaml#10507 and as long as ocaml/ocaml#10508 is not merged, the operators `( @@ )` and `( |> )` do not play well with the `ocaml.tailcall` annotation. Unfortunately, the Michelson operator makes a heavy use of both. Despite the absolute superiority of `@` over parentheses in these circumstances, we need to alter the aesthetic of the original code to prepare the use of OCaml 4.13 with Tezos. Signed-off-by: Hugo Heuzard <hugo.heuzard@nomadic-labs.com>
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
The following program emits a pair of
wrong-tailcall-expectation
warnings when compiled withocamlc.4.13.0~alpha
:On
ocamlc.4.12.1
, the program is accepted without warnings instead.As far as I can tell, this isn't an intended feature of 4.13 – hence this issue – though it may be considered an improvement by some. Neither
f
norg
is syntactically a tail-call, but the implementation of[@tailcall]
is already non-syntactic in other regards (e.g. it observes inlining differences #9510, and may soon account for register spilling #10424). Personally, I think of[@tailcall]
as an assertion of a safety property (something like "this call doesn't require additional stack frames") and so preferred the 4.12 behaviour.Some details:
ocamlopt
is not affected (neither 4.12 nor 4.13 emit a warning).ocaml{c,opt}.4.{12,13}
) to emit warnings by first aliasing the sequencing operators:The text was updated successfully, but these errors were encountered: