clojure-europe

Ludger Solbach 2025-12-04T06:48:15.595199Z

Morning

thomas 2025-12-04T07:42:55.722409Z

mogge

simongray 2025-12-04T08:29:45.248839Z

good morning

dharrigan 2025-12-04T08:50:30.852769Z

Good Morning!

simongray 2025-12-04T09:07:01.035679Z

I live right across the largest concert hall in Copenhagen and Radiohead happens to be playing there tonight (unless they cancel again). My brother-in-law and his girlfriend are staying at our place tonight since they are going to that concert. I am a little bit envious…

borkdude 2025-12-04T09:20:26.481939Z

@simongray since you're not going to the concert, I guess it's just ok, computer for you today.

πŸ₯ 7
πŸ˜† 3
teodorlu 2025-12-04T09:24:00.473239Z

morning all! Yesterday, I learned that @daslu’s brain got started on how to make https://github.com/scicloj/clay/ during a pair programming session with Michiel and me after the first Babashka conf. Daniel and I thought of notebooks as something magical and complex, but no, "just read the namespace, eval the forms and present". Weird how one event influences a different event!

borkdude 2025-12-04T09:25:13.237609Z

I still remember that. Didn't clay exist before that? That's amazing to hear. I just updated the https://babashka.org/conf/ site with some preliminary info an hour ago since it will be listed in the Clojure Deref

πŸŽ‰ 2
teodorlu 2025-12-04T09:25:50.759939Z

Both Daniel and I are coming 😁

borkdude 2025-12-04T09:26:03.294249Z

so excited :)

2
2
borkdude 2025-12-04T09:30:30.552009Z

I was thinking about encouraging some pre and post conference activities organized by the community. Like: β€’ Informal hacking session in coffee place β€’ Escape room (with time limit... since we don't want to miss the conference) β€’ Brunch β€’ Post-conference dinner groups (1 person reserves table at restaurant, holds up sign after conference, when group is full they leave, we can have 10 of those groups). Then join for beers after dinner in some adjacently located pubs. Then next day DCD

πŸ’― 1
πŸ“ 1
πŸ’œ 1
onbreath 2025-12-04T16:00:21.971339Z

Wow, stoked to meet you all. I'm having lots of fun working on Clay now. So thanks @borkdude I guess. πŸ˜†

borkdude 2025-12-04T16:02:39.767869Z

it was an organic back and forth behind a laptop in a coffee place on a warm day so I don't remember most of what I said but I'm glad something useful came out of it :)

Daniel Slutsky 2025-12-04T20:08:43.797649Z

Yes, that day was really the inspiration to the major refactoring Clay went through, resulting in the current form of Clay v2, that was later crafted together with Timothy Pratley and friends. One thing we drafted was code-reading with rewrite-clj for Babashka support, but this remained a draft, that will probably be merged soon by @onbreath , closing the circle.

borkdude 2025-12-04T20:10:24.517899Z

ah yes, I remember we played around with rewrite-clj in that cafe

borkdude 2025-12-04T20:10:30.315279Z

why is this specific to babashka?

borkdude 2025-12-04T20:11:01.875309Z

btw meanwhile, Clerk now runs in bb. (a PR which only took 3 years :))

πŸ’œ 3
Daniel Slutsky 2025-12-04T20:11:44.479989Z

the main goal was to support Babashka :)

Daniel Slutsky 2025-12-04T20:12:06.892569Z

Yes, great to see that in Clerk ❀️

borkdude 2025-12-04T20:12:29.039629Z

@daslu can you remind me what the problem was with bb support in normal clay?

borkdude 2025-12-04T20:12:50.570639Z

(edit: clay)

Daniel Slutsky 2025-12-04T20:14:10.317199Z

I think a few dependencies are not bb friendly, and one of them is Parcera, that can be replaced with rewrite-clj.

borkdude 2025-12-04T20:14:45.206739Z

right

onbreath 2025-12-04T20:56:34.328919Z

From what we're doing now, I'd say integrating the babashka compatible read+eval with clay, while assuring backwards compatibility with every notebook already written for the Clojure side, was a big blocker. That's soon solved or testable with a diff on internal representation and rendered output of notebooks based on Clojure civitas posts, books and documentation for some projects. Lots of notes to compare that do all sorts of stuff. Kind of nice when a test suite writes "itself", or rather, all the great people who did in fact.

πŸ™Œ 1
πŸŽ‰ 1
borkdude 2025-12-04T21:13:21.988679Z

do you use parcera or rewrite-clj just to get a literal rendering of the code as written?

borkdude 2025-12-04T21:13:59.255809Z

or do you also analyze that stuff somehow. nowadays you can also use read+string to get a form + the string read back. edamame supports it too

πŸ’‘ 1
borkdude 2025-12-04T21:16:46.852499Z

oh I see

;; We use parcera only for specific types of
                ;; code blocks, that tools.reader does not
                ;; provide location info for.
                (some->> (when (#{:number :string :symbol :keyword :comment}
                                node-type)
                           {:code (first node-contents)})

borkdude 2025-12-04T21:17:41.853669Z

I think you could maybe do this only by tools.reader by reading the line/column of the reader before you read the next form (or faster). combined with read+string this gives you the literal string representation

borkdude 2025-12-04T21:18:17.364289Z

edamame also offers workarounds for the location problem

borkdude 2025-12-04T21:21:13.245559Z

like this: https://github.com/borkdude/edamame?tab=readme-ov-file#postprocess

borkdude 2025-12-04T21:21:30.260549Z

here's an example of source preservation:

user=> (map meta (e/parse-string-all "(+ 1 2 3)" {:source true}))
({:source "(+ 1 2 3)", :row 1, :col 1, :end-row 1, :end-col 10})

borkdude 2025-12-04T21:22:52.773719Z

but this may also work for you:

user=> (def rdr (e/reader ":hello"))
#'user/rdr
user=> (e/get-line-number rdr)
1
user=> (e/get-column-number rdr)
1
user=> (e/parse-next rdr)
:hello
user=> (e/get-column-number rdr)
7
user=> (e/get-line-number rdr)
1

Daniel Slutsky 2025-12-05T00:03:13.321849Z

Oh nice! πŸ™

onbreath 2025-12-05T18:35:44.598499Z

Thanks for looking into this @borkdude. The new implementation with rewrite-clj is https://github.com/scicloj/read-kinds/blob/b5183d654affd540e2fb078dfed3cdc05959c028/src/scicloj/read_kinds/read.clj#L106 and there's a WIP-PR adding more of clays features. But of course we don't use the write part and not even the zippers of rewrite-clj. Edamame doesn't parse comments apparently, that'd be missing for us at least. I'll have to see if we need any of its other features. rewrite-clj seems to work quite well so far for parsing, but I haven't looked into all the edge cases yet. Also, it is not quite clear to me what the difference is between the two, beyond no code rewriting.

borkdude 2025-12-05T18:38:07.646919Z

@onbreath do you mean ;; ? tools.reader doesn't do that either "between the two", what two do you mean?

onbreath 2025-12-05T18:41:47.774779Z

rewrite-clj and edamame. rewrite-clj parses ;;, which is quite convenient for us yea.

borkdude 2025-12-05T18:42:10.143459Z

if you mean edamame vs rewrite-clj: this is apples and oranges. you should compare edamame to tools.reader, it's basically the same idea but way more configurable

onbreath 2025-12-05T18:42:24.200489Z

Aha okay, thanks

borkdude 2025-12-05T18:42:45.776499Z

do you support the same comment -> markdown idea as clerk maybe?

onbreath 2025-12-05T18:43:14.873189Z

I guess yes

borkdude 2025-12-05T18:43:17.683129Z

I was confused since you use both parcera and tools.reader and sometimes pick one or the other result

onbreath 2025-12-05T18:45:59.459729Z

That was the old implementation to prevent a reader bug. It is being superseded by rewrite-clj. Under the hood it used tools.reader too I think.

borkdude 2025-12-05T18:47:40.287399Z

true

borkdude 2025-12-05T18:48:44.538119Z

is this the old one? https://github.com/scicloj/clay/blob/847c9d66d9e46f15be5d6c2508148cff608317ae/src/scicloj/clay/v2/read.clj#L4 I guess with old you still mean the main branch?

onbreath 2025-12-05T18:53:19.412709Z

Yes old in the sense that it will be removed when new is fully implemented and tested.

πŸ‘ 2
2025-12-04T10:33:44.398939Z

morning

imre 2025-12-04T11:39:55.845369Z

good morning

ray 2025-12-04T13:19:48.969529Z

Good Thrsdy morning

lread 2025-12-04T14:23:10.408229Z

Good morning!