Fork me on GitHub
#clojure-uk
<
2018-08-01
>
guy06:08:16

morning!

alexlynham07:08:10

morning morning

danm12:08:43

elloelloello :male-police-officer::skin-tone-2:

yogidevbear13:08:25

What's news in the world of #clojure-uk?

alexlynham14:08:38

still serverless-ing

rhinocratic14:08:04

Wrote a library that might be useful to one other person in the World. :thinking_face: I found a paper from 1977 that describes an error-correcting code for alphanumeric data (corrects a single transcription error or a transposition of 2 adjacent characters), and implemented it in Clojure "for fun". Needs some more tests, but it's nearly there!

mccraigmccraig14:08:32

still wanting to not use clojure, but not having any sane alternative 😬

rhinocratic14:08:14

Which insane alternatives have you tried? 😁

alexlynham14:08:32

@mccraigmccraig we'll have no anti-clojure treason here brother

rhinocratic14:08:19

Clexit means Clexit. :face_with_rolling_eyes:

😂 4
mccraigmccraig14:08:24

@rhinocratic well there is haskell, but i need something that runs on a jvm, and running on js would sure be nice... then there's lux, and while that looks awesome ( @bronsa's syntax-hate aside) for the future it's still not quite there yet... other than that i'm drawing blanks

😛 4
otfrom14:08:28

typed racket ftw (I'm sure someone has written a transpiler somewhere and you can get clojure style literals and other things too)

rhinocratic14:08:12

@mccraigmccraig Afraid I can't think of anything that satisfies those constraints. I also looked at lux and came to the same conclusion - but it looks as though it's worth watching.

dominicm14:08:04

@otfrom transpiler? racket supports custom languages.

firthh14:08:06

This might be surprising but F# is the language I want to learn next, it looks like all of the niceness of Haskell’s type system without the strictness. I’ve been reading this - https://www.amazon.co.uk/Domain-Modeling-Made-Functional-Domain-Driven/dp/1680502549/ and really enjoying it

mccraigmccraig14:08:30

(and i now have ~100kloc in clojure too, so i'm probably not going anywhere else soon)

mccraigmccraig14:08:10

@firthh isn't haskell's strictness a big part of the niceness ?

jasonbell14:08:12

@firthh I can give you the number of my psychiatrist if you want....

firthh14:08:15

Possibly. I never reached the point in Haskell where I felt productive doing anything that needed IO. Basic toy programs that you could avoid it were nice. Maybe I just need to power through that stage

yogidevbear16:08:29

@alex.lynham I see you're sharing your serverless findings in September

alexlynham16:08:03

didn't realise that was public yet

alexlynham16:08:52

yes the stuff I've been doing in cljs is how to use serverless with cljs to do a compojure/like backend that you can then build a re-frame app on top

alexlynham16:08:23

and at work it's been all python and stuff, but I've found myself pinching lots of clojure ideas to make it less icky

alexlynham16:08:06

honestly if they ever solve the cold start thing for JVM on lambda then clojure is going to destroy for this stuff

mccraigmccraig16:08:34

what dyu want from clj || jvm that you don't get from cljs @alex.lynham ?

alexlynham16:08:09

I don't want promises and I don't need async

alexlynham16:08:19

I want imperative code

alexlynham16:08:36

I've found that cljs sometimes wrongfoots me with what it returns from an fn and I don't like it. Clojure for me is all about the fewest surprises :)

alexlynham16:08:23

But that said, I'm using it, I don't mind it, s'all good :)

mccraigmccraig16:08:59

@alex.lynham what are you using to compose ops with promises ?

alexlynham17:08:05

Ooh good question

alexlynham17:08:19

I can't remember without looking at the code

alexlynham17:08:30

Do you have some recommends?

mccraigmccraig17:08:57

ha, yeah - most of our code in both clj and cljs is promise-based and reads (mostly) like imperative code. we use a promise-monad from the funcool/cats lib to achieve this

mccraigmccraig17:08:18

i've got lots of code if you are interested

alexlynham17:08:05

Oh yeah, that would be awesome!

alexlynham17:08:29

Atm my cljs is very 'clj translated into cljs' and there's a few instances where I'm sure there are more idiomatic things. Like 80% of my clojure experience is the jvm one so it's an area where I'm always up for learning more :)

mccraigmccraig17:08:57

here's an example from our clj cassandra client - it's using an LWT to acquire a unique key. it's a multi-stage process with each i/o op returning a promise (well, a manifold Deferred, but samesame) - https://github.com/employeerepublic/er-cassandra/blob/master/src/er_cassandra/model/alia/unique_key.clj#L54

mccraigmccraig17:08:22

this is clj, but it works exactly the same with js promises in cljs

mccraigmccraig17:08:46

and it works exactly the same with js promises if you use the promesa implementation of the monad - https://github.com/funcool/cats/blob/master/src/cats/labs/promise.cljc