3 ms·
> but messing with stack frames in a systems language is generally a no-no. Could you expand on this? Optimising away a stack frame that lies on the border of
by leoc 11y ago
> but messing with stack frames in a systems language is generally a no-no.
Could you expand on this? Optimising away a stack frame that lies on the border of some security barrier would obviously be Bad News, but what other specific problems are there? Conversely, it seems there are some possible benefits to TCO in a systems language: I'm thinking of those secure-C coding standards which (apparently) tend to ban recursion for fear of stack overflow.
- pcwalton 11y agoLLVM does do sibling call optimization, which allows for TCO in many common cases, including all cases of a function tail calling itself (but note that RAII makes the definition of tail position subtler than it may seem at first glance).
- leoc 11y ago> (but note that RAII makes the definition of tail position subtler than it may seem at first glance) Like http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuations-original.html http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuat... this?