Skip to content

Comment on Recursion, Tail Calls and Trampolines in JavaScript (2015)

Comments

For the record, many implementors are against STC and PTC for a few reasons:

- It may be significantly slower than regular recursive calls (though this claim seems to be false both in practice and theory)

- It may break debug tools

- It may break browser telemetry (especially on IE)

Additionally, they would have to decide on an explicit syntax for STC (return.tail or something like that).

Personally, I would love to see STC anf PTC land so I can write proper functional code in JS. It would also make functional programming in JS easier to teach (less gotchas).

See TC39 discussion: https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.