clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
javahippie 2020-10-12T07:10:21.354800Z

:spock-hand:

plexus 2020-10-12T07:11:46.355200Z

good monday! (if there is such a thing)

plexus 2020-10-12T07:12:01.355400Z

going to need a lot more tea for this one

2020-10-12T07:32:52.355600Z

Morning

2020-10-12T07:33:06.356Z

Pretty sure today is a post lunch coffee day

2020-10-12T07:33:21.356400Z

@javahippie peace and long life

plexus 2020-10-12T07:33:58.356600Z

https://twitter.com/aycabs/status/1315229327076683778

😄 1
borkdude 2020-10-12T07:44:47.357100Z

morning

dharrigan 2020-10-12T08:05:18.357300Z

Good Morning!

thomas 2020-10-12T08:20:32.357500Z

morning

dominicm 2020-10-12T08:39:41.358200Z

Morning. I meant to say it already, but I was busy dropping a table.

2020-10-12T09:01:09.358600Z

@dominicm always difficult to remember pleasantries when flushed with so much adrenaline

2020-10-12T09:01:26.358900Z

but at least you know you are alive (until the client finds out anyway)

2020-10-12T09:01:37.359100Z

can you drop tables in crux?

dominicm 2020-10-12T09:19:36.360400Z

I'm not using crux, I don't work for JUXT anymore @otfrom

2020-10-12T09:32:34.360700Z

ah, my bad

2020-10-12T09:32:51.361200Z

so just good old fashioned RDBMS table dropping this morning?

borkdude 2020-10-12T09:42:46.361500Z

drop table datomic_kvs

javahippie 2020-10-12T09:43:20.362Z

You could also drop furniture

😂 1
raymcdermott 2020-10-12T10:28:53.362300Z

morning

raymcdermott 2020-10-12T10:31:05.362800Z

@dominicm people outside of JUXT are also allowed to use Crux IIRC

raymcdermott 2020-10-12T10:32:09.363600Z

@otfrom tables don't exist in CRUX, only as a fiction when using SQL for querying data

raymcdermott 2020-10-12T10:36:00.364200Z

cloud servicing the sky today

slipset 2020-10-12T10:53:03.364600Z

Morning.

slipset 2020-10-12T10:54:11.365900Z

I seem to remember a library used for testing web-apps built on compojure, but my google-fu is not strong enough today. I also seem to connect this library with someone working at JUXT, Anyone know what lib I'm looking for?

slipset 2020-10-12T10:54:50.366600Z

I could of course just state my problem. I'd like to be able to pull all the routes out of a compojure route-definition, if that makes sense.

plexus 2020-10-12T10:57:20.367700Z

not sure if that's possible @slipset, short of parsing the source yourself. AFAIK compojure works by composing closures, they're opaque functions

slipset 2020-10-12T10:58:28.368500Z

Yes, there would be some trickery involved in doing so.

borkdude 2020-10-12T11:01:30.369Z

It would be nice if those closures carried some metadata about the routes maybe?

borkdude 2020-10-12T11:02:04.369400Z

Other solution could be wrapping compojure macros and extracting the routes yourself before it goes into compojure

slipset 2020-10-12T11:07:14.371700Z

In other news. Spent the weekend refactoring some rather opaque Clojure code. One could argue that that job would have been easier if I were working in a statically typed language. One could also question the ability to cleanly type this code and still end up in the same mess. I guess what I'm saying is that the types written for for the code as it were would have been as messy/opaque as the untyped code was.

slipset 2020-10-12T11:08:42.373Z

An argument that I could accept is that given a statically typed language you wouldn't write as messy code, as your types would indicate that your code is messy, but then again, you didn't need types to figure that out.

raymcdermott 2020-10-12T11:10:20.373900Z

@slipset not sure what point you're really circling here but it's true that you can write messy code in any language

raymcdermott 2020-10-12T11:11:12.374600Z

also messy might be OK in some situations, like a code spike but not for the long term

raymcdermott 2020-10-12T11:12:01.375700Z

when I write messy code it's a sign that I don't understand the problem or that I haven't yet found the correct abstraction

raymcdermott 2020-10-12T11:13:01.376600Z

which is to say that a lack of some knowledge contributes to the mess

raymcdermott 2020-10-12T11:13:37.377200Z

but it also feels to me that you can see it more clearly in Clojure than most languages

raymcdermott 2020-10-12T11:14:06.377600Z

mess is like art, you know it when you see it 🙂

borkdude 2020-10-12T11:14:47.378Z

Clojure keeps you ignorant of the mess for longer as well and ignorance is bliss :)

slipset 2020-10-12T11:16:18.379200Z

I guess what I'm circling around is that it would have been easier to do this refactoring if I understood the data being passed around. This understanding would have been easier to come by if the code had been typed.

slipset 2020-10-12T11:17:05.380Z

But then I would argue that the types that would have made this stuff even compile would probably have been so obscure that any insights would have been lost.

slipset 2020-10-12T11:18:09.381100Z

So I'm basically arguing for and against static typing, and handwaving my way to figuring out that static typing wouldn't have helped even though it seems like it would have on the surface

borkdude 2020-10-12T11:18:58.381600Z

thus creating peace of mind for current practices, which is an evolutionary mechanism to preserve energy :troll:

2
dominicm 2020-10-12T11:23:37.382200Z

Only if there wasn't already a database in use 😢 I do hate having a schema for the work I do. Makes everything harder.

🤓 1
dominicm 2020-10-12T11:26:34.384500Z

I think messy code that you actually have to maintain benefits from documentation of some kind. If you're just trying to incrementally modify that code, then types are extra due to the refactoring capabilities they provide. But if someone spent time writing types, why didn't they instead choose to simplify and/or document!

slipset 2020-10-12T11:34:14.385300Z

I guess because typing (or spec'ing) it doesn't break the existing code. My refactoring will have bugs in it.

slipset 2020-10-12T11:34:36.385600Z

But if you want an omelette...

borkdude 2020-10-12T11:34:52.386100Z

I find tests the most helpful thing here

slipset 2020-10-12T11:35:01.386300Z

If only...

borkdude 2020-10-12T11:35:50.386500Z

never too late to write one ;)

slipset 2020-10-12T11:36:06.386800Z

But then you have to understand the code 🙂

borkdude 2020-10-12T11:38:31.387200Z

No, you have to understand the requirements

slipset 2020-10-12T11:39:38.388100Z

true. At this point in time I guess the only requirements are that it works as it always has, Including whatever Hyrum's been up to.

borkdude 2020-10-12T11:40:57.388300Z

All hail Hyrum. https://twitter.com/hyrumwright

borkdude 2020-10-12T11:43:09.388600Z

> Michael Feathers introduced a definition of legacy code as code without tests,

borkdude 2020-10-12T11:43:32.388800Z

https://en.wikipedia.org/wiki/Legacy_code

borkdude 2020-10-12T11:43:46.389200Z

I have that book, but I never read it.

slipset 2020-10-12T11:47:07.389600Z

Not sure if I still have it or if I gave it away. But I have read it.

ordnungswidrig 2020-10-12T12:10:25.389800Z

Good midday

borkdude 2020-10-12T12:19:18.390Z

Just automatically qualified deps in a large deps.edn file: https://github.com/borkdude/rewrite-edn/blob/master/examples/qualify_deps.clj

jasonbell 2020-10-12T12:22:05.390400Z

Morning

2020-10-12T13:09:10.390600Z

that sound DaaF(t)

dominicm 2020-10-12T13:21:27.391400Z

I think I made a script to do that too, I probably should have shared it :p

2020-10-12T16:06:17.393500Z

🥕 🥕

2020-10-12T16:06:24.393800Z

(wot? no purple carrot?)

2020-10-12T16:30:45.394900Z

hmm... apache commons BZip2CompressorInputStream seems unusably slow for a file that inflates to 459MB

2020-10-12T16:30:48.395100Z

that is a pity

borkdude 2020-10-12T16:39:53.395500Z

maybe shell out to bzip2?

borkdude 2020-10-12T16:40:56.395900Z

I'm reading on wikipedia that bzip2 has better compression at the cost of speed and memory usage

2020-10-12T18:49:33.396900Z

I'm actually wondering about nippy as it will really only be consumed by clojure

2020-10-12T18:53:47.397400Z

But shelling out is a possibility too

borkdude 2020-10-12T19:03:44.397900Z

it would be worthwhile to measure the shelled out time against the Java time. Chances are bzip2 is just slow in general?

2020-10-12T20:20:57.399200Z

Bzip2 command line is noticeably faster

borkdude 2020-10-12T20:25:14.399500Z

@otfrom why not just use gzip though?

borkdude 2020-10-12T20:26:17.400300Z

I have a function in my current buffer for un-gzipping natively in Java without deps:

(defn un-tgz [^java.io.File zip-file ^java.io.File destination-dir verbose?]
  (when verbose? (warn "Unzipping" (.getPath zip-file) "to" (.getPath destination-dir)))
  (let [tmp-file (java.io.File/createTempFile "glam" ".tar")
        output-path (.toPath tmp-file)]
    (with-open
      [fis (Files/newInputStream (.toPath zip-file) (into-array java.nio.file.OpenOption []))
       zis (java.util.zip.GZIPInputStream. fis)]
      (Files/copy ^java.io.InputStream zis
                  output-path
                  ^"[Ljava.nio.file.CopyOption;"
                  (into-array
                   [java.nio.file.StandardCopyOption/REPLACE_EXISTING])))
    (sh "tar" "xf" (.getPath tmp-file) "--directory" (.getPath destination-dir))
    (.delete tmp-file)))
(note: I untar at the end, for this I shell out, this is only necessary when dealing with multiple files)

2020-10-12T21:40:05.401500Z

That would work. I think when the bzip2 didn't work I wondered why I was round tripping to csv