Electric Clojure lets you code frontend/backend expressions that compose across the client/server boundary, due to compiler-managed network powered by DAGs. #Clojure
20230131.hello.photon.tranasfer.2.edited.mp4
p/defn
defines a function that follows all the same laws as regular Clojure functions, but it’s actually a macro that compiles the function body into a DAG (Directed Acyclic Graph).- The DAG forms an event propagation network, resulting in reactive rendering like React.js. (No React.js on the page; fine-grained direct DOM effects are scheduled by https://github.com/leonoel/missionary, a functional effect and streaming system for Clojure/Script)
p/client
andp/server
mark streaming client/server transfer points in the DAG.- If the frontend backend is reactive, and the backend is reactive, inserting a small delay for a websocket hop has no impedance with the already async computation model. And your database queries are already heavier than a websocket hop.
- For a deeper explanation, see UIs are streaming DAGs