top | item 32153723

(no title)

AndruLuvisi | 3 years ago

Why do so many new and improved languages still lack tail calls?

discuss

order

JonChesterfield|3 years ago

It's moderately annoying to implement because it messes with the calling convention in architecture dependent ways. So it isn't an IR transform, it's N lowerings for N architectures.

Clang and llvm understand them, and you can require them from the front end, but the cost is some backends will hard error on them as unimplemented.

throwaway17_17|3 years ago

Just to clarify, are you saying that a language’s calling convention is implemented differently per architecture? Or is it that the tail call implementation needs to be implemented in different ways per architecture and that would mess with the required calling convention?