JS is a beautiful functional language used exclusively to write unholy abominations.
js itself is a bit of an abomination but i feel people shit on it a bit too much
the real worst thing about js is that npm exists
npm is a cancer on this earth and those responsible should be executed for crimes against humanity
tbh, even as someone who has a degree in this shit, category theory terminology always makes my eyes glaze over when I read it.
oh ok so it's not just me then
that reminds me of how i thought i didnt understand pointers, because r/programmerhumor was treating it like something advanced and hard to understand. far cry from "just a memory address lol"
a properly confused indian saar can make anything unnecessarily complicated and hard to understand
Weird seein' Lispy folks "draw the line at continuations". call-with-current-continuation aka call/cc is one of the defining attributes of a Scheme, and the domain name of Chicken Scheme, call-cc.org . It's conceptually simple: it's a JMP that also loads the couple variables in the closure of the code that is being JMPed to. NBD. Like Creative Username said, it's "just a function call that doesn't return."
one of the greatest ways to think of regular call/cc non-delimited continuations is that they're just a way to take the return stack and jump into that in a function-like way
basically it's like if you could take a random
return statement from your program and store it into variables and pass it to other functions
delimited continuations (shift/reset, prompt tags, etc.) are better in certain ways but i don't exactly understand them yet
Once you get the hang of the theory around it all, take a look at
Continuation-passing style (which I have probably linked in this thread 100 times now) and try writing a minimal S-expression JIT compiler with it in C. It sounds more daunting than it actually is; you're (probably) not going to be writing assembly for it. CPS is the traditional basis for Scheme compilers and Scheme->C transpilation.
i did indirectly explain how cps works on the last page: basically you just turn everything inside out and make continuations explicit, which results in the stack not really mattering and your program becoming an endless chain of functions calling each other
white people languages have guaranteed proper tail calls for this reason, and also so you don't need to put loops into the language as a feature like a fucking retard when you could just implement loops using λ and a couple of macros
also, fun fact: when you use dom shit in javascript you're writing in a sort of cps
see haskellers aren't the only scary functional programming autists who say things like "


<common idiom> is really just an application of monads you know"