re: browser engines
@Lady based on this example being in JavaScript I assume you mean V8, then, rather than Webkit? I wonder why SpiderMonkey doesn't optimize tail recursion? I know they put quite a bit of work into supporting the WebAssembly tail calls extension efficiently, so there's some support somewhere in there already
re: browser engines
@jamey no, i mean webkit (well, JavaScriptCore)
webkit has implemented PTC for ages: https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-in-webkit/
chrome implemented in V8, but refused to ship, and eventually removed: https://v8.dev/blog/modern-javascript#proper-tail-calls
firefox bug is very sleepy: https://bugzilla.mozilla.org/show_bug.cgi?id=723959
more of a summary here: https://www.mgmarlow.com/words/2021-03-27-proper-tail-calls-js/
re: browser engines
@jamey i’d be very interested in <https://bun.sh/>, which is built on JavaScriptCore instead of V8, because i do think JSC is generally the better runtime (well, and i don’t like Google)
but unfortunately i don’t care at all about the kind of development they are targeting and my needs are much better served by Deno
re: browser engines
@Lady at work I've been helping a bit to hack on SpiderMonkey, contributing to the effort my teammate Chris started and wrote up (https://cfallin.org/blog/2023/10/11/spidermonkey-pbl/). we compile SpiderMonkey as a WebAssembly module so we can run JavaScript in our serverless platform without needing to trust the JavaScript implementation. I've learned a lot about that particular JavaScript implementation in the process and yet there's still so much more to learn