4 ms·
Ironically, the Lisp Machines didn't have TCO either.
by ScottBurson 10y ago
Ironically, the Lisp Machines didn't have TCO either.
- qwertyuiop924 10y agoOne of their great failings. I'm a Scheme user, so I feel a bit weird without TCO.
- lispm 10y agoThe designers argued that a million-line software (the OS + basic applications) was easier to debug/develop without having TCO everywhere. It makes stack traces useless, unless one thinks of clever ways to keep tail calls recorded, which makes it complex/tricky. The basic machine architecture is a stack machine with compact and nice instructions. Stack traces were useful then. The compiler also was not very sophisticated when it comes to optimizations.
- qwertyuiop924 10y agoIt's an entirely reasonable tradeoff, which I understand. But not having TCO is a strong negative from the language perspective, IMHO. Not an impossibly bad one, but it's really nice.
- ScottBurson 10y agoI've long thought the right thing for Common Lisp would be to provide a way to declare sets of functions such that any tail call from one member of the set to another would be TCO'd; all other calls would push stack. This lets you write sets of mutually tail-recursive routines without forcing TCO on the entire system.
- shakna 10y agoI wouldn't say that it was appropriate there, either. I really wish I could get my hands on a LISP Machine. I love the idea of LISP being so close to the metal, but that power means some design tradeoffs. Scheme makes sense with TCE. I'm not sure InterLISP and the like need it - memory is limited and you work without so many of the system overheads I'm used to with modern systems. Iteration is less costly here, and that makes it easier to not need recursive design. (Which is more expensive). In simple terms: Why worry about blowing up a stack you don't need, when you've thought long and hard before you allocated it?