Fork me on GitHub

morning morning


@wesley.hall: I would definitely go with integrant (or duct). mount is very inflexible as it effectively makes everything a singleton.


Almost all of our apps use integrant these days.


@wesley.hall - I would also vote for Integrant; it's the direction we are going in...


Also a colleague who’d used mount extensively at a former place of work (though reported no issues with it); is now a convert to integrant now he’s using it.


I used to be a big fan of mount and then rick converted me to integrant, tend to just use that now

Wes Hall10:01:15

No love for "component" here then 🙂.


although... I've found showing clojure newbies mount makes life much much easier


and then giving them the option of integrant


component is fine — but you just end up rebuilding integrant, as you almost always want to move the system to configuration.

Rachel Westmacott10:01:13

can you unpack “move the system to configuration” a little for me?

Wes Hall11:01:47

@U0FR9C8RZ I think I probably can. I think the point here is that it is idiomatic in integrant to place the configuration of your system in an EDN file. The library reads this file and constructs a system. You essentially just map keywords to component factory functions. In component, this is not really a thing and systems are composed in code, from code... so I think what Rick is saying here is that with component, you often end up creating your own config -> code system.

Rachel Westmacott11:01:44

I think of the declarative Clojure code that defines my system map as config. (albeit config in a fully featured programming language) So I’m not sure I see the difference.

Rachel Westmacott11:01:50

code == data, etc. etc.


@U0FR9C8RZ the nice thing about literal data for system config is that whatever is building the system can easily traverse the structure and e.g. sort by the dependency partial-order, or you can use things like aero to configure/specialise your system


if it's code then sure, you can traverse the code tree but that's quite possibly got opaque structures in it (closures, function refs) so it's not so easy


@U0FR9C8RZ: I think the others in this thread have explained most of the differences. As I said “component is fine”, it’s pretty much the same as integrant; but it’s effectively a config map in a clj file. It can be useful to be able to expose that map as configuration file so people can modify or effect values in the system in different contexts - e.g. production vs staging vs dev vs test without changing code. With component you have to do this work yourself. Or add some notion and wiring of special configurable bits of the system. Integrant / duct gives you all the pieces you need to separate this out. Without needing much extra glue. Also it’s worth saying that you can get a lot of power by then meta-merging these maps in a precedence chain. Typically we’ll have an override chain that gets merged into the final system e.g. (meta-merge [base-config customer-config env-config]) so you can configure different overrides without having to duplicate the whole system map.


Also integrant has some great features, such as hierarchies, refsets, and composite keys. Which are really useful concepts component doesn’t really have.

Rachel Westmacott13:01:43

cool, thanks all for unpacking

Rachel Westmacott13:01:19

we use component extensively but have an item on a todo list somewhere to take a look at Integrant, because people keep recommending it


depending on the project it’s probably not worth switching, unless you want things to be more configurable, and adding a config system is about the same amount of work as porting. Like I said component is fine, integrant isn’t much different. I’d certainly consider using it in greenfield projects over component. It’s much better than mount, and far more flexible. mount’s singleton design is a big problem in my mind.


I need to bump the versions in the project clj but I use this as a template to show people new to integrant roughly how it fits together


there's some things that aren't perfect about it, but it shows the idea well enough

Wes Hall10:01:07

Looks like all the love goes to integrant 🙂. To be honest, it's my favourite too, so I am happy to be validated. Thanks for input folks.


So a fun little thing I found out the other day: pprint to a file. So when it comes to saving json pprint it can be quite nice :thumbsup:


Nice one @guy, that’s handy

👍 5

And just found out about ex-data over lunchtime, that was a new one.


King Crimson, nice one @jasonbell 🙂 What's ex-data ?


@maleghast i) I was there 🙂 ii) ex-data turns thrown Exception data in to a map.


With caveats Returns exception data (a map) if ex is an IExceptionInfo.


Even so, that's pretty cool 🙂

Ben Hammond14:01:57

sorry to lower the tone; has anyone got a good link to the content of yesterday's immigration bill? I got put an end to free movement of people and sweeping Henry 8th powers all the press sounds so awful that I just wanted to double check

Ben Hammond14:01:12

bah. Bureaucrats vote for an increase in bureaucracy


makes perfect sense to me...

Ben Hammond14:01:20

I shudder when I have to deal with the Home Office wouldn't wish it on anybody


why do you think I have done my Brexodus?

Ben Hammond15:01:09

perhaps I'm still in denial. doesn't seem to be an emoticon for that ;'(


🎵 brexodus, movement of high-skilled people 🎶


lots of Labour abstainers. Only a single line whip and that was after a lot of pressure from various sides. Not really what I hoped for from Labour, but what I've come to expect. (I always assume the Tories are going to be bastards on things like this, esp under May, but was hoping that Labour might at least show some leadership here)

Ben Hammond15:01:45

Pete Wishart is my MP. I didn't vote for him, but I'm glad he got in anyway


he's good to follow on twitter

Ben Hammond15:01:24

he seems to be madly tweeting from inside the chamber


I'm pretty happy with my west Dundee MP Chris Law.

Ben Hammond15:01:29

or his office is


I think it is actually him


Steve Brine (my so called MP, as I couldn't vote) seems to be invisible as far as I can tell... he just follows the party line (conservative)


I did write to him telling that Brexit was one of the reasons I left and I got back a very none answer


But we once did get a handwritten letter from him saying that he understood our frustration at not being able to vote in the UK (for Westminster) and yet having to pay income tax.


uh, tl;dr. There's a plan to end EU immigration?


I don't really have time to read that right now, @ben.hammond but thanks for the link

Wes Hall14:01:36

ex-data partners nicely with ex-info 🙂

👍 5

And now there's ex-message too.

Rachel Westmacott14:01:32

I’m so glad that people are talking about ex-*. More people need to know about it.

👍 20

I actually managed to mention something about Clojure….. wow 🙂

👍 5

we use ex-data a lot... quite often the ex-data gets pr-strd into an http error response body