Passing DBs through continuations
11–19 of 19 posts
Re: Passing DBs through continuations
#12Long before AI psychosis, there was FP psychosis, clinically defined as the intense psychological response to understanding functional programming concepts like recursion, higher order functions, monads, or in this case, continuation passing style.
At least FP psychosis leaves you more educated and with more tools in your box. Not sure what the AI one gives you at a personal level.
Re: Passing DBs through continuations
#13CPS is a way of embedding imperative computation into an FP language. I think they built a mini compiler for their binary relation language, which is then Jitted by Julia.
I'd rather compare CPS to goto than regular imperative computation.
A better analogy is that continuations are reified function call return addresses, since return addresses come with a frame pointer (explicit or implicit), and therefore are closure-like.
Re: Passing DBs through continuations
#14isn't this https://clojure.org/reference/transducers ?
Transducers are just the morphisms in the category of the reducing-functions. No problem!
Re: Passing DBs through continuations
#15Earlier quoted context omitted.
At least FP psychosis leaves you more educated and with more tools in your box. Not sure what the AI one gives you at a personal level.
As a happy sufferer from FP psychosis, I can tell you that LLMs can be a fantastic tool for learning if you choose to use them that way.
Re: Passing DBs through continuations
#16 > "Suppose you want to write a database. You'd probably start by implementing relational algebra operators — projection, filter, join, etc. The easy way is to implement them as functions that take in tables and return tables, and assemble them into a larger expression. That was how Prela worked in its first incarnation. The code was clean, but it was hella slow! Which was not surprising, because every operator materialized every intermediate result. "
This is one of the LAST things you do when writing a database.DB development starts with the storage engine, file manager, buffer pool (page cache), and page access methods (heaps/indices) which are binary buffer views. Then, you add the transaction manager, the WAL/recovery bits.
The actual implementation of relational algebra and a SQL language + parsing are little icing layers on top of a transactional storage engine.
Re: Passing DBs through continuations
#17> "Suppose you want to write a database. You'd probably start by implementing relational algebra operators — projection, filter, join, etc. The easy way is to implement them as functions that take in tables and return tables, and assemble them into a larger expression. That was how Prela worked in its first incarnation. The code was clean, but it was hella slow! Which was not surprising, because every operator materi…
Re: Passing DBs through continuations
#18Earlier quoted context omitted.
As a happy sufferer from FP psychosis, I can tell you that LLMs can be a fantastic tool for learning if you choose to use them that way.
You're not describing AI psychosis tho.
As far as I'm concerned, it's all just Luddites v2.0.
Re: Passing DBs through continuations
#19CPS is a way of embedding imperative computation into an FP language. I think they built a mini compiler for their binary relation language, which is then Jitted by Julia.
I'd rather compare CPS to goto than regular imperative computation.
A continuation is a value that's passed to a function to tell it where to send its result when it's complete.
In imperative programming languages which invariably have restricted function calls, the continuation that every function receives is the address following the function call. This was just a mistake which the earliest programming languages committed, which has been perpetuated ever since, except in functional languages.