Dustin Getz 2021 September https://twitter.com/dustingetz

See HN discussion: https://news.ycombinator.com/item?id=28630209 (178 comments)

Web data-sync doesn't compose

Let's define "data-sync contagion" as any web code a framework makes you write that isn't a functional expression. E.g. services, connections, sockets, reducers, normalizers, resolvers, etc. This imperative contagion is typically found adjacent to a network, and since it resists composition it tends to spread. Note that client/server/database web apps are characterized by pervasive network, and in fact most web application complexity is spent coordinating data flow between places in your system over network (e.g. client/server data sync).

To date, this coordination boilerplate has been abstraction-resistant. The essence of the problem is: How can you make a simple expression like below compose over network?

(reagent.dom/render 
  [:table (for [x (query-database ...)] 
            [:tr (pr-str x)])]
  (js/document.getElementById "root"))

At Hyperfiddle, we think we've finally solved this.

Hyperfiddle Stack: a functional programming web stack that composes in datasync

Photon is the central piece of this stack. Photon has two big ideas:

  1. "Reactive Clojure". Photon is a macro that compiles normal Clojure/Script syntax (s-expressions) to a dataflow signal graph (DAG). This DAG is lifted and further compiled into Missionary reactive signals. The result is that Photon s-expressions are reactive, like Excel or the React.js experience. Missionary manages reactive execution (incremental maintenance such that a small adjustment to inputs results in a small adjustment to outputs).