3 ms·
Cute! Major props to the two for the execution :) Sadly, these days Safari is the only engine that does TCO. It also keep track of a decent number of frames (c
by saagarjha 6y ago
Cute! Major props to the two for the execution :)
Sadly, these days Safari is the only engine that does TCO. It also keep track of a decent number of frames (currently 128). For more details on the implementation (called Shadow Chicken), see https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-in-webkit/ https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-....
- sitkack 6y agoTail calls are coming to Wasm. Aside, calling tail calls TCO makes it sound like it is just an optimization, which it is not. Tail calls enable beautiful control flow inside of state machines. It is a new fundamental capability and not an optimization.
- cben 6y agoIt makes a big difference when a language spec (such as Scheme) requires it. If only some implementations have it, and you can't assume it when coding, then it's "just an optimization". https://en.wikipedia.org/wiki/Tail_call#By_language https://en.wikipedia.org/wiki/Tail_call#By_language has a list.
- wffurr 6y agoSome backstory on the "disastrous meeting" that led to the abandonment of TCO by every browser vendor other than Safari here: https://stackoverflow.com/questions/54719548/tail-call-optimization-implementation-in-javascript-engines https://stackoverflow.com/questions/54719548/tail-call-optim...