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-07-24T07:05:50.132400Z

Good Morning!

seancorfield 2020-07-24T07:10:36.132600Z

Mornin'

2020-07-24T08:12:20.135500Z

Does anyone know the current situation with json-schema? When I last used it (several years ago) the spec was underspecified and lots of implementations were incompatible. In particular JSON pointers were a bit of a nightmare. Have things improved?

dominicm 2020-07-24T08:38:24.135700Z

A little

dominicm 2020-07-24T08:38:44.136300Z

Someone took the helm again and pushed v8, but I've not followed since then

alexlynham 2020-07-24T08:50:12.136400Z

it's okay, but recently I've found typescript interfaces at the edge of our system have solved that problem better, with better integration and editor tooling & it's faster too

dominicm 2020-07-24T11:54:14.137800Z

You'll struggle to share TS definitions across network boundaries though. JSON schema is a tool of communication.

alexlynham 2020-07-24T12:20:00.137900Z

true, I guess depends how much of your domain is in your control

alexlynham 2020-07-24T12:20:27.138Z

atm working on a system that's backend and very much glue so we don't have to share our defs with e.g. a frontend

alexlynham 2020-07-24T12:20:44.138100Z

although if they were TS I think we'd monorepo nad share the defs that way

2020-07-24T13:57:58.138300Z

Morn’

maleghast 2020-07-24T14:46:59.138600Z

Hello Alll πŸ™‚

maleghast 2020-07-24T14:47:28.139400Z

Does anyone happen to know how to update the exec-path in Spacemacs flavoured Emacs..?

maleghast 2020-07-24T14:48:37.140700Z

I have never had to do it before, but suddenly, on my work machine (Ubuntu 20) Emacs is no longer seeing my ~/bin folder which is where I put lein

maleghast 2020-07-24T14:49:54.142200Z

(also, I'ved not had to use lein for a while as I was all tools-deps all the time, but I've been overruled by my team and we are back to Leiningen) (I don't care, I just can't cider-jack-in to the prototype I am working on because of this exec-path stuff)

alexlynham 2020-07-24T14:51:27.142900Z

do you use the exec-path-from-shell plugin? that seems to mostly sort it out for me

maleghast 2020-07-24T15:05:42.143400Z

Thank @alex.lynham - I will look at that, sounds like a plan

maleghast 2020-07-24T15:54:40.145500Z

Odd question - anyone else getting an aleph error when trying to evaluate a namespace where [yada.yada :as yada] is in the :require..?

maleghast 2020-07-24T15:54:56.145900Z

If I comment it out, clearly no errors, but I want yada in that namespace

maleghast 2020-07-24T16:24:02.146900Z

This is why I should have learned about Java properly, this stacktrace is mental and it appears to be to do with a transitive dependency to the library I am trying to use... https://gist.github.com/maleghast/3cfb6b8a7da2d648b87c6fcf43f148f5

maleghast 2020-07-24T16:24:22.147400Z

Does anyone have any idea what is goin on there ^^

seancorfield 2020-07-24T16:25:57.148Z

Looks like a Java 9+ compatibility issue with one of the libs you are using, or maybe how your REPL is getting started?

seancorfield 2020-07-24T16:26:48.148900Z

javax.xml.bind.DatatypeConverter is one of the usual culprits in Java 9+ issues regarding bootclasspath or something like that...

maleghast 2020-07-24T16:26:53.149Z

Oh... Yeah, I am using Java11

maleghast 2020-07-24T16:27:30.149500Z

How would I fix that, without going back to Java8?

maleghast 2020-07-24T16:30:28.150700Z

More importantly, how do I get Yada to be compatible with a more up to date JVM than Java8 - I love the way that Yada works, but I am not comfortable relying on a JVM that is about to EoL

maleghast 2020-07-24T16:38:54.151300Z

@seancorfield - FWIW I switched back to Java8 and the code runs, so I am now pretty sure that you are right

2020-07-27T07:44:57.225200Z

XML is treated as a seperate module in Java 9that you have to turn on as a commandline switch

2020-07-27T07:45:06.225400Z

now if only I could remerber what that was

2020-07-27T07:47:30.225700Z

Meh unfortunately I have that stuff on Ubuntu; and I'm booted into Windows for current client work

2020-07-27T07:48:33.225900Z

it was also possible to solve by including java xml dependencies into lein/deps/mvn to bring the processing code into your main user space

2020-07-27T07:54:00.226100Z

something like

java --add-modules java.xml
on the startup command perhaps?

2020-07-29T07:13:13.235700Z

:jdk11
  {:extra-deps {com.sun.xml.bind/jaxb-core {:mvn/version "2.3.0.1"}
                com.sun.xml.bind/jaxb-impl {:mvn/version "2.3.0.1"}
                <http://javax.xml.ws/jaxws-api|javax.xml.ws/jaxws-api> {:mvn/version "2.3.1"}
                javax.xml.bind/jaxb-api {:mvn/version "2.3.0"}
                javax.activation/activation {:mvn/version "1.1.1"}}}

2020-07-29T07:13:35.235900Z

since I'm here

maleghast 2020-07-29T14:37:54.237500Z

Ooh, thanks @ben.hammond πŸ™‚

maleghast 2020-07-24T16:38:57.151500Z

πŸ™‚

seancorfield 2020-07-24T16:40:55.152600Z

The stacktrace suggests it's Aleph, specifically. Which is pretty much no longer maintained?

seancorfield 2020-07-24T16:41:01.152800Z

(and Yada uses Aleph)

seancorfield 2020-07-24T16:42:01.154Z

I'm surprised at this point it hasn't all been updated to work properly with Java 9+ tho'... although we ended up switching a couple of our Java library deps because they were taking so long to fix Java 9 compatibility issues in the end 😐

maleghast 2020-07-24T17:05:45.154700Z

Ah, bummer... I did not know that Aleph has become abandonware - it always struck me as a great library

maleghast 2020-07-24T17:05:55.155Z

Thx anyway @seancorfield

maleghast 2020-07-24T17:06:42.155900Z

I'll drop Malcolm a DM and ask him if there is a plan, and if not see if we can fork our way to a working version, even if that's some work... πŸ˜‰

maleghast 2020-07-27T14:25:04.233300Z

I will check to see if that works - does this mean that the fix is in Yada, or has Aleph been updated to work on an "unstable" branch that is actually stable?

maleghast 2020-07-27T14:25:10.233500Z

Also, thanks @dominicm

seancorfield 2020-07-24T17:15:36.156100Z

@maleghast https://github.com/ztellman/aleph/issues/539

seancorfield 2020-07-24T17:16:16.156700Z

So there are plans to get to a 1.0 but it sounds pretty minimal.

maleghast 2020-07-24T17:18:21.158Z

Crikey! Thanks for the info @seancorfield - I am stunned, Aleph always seemed to me that it would be around forever; such a shame... I wonder if this is all part of Zac falling out of love with Clojure... πŸ’£

seancorfield 2020-07-24T17:26:30.158600Z

I like Zach, he's really smart, but his projects have nearly always seemed really... weird...

maleghast 2020-07-24T17:29:32.158800Z

Yeah, no doubt...

maleghast 2020-07-24T17:29:53.159200Z

What are people using instead of Yada these days then..?

maleghast 2020-07-24T17:30:29.160100Z

As I just said in another window, I've not had to develop something from scratch for a good long while and this experience has uncovered some concerns to say the least...

maleghast 2020-07-24T17:31:33.161500Z

I would like to carry on using Bidi / Yada as I like the way that they work together, but the reliance on Aleph and Aleph having an uncertain future makes me wonder what others in this community have been "picking" if they are starting a new project in the last few weeks / months...?

seancorfield 2020-07-24T17:33:09.162600Z

I've never needed anything more sophisticated than Jetty, to be honest. Although we have one system at work that has been built directly on Netty via Java interop in two of its incarnations over the years.

seancorfield 2020-07-24T17:34:41.164Z

We ran http-kit in production for a while, but New Relic didn't support it very well so our metrics were sub-optimal. So we switched (back) to Jetty, which we'd originally used but abandoned due to random thread death errors (which got fixed by the time we went back to it).

maleghast 2020-07-24T17:35:58.164900Z

So are you just using Compojure @seancorfield..?

seancorfield 2020-07-24T17:36:33.166400Z

Bidi on one service (built on Jetty). Compojure in everything else, except the one Netty-based service.

maleghast 2020-07-24T17:36:45.167100Z

I mean I think that Yada could be re-tooled to run on Jetty as the server, although a lot of the async stuff would be problematic...

maleghast 2020-07-24T17:37:19.168500Z

Bidi -> Bare Ring Handlers or are you using some other abstraction over Ring?

seancorfield 2020-07-24T17:38:04.170Z

Ring is a perfectly good abstraction IMO. Clean, simple, obvious. And it does have async support (although it's a bit limited, I gather -- we've never used it).

Joe 2020-07-24T17:38:13.170200Z

@maleghast That’s a shame he’s not so into it any more, I was a big fan of Elements. Has he written anywhere about why he moved away from it?

maleghast 2020-07-24T17:38:46.171Z

Yeah, I am absolutely not dissing it, I think that Ring is amazing, I just got used to Yada and the extra bits of convenience and power I got out of it.

maleghast 2020-07-24T17:39:21.172Z

I started building REST APIs in Clojure with Liberator and Yada was a nice middle ground of power and features without being as complex to work with as Liberator

Joe 2020-07-24T17:39:22.172100Z

Clojure I mean, not Aleph

seancorfield 2020-07-24T17:39:59.172900Z

@allaboutthatmace1789 He has talked about, yes. I don't have specific links to his reasons. Part of it was due to his work on tuples being rejected/rewritten by Rich after he (Zach) had put a lot of work into.

maleghast 2020-07-24T17:39:59.173100Z

I could go back to Liberator to get the REST API structure stuff and to be honest there is an attraction in the strictness of that

seancorfield 2020-07-24T17:40:34.173800Z

We're happy enough with Compojure for a REST-like API without all the bells and whistles.

maleghast 2020-07-24T17:41:50.175200Z

I realise it's not a like for like comparison, but I used to build APIs on Rack in Ruby, and that's like rolling one's own just on Ring in Clojure, so it should feel pretty comfortable for me, I really think that I just got spoiled (in a good way, again not a a criticism) with what Yada did for me.

seancorfield 2020-07-24T17:44:29.176100Z

I looked at Yada at one point and it just seemed like too much "magic" going on if I recall...

maleghast 2020-07-24T17:44:32.176300Z

@allaboutthatmace1789 -Yeah the impression I got is that he changed jobs and was upset by the way his work on tuples was treated by the core committers and just decided to pursue other interests. Clearly I don't want to speak for him, and I am sure he'd be prepare to tell you himself. I agree about Elements of Clojure by the way, really great book.

seancorfield 2020-07-24T17:44:43.176700Z

(and maybe that was because it was built on Aleph/Manifold)

seancorfield 2020-07-24T17:47:30.176800Z

Several people who were very active in the early days have left the community (and the language) after disputes about stewardship of the language -- and I must admit, I clashed with Rich and some of the other core committers occasionally in the early days, but I ultimately accepted it's Rich's project and he's going to run it the way he wants and if you're going to contribute, you just have to get on board with that.

seancorfield 2020-07-24T17:50:11.177Z

In a decade of using Clojure, I've had one tiny little patch accepted into Clojure itself, and I've contented myself with maintaining a lot of projects -- some in Contrib, some outside.

maleghast 2020-07-24T17:54:24.179100Z

Yeah, I can see that being the impression for sure - there was a learning curve in adopting it, but the payoff was automatic content-negotiations, good boundary hygiene around what resources could be used for and best of all the whole API was decoupled from the routes / routing.

maleghast 2020-07-24T17:55:16.180100Z

I've gone back and looked at Compojure and I have to admit that there is clearly an argument for a different kind of ease of use there, and let's face it it's very widely used so it's widely understood which is not nothing.

maleghast 2020-07-24T17:57:09.181Z

Overall I am wondering if it's worth worrying about doing anything other than Compojure / Compojure-API

seancorfield 2020-07-24T17:58:26.181900Z

If I needed the whole content negotiation thing and/or auto-generated API docs, I'd look at a more sophisticated library that handled that stuff.

seancorfield 2020-07-24T17:59:49.182700Z

But I really do like simplicity in libraries and I'd prefer to compose several small, independent things if I could, rather than adopt something all-purpose.

maleghast 2020-07-24T18:02:05.183600Z

nods

samoleary 2020-07-24T18:03:06.184400Z

I haven't used this library myself but I saw a great demo of it at clojure north last month https://github.com/metosin/reitit https://github.com/markbastian/clojure-north-2020/blob/master/src/clojure_north_2020/ch03_web/x04_reitit.clj

maleghast 2020-07-24T18:03:22.185200Z

I am eyeing up reitit from metosin as an altgernative to Yada and Bidi, in that it has a bidirectional routing approach like Bidi

maleghast 2020-07-24T18:03:33.185500Z

@ssjoleary746 - LoL!

samoleary 2020-07-24T18:03:41.185800Z

Ha!

samoleary 2020-07-24T18:03:43.186Z

Jinx!

maleghast 2020-07-24T18:03:49.186200Z

Indeed

maleghast 2020-07-24T18:05:35.186600Z

Thanks for the presentation link I am going to go check that out...

πŸ‘ 1
maleghast 2020-07-24T18:13:31.186800Z

Yeah, I've never had the time or the chops (frankly) to get to a place where I was looking to try and contribute, so it's not touched my life... I am genuinely thankful that smarter people than me are there making Clojure the wonderful day to day professional programming experience. If i ever decided I didn't like it any more there are plenty of other languages I might consider, but the way that the project is run is not a factor in my feelings on the matter πŸ™‚

dharrigan 2020-07-24T20:04:59.187100Z

I use reitit

dharrigan 2020-07-24T20:05:04.187300Z

works very well

dominicm 2020-07-24T21:16:27.187400Z

I think yada works under java 11 as is on the latest alpha (Which is stable and should be cut as a release)

dominicm 2020-07-24T21:17:23.188700Z

Yada handles a lot of http that ring doesn't. Or rather, ring is an abstraction over the http protocol, and yada is a proper implementation of http specs.

dominicm 2020-07-24T21:18:51.191100Z

You should not be choosy about implementing specs. You should attempt to be comprehensive. Ring forces the developer to take care of all of that themselves. I think that's okay, but ring is too low level to be working at regularly. "Need" of compliance is a funny one, because your clients (not you) care about you being compliant.

seancorfield 2020-07-24T21:24:35.193Z

It's probably also worth pointing out that browsers, proxies, and CDNs can all conspire to break HTTP requests that are not just GET/`POST`/`HEAD`/`OPTIONS` -- so PUT/`PATCH`/`DELETE` cannot be assumed to work universally, which means the HTTP spec is not as useful as some people think πŸ™‚

seancorfield 2020-07-24T21:26:02.194Z

(updated to say "CDNs" instead of "load balancers" now that I've remembered it was CloudFront that caused us some pain there, not the F5 Big-IP πŸ™‚ )

dominicm 2020-07-24T21:26:58.195300Z

Broken proxies break http? Shocker :)

seancorfield 2020-07-24T21:27:03.195500Z

(and, no, I no longer remain exactly what that pain was, but it was enough of a problem that we quickly abandoned put/patch/delete as universally viable HTTP verbs)

dominicm 2020-07-24T21:27:32.196700Z

CDNs don't make sense on that list really. You don't control those, and you can't make those kinds of requests to them.

seancorfield 2020-07-24T21:27:59.197800Z

Our customer base is global, many in Africa and the Middle East, so strange browsers/devices and nasty proxies are bread and butter for us, unfortunately.

dominicm 2020-07-24T21:28:26.198700Z

Browsers work fine with all the methods afaik anyway. Never heard otherwise. There's limits to the methods available in forms, but there's other details behind that.

dominicm 2020-07-24T21:28:51.199600Z

Maybe partially implemented browsers on old devices or something?

dominicm 2020-07-24T21:29:02.200Z

As in, pre-smartphone

seancorfield 2020-07-24T21:29:15.200200Z

I can't remember exactly how the CDN played into the equation now. But it was a contributing factor.

dominicm 2020-07-24T21:31:45.202500Z

Content negotiation is still valuable regardless. Having language automatically managed correctly according to browser headers is a win. Same for things like encodings for reducing bandwidth use.

dominicm 2020-07-24T21:34:23.203600Z

Or setting vary headers, so caching proxies behave correctly.

seancorfield 2020-07-24T21:34:57.204200Z

(we are somewhat "saved" by having our REST-ish API only called by our own React.js SPA -- if we had a public REST API, I would want more HTTP compliance)

dominicm 2020-07-24T21:36:04.205600Z

I think the web is missing a high level http client that assumes things like caching are implemented, and allows you to skip a bunch of steps even for internal applications.

dominicm 2020-07-24T21:36:45.206600Z

Eg knowing that 400 means client error, and handling the form appropriately

seancorfield 2020-07-24T21:37:35.207500Z

Yeah, given what we try to do on the web these days, it often feels like we're shoehorning a lot of stuff into what was originally a very simple text-based protocol 😐

dominicm 2020-07-24T21:42:26.208300Z

I think the goal was always accretion. A surprising amount of stuff is in the early specs. Including caching and proxy headers.

πŸ‘ 2