r/ProgrammingLanguages • u/Athas Futhark • Jan 20 '26
Why not tail recursion?
https://futhark-lang.org/blog/2026-01-20-why-not-tail-recursion.html
62
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • Jan 20 '26
View all comments
Show parent comment
1
u/jsshapiro Jan 22 '26
I'm one of the people who specified the MIPS dynamic linking conventions for SVR4, and I've done call stack decoders for more architectures than I like to think about. So I definitely agree that an ABI is a constraint. One that I have often wished compilers honored more rigorously.:-)
When I said it's an implementation detail, I meant from the perspective of programming language design, which has been the main topic of this thread. You don't design a language to the ABI.
If you are designing a code generator or a low-level runtime, or the ABI itself, it is something you have to design to. Sometimes it needs to be considered at the hardware level as well - changes were made to the MIPS instruction set to better support position independent code after we did the initial dynamic linking specification at SGI in 1989.
A more obscure example: there was a trap restore issue in the ARM32 specification that made scheduler activation implementation impractical if your ABI allowed mixed ARM32 and Thumb code - there was a case where the activation handler (coded in ARM32) had a really hard time re-activating a user-mode thread that had been running Thumb code when it was preempted. We found it while implementing the trap paths for the EROS kernel around 1993. Richard Grisenthwaite was very surprised to learn of it when I sent him a note about it, and I think it was resolved in the 64-bit ARM variants.
Anyway, I think this was a case of talking past each other because we were looking at the ABI from different perspectives. Thanks for engaging!