Fork me on GitHub
#clojure
<
2018-11-14
>
lispyclouds07:11:10

Hello all, Im building a docker client for Clojure at https://github.com/lispyclouds/clj-docker-client which wraps around https://github.com/spotify/docker-client which is in Java and isnt exactly Clojure friendly. I have published it to clojars with lein deploy clojars and it works fine in the leiningen repl/project if I add [lispyclouds/clj-docker-client "0.1.4"] to my project.clj. But when I tried with the Clojure CLI by adding lispyclouds/clj-docker-client {:mvn/version "0.1.4"} to deps.edn i get the exception:

user=> (require '[clj-docker-client.core :as docker])
nil
user=> (def conn (docker/connect))
#'user/conn
user=> (docker/image-ls conn)
ClassNotFoundException com.kenai.jffi.Type  jdk.internal.loader.BuiltinClassLoader.loadClass (BuiltinClassLoader.java:583)
which is a dependency of the spotify lib. This however works if i add the uberjar via local/root in deps.edn. What am I doing wrong here? Any help is much appreciated! 😄

qrthey11:11:49

To follow up on my previous question about sets, the following minimal example shows the core problem, which is that = isn't commutative for the involved types, as the host platform dictates this.

(let [x (java.util.Date.)
      y (java.sql.Timestamp. (.getTime x))]
    (= (= x y)
       (= y x)))

;; => false

bronsa12:11:09

that has nothing to do with clojure's equality

bronsa12:11:21

(let [x (java.util.Date.)
      y (java.sql.Timestamp. (.getTime x))]
   [(.equals x y) (.equals y x)])
;; => [true false]

qrthey12:11:55

Exactly, as I wrote, the host platform dictates this.

bronsa12:11:40

sorry, I interpreted that as "the host platform dictating equality to be commutative" :)

dpsutton12:11:40

(this is the reflexive property by the way)

qrthey13:11:20

@bronsa, my formulation was probably wrong, @andy.fingerhut wrote lots of examples of this in a reply thread on my first post (https://clojurians.slack.com/archives/C03S1KBA2/p1542102262019000).

martinklepsch13:11:58

Does anyone know of Clojure artifacts on Maven Central besides the stuff under org.clojure?

andy.fingerhut15:11:13

I think commutative is the correct word here. Reflexive for = would mean "is it always true that a thing is equal to itself?" Clojure = is reflexive most of the time except for the weird value ##NaN, and for any Java objects that are not reflexive for the .equals method (I don't know which objects might be non-reflexive that way, if any).

dpsutton16:11:40

ah yes. it is the symmetric property that a=b -> b=a. had my term wrong

Alex Miller (Clojure team)17:11:28

I ran the Clojure build with it and everything passed

💯 8
✔️ 12
🎉 8
andy.fingerhut17:11:55

Amazon is not the first company on my mental list of companies that might do such a thing, but it certainly makes sense for them to do.

Alex Miller (Clojure team)17:11:17

they’re not the only ones - Red Hat is doing it as well, and the AdoptOpenJDK too

Alex Miller (Clojure team)17:11:03

I’m a little unclear whether Oracle’s goal was to a) make money, b) stop doing old version maintenance, or both. They may be succeeding spectacularly with b and completely failing at a.

Alex Miller (Clojure team)17:11:59

tbh, I’m pretty happy they’ve driven multiple industry players to commit the resources to make good free versions with support

💯 20
ghadi17:11:42

No support, but if you're looking for builds only, Alexey Shipilev has a nice build server

ghadi17:11:26

has ARM builds there, too, if you like running JDK 12 on a raspberry pi

💪 8
ghadi17:11:26

I wonder what the relation is between Corretto and the AWS Lambda runtime

dominicm17:11:33

@alexmiller what is getting you excited about Corretto exactly? I looked at it and wasn't particularly bothered.

dominicm17:11:44

I'm hoping I've missed something 😄

noisesmith17:11:16

it means there's someone supporting 1.8, many clojure libraries don't work well with versions after 1.8

ghadi17:11:51

@dominicm it is committed support

ghadi17:11:56

that's super exciting 🙂

ghadi17:11:11

it's still openJDK

ghadi17:11:23

which will include all the good stuff like Flight Recorder, etc.

dominicm17:11:24

Sure. I know. But there are plenty of others offering this too, like Zulu?

noisesmith17:11:23

are zulu committed to support 1.8?

dominicm17:11:24

Is Amazon's support better than the other's support?

ghadi17:11:15

we need a table 🙂

Alex Miller (Clojure team)17:11:45

I’m just happy to have a range of free choices from multiple vendors

💯 4
dominicm17:11:23

https://www.azul.com/last-free-java-8-download/ Seems so: > We support Java SE 8, as well as Java 6, 7, 9 and 10. And with Azul, you not only get bug fixes and timely security updates, you also get access to our award-winning Support team.

ghadi17:11:37

yes. From what I can tell, Amazon's Corretto's LTS support is free, Zulu's is paid.

dominicm17:11:48

@ghadi Can we start a Rich Hickey Magic 8 ball kickstarter?

ghadi17:11:51

The quality of that support probably differs too

👍 4
dominicm17:11:03

Having said that, I've never felt like I needed support. I understand enterprises will ask for it no matter what. Has anyone ever wished they'd had support (using clojure on the JVM?)

Alex Miller (Clojure team)17:11:15

you are constantly benefitting from support

Alex Miller (Clojure team)17:11:27

by getting security fixes

dominicm17:11:53

I think that support is free with Zulu.

Alex Miller (Clojure team)17:11:02

you’re not aware of it because you’re not constantly being hacked and ddos’ed in your jvm web app

Alex Miller (Clojure team)17:11:49

no joke intended - this is really important and we (the greater JDK community) have taken it for granted for a long time

👍 12
dominicm17:11:20

@alexmiller I think this is good to highlight.

Alex Miller (Clojure team)17:11:26

and a lot of industry players have really been free riders

andy.fingerhut17:11:45

I take this as an example of why it is so difficult to sell computer security products (or security in general) -- if you do well, nothing seems to happen.

Alex Miller (Clojure team)17:11:49

reaping the benefits but not paying for people to do the work

Alex Miller (Clojure team)17:11:06

(which is not to say these companies don’t have people helping)

Alex Miller (Clojure team)17:11:19

but Sun then Oracle have borne the bulk of that

Alex Miller (Clojure team)17:11:27

I’m happy to see it spread around some

Alex Miller (Clojure team)17:11:35

because then everyone has skin in this game

Alex Miller (Clojure team)17:11:52

that’s great for the future of the jvm

dominicm17:11:55

So less about the "phone support" and more about maintenance of the JDK code?

dominicm17:11:14

Support seems overloaded even in this discussion.

noisesmith17:11:39

it's overloaded in practice: if you are supporting a software project, that can mean committed maintenance and software fixes (engineering work) or help desk / consultation / trouble shooting

noisesmith17:11:53

usually it means some amount of each

dominicm17:11:25

That's true, yeah.

Alex Miller (Clojure team)17:11:10

yeah, I am being vague. having many players that maintain the jvm/jdk is a good thing. having multiple players with paid support options is also good though (as enterprises want this kind of thing).

Alex Miller (Clojure team)17:11:06

fyi, we offer paid Clojure support at Cognitect

Alex Miller (Clojure team)17:11:44

some companies find this to be an essential thing

johnj18:11:40

same for postgres, with the "database freedom" amazon has been pushing

dominicm18:11:13

@alexmiller you've worked yourself out of a job by making it possible to always upgrade Clojure without breaking changes 😊

andy.fingerhut18:11:56

How has that worked him out of a job?

andy.fingerhut18:11:59

New features in next version!

andy.fingerhut18:11:54

Or rather, the breaking changes are limited to name conflicts with the new functions added in the next version of Clojure 🙂

dominicm18:11:47

Well, he gets to do cool things like write tools.deps. I'm trying to say support is probably less useful to companies as upgrades are always safe.

andy.fingerhut18:11:02

I'd bet Cognitect customers that pay for commercial Clojure support get to leave out those question for the most part (happily) and move on to more interesting productive questions: how best to use the language for my project X? (I'm not a paying Cognitect client, nor have I been involved in any such discussions.)

andy.fingerhut18:11:52

Dealing with breakage is only a time sink -- it doesn't move anyone forward.

dominicm18:11:00

If you get that under the support umbrella, then that's more interesting. I once again underestimate it!

Alex Miller (Clojure team)18:11:58

Cognitect provides a range of architecture advice, consulting, support, etc - it’s pretty customized to what someone needs

didibus18:11:01

To be honest, Java is now more appealing then ever. First off, it is one of the more polyglot platform. You can use it for Python, Ruby, Clojure, Kotlin, Scala, Eta, Groovy, Fantom, Java, etc. And now, it has multiple legitimate builds such as AdoptOpenJDK, Oracle OpenJDK, Azul Zulu OpenJDK, this Amazon Coretto OpenJDK, red hat has one don't know the name, etc. On top of that, it is starting to even expand in alternate VMs. You now have HotSpot, OpenJ9, Graal, Substrate, and Exelcsior Jet. And Oracle has been making pretty good work innovating on the platform. Once modules take off further, you'll be able to package a minimal JVM along your app for example. And let's not forget it is currently the fastest known VM of its sort. Now if only there was a memory optimised variant.

ghadi18:11:54

the community wants it to be so bad, but it isn't

benzap19:11:55

I'm pretty excited for GraalVM, just wish you could set build targets for native-image. I hope that lands in the next few years.

jaawerth19:11:20

GraalVM does seem like it has potential to be a huge (and awesome) gamechanger.. even if their polyglot data-sharing memory maps seem like sorcery 😉