Skip to content
Discussion options

You must be logged in to vote

I've attached what Claude thinks will be required, which matches broadly what I would expect:

  • new insn MIR_TAILCALL (parsing, API, serializing, validate that the return signature matches the current function's one).
  • teach the optimization pipeline what tailcall means (essentially RET+CALL).
  • implement in the interpreter (shouldn't be too difficult).
  • get involved in each target calling convention's machine code lowering to implement as: function epilogue + directly chaining to the tailcall without transferring control back to the saved return address but leaving it as the return address for the tailcalled function.

An issue Claude flagged that I hadn't spotted is a restriction on the tail…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@jgonggrijp
Comment options

@cyanogilvie
Comment options

@jgonggrijp
Comment options

@cyanogilvie
Comment options

Answer selected by jgonggrijp
@jgonggrijp
Comment options

@jgonggrijp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants