datomic

robert-stuttaford 2025-09-16T19:17:02.348239Z

perhaps a long shot 😊 has anyone with macro chops perhaps come up with a way to inline Clojure functions into inputs for Datomic's d/function? i've been using letfn as my topmost form and copying over otherwise normal functions (with no dependencies other than core and datomic) into there, but it's quickly getting stale πŸ˜… there are so many great Datomic library and tool repos out there these days. does this ring a bell for anyone?

ghadi 2025-09-16T19:36:16.183489Z

Great question. Classpath functions are underutilized and don't make you transact all the pieces into the database

βž• 1
ghadi 2025-09-16T19:36:31.716229Z

They can call helpers directly, structure your code however you want.

ghadi 2025-09-16T19:36:51.258339Z

Downside: you have to ship code to your transactor classpath then cycle your transactor

enn 2025-09-16T20:49:03.238989Z

I think the superior developer ergonomics of classpath functions generally outweigh the additional deployment complications, especially as you start using transactor functions more heavily.

robert-stuttaford 2025-09-17T06:29:44.124779Z

yep that downside is a real impediment for us. we'd have to cycle our transactor every time we deploy, which is often.

robert-stuttaford 2025-09-17T06:30:21.532129Z

i guess we'd have to push through on building and shipping a jar suitable for this use, and then setting up a CI pipeline that conditionally builds it whenever its sources change.

mkvlr 2025-09-17T12:30:22.219039Z

we’ve done that and it’s been worth it

mkvlr 2025-09-17T12:31:10.179059Z

we have a single file that contains our classpath functions, compute the hash of that file on deploy and only restart the transactor it if it changed.

πŸ™ 1
mkvlr 2025-09-17T12:32:16.880989Z

we considered having a defn alternative that records the form but decided against it. Utility fns then also need to be called through datomic.api/invoke which we found too cumbersome.

βž• 1
ghadi 2025-09-17T13:42:27.699419Z

> we'd have to cycle our transactor every time we deploy, which is often. is your transaction supporting code really moving that fast?

robert-stuttaford 2025-09-18T05:54:59.981879Z

thanks @ghadi, it's more that our current CI happens a lot, so we'd have to build conditional deployments into that as described above. it's all good though, i completely buy that it's worth the once-off effort of getting CI right to be able to program normally with Clojure in this mode πŸ™‚