clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
dharrigan 2020-08-18T05:16:59.021400Z

Good Morning!

seancorfield 2020-08-18T05:29:29.021600Z

Mornin'

djm 2020-08-18T05:39:49.021800Z

👋

jiriknesl 2020-08-18T06:29:40.022Z

Morning

dominicm 2020-08-18T06:48:16.022200Z

Morning

Jakob Durstberger 2020-08-18T07:33:05.022500Z

Morning 🙂

mccraigmccraig 2020-08-18T07:34:25.022800Z

¡måning!

alexlynham 2020-08-18T07:57:07.023100Z

morning

dominicm 2020-08-18T08:27:01.023300Z

Morning 🙂

dominicm 2020-08-18T08:27:06.023500Z

Wait a minute...

😄 1
alexlynham 2020-08-18T08:33:03.023700Z

...

wotbrew 2020-08-18T15:01:04.024900Z

I wish there was a channel to post for feedback on lib ideas, cold-shower/sanity-check type stuff. What happens if I post it here... I mean, I'm in the UK right. I've posted here before...

wotbrew 2020-08-19T07:46:25.052300Z

@dominicm I'm not exactly sure how this would help? Do you have an example of the problem at hand?

2020-08-19T08:38:42.052500Z

@danstone: yeah that makes a lot of sense, I’ve just seen the changes you made to the why section in the README. I could certainly see myself using something like this.

dominicm 2020-08-19T08:39:57.052700Z

@danstone if you have [1 2 3 4 5] and you want to place 5 between 2 and 3 that's annoyingly difficult to do efficiently.

dominicm 2020-08-19T08:40:31.052900Z

The classic solution involves subvec and other magic :)

dominicm 2020-08-19T08:41:13.053100Z

5 is not the best example there. Maybe placing 4 between 2 and 3. The instructions are arbitrary.

👍 1
2020-08-19T08:44:33.053600Z

Can idx could help with that? I might well be missing something.

wotbrew 2020-08-19T10:23:44.054600Z

I mean you could use the sorted index to write a function that does that in a linear pass. If you want to do multiple reinsertions you might be able to use replace-by.

wotbrew 2020-08-19T10:23:56.054800Z

(let [coll (auto-idx [1 2 3 4 5])
      target 5
      left (ascending coll identity <= 2)
      right (remove #{target} (ascending coll identity >= 3))]
  (concat left [target] right))
? @dominicm

wotbrew 2020-08-19T10:24:59.055100Z

idx really doesn't offer you anything you couldn't do yourself manually of course. (e.g I could create a sorted map there and do the same thing)

👍 1
mccraigmccraig 2020-08-18T15:07:52.025400Z

try it and see @danstone - what could possibly go wrong 😃

wotbrew 2020-08-18T15:08:35.026400Z

I might go back to my its-not-going-to-work position that I held this morning before rafts of tweaks. Be gentle folks.

wotbrew 2020-08-18T15:08:52.026500Z

https://github.com/wotbrew/idx

wotbrew 2020-08-18T15:08:56.026900Z

^^ see thread

wotbrew 2020-08-18T15:09:45.027Z

Obviously don't use this, still needs a lot of work before its done. I mean I need to do my full property test suite...

wotbrew 2020-08-18T15:11:40.027200Z

• Would people use it? 'is it worth the effort getting it lib quality' • I am worried about misuse of auto-idx • I am worried people might not understand what the hell this is even about.

wotbrew 2020-08-18T15:12:35.027400Z

As this is quite general purpose I'd hope it'd be useful quite broadly on most kinds of non-trivial application.

wotbrew 2020-08-18T15:12:59.027600Z

This sort of library I feel needs a massively high quality bar so I will probably spend a lot of time on it before I release it, hence my request for a cold shower.

wotbrew 2020-08-18T15:13:21.027800Z

Don't want to do a load of work that produces something nobody wants to use.

Jakob Durstberger 2020-08-18T15:27:46.028Z

I am quite a Clojure noob, so I am not quite sure what I’d use that for. Maybe it would be possible to add some examples?

👍 1
wotbrew 2020-08-18T15:29:11.028300Z

I don't know if I'd recommend this for beginners, but I think a section on what your options are and where this fits would be good.

mccraigmccraig 2020-08-18T15:34:45.028500Z

(having only looked at the README) i would like clojurescript support - we manually construct secondary indexes on a few collections in our re-frame app-db map

wotbrew 2020-08-18T15:35:28.028700Z

Yes this would be very suitable for re-frame

wotbrew 2020-08-18T15:35:58.028900Z

as your collections are not opaque, they look and smell exactly like normal collections all the subscription invalidation would work on these whilst still providing some nifty query support

wotbrew 2020-08-18T15:36:32.029100Z

I would be looking to do a clojurescript implementation at some point, but my dream would be somebody would help me with that.

wotbrew 2020-08-18T15:37:27.029300Z

I'd probably polish the clj implementation first to test the waters and see if there is demand

Jakob Durstberger 2020-08-18T15:37:46.029500Z

I am fine with it not being suitable for beginners, but I’d least like to understand where I could (maybe) apply it. So one day I could go “ah, maybe lib x would be good here”

wotbrew 2020-08-18T15:38:13.029900Z

@jakob.durstberger I agree, I'm gonna work on something in the readme 🙂

👍 1
wotbrew 2020-08-18T15:38:30.030100Z

readme is normally more work than the actual lib tbh

😄 1
2020-08-18T15:42:43.031100Z

Any chance we can get giphy integrated here ?

Jakob Durstberger 2020-08-18T15:43:27.031600Z

I guess you can ask in #slack-help 🙂

Jakob Durstberger 2020-08-18T15:43:49.032Z

Though Sean Corfield is also in here 😄

alexlynham 2020-08-18T15:45:35.032300Z

i think there's a giphy ban in this slack

2020-08-18T15:45:37.032500Z

thanks , i've posted in slack-help

2020-08-18T15:45:40.032700Z

NOO

alexlynham 2020-08-18T15:45:41.032800Z

possibly for the best tbh

alexlynham 2020-08-18T15:45:57.033300Z

i don't think it would be popular

2020-08-18T15:46:56.034Z

sayonara freedom of expression 😞 . oh well hope they reconsider , ill wait and see what the moderators say on slack help

wotbrew 2020-08-18T15:55:17.034100Z

@jakob.durstberger see the Why section I just added? Does that clarify at all?

alexlynham 2020-08-18T15:57:28.034300Z

not sure if serious :not-sure-fry:

2020-08-18T16:02:53.035700Z

does giphy really improve signal:noise ratio? am I just a grumpy old man?

alexlynham 2020-08-18T16:03:16.035800Z

it improves the gif ratio

alexlynham 2020-08-18T16:04:02.035900Z

now @mccraigmccraig will vouch for the fact that i'm very pro gif but it's rarely if ever that i've missed the integration on this particular slack tbh

Jakob Durstberger 2020-08-18T16:04:18.036Z

Yeah that’s quite useful 🙂 Two comments. “… introducing incidental complexity to their signatures, which I find very, very smelly.” • I only know inherent and accidental complexity, I assume you mean the later? • “which I find very, very smelly” To me that is not helpful. Why is it smelly? Is it because it creates unnecessary coupling or any other “metric” that is more objective?

👍 1
alexlynham 2020-08-18T16:04:21.036200Z

(im not a racist, some of my best friends are gifs! etc)

2020-08-18T16:05:13.036900Z

Interesting lib… I think I see the usecase, as I’ve built secondary indexes too… particularly in reagent/re-frame app dbs. However I tend not to do so much of this now, as we use an indexed in memory graph database to do this sort of thing. i.e if you’re maintaining various secondary indexes you’re probably also approaching wanting a query language too. That said I can imagine there are still uses. Anyway in terms of what I think would benefit this: 1. better more explicit examples that show the data and results too. Eliding them means readers are just guessing at what things do. 2. Benchmarks 3. Comparison or suggestions for alternative approaches, e.g. in memory databases, perhaps also memoize or core.cache is better for some smaller use cases, also perhaps specter?

👍 1
mccraigmccraig 2020-08-18T16:05:22.037200Z

@alex.lynham does indeed generally tend towards the pro end of the gif tendency spectrum

2020-08-18T16:06:25.037400Z

Also to be clear I think cljc support rather than just cljs support would be useful (i.e. working isomorphically in both environments)

2020-08-18T16:08:07.037800Z

seconded 😆 , though the gif choices can be very obscure — some arguably have an audience of 1.

alexlynham 2020-08-18T16:09:28.038200Z

sometimes giphy gives you a weird one and you just have to take the bitter with teh better ya know

wotbrew 2020-08-18T16:09:37.038300Z

yea, I would attempt a .cljc first. I believe though if your .jar contains both a idx.cljs and idx.clj file the runtime will pick the right one? I am worried the branches will noise up the code, I mean there is a lot of java-specific stuff in there.

2020-08-18T16:11:38.038600Z

yes you can organise it like that — or with reader conditionals.

dharrigan 2020-08-18T16:14:58.039Z

I use gif keyboard for our slack at work

dharrigan 2020-08-18T16:15:34.039900Z

personaly, I find it useful to lighten the mood or to have a nice little funny moment

dharrigan 2020-08-18T16:16:02.040500Z

with /gifs you can choose what to send, it's not a random obscure gif

dharrigan 2020-08-18T16:17:22.040700Z

This <https://slack.riffsy.com/>

2020-08-18T16:23:37.040800Z

Regarding the database point, I seem to recall cgrand making a good point on this… which is that using complex clojure datastrutures as databases is similar to using a hierarchical database from the 1960s. A model that was essentially destroyed by the relational model — because they’re painful to query, update, index etc. I find that argument quite compelling, though I guess I didn’t have idx at the time… Curious what your thoughts are about this and that spectrum of options though

wotbrew 2020-08-18T16:38:11.041600Z

I live and breath relational data, and long for the day that programming with logic, rules and relations is the norm (no pun intended). This lib is not really trying to compete with databases though. If you can pour all of your data into datascript and use that great.

wotbrew 2020-08-18T16:38:56.041800Z

A lot of use cases for idx will be internally in functions where you whack on an auto-idx do some work and then unwrap and return. Much like you would use a transient.

2020-08-18T16:39:42.042700Z

It's just to lighten the mood as mentioned above .

wotbrew 2020-08-18T16:40:54.042800Z

In the large use relational databases, in the small use databases when it makes sense. Use idx for ad-hoc collection indexing as you would group-by.

seancorfield 2020-08-18T17:02:59.045Z

As @alex.lynham surmises, the Admin team discussed giphy and decided it was just too distracting and too open to abuse -- it can also be very bad for people who are photo-sensitive because of the "flashing" that you get with some results (it's also why we removed the :party-parrot: emoji -- although I see a couple of flashing emojis have come back).

Jakob Durstberger 2020-08-19T07:35:01.051900Z

Can I just say how amazing I think it is that you are trying to be inclusive to people with photo-sensitivity. :fist:

👍 1
dharrigan 2020-08-18T17:05:03.045300Z

you mean :party-corgi: ?

dharrigan 2020-08-18T17:05:11.045600Z

cute little doggie 🙂

seancorfield 2020-08-18T17:05:41.046300Z

Sigh. Yes. It's not quite as bad as the parrot but it is really distracting and bad for folks who are sensitive to that kind of thing.

seancorfield 2020-08-18T17:06:33.046800Z

I responded in #slack-help as well so there's a more public "official response".

seancorfield 2020-08-18T17:07:10.047500Z

(and all accessibility concerns aside, we are on the free plan here and integrations are "precious" because they are very limited)

seancorfield 2020-08-18T17:08:07.048200Z

I've been in several Slacks where animated emojis are banned out of consideration for people who are sensitive to flashing lights etc.

minimal 2020-08-18T17:15:28.048500Z

there is the “Allow animated images and emoji” checkbox

seancorfield 2020-08-18T17:26:34.049100Z

@minimal That's probably "new" since the policy was discussed. Nice to know.

minimal 2020-08-18T17:27:20.050Z

Yeah must be relatively new

seancorfield 2020-08-18T17:27:29.050200Z

There are sometimes uses for animated images here: quick demos of features in tooling/editors -- but I'll mention it to the Admin Team...

seancorfield 2020-08-18T17:32:31.050800Z

Ah, that's on a per-user preference basis -- so individual folks can opt out if they want (and if they know about it).

minimal 2020-08-18T17:33:29.051Z

Yeah

dominicm 2020-08-18T19:28:52.051100Z

Love this library. Been watching it since you created it.

❤️ 1
dominicm 2020-08-18T19:29:43.051300Z

I haven't figured out yet if it would help me reorder elements in an array efficiently, but that would be great.