Fork me on GitHub
#clojure-uk
<
2018-11-30
>
thomas08:11:22

mogge 😼

alexlynham08:11:28

morning morning

alexlynham09:11:38

marginally offtopic, but I've been reading this alongside the haskell book and it's been very good so far https://github.com/hmemcpy/milewski-ctfp-pdf

otfrom09:11:18

@alex.lynham surely talking about clojure is the weird thing to do in #clojure-uk

otfrom09:11:38

anyone got any highlights from the conj so far?

alexlynham09:11:41

hahahaha yes very true

alexlynham09:11:54

I think @maleghast is there...

alexlynham09:11:02

maybe he could report back...

rickmoynihan10:11:05

@otfrom: Not at the conj but they published the videos immediately… There are at least two really momentous things as far as I can see: 1. https://www.youtube.com/watch?v=c52QhiXsmyI 2. https://www.youtube.com/watch?v=YR5WdGrpoug (for the new thinking on spec)

rickmoynihan10:11:46

there may be other momentous things too… but these two will almost certainly be a really big deal for clojure.

alexlynham10:11:11

@rickmoynihan what's the TL;DR? won't get a chance to watch until I get home this eve

rickmoynihan10:11:55

clojure is about to get a whole lot more f***ing awesome

otfrom10:11:29

the REBL stuff is interesting. Stu H says it is free as in beer in the talk which is fair enough, but it doesn't look like I can use it for work according to the license (we'll see when/if that gets cleared up)

otfrom10:11:05

not watched the Maybe Not talk yet but saw a quick review from @annapawlicka and if it is solving problems for her then it will probably do the same for me

rickmoynihan10:11:47

REBL is a sidecar data browser for your REPL. I installed it last night, it’s great. It’s been a long time coming… This is why I was so excited by unREPL last year, but it seems cognitect have smashed it out of the park with this. A smalltalk like data browser is the main idea; except the big deal is how it extends to arbitrary data; and NOT just data, but also arbitrary java objects which can be extended to datafy… think arbitrarily walking your database from your dev tools. It composes with literally everything.

otfrom10:11:43

I agree. The smalltalk influence there is clear and strong

otfrom10:11:06

I really like the idea of it. I'm just not sure I'll be able to use it much. I like what datafy and nav will enable though

rickmoynihan10:11:41

Then there’s Maybe Not… first half hour is a bit ranty; but makes a good point… and then Rich talks about his mistake in spec and the big new ideas on how to fix it. Short story is it looks like it fixes a lot of the big issues people probably didn’t realise they had with spec. Exciting times.

thomas10:11:44

maybe I can stream it on the train tonight :thinking_face:

alexlynham10:11:46

thanks for the summary, will have to watch

rickmoynihan10:11:04

Yeah license needs to be sorted out… I suspect it’s intended to be usable commercially; just not integratable into other peoples products.

alexlynham10:11:12

> free as in beer in the talk that makes me wince a bit, but I guess I'll look at what it is in more depth before working out if that's an issue or not

rickmoynihan10:11:19

But we need to wait for a clarification for sure.

alexlynham10:11:12

I mean to some extent that kind of tooling is nice, but... well... I've survived without it 'til now. Still interesting though

rickmoynihan10:11:31

I’m curious why it wasn’t open sourced; I don’t think there’s any real IP in it… and it would be a relatively easy project to clone as opensource. I suspect the main reason for it being closed is so cognitect can integrate it with datomic and keep datomic closed, and not have to worry too much about where the closed/open boundary is. That has been a challenge for us. It’s much easier to be all open or all closed than half and half.

rickmoynihan10:11:26

It’s all doable but is ultimately wasted effort, and contorts designs a little as licensing forces artificial software boundaries; where as clean code may want a different separation of concerns

👍 4
mccraigmccraig10:11:01

what were the points from the spec vid (summarised for someone who hates video as means of info distribution 😬)

rickmoynihan10:11:04

But we need to wait for clarification.

reborg10:11:24

License seems to be clear, it’s not for commercial use

rickmoynihan10:11:36

It is. But people from cognitect have unofficially indicated the intention isn’t that developers can’t use it to work on commercial stuff. Clarification needed for sure.

otfrom10:11:37

@reborg the license is clear. I think we are wondering if the clarity was what was intended. I'm not really doing much non-commercial clojure these days (even though it is still almost all FLOSS)

reborg10:11:09

I see, didn’t know about the intention to relax the license

rickmoynihan10:11:12

@mccraigmccraig: Summary is that optionality is hard…. Rich made a mistake with s/keys and :opt which is the same mistake Haskell and others made with Maybe, Either types etc… this mistake is fundamentally what people struggle with in spec, and leads to a proliferation of specs and lack of reuse. The answer as always is that we’re complecting something; Rich explains what… and how he’s going to split it apart with some new spec functions. Essentially separating schemaness from requirements and obligations etc.

reborg10:11:03

Other than that, yes, interesting tool. I was wondering if I could write an editor on top of it, not just a browser. I still need to try it out, but it sounds possible

mccraigmccraig10:11:07

sounds like it might be worth watching the rich vid - i tried stu's vid and lasted about 30s before i was all "screw this, give me information stat!"

rickmoynihan10:11:11

yeah there’s a bit of waffle at the start of his talk, which is old news for many of us… It does get a lot better when he starts demoing it and talking about the implications of it though.

4
rickmoynihan10:11:45

Same for Rich’s talk too… The first twenty mins or half hour is a bit ranty about Maybe etc… I did start to feel like the whole talk was going to be trying to justify dynamic languages vs strongly typed ones… but it turns out Rich really uses the rant to say “I made the same mistake they made too” - which I thought was quite humbling actually. Then the good stuff, big ideas stuff happens.

4
bronsa10:11:39

I thought some of his points against Maybe were a bit strawman-y and not reflective of how people use type systems in practice

👍 4
bronsa10:11:50

the spec stuff is good

bronsa10:11:03

the Maybe rant he could've done without

mccraigmccraig10:11:05

what's up with Maybe ?

bronsa10:11:16

watch the talk :P

bronsa10:11:45

>summarised for someone who hates video as means of info distribution sorry didn't read this part :)

rickmoynihan10:11:13

Yeah I think the rant should’ve been toned down a bit, but still the points were broadly valid and deserved to be mentioned, particularly as back story to the thinking around spec. Yes he did set up a bit of a strawman… as a function with maybes can remove/add the maybe by just defining a new function… but that’s also proliferation to some extent. Generally I think what he’s articulating about modelling or is completely true though.

bronsa10:11:44

@mccraigmccraig I may not be completely accurate in summarising his thoughts, but he's arguing that using Maybe for conveying optionality is conceptually wrong as it breaks situations that shouldn't: - relaxing the optionality of inputs (i.e. going from a to Maybe a as an input type) - tightening the guarantees of returns (i.e. going from Maybe a to a as a return type)

👍 4
🙏 4
bronsa10:11:20

there's a quite a bit more nuances to his arguments that I can't remember having watched the talk at 2am :)

rickmoynihan10:11:24

That’s how I understood it too.

alexlynham10:11:26

but isn't that just about programmer discipline at the end of the day?

alexlynham10:11:40

(in the sense of how you'd model it in a strongly typed lang)

rickmoynihan10:11:42

No. It’s about leaving room to grow

rickmoynihan10:11:54

which is also a discipline

bronsa10:11:55

right, and nothing stops you from returning Some a all the time to avoid breaking changes, in the second case for example

bronsa10:11:31

nothing also stops you from having a wrapping function that wraps a in Some a to avoid breaking callsites in the first case

alexlynham10:11:32

right, I guess the question is how you evolve to support composition

rickmoynihan10:11:50

watch the talk

bronsa10:11:54

so I really don't see from a practical pov how what he was arguing about made sense

alexlynham10:11:56

(where it's required for new functionality or whatever)

rickmoynihan10:11:57

too much to go into here

bronsa10:11:11

I get the ideological/phylosophical argument

bronsa10:11:17

but from a practical pov.. dunno

rickmoynihan10:11:20

yeah that was the bigger bit

bronsa10:11:36

I'm really not convinced that part of the talk was necessary, at all

rickmoynihan10:11:42

like we agreed the rant at the start overstated the case a bit

rickmoynihan10:11:02

the ramifications for spec are whats important and exciting

bronsa10:11:12

but whatever, that's not the payoff of the talk

rickmoynihan10:11:15

splitting schema and obligations etc

rickmoynihan10:11:39

which is totally a problem I’ve felt with spec

rickmoynihan10:11:03

well I should clarify… I’m not smart enough to have realised how what spec gave was complected… I was really only aware of the symptoms and problems in using it (proliferation etc) but now Rich has pointed out, how and where elements of it were misguided and how he can solve it. I completely agree. And I think the solution he articulates looks like it’ll work really really well… but we need to really see the implementation 🙂

rickmoynihan10:11:49

Also the solving it shouldn’t break existing code.

thomas11:11:56

I just downloaded the talk and I am planning on watching it this evening on the train to LDN...

thomas11:11:20

I got the Rich and Stuart ones... any others?

thomas11:11:52

hmm need to buy some headphones as well 😞

rickmoynihan11:11:12

Probably loads, but haven’t watched any others yet…. Stu name checks a talk about using REBL with AWS services etc which will supposedly be mind blowing… not sure if that talk has happened yet though; but it looks like it will demo more of why REBL like tools are a really good idea.

alexlynham11:11:41

I think he alluded to it on the datomic ions one from a while back

thomas12:11:54

ok, thanks.

otfrom12:11:02

every time I watch a talk on spec from Rich I feel like he's spent a lot of time doing what I've done in my career, which is dealing with data created by other people (on the wire, in a file, etc)

otfrom12:11:53

that Maybe not talk was great. It is only annoying that it isn't built yet as I want to use it. I'm wondering what the halfway house is (doing select like things in old style preconditions?)

danielneal12:11:17

same here! Everything from datomic to this has felt like the sort of things I've desperately needed when dealing with information in business contexts that changes other time and is incomplete or partly specified

danielneal12:11:36

Really looking forward to spec2

mccraigmccraig12:11:19

i went and watched rich's talk - the separation into schema and select seems reasonable to me at first blush - although select just seems like a clever type constructor which allows you to avoid embedding context-based optionality in your aggregate types

otfrom12:11:51

the type constructor will be at point of creation rather than at point of use though (I'm not familiar with them, just reasoning out from your words), whereas select would be at the point of use in the function that is using the data

mccraigmccraig12:11:38

afaiu it constructs input or output types for the data-using-function based on the schema type - so yes, you don't need to specify any use-context constraints in the schema type

rickmoynihan13:11:56

> although select just seems like a clever type constructor > you don’t need to specify any use-context constraints in the schema type Yup. Sounds good to me 🙂

mccraigmccraig13:11:08

yep - i'm not down on it - it sounds like a good thing, i'm definitely not a fan of the combinatorial type explosions nested optionality can cause

👍 4
danielneal13:11:10

We had a stage when we had prismatic schemas for e.g. product store-product feed-product elasticsearch-product elasticsearch-product-with-likes and it just got out of hand

danielneal13:11:52

ended up being more trouble than it was worth

danielneal13:11:27

I wonder if the extensibility would be able to handle transformations on schemas as well as optionality

danielneal13:11:09

I guess coercion != conform and all that

mccraigmccraig13:11:19

we do have some schemas like that @danieleneal - not quite a as bad as that though, and the derived schemas are generally constructed by manipulating the base schema to e.g. add optionality to a particular key, which is quite like the select thing i suppose

danielneal13:11:45

^ yeah I think we did something a bit similar with a schema-tools library - a base schema which was then modified

rickmoynihan13:11:07

yeah I ended up doing something similar when I used p(lumb|rism)atic schema… at least they were still maps so you could make it work; but at some point the plumbing for reuse starts hiding the specification.

thomas14:11:29

a non cljs question... I have a JSON file and there are two objects in there which miss a certain key and this is causing problems. but which object it is I don't know... and there almost 1k of objects. What best to use to find the two objects?

danielneal14:11:29

is it valid json?

dominicm14:11:40

which key is missing?

alexlynham14:11:11

map and filter?

danielneal14:11:15

for anything like this, because I'm so familiar with clojure, I get it into clojure land asap

thomas14:11:23

it is valid json and there is a key called educationRole which is missing in my json

danielneal14:11:40

clj -Sdeps '{:deps {cheshire {:mvn/version "5.8.1"} com.bhauman/rebel-readline {:mvn/version "0.1.4"}}}' -m rebel-readline.main

alexlynham14:11:40

load it into a repl

thomas14:11:42

I was thinking a tool like jq might help here...

dominicm14:11:43

@thomas (remove :educationRole read-json)

thomas14:11:51

yes that might the answer.

danielneal14:11:52

see above to get a repl with cheshire quick if you have clj

danielneal14:11:14

oh wiat typo sorry

thomas14:11:17

ooh nice.. thank you @danieleneal

alexlynham14:11:29

by the time you've come up with the jq incantation (and it's super powerful) you could have done a clj ver and gone to get a

danielneal14:11:53

this is exactly what I found

danielneal14:11:04

poring through stackoverflow to figure out jq

danielneal14:11:41

also if you haven't tried clj main with rebel-readline at the terminal you're in for a treat

👍 4
danielneal14:11:49

got rebl on the brain

danielneal14:11:05

why don't we have stu emoji

bronsa14:11:27

you're not entitled to it

danielneal14:11:41

if you want something, build it yourself

👍 4
thomas14:11:00

I haven't yet...

danielneal14:11:10

ooh sounds interesting

thomas14:11:16

it does indeed.... but now I have to figure out how to use it!!!

3Jane14:11:58

(interactive jq with on the fly data exploration - see demo gif in readme)

otfrom16:11:11

I ❤️ this channel

❤️ 28
alexlynham17:11:33

it’s wholesome as hell

thomas22:11:30

greetings from the Eurostart... I am somewhere in northern France at the moment... hacking on some clojure

thomas22:11:51

unfortunately, we had a 2.5-hour delay in Brussels :(((

thomas22:11:00

still stuck just outside the tunnel... there are engineering works going apparently.

thomas22:11:05

going underground now... ttfn

thomas22:11:42

it seems that even in the tunnel the wifi works on the train... not bad.