r/AskComputerScience • • Mar 17 '26
Hyperfiddle's electric clojure project
I'm an amateur programmer, and don't have a solid computer science background.
Hyperfiddle have a project that allows you to blend server and client side code together in a fairly seamless way. It's more efficient than a naive implementation would be. For example, you can consume a lazy sequence without the client side code blocking while it waits for the whole thing to finish.
https://github.com/hyperfiddle/electric
They take a DAG, and use a macro to split it into client and server DAGs, which interact with one another.
My questions are:
Is this something that the hyperfiddle guys worked out on their own, or is it based on ideas that are generally known to people who think about this stuff? If it's based on known stuff, what could I read to learn more about it?
Why does the code have to be a DAG? I see DAGs every now and then, and I never really understand why the limitations are there. Apache Airflow talks about DAGs, rather than arbitrary blocks of code, and I've never understood why.
View all comments
Show parent comment
3
u/ghjm MSCS, CS Pro (20+) Mar 17 '26
It seems like this requires everything in the app to be pure functions. But the browser DOM is a minefield of side effects. How do you pure-function-ize the client side given the constraints of how browsers are?