Good Morning!
👋
☕ :spock-hand:
Morning
Llap
godmorgen
Good morning
Mooin
Morning
Morning has broken
Morning!
god morgon
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 ✨
asami is a good choice too now (storage is in alpha), you get as-of
too
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.
morning
morning 🙂
Morning
måning
Good morning!
morning!
Morning
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.
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.
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.
good morning
late morning for you today? 🙂
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.
(I wanted to change into proper pants hours ago, but our son has been impossible all day)
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.
I made a joke. https://twitter.com/borkdude/status/1371803345871122433
@borkdude what’s your recent metal discovery/ies? 🙂
My latest favorite album isn't really metal, more progrock
Transatlantic, The Absolute Universe
Looking forward to the new Liquid Tension Experiment 3 (instrumental progressive rock/metal)
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!
(Transatlantic, I mean 🙂 )
I love a wide range of rock/metal related bands, but progressive tickles my musical brain the most.
I totally get that, brain tickling is lovely in general 🙂 For me, stuff like Tool does that, but also some complex electronic music.
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?
I don't have a problem with it either, it's just a joke
I read the title in both ways at once! Odd.
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.
Took me a second to parse the pun 🙂
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.
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
I'm so tired I had double morning
sounds pretty good \,,/
I remember as a beginner is was a little lost even though I have a strong background in java.
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.
I think it’s the S T A C K T R A C E S which are hard to read for many developers.
OMG I need some post moder jukebox after this :-p
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.
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
some Stockholm activities occurring here 🙂 take a look at ELM and Rust even and you see what things might be like
"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
it's an indication that you should rewrite your answer 😝
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)
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
who's the chicken in that scenario?
that is your koan
btw the egg definitely came first 🙂
I think there are enough experts that care
Where is the evidence?
your work, expound, etc
maria.cloud
I thought we were discussing Compiler exceptions
the problem isn't a lack of care in the world it's just that changes outside of the centre have lower impact
I ordered a chicken and an egg from amazon to see which came first.
are the annual clojure survey results out btw?
I’m most likely hit by the Stockholm syndrom, but I don’t spend much time agonizing over error messages these days.
isn't that your home location?
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 paramsBut 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.
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.
I looked into this at some point, and it’s rather involved in how AFn (or whatever is implemented)
Basically AFn (or whatever) is an abstract class containing 21 methods which all throw exceptions like Wrong number of args (3) passed to (.name)
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
and then the concrete implementation for say foo
overrides invoke
for the correct arities.
so I'll just continue in my own little clj-kondo corner :p
I raised a similar issue around erroreporting on multimethods https://clojure.atlassian.net/jira/software/c/projects/CLJ/issues/CLJ-2263?filter=reportedbyme
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.
Can I quote The Big Lebowski here?
Any time
The Dude: Yeah,well, that's just, like, your opinion, man.
🙂
not directed at anyone here 🙂
And, if I were to choose, there are other things I would want Rich to spend his time on 🙂
anyone here ever used http://keycloak.org/ in production?
At finalist we used it quite often. Does the job really well.
if you have questions let me know @joelkuiper
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 😛
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
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
I think Fogus is working on some cool stuff related to speeding up destructuring.
Was it speeding up or extending it with "passing named arguments and get a map"
I saw the issue flying past at some point, but not able to find it now.
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
The latter.
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
I was hoping the first, but the second is cool too, if it's not making it any slower :)
https://github.com/clojure/data.json/blob/master/src/main/clojure/clojure/data/json.clj#L297 is hitting me for small json-payloads
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.
(especially since merge
uses reduce1
in lieu of reduce
)
(I seem to remember an issue about that, but I’m unable to find it)
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
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)
I had it up and running with ring-oauth2 via standard OIDC, what does this library do?
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 😛
most of the meat seems here though https://github.com/jgrodziski/keycloak-clojure/blob/master/src/keycloak/admin.clj
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
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
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" 😆
so I guess there was some alignment there 😛
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
hmm, I kinda like that it isn't integrated at the moment though, but good to have the option at least 🙂
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.
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]]
Funnily enough we might need to use keycloak as an identity provider as google SSO is a joke
We are multitenant too
One realm per tenant
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.
We have some scripts to set the realms up, using some json templates
We also have to deal with social signups and other concerns, plus we want to control the UI 100%
We're very antisocial, so I can't comment on that part
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
> Funnily enough we might need to use keycloak as an identity provider as google SSO is a joke Try Apple
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...
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.
Something like a grep for :orders :* :client :person :name #(.starts with % "Dude")
but lazy.
@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.
jsoniter (a java and a go lib) also has some lazy stuff in it.
@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.
Languages like Haskell or Scala support this better when you build custom types to deserialize to.
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)))
but it would’ve been cool
Allthough somewhat useless
$ bb -O -e '(range)' | bb -I -e '(take 10 *input*)'
(0 1 2 3 4 5 6 7 8 9)
That’s cool 🙂
only works on macOS/linux, not on Windows due to some missing signal there
Reminds me of a blog/article about running some stuff in parallel in bash, but my google-fu is failing me.
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.
There we go: a streaming jsonpath library https://github.com/jsurfer/JsonSurfer
I think you could accomplish it using a zipper.