2023 Jan 31 by Dustin Getz – https://twitter.com/dustingetz
This is a collection of the best twitter teasers from 2022 demonstrating Electric Clojure (formerly Photon), a reactive Clojure/Script dialect for web UI with compiler-managed client/server data sync.
If you haven’t seen Electric before, start with our previous progress update from June 2022.
As a reminder:
- Electric builds "compiler managed network" into Clojure itself with a macro
- Electric uses continuous time dataflow programming (FRP signals) to abstract over rendering, interaction, and frontend/backend data sync
- with Electric, client and server code are defined in the same file/function/expression, allowing you to conceptualize your client/server application as a single cohesive program without network boundary.
FAQ at the end. On to the demos!
Recap: compiler-managed network
- This demo prints and renders the platform type of a number, from either a web browser (
#object[Number]
) or the server JVM (java.lang.Long
).
- What’s interesting is there is no client/server coordination code: the entire client/server system is defined in a single expression, in a single function.
20230131 hello photon tranasfer 2.mp4
- How does it work? The
p/defn
macro performs deep analysis of your program and compiles it into missionary reactive signals connected by websocket.