Fork me on GitHub
#clojure-uk
<
2018-05-22
>
korny08:05:37

(trying to re-lurk here as I’m rolling off my non-clojure client, so 🤞 maybe I could be back in the real world next? Probably not, but at least I’m tinkering with some clojure code again)

🤞 8
otfrom08:05:58

@korny you are welcome regardless of your current clojure hacking activities. 🙂

yogidevbear08:05:43

Morning everyone

korny09:05:03

@otfrom thanks 🙂 I mainly stopped wandering by because it just depressed me! Though I have found that es6 is at least a slightly palatable language, at least you get destructuring and immutable.js and easy lambdas

mccraigmccraig09:05:35

#{:easy-lambdas :persistent-data-structures :decent-macros :hm-or-similar-type-checking :no-global-namespace :pattern-matching} are my ideal foundational lang features @korny... ur getting 3.5/6 with es6 (destructuring counting for half a pattern-matching point) which is not awful... clojure scoring 4.5/6 (i can't bring myself to use core.match, so i'm not giving a full point) feels considerably better... i can only dream of what a 6/6 lang would be like

Rachel Westmacott09:05:20

can you tell me more about why you don’t use core.match? I’ve tried to use it before and failed - I never quite got my head around what I was doing wrong before I decided I was losing more time than I stood to gain from it.

mccraigmccraig09:05:38

i found the syntax awkward, and it may also be that without a type-checker to tell you when you haven't covered all the cases pattern-matching is less useful

korny10:05:53

I’d substitute :optional-hm-or-dependent-or-magic-type-checking - I love type checking where I need it, and only where I need it. I hate it when it gets in my way. Vast amounts of work at $client is mapping JSON to intermediate types, manipulating them, and spitting out more JSON.

4
korny12:05:59

The main thing that really annoys me in Java land is the lack of persistent data structures. It’d be quite easy for Oracle to do this - they could probably steal most of the Scala stuff without pain, and just give persistent vs mutable versions of the main data structures. But instead, they’ve hacked in a mutable alternative to reduce because reduce doesn’t work nicely without persistent structures. https://docs.oracle.com/javase/tutorial/collections/streams/reduction.html#collect

alexlynham09:05:51

morning morning

guy09:05:26

morning!

maleghast10:05:17

Morning All! Unsolicited share of the day 'cos I just had to solve this and I wanted to "write it down" somewhere and then realised that other people might care too... https://gist.github.com/maleghast/eeff990fb9619aed96f81035443a2dc4

maleghast10:05:40

(How to copy a table and all its data from one Database to another under PostgreSQL)

👍 8
maleghast10:05:32

"Vast amounts of work at $client is mapping JSON to intermediate times, manipulating them, and spitting out more JSON." - this does not sound like the FUN TIMES 😞

mccraigmccraig10:05:26

@korny surely if you are dealing with a set of JSON types (rather than some application specific types) that all works nicely with static checking ?

korny10:05:00

If the JSON had a schema, maybe

3Jane10:05:01

<cough>Avro</cough>

3Jane10:05:16

also GraphQL

👌 12
💯 4
metal 8
💥 8
3Jane10:05:46

(Avro is still horrible, from what I vaguely heard from data guys)

3Jane10:05:07

but, like, we started with xml, everyone hated it, and now we’re going back the full circle ¯\(ツ)

mccraigmccraig10:05:55

@lady3janepl were you never exposed to the delights of ASN.1 ?

3Jane10:05:02

no, I went down the web development route seduced by wonders of semantic web

3Jane10:05:09

spent a brief period in Java way back when, so I was exposed to the wonders of everything in xml, then xhtml, then some people thought xslt and xpath would be good ideas…

bronsa12:05:16

I think xslt and xpath are both great

bronsa12:05:21

modulo the xml part

3Jane12:05:29

thank you 🙂

3Jane10:05:26

incidentally, if any of you know a better tool than xpath for expressing a path on a tree, I’d be grateful 😄

mccraigmccraig10:05:27

i think ASN.1 was probably ancient before any of those things were born...

mccraigmccraig10:05:34

if you don't let your tree-nodes have attributes then it's much easier

mccraigmccraig10:05:09

but xpath has been ok on the few occasions i've needed to use it

3Jane10:05:22

no, I do need attributes

3Jane10:05:59

I don’t mind xpath myself, but a) people scream with terror if you mention it b) the usual libraries are not very efficient

3Jane10:05:31

in short: pattern matching on an AST

alexlynham11:05:34

alas semantic web, I knew thee well

💀 4
maleghast11:05:28

Hahahahahaha

maleghast11:05:12

XPath is AWESOME (i still like XSLT as well, but I may be broken inside...)

maleghast11:05:16

Right, lunch!

🍝 4
maleghast11:05:48

FWIW, Avro is a lot better than you might think...

maleghast11:05:58

RIght, really must go and get some lunch....

bronsa12:05:15

morning

👋 8
🌇 4
jasonbell12:05:55

morning..... honestly can't remember if I said it earlier or not.

otfrom12:05:09

perhaps you fell asleep again?

otfrom12:05:13

I do that all the time

jasonbell12:05:40

Depends who I'm talking too.....

korny12:05:59

The main thing that really annoys me in Java land is the lack of persistent data structures. It’d be quite easy for Oracle to do this - they could probably steal most of the Scala stuff without pain, and just give persistent vs mutable versions of the main data structures. But instead, they’ve hacked in a mutable alternative to reduce because reduce doesn’t work nicely without persistent structures. https://docs.oracle.com/javase/tutorial/collections/streams/reduction.html#collect

danm13:05:10

I remember when I started here, and we were were of the first teams to be doing functional stuff,and we were using xquery

danm13:05:17

Everything is xpath!

thomas14:05:07

why is it so easy to [email protected]#$% up git [email protected] 😠

😭 4
guy14:05:15

dare i ask what u did?

danielneal14:05:39

do you use magit

danielneal14:05:16

someone showed me M-x magit-reflog

danielneal14:05:23

it has saved me a few times

danielneal14:05:28

when I've messed things up in gits

thomas15:05:45

I was attempting to do a rebase.... but then accidentally did a commit/push of the changes I made for the merge... not doing a git rebase --continue

thomas15:05:33

I might have it sorted now... but I had to do the merge 3 times.

korny15:05:33

There are git commands I just avoid completely. I really don’t care if my git history is “messy” if it means I never have to fix another broken rebase.

👍 4
korny15:05:14

On the subject of #{:easy-lambdas :persistent-data-structures :decent-macros :hm-or-similar-optional-type-checking :no-global-namespace :pattern-matching} - are there any other mainstream-ish languages that have a subset of these? It’d be great to see a grid of where languages like rust/elixir/kotlin/golang (basically, all the cool languages I’ve been to busy to try) fit on this scale.

korny16:05:37

ruby has hamster: https://github.com/hamstergem/hamster (and has had for a long time) but it doesn’t have nearly the popularity of immutable.js

mccraigmccraig16:05:17

feel free to update the sheet!

korny16:05:16

actually I’d also add :easy-laziness to that list, though it’s trickier to define… maybe :lazy-sequences ? But there are languages with a sequence abstraction, where it’s still a PITA to actually turn a function into a lazy sequence

korny16:05:36

I hadn’t met lux before - looks like it has the simple mental model of Haskell, combined with the popular and easy to learn syntax of clojure? 😉

mccraigmccraig16:05:45

add more features too... those were just the ones which came to my mind... some are obvs overlapping, e.g. if you have macros+lambdas then you have laziness

korny16:05:23

Yeah - in theory Java8 has laziness, but it’s more painful to implement.

mccraigmccraig16:05:44

lux is very new - i've been following it for a while... it's awesome, but probably not a beginners lang... @bronsa had some pretty strong opinion on its syntax

bronsa16:05:38

I’d prefer APL over lux’s syntax

minimal16:05:54

Haskell doesn’t need macros for laziness. I don’t know whether the other macro facilities it has would count as easy.

mccraigmccraig16:05:59

right, haskell builds it in to the lang...

minimal16:05:10

Depends what you need the macros for

mccraigmccraig16:05:40

if the macro facility lets you do large-scale rewrites like applicative-do or core.async sanely then i'd say it's decent

bronsa16:05:25

other than that, lux is pretty cool

korny16:05:26

I’m only half joking with “the easy to learn syntax of clojure” - I love Clojure’s syntax, and it’s what makes the macros so powerful. But it’s by far the biggest barrier to entry the language has, for the casual developer.

minimal16:05:24

applicative-do was a compiler mod to rewrite the do notation. core.async would just use do notation

mccraigmccraig16:05:36

@minimal applicative-do was a compiler-mod in haskell. it's a macro in clojure https://github.com/funcool/cats/blob/master/src/cats/core.cljc#L413

korny16:05:40

I can run a dev workshop and show people golang or scala or rust or many others, and people will go “ooh, that could be fun”. I show them clojure and they go “what’s with the parentheses?“ 😞

otfrom16:05:02

I'm never really sure if it is the "casual developer" or the "interface damaged algol experienced" developer

minimal16:05:16

@mccraigmccraig yeah it’s a fun read in cats

korny16:05:18

anyway, got to catch a 🚲 -> 🚆 -> 👶

👍 4