browser engines Show more
webkit is still the only one which lets you do proper functional programming, huh
re: browser engines Show more
; { const sum = (() => {"use strict"; return (x,i=0) => x === 0 ? i+x : sum(x-1,i+x)})(); sum(5000000) }
Works On My Machine
@Lady i keep furgetting that tail call optimization is actually in the standard, not that it means anything in purractice
@aescling technically it is not “tail call optimization” but “proper tail calls”, meaning that tail calls can’t overflow the stack, but they don’t have to be any faster than other calls (some complain PTC is actually harder to optimize)
@aescling anyway it could mean something in practice if you built your JS runtime on top of JavaScriptCore instead of V8…
A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.
re: browser engines
@aescling technically it is not “tail call optimization” but “proper tail calls”, meaning that tail calls can’t overflow the stack, but they don’t have to be any faster than other calls (some complain PTC is actually harder to optimize)