Fork me on GitHub
#clojure-uk
<
2020-01-07
>
dharrigan05:01:02

Good Morning!

seancorfield06:01:26

Ugh! That's a bit early @dharrigan!

dharrigan06:01:01

I'm a light sleeper. Been up longer.

dharrigan06:01:24

I enjoy this time, since it's peaceful 🙂

dominicm07:01:40

Until I wake up that is 😉

yogidevbear08:01:12

Morning everyone 🙂

thomas08:01:49

morning, I still run JDK8.

thomas08:01:41

not the oracle variant. I tried the OpenJDK J9 version but that wasn't compatible with Jira and/or Confluence.

guy09:01:22

morning 👋

rickmoynihan10:01:19

We’re still on JDK 8 in production, but have been running JDK 8 and 11 in dev for a while… We have an active branch which has ported stuff to use adopt openjdk11. Our app could technically switch over today; but our database still requires JDK 8; though they’re supposedly going to support 11 in the next release which I believe is due to be released this quarter. The DB not being on 8 is the main reason we’ve not switched yet; as it’ll require provisioning two different base images for our servers which isn’t really a big deal; it would just be wasted effort. Also we have a backend service which I’ve run in dev on 11 but it hasn’t been tested in CI on 11 yet… I don’t expect any issues there, but would like to either matrix build it on 8 and 11 or solely 11; before we switch prod over.

folcon13:01:48

Morn’ using openjdk 8 ourselves…

otfrom14:01:03

openjdk8 here too. Should move over to 11

Wes Hall14:01:07

The JDK upgrade path has been annoying as hell recently. "We'll just remove packages that have been in the standard library for 15 years that everybody is using. What could go wrong?".

Wes Hall14:01:37

I like to be on the very lastest JDK I can because the GC improvements tend to be pretty significant, but Oracle, it must be said, are less conscientious stewards than Sun were, and, having recently explored their cloud product, this doesn't seem to be a culture problem constrained only to the JDK.

otfrom14:01:58

they were sun.* packages which have always been labelled as "do not use" unless there are some others

Wes Hall14:01:52

@otfrom I am thinking about some XML stuff that was a problem, but I don't have the details to mind right now. Definitely not sun.* though.

Wes Hall14:01:59

You can do some stuff with flags here but we ended up in a right old mess with some of them. If you want to be able to run against different JDKs, then you need flags on the new ones to include stuff that has been removed, but then the old one complains that it doesn't understand the flag, so you need another flag to tell it to ignore flags it doesn't understand.

Ben Hammond16:01:04

I found myself adding this extra alias into deps.edn

: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"}
                 {:mvn/version "2.3.1"}
                javax.xml.bind/jaxb-api {:mvn/version "2.3.0"}
                javax.activation/activation {:mvn/version "1.1.1"}}}
to pull in the missing xml binds

Ben Hammond16:01:17

not much help if you are not using deps though

Wes Hall16:01:09

@ben.hammond I hadn't thought of this as a solution. We used some JVM flag, but I like this approach. Seems like a cleaner solution. Thanks.

😁 4
dharrigan14:01:04

I think the JDK has really improved

dharrigan14:01:26

Yes, there was a bit of pain moving from 8 to 11, but it had many many many months of forewarning and upgrade paths

dharrigan14:01:52

The result is the ability now to have a leaner, meaner JVM, with less bloat and a far far better cadenance in release cycles

dharrigan14:01:03

something that I believe has reinvigorated the platform

dharrigan14:01:59

We found very little problems moving from 8 to 11 on our platform, and we have quite a number of µservices.

Wes Hall14:01:46

@dharrigan I am possibly a bit spoilt honestly. I've been working with the JVM since 99, and Java 1.1. Relative to many other popular platforms (cough nodejs cough), the JVM upgrade paths, even today tend to be pretty painless, but back in the day Sun were famously fastidious about backwards compatibility. This did mean that apis tended to be slight "accretive", but isn't that what we are being told to do by our lord and saviour (prase be to Hickey). It's not that it's impossible to go through the process, but I do wonder how many people are running on older JVMs because they tried to run on a recent one and saw it crap out horribly. This really never used to be a "thing" in Java land. You'd have new stuff when you upgraded, but you could bet the farm that the old stuff would work without having to go diving through obscure docs to find the flags you need (or, if you are later to the party, stackoverflow).

Wes Hall14:01:35

Now would probably be a good time for an "OK Boomer" gif 😉

jasonbell14:01:56

You’ve said it, you may as well do it. 🙂

😂 4
Wes Hall14:01:51

I'd also add that I can't remember ever seeing, "Doesn't work on <insert latest JDK version here>", bugs in github or equivalent until around version 8. Now they seem to appear everywhere on every beta release.

dharrigan15:01:57

What's ok boomer?

Wes Hall15:01:46

@dharrigan Do you even internet bro? 😉

dharrigan15:01:11

I can't keep up with all the young'uns thesedays

3Jane15:01:26

(is (= "ok boomer" (reverse "things millenials are killing")))

😂 12
minimal15:01:54

if you have to ask…

3Jane15:01:23

i remember encountering a tweet from a gen X-er whose feelings were hurt b/c his kid ok boomer'd him

otfrom16:01:18

I at least know that when the Millenials start their anti-boomer pogroms that being a gen-xer won't help me as people don't think we exist (forgotten again, whatever). At least I'll know that someone has carried on the hatred of boomers as I get executed.

3Jane17:01:27

counting by years I'm one of the very early millenials, but eastern europe was years behind the west and i feel like i missed out on my avocado toasts

3Jane17:01:56

at least in london they sell cronuts

otfrom18:01:24

I can blame you then. Boomers give us Trump. Millennials give us Zuckerberg

3Jane12:01:17

Guilty :[

3Jane15:01:54

"why don't you come up to those girls and talk to them?" "maybe it worked for you in the 50s dad, but we don't do human interaction like that these days"

Wes Hall15:01:13

@lady3janepl My wife's cousin was complaining about exactly this. Every time he asks his kids to do something they respond with, "OK Boomer". I laughed more than I should have.

Wes Hall15:01:04

By the way folks, since I am already here shatting chit... If anybody is interested, I am doing a thing...

Wes Hall15:01:40

I am not that interesting really, but if anybody from here does come, and mentions you are a #clojure-uk person, i'll buy you a drink after.

Wes Hall15:01:45

Also, the other guys are nice 😉

dharrigan15:01:51

Are you the one holding the pencil/pen/arm-about-to-drop-off or the one smiling blankly at what I think is a MBP?

Wes Hall15:01:50

@dharrigan Weirdly, I think that is a stock image. I don't do the promotions as you can probably tell from my lukewarm description above 😉

Wes Hall15:01:27

In any case, the four of us did one of these before (we have a kind of Pythonesque troop going), and it was fun. Very Q&A and lots of discussion about things like building startups, funding challenges, and being responsible as a "buck stops with me" technical strategist. I get the feeling that most people here are pretty experienced anyway, but if you do find any of these things interesting, come and see the show 🙂

seancorfield15:01:40

One of the annoyances about upgrading from JDK8 for us was the complete change of GC logging in 9. It wouldn't even startup with the GC logging options we've had in place for years. Like Wes said, hard to have a set of options that works across both 8 and 11

Ben Hammond17:01:20

I need to access the file seperator; is it idiomatic to just use .File/seperator ? Is there a clojurier way to do it?

jasonbell17:01:10

Not that I’m aware of.

👍 4
rickmoynihan17:01:10

That’s idiomatic

👍 4
Wes Hall17:01:26

I have this vague, wishy-washy memory of some file IO apis accepting forward slash separators even on windows in order to avoid having to do weird interpolation with a separator constant like this, but I don't know if I just dreamt of this amazing utopia.

Wes Hall17:01:36

I think a lot of the Java APIs now at least let you specify the path segments as a vararg style thing so you don't have to muck about.

rickmoynihan17:01:31

Yeah that’s a good point there is java.nio.file.Path and libraries like datoteka that wrap it from clojure, though I had some minor grumbles with datoteka. Also ( "foo" "bar" "baz") which will give you a .File back and can construct the path in platform dependent way with varargs, and it ships with clojure core, but if for some reason you need the separator itself use the above.

rickmoynihan17:01:47

Personally I’d opt for unless you need nio, or are working with the java FileSystem abstraction.

rickmoynihan17:01:54

datoteka’s lack of support for the FileSystem abstraction is my main grievance with it. It always creates java.nio.file.Path s in the local (default) file system. Which seems to make moot the main reason for wanting Path’s rather than File’s.

Ben Hammond18:01:27

its for something a bit mucky like

(defn fileshortname
  "returns only the last section of the filename"
  [f]
  (if (instance? File f)
    (.getName ^File f)
    (let [s (str f)]
      (if-let [idx (string/last-index-of s File/separator)]
        (subs s (inc idx))
        s))))

Ben Hammond18:01:38

so I'm parsing rather than generating

Wes Hall19:01:23

@ben.hammond According to "Learning Java, 4th edition", I did not dream my utopia, and the the File constructor does accept paths with both forward slashes and backslashes on Windows (though only forward slashes on other platforms). In any case it shouldn't matter in your example here because you are implicitly assuming that the path you are parsing was generated on the platform that is doing the parsing (by using File/seperator). With this in mind, why not just call ".getName", if it's a file, and if it's a string, construct a file from the string and then call .getName. (.getName (File. (str f))) is maybe a little clearer than all of the string parsing stuff. I haven't tested it, but I can't think why it wouldn't work.

Ben Hammond20:01:28

ha! I've been overthinking it all this time! nice thanks!