Fork me on GitHub
#clojure-uk
<
2018-12-28
>
dominicm06:12:00

I've decided that vim orgmodes agenda isn't good enough.

mccraigmccraig10:12:35

I've always been scared of saveloys @otfrom, is that unreasonable?

otfrom10:12:18

@mccraigmccraig seems perfectly sensible to me

otfrom10:12:57

@mccraigmccraig what about cocktail sausages?

alexlynham10:12:57

saveloys are imo inferior to regular chip shop sausages

alexlynham10:12:05

and by extension battered sausages

alexlynham10:12:12

but nothing to be afraid of…

mccraigmccraig10:12:42

i dunno, inferior to regular chip shop sausages seems like a reasonable foundation for gibbering terror

alexlynham10:12:24

I mean given that the average chip shop sausage only contains fractionally more meat than a veggie sausage and… well, where that meat comes from you probably don’t want to know…

alexlynham10:12:01

now battered quorn sausages… that’s an idea I can get behind

otfrom10:12:11

I like to think of sausages as slightly more environmentally meat - it uses up more of the animals we kill, and kills us off faster. Win-Win

otfrom10:12:04

hmm... I'm thinking about core.async again today, not for concurrency as such, but as a way of decomposing systems. I build a lot of data cleansing pipelines where I then want to do some report on things and then do some calculations with some proportion of the data. Doing this with channels that have transducer functions, mults to have multiple things processing that data to create different reports and then core.async/transduce functions at the end feels like a really good decomposition to me. I know it isn't the fastest necessarily, but it is fast enough and with things like pipeline-blocking I can get the parallelism I'm after too and heat up those cores (so I can at least save wall clock time). I'd be interested in hearing from people whether or not this is a good or bad idea and what alternatives they'd propose (if any).

danm10:12:54

Not considered it, but it certainly sounds like it's got legs

alexlynham10:12:57

perhaps from having too many run-ins with the node runtime, but my hand-wavey observation would be one does not simply do async

alexlynham10:12:31

as in, if you’re looking to window over the data, there’s probably a way of sampling that still involves a good separation of concerns but doesn’t fundamentally change the expectations around return time

alexlynham10:12:12

adding async also more strongly introduces the dimension of time into the code and ’tis not to be trifled with

otfrom11:12:12

@alex.lynham I think having go blocks sitting around and receiving events does that, but bolting channels together doesn't feel very async to me, which is partly why I'm a bit nervous. I'm really using it for things that are embarrassingly parallel

otfrom11:12:45

(with the exception of the bits where I'm using the pipeline-blocking, but even then we're not really pushing that hard on asynchrony)

otfrom11:12:39

it feels a lot more like using kafka for pushing this kind of thing around (w/o using kafka). It does make me wonder if I should just do some sugar around some java queue stuff, but then I'd lose things like pipeline and having all of my extra filtering and transducing functions making good use of machine resources.

danm11:12:19

That was how it sounded to me, yes. If you don't need the persistence of Kafka it sounded like a nice way to do the same sort of thing in-component.

otfrom11:12:18

yeah, this is all running in batch from the REPL anyway, so even "component" is too grand a term. I might run from a mainline in a cronjob at some point, but even then probably not.

otfrom11:12:12

I'd be doing this in clojure rather than in clojurescript and all on the jvm.

otfrom11:12:19

(so I've got real threads etc)

alexlynham11:12:58

okay, well if it doesn’t need to be platform portable then that does make things easier, and that is a fair point about channels

alexlynham11:12:28

the last large thing I did was heavily evented python, but using lambda so the async happened between these tiny lil handlers - so you sort of had the benefits of async while writing synchronous code… which I guess you can kinda get the way you’re describing

👍 4
otfrom11:12:35

my workflow atm is to prototype things in a rich comment block w/transducers and then create the actual app itself my moving those transducers and reducing functions to core.async

otfrom11:12:40

I think the only reason I'd want to write a go block would be to tweak some atom, but even then I'd like to structure things so I didn't have to do that (like say processing the data more than once, which is fine with the data sizes I'm dealing with)

jasonbell11:12:50

Morning

4
👋 4
otfrom11:12:09

@jasonbell I'm interested in your take on the above as we spiked out those ideas together and I think you are in a team with different opinions now. 🙂 https://clojurians.slack.com/archives/C064BA6G2/p1545993724119400

jasonbell11:12:00

@otfrom Let me think of a remotely coherent answer and I’ll pop it here 🙂

jasonbell11:12:11

I’ve actually been thinking about it on and off.

otfrom11:12:22

lol, sorry, didn't mean to put you on the spot

otfrom11:12:34

I need to find a way to publish what some of this would look like

jasonbell11:12:03

No need to apologise at all. It’s an interesting point to make.

jasonbell11:12:55

@otfrom Okay. Firstly yup, new team and a new way of thinking, some of which I’m still wrapping my head around but ultimately it’s settling in my head. The way I’m seeing async now is really centred around futures and promises, “do this! bind it to this! oh it’s messed up I better handle it“, regardless of whether it’s http or db calls etc. Anything that has an associated response time is better handled that way, having seen it in action I’m fairly convinced of it. How that would apply to what we spiked out in a core.async sense I’m not sure without trying. I do distinctly remember us talking at length about a stream of data and the distinction between something like a Kafka like stream and what we were working on which was more a transform stream (my words, no one elses). Therefore core.async with transducers makes perfect sense when reducing numbers on usage data for example, perfect for reporting. As every report requirement is a function then it makes sense to have the channel <- mult -< n taps. Data goes in once and the report’s own functions extract what it needs to construct the report, transducers do the lifting. All makes perfect sense to me. Annoyingly the times I needed it I forgot most of the code from the spike 🙂

jasonbell11:12:37

For data processing, transforms and reporting core.async now feels like a logical choice.

danm11:12:40

@jasonbell New company? Or just new team within the current one?

jasonbell11:12:17

New gig started mid december

otfrom11:12:28

@jasonbell I'm not sure your use case fits in with what we were doing. I know a lot of people use core.async to do the whole "make a bunch of requests w/o blocking and then deal with the results" but I think things like promises and (and promise monads?) do a good job for that. I'd expect that it would look something like

(let [foo (promise call to remote service)
     bar (promise call to other service)]
  (do stuff with foo and bar))

jasonbell11:12:30

The spike we did made perfect sense from a data transformation point of view. It stuck with me.

jasonbell11:12:48

But yes, where you are coming from in the CSV -> loader put onto channel <- mult <- tap makes perfect sense for multi level reporting. I think that got proved in the spike.

alexlynham12:12:39

a little offtopic but @jr0cket that lenovo came and it’s actually immaculate, you can barely tell it’s been used. Just making an ubuntu USB now to get cracking. Might leave windows on for now so my other half can use that… think I’ll go with ubuntu for now as I’ve used that the most in the past & I doubt I can get a stable arch setup to test on my lunch break

👍 4
alexlynham13:12:50

though having gone for one in better condition trading off against SSD size means I need to get a new SSD and switch it in, but that’s easy… ish

alexlynham14:12:24

okay so loads of the ubuntu experience has gotten slicker since 2013 (he said, dumb-ly)

alexlynham14:12:35

the window management is absolutely leagues ahead of osx

practicalli-johnny20:12:42

@alex.lynham Great to here the 'new' laptop is working so well. I love the keyboardy-ness of the ubuntu desktop, you can even do window placement by holding the Super and arrow keys - left/right shows on that half of the screen, up to maximise, down to unmaximise.

alexlynham21:12:54

Yeah, that stuff is super slick. I had to get an app (spectacle) for that on osx and even then it doesn't work as well as this does. Plus the thinkpad keyboard is everything the mac's is not. Obviously the mouse experience on osx is superior mind you but hey

alexlynham21:12:38

Amazingly my osx emacs config pretty much worked out of the box as well