4 ms·
I would opt for balance, there is a reason why some languages compile in debug and release mode, because of the tradeoffs. Having code that is optimal in perfo
by pmelendez 4y ago
I would opt for balance, there is a reason why some languages compile in debug and release mode, because of the tradeoffs.
Having code that is optimal in performance often implies a tradeoff in debuggability. If debugging helpfulness is the major design decision of a programming language, that designer is trading off performance.
- duxup 4y agoIt certainly can be a trade-off. I think that's what they're saying for Python, maximizing helpful debugging > that feature.
- layer8 4y agoTail calls fundamentally isn’t (just) about performance, it’s about language capability. Tail calls allow you to recurse indefinitely (because required stack space remains constant), which is not possible without tail calls (stack grows indefinitely). For example, tail calls make it okay to recurse on variable-length user input, which would be ill-advised in languages not supporting tail calls.
- Jtsummers 4y agoAnd not just direct recursion as is often considered. Mutual recursion is also handled neatly by this permitting you to write very clear state machines via functions and mutual recursion, if the tail calls get optimized. Very handy for parsing and similar tasks.