Closed ElvishJerricco closed 4 years ago
If WebAssembly intends to add other call instructions, we may find that they have slightly different syntactic requirements to support tail calls. If this is a concern, we should probably go with the many different tail call instructions, so they can all have their own tailored syntax.
I think having multiple tail-call instructions has the main advantage of simplicity, both in encoding and decoding. To a rough approximation, for consumers, prefix bytes create a "nested decoder loop" or require passing information from one decoding location to another. Multiple tail call instructions allow an implementation to just have a "flat table" of decoding. It also makes clear that tail calls have different behavior, rather than just a modification of existing behavior.
We went for multiple.
Opening this issue to discuss this question from the proposal overview.