| That wasn't 'me claiming something', it was Guy L Steele Jr. You still just copy and pasted titles, this isn't evidence of anything. If citing the literature Then put in the part you think is evidence or significant. This is the classic "prove my point for me" routine. You're the one who wants to change a standard. Literally every function/procedure/method/subroutine/etc. has at least one tail position Are you conflating general functions with tail call elimination? Loops have limited expressiveness; e.g. they don't compose, they break encapsulation, Why would that be true? How would looping through recursion change this? Hence most (all?) programs utilise some form of function/method/procedure/subroutine/GOTO What does this have to do with tail call optimizations? Web assembly has functions. machine-code doesn't have loops, Web assembly is not the same as machine code I think overall you are thinking that making claims is the same as evidence. You haven't explained any core idea why tail call optimizations have any benefit in programming or web assembly. You basically just said a well known language creator put them in some languages. There is no explanation of what problem is being solved. |
Indeed; if web assembly allowed unrestrained GOTOs (like machine code) then compilers would already be able to do tail-call elimination.
---
> Are you conflating general functions with tail call elimination?
> What does this have to do with tail call optimizations?
> You haven't explained any core idea why tail call optimizations have any benefit
Sorry, I think there have been some crossed wires: I was mostly pointing out the absurdity of your statement that "almost no programming is actually done using tail calls" (when in fact, almost all programs will contain many tail-calls).
That's separate to the question of how tail-calls should be implemented: in particular, whether they should perform a GOTO (AKA tail-call elimination/optimisation); or, alternatively, whether they should allocate a stack frame, store a return address, then perform a GOTO, then later perform another GOTO to jump back, then deallocate that stack frame, etc.
> You haven't explained any core idea why tail call optimizations have any benefit in programming or web assembly
Based on my previous sentence, I would turn the question around: what benefit is gained from allocating unnecessary stack frames (which waste memory and cause stack overflows), performing redundant jumps (slowing down programs), etc.?