3 ms·
Or how about TCO (tail-call optimization)? Please pretty please!
by adamddev1 5y ago
Or how about TCO (tail-call optimization)? Please pretty please!
- lucacasonato 5y agoTCO is something that specific JS engines need to implement. It is implemented in JSC (Safari), but not in V8 or SpiderMonkey. Also see https://v8.dev/blog/modern-javascript#proper-tail-calls https://v8.dev/blog/modern-javascript#proper-tail-calls. As this is an engine feature rather than a spec thing, there is nothing me (or any other TC39 delegate) can do.
- adamddev1 5y agoOh yes, I see, that's true. Thanks for the explanation.
- hajile 5y agoProper tail calls are ALREADY part of the spec. Google and Mozilla simply chose to ignore the spec.
- Scarbutt 5y agoMore like Google, Mozilla just waits to see if Google is going to implement it since they can't think for themselves.
- adamddev1 5y agoIt would be so nice to have it though! It could do a lot popularize recursive problem-solving and function writing, without having to go into modifying these functions to make them stack-safe.