clojure 2026-10-28

hey @arthurfucher splitting off a thought i had related to your post in clj-kondo https://clojurians.slack.com/archives/CHY97NXE2/p1793189900802099

🧵 1

would it be possible to write a test library that loads schemas and spits them out pretty-printed to a file and then you could diff them in CI like normal?

what do you mean by "a test library"?

maybe i just mean a new library/external library

i know you're getting paid to do this and i'm not, but i'm nerd sniped by this idea so let me see if i can wire up a POC real quick to demonstrate

I loved the "nerd sniped" 😂

Does schema store schemas in some kind of registry along with the vars? If so, then this would be a feasible alternative

I am still checking alternatives. The idea to use clj-kondo, is because we already use it for statical analysis. I am trying to avoid have a "runtime analysis" (don't know if is the best terminology)

that is the right terminology, yeah. i'm proposing runtime analysis, but it would only load namespaces, not run anything

okay, spent too much time on this lol but here we go

$ bb compare main other
diff --git a/output/main/example/user b/output/other/example/user
index e409bf2..b33952f 100644
--- a/output/main/example/user
+++ b/output/other/example/user
@@ -7,4 +7,4 @@ get-user
 (=> {:name Str, :age Int} Uuid Any)

 multi
-(=>* (maybe Int) (Int) (Int [Int] & [{:name Str, :age Int}]))
+(=>* (maybe Uuid) (Int) (Int [Int] & [{:name Str, :age Int}]))

that uses raw git diff, but you could run any analysis you want

the idea is you have main and a feature branch other, for each branch you require all of the namespaces and grab any top-level schemas, then spit the s/explain rendering of each schema into a file keyed to the branch. once both are done, you can then run any regression analysis you want over them

this is purely a POC but the bones are there and allow for any programmatic changes to be taken care of as well without eval

i hope you find it useful lol

1
❤️ 1