clojure-europe

2026-03-08T09:08:48.861689Z

morning!

Ludger Solbach 2026-03-08T10:29:54.085359Z

Morning

teodorlu 2026-03-08T10:47:08.062909Z

morning!

teodorlu 2026-03-08T10:50:40.424859Z

Unambiguous data attributes are just so nice. You know exactly what it is (within your app), it can be serialized and passed over the wire, and the data has zero dependencies. I'm also suprised about how suprised I am about this. I wrote my first real Clojure code nearly 9 years ago, and I had no idea how important the data part and the unambiguous part were. At that point, I just liked the REPL and the ->> macro with map/filter/reduce.

1
reefersleep 2026-03-08T11:02:04.736909Z

When you say unambiguous, are you referring to namespaced keys?

teodorlu 2026-03-08T11:03:49.107579Z

Yes.

teodorlu 2026-03-08T11:13:43.688089Z

quick example from what I'm toying with right now,

(def realizers
  {:doc/slug {:key :doc
              :source :datomic}})

(defn realize [request]
  (reduce (fn [realized [k v]]
             (cond-> realized
               (= :datomic (get-in realizers [k :source]))
               (assoc (get-in realizers [k :key])
                      (d/entity mblog.state/datomic [k v]))))
           {}
           request))

(realize {:request/id #uuid "85b45e6d-a617-4286-9c99-594f1c3a0c6c"
          :session/id #uuid "2be72578-6d49-4685-88b5-1a789f2c9a84"
          :doc/slug "enklere-7"})
;; => {:doc {:db/id 17592186045502}}

πŸ‘ 1
teodorlu 2026-03-08T11:14:41.869259Z

credits go to @magnars for this, he calls this "reified parameters". By attaching behavior to parameters, you can push the responsibility for toil to the edge of your system, and just work on nice data-at-hand in the middle.

teodorlu 2026-03-08T11:15:15.812419Z

Re-watching Rich's talks now, I hear Rich advocating for the same thing, I just didn't get it the first time.

simongray 2026-03-08T14:13:58.090839Z

Rich was inspired by RDF as far as I know.

teodorlu 2026-03-08T14:25:30.235169Z

That's why I wanted different words than qualified Clojure keywords. The ideas aren't Clojure specific. Though I haven't talked to anybody who are into unambiguous data attributes who aren't also into Clojure πŸ˜‚

seancorfield 2026-03-08T15:18:13.541109Z

I assume instead of no nice you meant so nice?

shiyi.gu 2026-03-08T15:24:59.356809Z

I used gemini to understand the meaning, and it said no nice was a so nice typo:smile:

teodorlu 2026-03-08T15:38:44.926179Z

@seancorfield yes, thank you! Typo indeed.

simongray 2026-03-09T07:51:22.424129Z

> Though I haven’t talked to anybody who are into unambiguous data attributes who aren’t also into Clojure πŸ˜‚ (edited) I have, but it’s been with a bunch RDF nerds so that’s not too surprising πŸ˜‰

πŸ˜‚ 1
reefersleep 2026-03-11T09:18:44.421749Z

It's too bad that namespaced keywords don't gel so well with vanilla JSON.

πŸ’― 1
reefersleep 2026-03-11T09:19:01.662539Z

Not JSON's only downside, of course

simongray 2026-03-11T09:23:14.474099Z

That's why we have JSON-LD

teodorlu 2026-03-11T09:25:10.484969Z

> It's too bad that namespaced keywords don't gel so well with vanilla JSON. and also, HTML attributes! It's a shame both keys and values must be strings.

simongray 2026-03-11T09:25:51.506569Z

That's why we have XML πŸ˜…

πŸ‘ 1
teodorlu 2026-03-11T09:36:49.287539Z

so we want β€’ brevity (EDN, JSON, not XML) β€’ namespaced keys (EDN, XML, not JSON) β€’ no ordering (EDN, JSON, not XML) ?

simongray 2026-03-11T11:09:01.030249Z

We don't want another format, that's for sure πŸ˜› personally, I am satisfied with EDN (especially Hiccup) in a pure Clojure context. Venturing beyond that, I find that the W3C specs are great and I like to pick from those. They all work together to create a strong and well-documented tech stack, even the community ones, it's quite elegant.

πŸ‘ 1