Fork me on GitHub
#clojure-uk
<
2018-02-20
>
thomas08:02:01

moin moin morning

Rachel Westmacott08:02:15

how’s core.async going @otfrom?

otfrom08:02:20

thinking about writing something like core.async/reduce but that returns at atom so that you can reference it in ongoing streaming systems. Any thoughts?

otfrom08:02:54

@peterwestmacott seem to have gotten my head around enough of it to be dangerous. I like how it is affecting my design. mult make a lot of things simpler. 🙂

jarohen08:02:52

just a personal experience and probably not at all reflective of general core.async - we found it made certain areas of our application much harder to reason about, particularly when it came to stack traces and debugging error cases

jarohen08:02:36

although it probably wasn't a good fit for those areas - they didn't really need to be async in the first place

jarohen08:02:57

following your ongoing adventure with interest 🙂

otfrom13:02:32

yeah, I've had to flip my head around a bit. It was a bit like wrapping my head around why a seq from inside a with-open didn't hang around. I'm gonna work hard to keep some of the things inside pretty simple. It is a bit tricky to dig into why things aren't working sometimes. And my code isn't really async as such. It is more that I want to be able to do a lot of things in parallel off the same lazy stream of records (so suggestions to alternatives are welcome).

mccraigmccraig13:02:59

manifold streams are also nice for parallelizing processing of streams of things

Rachel Westmacott08:02:20

(I ask because I’ve recently been of the opinion that manifold might be a better library for that sort of thing (having written quite a bit of core.async (but admittedly not used mult or tap extensively)))

otfrom08:02:45

manifold might be better. I worry it might be abandoned like automat

otfrom08:02:52

(which was good for FSMs)

otfrom08:02:16

I'll probably learn manifold next

otfrom08:02:53

part of what I like about my design atm is that I'm using the same "business logic" functions for straight transducer and file io stuff that I am for core.async

otfrom08:02:03

so it is just the scaffolding that changes

otfrom08:02:28

which is some work, but is the incidental complexity rather than the inherent complexity of the domain

otfrom08:02:52

I do like how transducers and core.async play nicely together

Rachel Westmacott08:02:09

(one thing I like about manifold is that by default you get deferreds so it’s much harder to block your REPL when experimenting)

mccraigmccraig08:02:17

@otfrom Deferred<Stream<X>> reducing to Deferred<X> is the holy signature

Rachel Westmacott08:02:14

I got sucked into a core.async/transducer rabbit hole once, …and found a bug.

Rachel Westmacott08:02:58

I don’t believe that manifold is abandoned, just that the rate of change is low.

mccraigmccraig08:02:27

bugs still get fixed in manifold @peterwestmacott @otfrom - but i don’t think there are many anymore

dominicm08:02:47

I don't think automat is abandoned. Zach mentioned wanting to figure out why my example was slow.

dominicm08:02:52

Oh no, it got archived. That's a shame.

mccraigmccraig08:02:37

another alternative is to use the cats promise monad on top of manifold @otfrom ... which can then easily be swapped out for a core.async promise-chan monad... altho that doesn’t help with streaming ops - perhaps a comonad thing would, but i haven’t grokked comonads properly yet

otfrom08:02:52

I think I'll do pretend monads w/railway oriented programming for a bit

mccraigmccraig09:02:10

railway oriented programming ?

jarohen09:02:52

@mccraigmccraig: a way of thinking about monadic programming using railway points

jarohen09:02:32

was a really good blog on it a while back, as a way of explaining what monads are useful for

jarohen09:02:42

(yes, another monad tutorial)

jarohen09:02:52

one of the better ones, though, IMO

otfrom10:02:11

I know manifold isn't abandoned now. I think the bus number on it is low. Tho there has been a good long while where core.async didn't get fixed either.

otfrom10:02:53

I think basically I need to have functions that plays nicely as the f passed into map/filter/etc or reduce and then I can be a bit agnostic about which system I go with

otfrom10:02:11

any time I move away from that I find that I'm outside of where clojure goes long term

cddr11:02:07

Say you're emitting some riemann metric every 60s, to what would you typically set the ttl? A few seconds more? Or is it fine to set it to 60?

thomas11:02:14

I thought rule of thumb was 1.5 times the normal time out.

thomas11:02:25

so 60 sec becomes 90 sec.

cddr11:02:08

Makes sense.

otfrom13:02:33

what would you call the function that you pass into a reduce or a map?

otfrom13:02:40

a reducing function? a mapping function?

maleghast14:02:45

I call them reducing and mapping functions, but i am not sure that I am "correct", @otfrom

dominicm14:02:49

I call them functions.

dominicm14:02:28

the function passed to reduce is often referred to being a reducing function, largely because that context is reused elsewhere.

maleghast14:02:57

np, mi amigo 🙂

otfrom14:02:16

@dominicm I call them functions too when I pass them in, but I'd like a way of referring to them when they aren't attached to a reduce yet, but have the correct signature and function

yogidevbear14:02:00

@otfrom... a missed opportunity by @thomas the morning 😉

otfrom14:02:35

I think he was on it

otfrom14:02:54

he just wanted extra style points for referring to old wiki software written in python

otfrom14:02:01

and who doesn't

yogidevbear14:02:22

Oh my, I must be groggy headed today

otfrom14:02:39

given how late you've turned up I'm not surprised

yogidevbear14:02:45

Been busy 😉

thomas15:02:34

?!?!?!?! WAT???

chrisjd16:02:30

Nice blog post today, @dominicm 🙂

dominicm16:02:27

@chrisjd Thank you. It's been in drafts for about a year.

dominicm16:02:54

I'm trying to find some new topics to blog on. There's a blog post talking about Unrepl & Unravel, and how it saved the day when doing some one-off datomic queries.

maleghast16:02:01

@dominicm - I haven't had time to read it yet - it's the one about nREPL, yeah?

dominicm16:02:10

If anyone has suggestions on topics, I'd be happy to do some writing.

dominicm16:02:28

@maleghast Indeed. It's somewhat of a field guide to the inner-workings of the tooling we use every day.

maleghast16:02:42

I will definitely be reading it later on in that case 🙂

dominicm16:02:54

I've worked on both cider-nrepl and on 2 nREPL clients, so this is a topic I feel like I know something about.

otfrom13:02:32

yeah, I've had to flip my head around a bit. It was a bit like wrapping my head around why a seq from inside a with-open didn't hang around. I'm gonna work hard to keep some of the things inside pretty simple. It is a bit tricky to dig into why things aren't working sometimes. And my code isn't really async as such. It is more that I want to be able to do a lot of things in parallel off the same lazy stream of records (so suggestions to alternatives are welcome).