clojure-europe 2026-03-23

good morning

Good 🇪🇸 🚂 🇧🇪 morning (all day in fact)

👍 1

what route are you taking?

via Paris so that part will not be fun

cos we have to rush between Gare du Lyons and Gare du Nord

and I just found out we're running late

sounds like a challenge... but surely they can rebook the part to Brussels?

sure but I'd rather avoid the hassle. We have an hour and so we should be just about OK 🤞🏼

👍 1

Good morning 🙂

I sometimes have to remind myself that expressing yourself clearly in text is not a given skill. And, humbly, I must attempt to see the flaws in my own textual communication 😅

💯 1

It requires lots of practice! I've been pondering "terse" vs "brief" lately. It's easy to turn text into a terse text by removing stuff. That may cause misunderstanding. It's harder to find a brief way to explain the same message, without loss of meaning.

> Good morning 🙂 I think you did fine. You're too hard on yourself.

🏆 1

I like the word "concise". Wiktionary says: "Brief, yet including all important information. "

👍 1

I've been pondering "terse" vs "brief" lately. It's easy to turn text into a terse text by removing stuff. That may cause misunderstanding. It's harder to find a brief way to explain the same message, without loss of meaning.
Indeed. There's also the question of the choice of words for the right audience. I've been guilty of choosing a lot of "fancy" words in the past, which a native English reader or domain expert might have no issue deciphering and hopefully would appreciate for removing ambiguity, but the random reader might stumble over or, ironically, interpret in an ambiguous manner.

I like "concise", too! I always use it in this particular context.

edits above statements for the 10th time I feel like I'm especially hard on myself when writing about writing 😄 Also, haven't slept my intended number of hours a night for quite some days now, so nonsense may occur randomly in my current writing...

❤️ 1

The only way to get better is to practice! After an honest effort, good enough is good enough. At ten rewrites your effort is probably diminishing! "share scrappy fiddles" was a nice message from Heart of Clojure 2014: https://www.youtube.com/watch?v=MJzV0CX0q8o

🙌 1
🙌🏼 1

I'm not a fan of concision in all cases, a meandering approach is more humane

❤️ 1

we're not always writing academic papers

as always, there's a time and a place. Not all docs should look like they are written by Rich.

❤️ 1
😂 1
😏 1

morning 😴

Is there some good article or maybe even framework on "using unit tests to document your code" in Clojure? Not only in the sense of ensuring certain things about your code, but also weaving in explanations about the intent. I know and use testing a lot, but still, separate deftests in a namespace feel kind of disjointed when trying to tell a unified story about some component or function.

A colleague was deleting a lot of now unused code and it gave me the opportunity to see some very nicely written tests I wrote loooooong ago, interspersed with comment blocks of elaboration. I've inspired myself :)

☺️ 1

Have you tried using add-test or with-test?
> Ever looked at Metazoa? I wasn't aware of with-test, thanks! It "just" seems like a sugary way of adding metadata, but still. I can't find add-test? Metazoa looks very interesting, though I'm not sure it's what I'm looking for in this particular context... But the datalog querying looks like a great tool to have at hand!

> There's also https://github.com/hyperfiddle/rcf that could be used This looks promising!

Sorry, should have been set test https://clojure.github.io/clojure/clojure.test-api.html#clojure.test/set-test Metazoa allows you to define examples tables as metadata and execute them as tests iirc

👍 1

suddenly I'm spoilt for choice 😄

It's not hard to write but not built in, an API for adding one example to the metadata and to tie it in with Clojure test by providing a test meta that runs the examples

👀 1

I think there's a tension between unit testing, and trying to tell a story. Unit testing tries to exhaustively cover cases, that won't help you see the forest for the tree. I guess you could try to create "narrative" tests, by first testing higher level functions, and then breaking it down into lower level stuff, but if telling a story is the primary goal then there are better tools like notebooks. We have a convention to have a repl-sessions directory, and I will often create a <feature>_walkthrough.clj in there if I ship a big thing, something another dev go through top to bottom, reading comments, evaluating forms, that explains conceptually how things hang together.

👍 1

Notebooks can also be good vehicles for explanations/stories — if your team wants to use them.

@plexus nicely done. Yours is a good example of conciseness. I feel like having the examples strengthened by tests would bolster the faith that the documentation and implementation haven't drifted, but brevity would surely suffer. I think that's part of what I find a bit difficult. I could make distinct "walkthrough" test ns'es which focus on the story, separate from dedicated unit test ns'es which test exhaustively and without an overarching narrative. But often, the test setup becomes big and cumbersome in and of itself, ruining the flow of a story that could be told concisely in prose.

> But often, the test setup becomes big and cumbersome in and of itself, ruining the flow of a story that could be told concisely in prose. To me, that often signals I should introduce helper functions or a test data namespace!

Indeed 🙂 I find it hard to make helper functions that are actually useful without concealing too much of the intent. I like it when things are in your face and you don't have to hop around between functions to get a full picture.

But maybe that's a me thing - having both trouble writing it and reading it.

Have you tried using add-test or with-test? Ever looked at Metazoa?

💔 we had to take down a large tree. I won't live until the successor reaches the same height... Maybe my grand-children.

❤️ 5

I had a similar need recently … the tree was becoming a danger to neighbouring property

It was better than felling it 🤷🏻‍♂️

Not to pile the 💔 on Thomas

Successor

Lime tree. More robust and good for bees.

Cute hack over the weekend. Trying to decide whether to polish it up 🤔 (Makes use of @borkdude’s edameme and sci.) https://berlin.social/@jack/116273315614370868

👀 1
🤓 1
🚀 3
🎉 4

Wow! How does sci help? Does having an interpreter help you build the compiler / type inference somehow?

http://prescheme.org mentions partial evaluation: > The compiler uses type inference, partial evaluation, and other correctness-preserving transformations to compile a subset of Scheme into C with no additional runtime overhead. I guess I should read https://dustycloud.org/misc/prescheme.pdf. I'm still kind of baffled an interpreter can be leveraged to "tease out" a compiler, unless I'm missing something.

There's a fun topic in interpreters around reflective interpreters, towers of interpreters and collapsing them. That is indistinguishable from compilation phases

👍 1
🤔 1

I enjoy Nada Amin's work on the subject and her citations chain

I'm also curious about how you used SCI (and edamame) @jackrusher

I had lunch with Nada on Sunday 😊

I'm using Edmame to parse the Clojure source and sci for the test harness, which uses test.check to do generative testing by comparing empirically observed types to inferred types on large numbers of pseudo-random source fragments. (There are deterministic tests too, of course.)

👍 1

I had lunch with Nada on Sunday 😊
> Lucky (totally jealous)

Neato

❤️ 1

Wow - some human 🧠 work 😅

Hi 🙂 Is there anyone here that happens to have a https://lobste.rs/ invitation for me ?

Sure, DM me your email :)