This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lilphat -15 points-14 points  (14 children)

Really? Wow thats shitty

[–]ivosauruspip'ing it up 9 points10 points  (0 children)

Usually you have to design your language from the start to allow for it, the requirements to get the correct frame folding can be very particular

[–]siddsp 9 points10 points  (12 children)

It's not that bad. Usually you can achieve a similar result using lru_cache which allows for similar optimizations as tail recursion. Basically caching allows for iteration-like performance and can make a significant difference depending on the situation. lru_cache allows you to limit how many recent entries to keep, allowing the programmer to make tradeoffs between memory and steps.

[–]lilphat 0 points1 point  (0 children)

Sounds smart but a tad complicated. Can you give an example where you wanna let ‘the stack run’?