Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're doing CPS in a language with tail-call optimization then the same stack frame will be used for all your function calls. I don't know if V8 does this. In something like Node you don't do full CPS, you have portions of your code in CPS but usually only a few layers deep as you need to give control back to the event loop at some point.


I don't think JS has tail-call optimization. At some point you'll likely hit an error similar to too much recursion, but it would require a scope chain in the thousands.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: