clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
dharrigan 2021-03-16T06:40:41.000200Z

Good Morning!

djm 2021-03-16T06:43:50.000400Z

👋

RAMart 2021-03-16T06:46:42.000600Z

:spock-hand:

2021-03-16T07:02:53.000800Z

Morning

2021-03-16T07:02:58.001Z

Llap

simongray 2021-03-16T07:23:43.001200Z

godmorgen

anthony-galea 2021-03-16T07:31:20.001500Z

Good morning

synthomat 2021-03-16T07:43:14.001900Z

Mooin

agigao 2021-03-16T08:13:39.002100Z

Morning

raymcdermott 2021-03-16T08:15:32.002700Z

Morning has broken

javahippie 2021-03-16T08:17:33.003Z

Morning!

mpenet 2021-03-16T08:17:44.003200Z

god morgon

borkdude 2021-03-16T08:18:31.003800Z

Instead of storing EDN files as a "db" I would probably go for datalevin now if I would have that case use again: https://twitter.com/huahaiy/status/1371689142585753604

2👍
mpenet 2021-03-16T08:20:16.004600Z

asami is a good choice too now (storage is in alpha), you get as-of too

1👍
pez 2021-03-16T08:50:06.006900Z

Good morning! I just found out that GitPod is switching to using VS Code instead of Theia. It’s already an experimental feature and when I try it, I can install and run Calva in there. Quite amazing. The first run is slow, but from then it is quite like running it on my computer.

thomas 2021-03-16T08:51:38.007100Z

morning

joelkuiper 2021-03-16T09:01:03.007500Z

morning 🙂

2021-03-16T09:06:50.007700Z

Morning

mccraigmccraig 2021-03-16T09:16:42.008100Z

måning

reefersleep 2021-03-16T09:37:11.008300Z

Good morning!

slipset 2021-03-16T09:54:14.008500Z

morning!

jasonbell 2021-03-16T10:08:56.008700Z

Morning

orestis 2021-03-16T10:27:41.009400Z

Good morning! I reconnected with my Iyengar Yoga teacher via Zoom, and I'm so happy. I haven't done any yoga or exercise since more than a year now.

6👍
borkdude 2021-03-16T10:59:29.010200Z

My wife is also doing yoga (but via Youtube, her teacher is sometimes live and posts videos), has been doing it throughout the pandemic. Only in the summer there were some lessons she could attend, but then the lockdown came again.

simongray 2021-03-16T11:04:09.013300Z

I used to do yoga on the regular with a friend of mine, but at one point (a year or two before the pandemic even started) he stopped wanting to go preferring to do it online instead… and then my attendance also dropped to zero soon after.

ordnungswidrig 2021-03-16T12:14:32.014300Z

good morning

reefersleep 2021-03-16T12:19:26.016100Z

late morning for you today? 🙂

ordnungswidrig 2021-03-16T12:19:49.016400Z

I redescovered DDR yesterday, a dance game with a sensor mat on the wii. I was more fun than I remembered and more exhausting on top. Unfortunately that mat is not recognized as a usb gamepad like a similar mat I have. Otherwise I would totally create some clojurescript game with it otherwise.

reefersleep 2021-03-16T12:19:51.016600Z

(I wanted to change into proper pants hours ago, but our son has been impossible all day)

ordnungswidrig 2021-03-16T12:20:28.017500Z

The game controller support in browsers is an awesome thing. Using the other controller mat, I created a “jump height measuring app” (based on the time of flight) with reagent and it was very fun.

2🙌1🎮
borkdude 2021-03-16T12:40:24.018Z

I made a joke. https://twitter.com/borkdude/status/1371803345871122433

reefersleep 2021-03-17T15:09:18.055600Z

@borkdude what’s your recent metal discovery/ies? 🙂

borkdude 2021-03-17T15:10:29.055800Z

My latest favorite album isn't really metal, more progrock

borkdude 2021-03-17T15:10:39.056Z

Transatlantic, The Absolute Universe

borkdude 2021-03-17T15:11:05.056200Z

Looking forward to the new Liquid Tension Experiment 3 (instrumental progressive rock/metal)

reefersleep 2021-03-19T12:55:30.237300Z

I’m not that much of a prog rock fan. I enjoy Roundabout by Yes, but that’s about it, so far. I’ll pass this recommendation on to my prog rock loving colleague, though!

reefersleep 2021-03-19T12:56:05.237500Z

(Transatlantic, I mean 🙂 )

borkdude 2021-03-19T12:58:46.237700Z

I love a wide range of rock/metal related bands, but progressive tickles my musical brain the most.

reefersleep 2021-03-19T13:15:06.238200Z

I totally get that, brain tickling is lovely in general 🙂 For me, stuff like Tool does that, but also some complex electronic music.

jkxyz 2021-03-16T12:46:44.019Z

Is it a sign of tunnel vision that I don’t have a problem with Clojure’s error messages, which everyone seems to complain about so much?

borkdude 2021-03-16T12:47:20.019300Z

I don't have a problem with it either, it's just a joke

reefersleep 2021-03-16T12:47:43.019400Z

I read the title in both ways at once! Odd.

reefersleep 2021-03-16T12:48:30.019600Z

I’ve learned to read them, but they were hard in the beginning, and I even had experience from Java. If you come from a different language (or from scratch), it might be tough.

jkxyz 2021-03-16T12:54:20.020100Z

Took me a second to parse the pun 🙂

reefersleep 2021-03-16T12:55:30.020200Z

We’re probably the same by now, you and me. There’s way too much information for the REPL to decode the errors. We’ve gotten used to it, though. Our brains do the translating. We don’t even see the code. All we see is blonde, brunette, redhead.

1🕶️
reefersleep 2021-03-16T12:57:45.020500Z

Btw, I saw metal mentioned in your tweet profile. This is my latest discovery, maybe you’ll like it: https://www.youtube.com/watch?v=SSEtBgQDExE

2021-03-16T13:00:40.020800Z

I'm so tired I had double morning

borkdude 2021-03-16T13:13:47.021Z

sounds pretty good \,,/

1🤘
ordnungswidrig 2021-03-16T13:51:11.021300Z

I remember as a beginner is was a little lost even though I have a strong background in java.

ordnungswidrig 2021-03-16T13:52:00.021500Z

On the other hand when I do some haskell, I’m even more lost, even though the errors might be technicall more precise and even more concise.

ordnungswidrig 2021-03-16T13:52:23.021700Z

I think it’s the S T A C K T R A C E S which are hard to read for many developers.

ordnungswidrig 2021-03-16T13:53:20.021900Z

OMG I need some post moder jukebox after this :-p

slipset 2021-03-16T14:08:33.022200Z

I did some work (somewhat recently) in Python. I think the problem is familiarity rather than anything else, as in, the error messages from Python were quite cryptic even though I believe they were in colours.

jkxyz 2021-03-16T14:12:06.022400Z

Yeah I think you have to develop some mental heuristics for skipping the unimportant parts in the stacktrace (clojure.lang.RT etc) and parsing the generated class names to get to the function that caused the error. But I don’t think it’s worse than a lot of languages. I actually think that JVM Clojure is good at pointing you to where to look

raymcdermott 2021-03-16T14:59:08.023800Z

some Stockholm activities occurring here 🙂 take a look at ELM and Rust even and you see what things might be like

borkdude 2021-03-16T15:02:39.024700Z

"you should use spec to get better error message", yeah, but instrumenting core specs will make my Advent of Clojure solution run in 15 minutes insteaf of 300ms :P

raymcdermott 2021-03-16T15:03:27.025300Z

it's an indication that you should rewrite your answer 😝

raymcdermott 2021-03-16T15:16:35.028100Z

spec would be nice but annotated exceptions would already be better - they recently changed exceptions to be data so that's something that could be used to help users (new and old)

borkdude 2021-03-16T15:17:21.028600Z

I think it's a chicken and egg situation: the experts don't care and the beginners don't have the experience to fix it

raymcdermott 2021-03-16T15:17:39.028900Z

who's the chicken in that scenario?

borkdude 2021-03-16T15:17:59.029300Z

that is your koan

raymcdermott 2021-03-16T15:18:02.029500Z

btw the egg definitely came first 🙂

raymcdermott 2021-03-16T15:18:57.029800Z

I think there are enough experts that care

borkdude 2021-03-16T15:19:14.030200Z

Where is the evidence?

raymcdermott 2021-03-16T15:19:24.030500Z

your work, expound, etc

raymcdermott 2021-03-16T15:19:38.030800Z

maria.cloud

borkdude 2021-03-16T15:20:09.031700Z

I thought we were discussing Compiler exceptions

raymcdermott 2021-03-16T15:20:21.032200Z

the problem isn't a lack of care in the world it's just that changes outside of the centre have lower impact

slipset 2021-03-16T15:20:23.032300Z

I ordered a chicken and an egg from amazon to see which came first.

5😂3😆
raymcdermott 2021-03-16T15:21:15.033Z

are the annual clojure survey results out btw?

slipset 2021-03-16T15:21:53.033700Z

I’m most likely hit by the Stockholm syndrom, but I don’t spend much time agonizing over error messages these days.

raymcdermott 2021-03-16T15:22:34.034800Z

isn't that your home location?

slipset 2021-03-16T15:25:06.035900Z

There are a couple that are annoying, like this one:

user> (foo 'bar 'baz 'qix)
Execution error (ArityException) at user/eval204152 (form-init9860581626012504089.clj:4103).
Wrong number of args (3) passed to: user/foo
user> 
I believe the compiler/runtime has enough information to tell me that foo expects two params

slipset 2021-03-16T15:26:07.037400Z

But notice, no stack traces or anything here. Also, thanks to @borkdude and @ericdallo I’m catching a lot of stupid (compiler) errors before they become exceptions.

dharrigan 2021-03-16T15:26:25.037800Z

That one is one of my most confusing ones...why couldn't it have said "Wrong number of args passed to: user/foo, got 3 expecting 2" or something like that.

slipset 2021-03-16T15:27:10.038500Z

I looked into this at some point, and it’s rather involved in how AFn (or whatever is implemented)

slipset 2021-03-16T15:28:06.040200Z

Basically AFn (or whatever) is an abstract class containing 21 methods which all throw exceptions like Wrong number of args (3) passed to (.name)

borkdude 2021-03-16T15:28:20.040800Z

I once brought up the arity information problem in #clojure-dev since the CLJS compiler warns you about this. But it wasn't deemed interesting enough

slipset 2021-03-16T15:28:30.041100Z

and then the concrete implementation for say foo overrides invoke for the correct arities.

borkdude 2021-03-16T15:28:44.041500Z

so I'll just continue in my own little clj-kondo corner :p

slipset 2021-03-16T15:30:35.042300Z

I raised a similar issue around erroreporting on multimethods https://clojure.atlassian.net/jira/software/c/projects/CLJ/issues/CLJ-2263?filter=reportedbyme

borkdude 2021-03-16T15:31:41.043600Z

The compiler can keep around enough information to be able to warn you about this, but this comes at slightly more compile time cost (which may be worth it) and the trade-off that vars can be redefined at runtime, so the information might go out of date (but I think even that can be accounted for since the Compiler sees everything). But you cannot get the arity from an opaque function object, which may be the most fundamental problem (I do think you can fix this on the compiler or even macro level). But even then, it wasn't deemed that interesting.

dharrigan 2021-03-16T15:32:18.043900Z

Can I quote The Big Lebowski here?

1😎
borkdude 2021-03-16T15:32:38.044200Z

Any time

dharrigan 2021-03-16T15:32:51.044500Z

The Dude: Yeah,well, that's just, like, your opinion, man.

2😆
dharrigan 2021-03-16T15:32:56.044700Z

🙂

dharrigan 2021-03-16T15:33:11.045600Z

not directed at anyone here 🙂

slipset 2021-03-16T15:33:13.045700Z

And, if I were to choose, there are other things I would want Rich to spend his time on 🙂

joelkuiper 2021-03-16T15:33:19.046Z

anyone here ever used http://keycloak.org/ in production?

thomas 2021-03-17T08:12:58.021500Z

At finalist we used it quite often. Does the job really well.

thomas 2021-03-17T08:13:19.021700Z

if you have questions let me know @joelkuiper

1👍
joelkuiper 2021-03-16T15:34:11.047400Z

it seems like it would save quite a few headaches without being tied to AWS/Cloud for IAM, but not sure if there are some "gotchas" I should be aware of 😛

borkdude 2021-03-16T15:37:17.050600Z

To give an argument in favor of not doing this in the compiler: a linter can catch most of these issues and you don't get any compilation delay. In sci I'm also not checking for certain things which I just leave to the linter

javahippie 2021-03-16T15:37:18.050700Z

The gotcha is that you run the database with all the credentials yourself, and are responsible for it - and that it’s kind of chunky in both runtime and configuration

slipset 2021-03-16T15:37:23.051Z

I think Fogus is working on some cool stuff related to speeding up destructuring.

borkdude 2021-03-16T15:37:53.051800Z

Was it speeding up or extending it with "passing named arguments and get a map"

slipset 2021-03-16T15:37:54.051900Z

I saw the issue flying past at some point, but not able to find it now.

javahippie 2021-03-16T15:38:01.052100Z

I’d assume it’s battle tested, and it’s heavily used and tested by RedHat. We have it running to secure our OpenShift Dev Environment, but gladly I am not the one managing it

slipset 2021-03-16T15:38:05.052300Z

The latter.

djm 2021-03-16T15:38:07.052400Z

We use it. I think it depends on what you want to do - we ended up with some complex integration code (using their SPI thing), as we were trying to fit it into our existing ecosystem. Doing something sensibly from scratch would be much less painful

borkdude 2021-03-16T15:38:28.052900Z

I was hoping the first, but the second is cool too, if it's not making it any slower :)

slipset 2021-03-16T15:38:59.053300Z

https://github.com/clojure/data.json/blob/master/src/main/clojure/clojure/data/json.clj#L297 is hitting me for small json-payloads

slipset 2021-03-16T15:39:47.054200Z

So I have a published interface which accepts kw-args, and I needed to make them into a map (and merge with defaults). And that is slow.

slipset 2021-03-16T15:40:10.054800Z

(especially since merge uses reduce1 in lieu of reduce)

slipset 2021-03-16T15:43:57.055300Z

(I seem to remember an issue about that, but I’m unable to find it)

joelkuiper 2021-03-16T15:44:18.055400Z

Hmm that's good to know, I got it running in Clojure with reitit/re-frame/buddy-auth (front + back) by adapting https://github.com/jgrodziski/keycloak-clojure ever so slightly and just running the docker containers in a day or so, but it does seem rather brittle

joelkuiper 2021-03-16T15:45:11.055800Z

I'm anticipating some SAML/LDAP auth stuff, and I really didn't want to do that from scratch, so it seemed a pragmatic choice but not sure if it ends up being worth the trouble (even getting the theming right is a pain)

javahippie 2021-03-16T15:45:18.056Z

I had it up and running with ring-oauth2 via standard OIDC, what does this library do?

joelkuiper 2021-03-16T15:46:58.056200Z

it's pretty much a wrapper around the java lib , primarily focused around the admin tasks rather than the auth flow itself, but it had a sample for integrating it with re-frame so I just rolled with it 😛

joelkuiper 2021-03-16T15:47:23.056400Z

most of the meat seems here though https://github.com/jgrodziski/keycloak-clojure/blob/master/src/keycloak/admin.clj

javahippie 2021-03-16T15:49:08.056900Z

If you stick with OIDC default flows, you could always interchange the provider and not be coupled to Keycloak. But that lib does seem convenient. I guess if you want to have one component bundling LDAP, OIDC, platform auth etc. etc., and be the one controlling that component, there is not much way around keycloak

javahippie 2021-03-16T15:50:24.057200Z

I’m currently considering throwing money at the issue and buying into Auth0, but they have been acquired, and I don’t like that. @orestis half-jokingly suggested building our own auth library with adapters, so I half-jokingly bring it up again here

joelkuiper 2021-03-16T15:51:14.057400Z

I was looking at keycloak and that lib and half jokingly thought "welp I guess I can build my own Auth0 and get acquired for an obscene amount of money" 😆

joelkuiper 2021-03-16T15:51:42.057600Z

so I guess there was some alignment there 😛

javahippie 2021-03-16T15:52:47.057800Z

It might even be possible to integrate keycloak into the application itself (at least in a java context): https://www.baeldung.com/keycloak-embedded-in-spring-boot-app

joelkuiper 2021-03-16T15:58:34.058200Z

hmm, I kinda like that it isn't integrated at the moment though, but good to have the option at least 🙂

orestis 2021-03-16T16:02:58.059400Z

Pac4j is on my list. I have almost already dismissed keycloak as we are multitenant and it seems like it wasn’t designed for our use case.

borkdude 2021-03-16T16:04:44.060300Z

I needed a kind of str/split for collections. It's neat that you can do this without traversing the collection twice or writing a lower level loop/reduce:

(into [] (comp (partition-by #(= % 1)) (take-nth 2)) [2 2 3 1 2 3])
[[2 2 3] [2 3]]

orestis 2021-03-16T16:06:26.061300Z

Funnily enough we might need to use keycloak as an identity provider as google SSO is a joke

djm 2021-03-16T16:07:27.061500Z

We are multitenant too

djm 2021-03-16T16:07:36.061700Z

One realm per tenant

orestis 2021-03-16T16:10:00.063100Z

Do you have to create the realms with xml and such then? I like just creating an entry in a central database and then things work automatically since we control the SSO code.

djm 2021-03-16T16:10:33.064100Z

We have some scripts to set the realms up, using some json templates

orestis 2021-03-16T16:10:34.064300Z

We also have to deal with social signups and other concerns, plus we want to control the UI 100%

djm 2021-03-16T16:11:26.064500Z

We're very antisocial, so I can't comment on that part

djm 2021-03-16T16:12:17.064700Z

All of our user admin is done is a separate application (and we have KC connected to that database), so mostly no one has to use the KC UI

javahippie 2021-03-16T16:16:30.064900Z

> Funnily enough we might need to use keycloak as an identity provider as google SSO is a joke Try Apple

orestis 2021-03-16T17:04:40.066700Z

Apple doesn’t control our emails and Calendar and files though! Google provides saml SSO but then provisioning only works for a built in list of apps...

1👍
ordnungswidrig 2021-03-16T17:41:15.067200Z

If you have the solution the problem will come to you 😜

ordnungswidrig 2021-03-16T17:43:46.069300Z

I wonder if there is a stream/query interface to json or even clojure lazy data structures. For those cases where you only need a small subset of a potential json document and you want to avoid reading it all or realizing all.

ordnungswidrig 2021-03-16T17:44:55.070700Z

Something like a grep for :orders :* :client :person :name #(.starts with % "Dude") but lazy.

slipset 2021-03-16T18:19:57.073Z

@ordnungswidrig cheshire seem to have some lazy stuff in it, but it uses jackson underneath, so I’m not sure where the lazyness kicks in, if it’s in lazy also in parsing, or only in creating the objects.

slipset 2021-03-16T18:20:12.073400Z

jsoniter (a java and a go lib) also has some lazy stuff in it.

borkdude 2021-03-16T18:23:11.074600Z

@slipset The laziness in cheshire is only for top-level arrays. @ordnungswidrig I proposed this to @ikitommi once for jsonista, but afaik it's not possibly out of the box currently.

borkdude 2021-03-16T18:23:34.075500Z

Languages like Haskell or Scala support this better when you build custom types to deserialize to.

slipset 2021-03-16T18:23:53.075900Z

From what I’ve read of the jackson source I don’t think you coul do:

(take 10 (json/parse-stream (json/write-stream (range)))

slipset 2021-03-16T18:24:19.076100Z

but it would’ve been cool

slipset 2021-03-16T18:24:49.076300Z

Allthough somewhat useless

borkdude 2021-03-16T18:26:15.076600Z

$ bb -O -e '(range)' | bb -I -e '(take 10 *input*)'
(0 1 2 3 4 5 6 7 8 9)

slipset 2021-03-16T18:31:04.076900Z

That’s cool 🙂

borkdude 2021-03-16T18:31:39.077300Z

only works on macOS/linux, not on Windows due to some missing signal there

slipset 2021-03-16T19:14:02.078Z

Reminds me of a blog/article about running some stuff in parallel in bash, but my google-fu is failing me.

ordnungswidrig 2021-03-16T19:22:20.080100Z

I was thinking about an event based interface like SAX for XML parsing. The interesting part would be the stream matching. Basicall you’ll get a pre-walk over all JSON values and I’d love to be able to match on it. For the above examples the “matcher” would need to keep the current “path” in memory to know when a match occurs. I think work on regex applied to streams could be resued.

ordnungswidrig 2021-03-16T19:44:19.080400Z

There we go: a streaming jsonpath library https://github.com/jsurfer/JsonSurfer

simongray 2021-03-16T21:00:50.081600Z

I think you could accomplish it using a zipper.