How hyperfiddle/electric works
Main Components
a) Compiler Layer:
• Electric Compiler component that performs graph analysis
• Key compiler modules (visible in src/hyperfiddle/electric/impl/):
• lang3 (language implementation)
• runtime3 (runtime system)
• cljs_analyzer2 (ClojureScript analysis)
b) Runtime Layer:
• Differential dataflow engine
• Network boundary inference system
c) Integration Layer:
• Adapters (electric_httpkit_adapter3, electric_ring_adapter3)
• DOM integration (electric_dom3)
• Form handling (electric_forms3)
Relationships and Data Flow
• Compile-time flow: Source code → Compiler → Generated client/server code
• Runtime flow: Client ↔ Server differential dataflow
• DOM updates: Runtime → Browser DOM
Specific Implementation Details
• Reactive primitives (from src/hyperfiddle/electric3.cljc)
• Incremental sequence handling (src/hyperfiddle/incseq/)
• Development tooling (debug3, trace3)
[Source Code]
• ↓
[Electric Compiler]
• ↓
[Generated Code]
• ↙ ↘
[Client] ↔ [Server]
• ↓
[Browser DOM]
Important Notes
• A note about the differential dataflow nature
• Network transparency feature
• Reactive programming model
• Where custom adapters can be plugged in
Technical Details to Highlight
• ClojureScript/Clojure interop
• Missionary integration for concurrency
• DOM manipulation system
• Network protocol (referenced in docs/electric-protocol.md)