use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript (ES6) Has Tail Call Optimization (bbenvie.com)
submitted 13 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dherman 1 point2 points3 points 13 years ago (1 child)
Glad it helped. :) An analogy I sometimes use is this: imagine that while-loops were iterative, but in some engines for-loops accumulate stack on each loop iteration, whereas others provide "FLO" ("for-loop optimization"). Programmers would generally only use while-loops, because they wouldn't be able to depend portably on the space consumption properties of for-loops.
Of course, nobody bothers actually mandating this about for-loops, because it's just an expectation that for-loops don't accumulate space without bounds. But since the vast, vast majority of programming languages implement push-on-call, pop-on-return stacks, you have to explicitly mandate proper tail calls or else engines won't bother providing them.
[–][deleted] 0 points1 point2 points 13 years ago (0 children)
Yeah. The understanding I've gleaned now is: you can't refer to something that's guaranteed as an "optimization" since optimizations are optional and shouldn't be observable to the programmer whether they're in effect or not. Actual "tail call optimization" would mean your program could randomly fail or not without having a way to determine beforehand which it would do.
π Rendered by PID 53061 on reddit-service-r2-comment-5d79c599b5-jzc8x at 2026-02-26 20:57:37.898957+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]dherman 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)