Fork me on GitHub
#clojure-uk
<
2018-10-11
>
dominicm06:10:03

Morning

🙂 1
dominicm06:10:42

How's it going?

yogidevbear06:10:52

I could do with a few hours more sleep 😄

agile_geek07:10:48

Bore da pawb welsh_flag

rhinocratic08:10:11

That's an unusual manifestation of synaesthesia, @mccraigmccraig! Is the smell of a monad reminiscent of anything else?

mccraigmccraig08:10:48

@rhinocratic it's a heady blend of the excitement of possibility, the verve of comprehension realised and a dash of confusion!

😁 3
🍷 2
mccraigmccraig08:10:09

we've used a promise-monad for ages to make promise-based async computations easy to read and write... but i've had an idea brewing that i could use a different monad which combines reader, writer, state and promise monads, which would have some nice properties [1] thread application context to fns without any explicit parameters [2] tracing of async control flow for debugging (since stack context is lost in async world) [3] passing a coarse operation-id around to use as a log-context-id to enable straightforward filtering of aggregated logging

rhinocratic08:10:09

That sounds really useful. Interacting with promise-based stuff (particularly Node) has been a pain-point for me.

alexlynham08:10:36

morrrrrrning!

mccraigmccraig08:10:39

what do you do with promises atm @rhinocratic ?

rhinocratic09:10:50

Sorry for the delay @mccraigmccraig - on a lengthy call. Thankfully, I'm not making much use of promises at present, but that wasn't the case 6 months ago when using a bespoke test driver that needed to make Node calls.

alexlynham08:10:16

yeah I'm currently looking at ways to make my cljs stuff easier. Got tabs open on manifold/deferred - your recommend I think @mccraigmccraig?

mccraigmccraig08:10:05

could be @alex.lynham - we use manifold on our backend - but manifold is clj only atm

mccraigmccraig08:10:02

manifold does have solutions to the immediate promise problems of composition, short-circuiting and error-propagation - (`manifold.deferred/chain` and manifold.deferred/let-flow )

mccraigmccraig08:10:33

but manifold won't help with cljs - we settled on using funcool/cats promise monads (clj-only : https://github.com/funcool/cats/blob/master/src/cats/labs/manifold.clj, clj+cljs : https://github.com/funcool/cats/blob/master/src/cats/labs/promise.cljc ) along with cats.core/mlet and cats.core/alet which provide similar composition, short-circuiting and error-propagation to manifold, but cross-platform

alexlynham09:10:13

ahhh yeah that was the one

alexlynham09:10:11

my frustration with cljs backends has been growing of late. I kinda feel like the heavily async nature of node is a hard boundary to writing easily comprehensible code

alexlynham09:10:20

browser JS is definitely easier to reason about imo

mccraigmccraig09:10:31

@alex.lynham our (clj) backend is fully non-blocking/async - the code is generally straightforward

mccraigmccraig09:10:50

but i think our approach is unusual

alexlynham09:10:01

what was the reason for that?

alexlynham09:10:07

just performance or...?

maleghast09:10:44

Good Mornin' everyone - loving the morning's topic so far, though I do feel a little out of my depth...

maleghast09:10:50

Still Deep Water is fun.

mccraigmccraig09:10:32

a (possibly theistic) fervour that soft threads are for mapping to hardware threads, not for use as application constructs

maleghast09:10:49

Profound, Deep is not a big enough word

mccraigmccraig09:10:14

it's worked out well - and being able to do things like control the concurrency of bulk operations by simply setting a buffer size is amazing

alexlynham09:10:16

> soft threads are for mapping to hardware threads I will happily expose my ignorance here - care to explain? 🙂

😍 1
danm09:10:00

Creating more threads just produces complexity for no benefit unless there are hardware resources they're mapping to that can actually be used in parallel (e.g. heavy network I/O can often be massively parallelised, but if you're CPU bound then there's no point having code threads much > CPU cores [+ hyperthreading])?

mccraigmccraig09:10:03

zakly @carr0t, much more succinct than my half-complete reply

danm09:10:31

I mean, that's the way we've generally done it. We only use async in places where we're going to be waiting on a lot of requests to external systems like REST APIs, dynamodb, etc, so we can fire a load off in parallel. We very occasionally pmap the actual local data munging, but anything more complex than changing a map to a pmap for entirely pure operations often brings more confusion and complexity than benefits

mccraigmccraig09:10:50

additionally things like promises (core.async too) reify operations as values which makes controlling execution very easy - it's just buffer size

alexlynham09:10:01

okay, yeah I totally agree with that

guy09:10:18

Morning folks!

mccraigmccraig09:10:50

a (slightly semantically different) alternative to pmapping which we use quite a lot @carr0t is to put a bunch of ops on a (manifold) stream, with a buffer-size determining concurrency, and map over the stream

alexlynham09:10:49

@otfrom though presumably linux won't behave w/ the tablet so well?

otfrom09:10:11

@alex.lynham not sure. My touchscreen on my xps13 works fine.

mccraigmccraig09:10:53

@otfrom give me that in 15", with 32GB, 1TB SSD, a retina screen resolution and good linux compatibility and i'd jump from macosx

alexlynham09:10:09

what distro?

otfrom09:10:19

ubuntu 18.04

alexlynham09:10:40

I think I'm on mac for the forseeable because I also heavily use logic pro for tracking audio

otfrom09:10:55

@mccraigmccraig 15" is bigger than I want. 32GB would be nice. I can get away w/16GB. I do like that it can have a 1TB SSD

danm10:10:10

@mccraigmccraig Aah, interesting idea

mccraigmccraig10:10:27

it works well for async ops too - so we can easily control the concurrency of requests to an api, or how hard we are hitting the db with a bulk update

danm10:10:03

nice 🙂

guy10:10:38

Didn’t Lenovo have that malware/spyware issue a while back

guy10:10:01

let me google and find the article 👀

3Jane10:10:05

How about the various versions of Surface?

3Jane10:10:11

(I’m looking for a new laptop for own use, so it’s interesting to hear about other people’s setups)

3Jane10:10:59

(Incidentally, thank you everyone who pitched in for my Noise Cancelling Headphones Research, it helped a lot and I’m happy with the result 😄 )

otfrom10:10:35

@guy the malware was on their non-thinkpad stuff too. I wouldn't buy anything from Lenovo that wasn't X- or T-

👍 2
mccraigmccraig10:10:31

is it possible to defrecord with namespaced field keys ?

practicalli-john10:10:15

@guy installing Ubuntu on a Lenovo is easy and automatically removes any dubious software for you

❤️ 2
practicalli-john10:10:08

@mccraigmccraig take a look at the Lenovo X1 Extreme and I think you will see much of what you want

practicalli-john10:10:35

FYI Ubuntu 18.10 is out next Thursday. Already running it on my old x201T laptop (with Emacs 27, self compiled). Ubuntu looks nicer and desktop is very responsive.

otfrom10:10:11

I just specced out a tricked out x1 extreme for £4035.59 😄

😱 5
🙀 2
💸 2
😅 2
mccraigmccraig10:10:56

but at those prices i might as well stick with a macbookpro

otfrom10:10:20

64GB RAM and 2TB of SSD in all

practicalli-john10:10:44

Time to start my own company again so I can reclaim the VAT on such a laptop

alexlynham10:10:02

isn't the whole laptop a pretax loss? equipment etc

Conor10:10:01

It is a company expense and so pre-tax, VAT can also be reclaimed if over £2000 on the flat rate scheme (or just in general if not flat rate)

alexlynham10:10:43

so you're effectively getting it free (for some definition of free) plus the VAT back?

practicalli-john10:10:14

@otfrom my X1 extreme would be half the price, £2,059 for 16Gb, i7, 256Gb SSD, and FullHD screen, or £2,262 with 4k screen

otfrom10:10:24

umm.... as long as you don't think your company's money is real, then yeah, free

otfrom10:10:49

it does give a pretty deep discount though compared to buying as a consumer

otfrom10:10:55

you don't get consumer protections though

otfrom10:10:06

if you buy it through a company

practicalli-john11:10:04

If you do buy direct from http://Lenovo.co.uk and you only intend to run Linux upon it, make sure you get the Windows Home version. If it's Windows Pro you will pay an additional £48. Windows Home is effectively free as manufacturers offset the price with sponsored software. Best approach is to choose cheapest laptop option and then customise to bump all the hardware specs up.

alexlynham11:10:30

> umm.... as long as you don't think your company's money is real, then yeah, free yes good point

alexlynham11:10:41

I guess I'm used to freelancing as a gear journalist where I pay my tax lump sum at the end of the year... unless I buy deductible things with it in which case I have a smaller tax bill - more efficient to buy things that way than use other income

alexlynham11:10:10

obviously it's all the same pool, more of a psychological/accounting thing. I've been using the same MBP since 2013 so I need to psych myself up before dropping that kind of 💵

mccraigmccraig15:10:53

anyone else use cats around here ?

thomas15:10:24

I used to have cats... but that doesn't count I suspect

yogidevbear15:10:23

Usually it's cats using people (not the other way around). 😉

🙀 2
yogidevbear15:10:55

You know it's true @U82DUDVMH 🐱

yogidevbear15:10:33

Cats are really the masters in the relationship with their humans

3Jane15:10:12

I know, you know, but now they know you know

3Jane15:10:25

close your windows at night!

😂 1
practicalli-john16:10:27

I have two lovely fluffy masters of my own and having noise cancelling headphones are a wonderful invention when the cats come in too early for feeding time... Meow... Meow... Meow...

seancorfield16:10:51

Our cats are indoor-only. Well, they have a fully-enclosed 12'x6'x6' outdoor run during the day (which I can watch from my home office), but everyone is in at dusk.

seancorfield16:10:04

And we have... quite a few... furry masters 🙂

😼 1
practicalli-john16:10:50

Here is a picture of my feline overlords from when they were kittens and a lot less demanding https://hacktogetherldn.github.io/images/kittens-snuggled.png

3Jane16:10:02

That’s how they get you!

3Jane16:10:55

A relative has a house in the country (not as glamorous as it sounds) and several cats, apparently I’ve been remotely adopted

yogidevbear16:10:56

Nothing like a black cat surprising you in the dark 🙂

3Jane16:10:00

(Every time I stay over, one of the cats sleeps in the guest room. It’s like she wants to move in… but I’m resisting)

3Jane16:10:16

@U0MFQNXFZ what would you rather, a black cat or a lego block?

yogidevbear16:10:46

Easy choice, black cat

maleghast16:10:24

@mccraigmccraig - I am going to go out on a limb here... Are you asking about a Clojure library, or perhaps some emerging tech I've not heard of yet..?

maleghast16:10:43

I mean you're not asking if anyone on here has a tame Clojure Dev Pool made up of felines, right?

mccraigmccraig16:10:53

but it probably won't make a lot of sense unless you are familiar with cats

maleghast16:10:41

Yeah, I just skimmed the first bit of the documentation and I had to stop and scoop my brain back up where it came spilling out of my ears...

alexlynham16:10:54

i can confirm that this is code

2
maleghast16:10:01

That's not to say I wouldn't like to understand all that, but woah...

yogidevbear16:10:33

@mccraigmccraig from what I've read online... If you don't find someone local then @ericnormand will probably be your best bet to check it

mccraigmccraig16:10:44

you probably do understand most of it, it's just presented in a way which makes you think that you don't...

mccraigmccraig16:10:18

which is the curse of monad tutorials everywhere

seancorfield16:10:13

@mccraigmccraig I think that's the first time I've seen someone make type/record constructors private (via alter-meta!). Interesting...

mccraigmccraig16:10:59

i picked that trick up from the funcool/cats source @seancorfield