Fork me on GitHub
#clojure-uk
<
2023-10-26
>
Joseph Graham05:10:08

what do people think of the Macjej Szajna method of having a reloaded workflow without integrant or mount or component? https://medium.com/@maciekszajna/reloaded-workflow-out-of-the-box-be6b5f38ea98

seancorfield06:10:51

There's a lot to be said for the simplicity of it and the guarantees around resources but... a) the future-call / future-cancel stuff relies on the running process being cancelable which makes me uncomfortable b) the REPL support is a lot messier than the start / stop of Component ...and of course you have to figure out your own dependency management by making it explicit in the ordering of the items in with-open (which you can argue is both a pro and a con I guess). It's also worth pointing out that Component doesn't require records these days. If you don't have dependencies, a component can be any metadata-carrying object such as a function, and if you have dependencies, it can be as simple as a plain hash map. You don't have to add wrappers to comply with Closeable (as that articles requires). And anything that doesn't have a start or a stop can just omit that part of the lifecycle metadata. That makes things easy to compose in Component and with both start and stop returning the updated system, REPL usage is a whole lot easier.

seancorfield15:10:37

So this gave me a fairly sleepless night because my brain wouldn't let me leave it alone... ...The more I think about it, the more I like the simplicity of the concepts behind it but I want something more amenable to a start/stop lifecycle for use with the REPL and I like the tangible "system" of Component... so now I'm trying to think of ways to combine the explicitness of with-open with the option for a stateful "system" that I can use with the REPL... I can sort of imagine a let-system that provides you with a wired-up, running system that is derefable and closeable and then you can use that in with-open for the auto-close but also in a REPL where you can .close it when you're done and recreate it easily...

Joseph Graham15:10:23

The only one I have used was mount and it seemed OK to me. But it seemed some people are using Integrant and I decided to look into the options and it seems there are many.

seancorfield15:10:00

Yeah, I don't like Mount at all since it's implicit global state. I don't much like Integrant because it's far too flexible and has so many extension points -- and it feels like the system declaration and its actual start/stop/etc function can end up spread out all over the place.

seancorfield15:10:24

I'm a big fan of Component but I understand that it looks/feels a bit too OO for some folks.

maleghast06:10:25

madainn mhath :flag-scotland:

schmalz07:10:27

Morning all.

seancorfield15:10:30

Mornin'... first really chilly morning here in a while... almost feels like I'm back in England 🙂

Joseph Graham15:10:18

it's been quite warm this past couple off weeks here actually

seancorfield15:10:59

We actually had to wipe condensation off the car windows this morning! The horror!