Fork me on GitHub
#clojure-dev
<
2022-10-18
>
seancorfield17:10:19

According to https://clojure.org/dev/contrib_libs core.async is actively maintained by Rich but it feels like it's not getting much "love" and there are numerous patches that have been sat in the queue there for years. Is that a Contrib library that could reasonably be maintained more actively by one or more community members, or is it considered too close to "core" usage by various projects to be maintained outside of the Clojure core team?

👀 1
seancorfield17:10:30

(I ask because we've just switched at work to our own fork so we can get some of the patches applied and use that updated version in our production code)

Alex Miller (Clojure team)17:10:23

We are going to continue managing that one

Alex Miller (Clojure team)17:10:06

I'd be happy to hear more about what patches you're applying or finding to be important outstanding issues for you

Alex Miller (Clojure team)17:10:54

I do spend time on it, just in periodic slices

seancorfield17:10:57

@hiredman Do you want to talk about ASYNC-234 which we've applied in the fork we're using at work now, and some of the other patches you submitted ages ago that you'd like reviewed/applied?

Alex Miller (Clojure team)18:10:42

I think it's unlikely that async-234's nack patches is something we're going to do

Ben Sless18:10:09

I was also forced to apply that patch to keep a service operational (only part 1, though)

hiredman18:10:27

our fork is just the 0001 patch

Alex Miller (Clojure team)18:10:15

if that's causing a lot of pain, I'm happy to raise it up the priority list and try to look at it in the near future

👍 1
hiredman18:10:09

the 0001 patch is very conservative, but should help, but I still think core.async needs some kind of general resource cleanup mechanism (the nack stuff)

Alex Miller (Clojure team)18:10:24

I'm curious if anyone has thought about alternate timer impls

Alex Miller (Clojure team)18:10:15

I'm late for a meeting but if there are other things of similar priority, happy to hear about it

hiredman18:10:53

well, the nack patches include an alternative timeout impl, and I think I have a patch on another ticket in the jira that changes timeout to just return a ReadPort instead of a full channel

hiredman18:10:55

I have a toy alternative to core.async (that incudes a nack mechanism and follows the concurrent ml model more) that includes a timeout implementation (all the clean up of which is handled by the built in nack mechanism)

hiredman20:10:06

https://gist.github.com/hiredman/19e01f112b52e3a967af597262de3a81 is the toy for the curious, everything up to around line 430 is pretty good, the pubsub stuff is off the rails

hiredman20:10:22

usage looks very much like core.async or another kind of csp, just this Event protocol at the bottom instead of channels

hiredman20:10:00

there is no thread creationg/go macro stuff, just registering callbacks

hiredman18:10:08

so I have thought a little bit about timeouts

hiredman18:10:12

but I think the focus on "timeouts" is incorrect, the 0001 patch for example doesn't touch timeouts at all

hiredman18:10:54

the issue alts attaches callbacks to whatever, and then has no way to notify whatever it attached callbacks to that the callbacks are no good any more, so the callbacks can hang around until whatever goes through all backs and checks the flag on them

hiredman18:10:40

outside of async-234 there is https://clojure.atlassian.net/browse/ASYNC-247 which you asked for a hand with

hiredman18:10:17

https://clojure.atlassian.net/browse/ASYNC-109 is the change to make timeout return a readport

Noah Bogart18:10:25

If you care about these things, your change to the docstrings have "afterwads" instead of "afterwards"

hiredman18:10:46

my care about is I guess relative to what I consider the chances are of getting it merged

👍 1
Noah Bogart18:10:32

right, that's what I expected

hiredman18:10:34

for the nack stuff, some more precise feedback would be nice, like is some kind of nacking mechanism at all a non-starter, or is it a problem with the implementation

hiredman18:10:11

for my toy library I've got some stuff with watches on atoms, which might be a good basis for a lighter version of nacks (if I recall the handler for alts has an atom in it somewhere)

Alex Miller (Clojure team)18:10:40

just from prior conversations with Rich, I suspect that's not a solution he's going to like very much

Alex Miller (Clojure team)18:10:59

so the idea of nacks, not the impl

hiredman18:10:53

that is unfortunate

seancorfield18:10:15

Well, we'll just have to continue with our fork of core.async then -- and perhaps we'll look at alternative implementations, at least for the JVM which is really all we care about. I'd love to see a near drop-in replacement for core.async based on virtual threads for example (and we're about to go from JDK 18 to JDK 19 at work so that's a realistic possibility in some ways).

niwinz07:10:34

I'm personally started working on it, an experimental version on it in funcool/promesa only for JVM

👍 1
niwinz07:10:55

and properly test it on penpot

partyparrot 1
Alex Miller (Clojure team)19:10:30

Rich is definitely interested in that (which at some point makes some of these issues a moot point)

seancorfield19:10:44

But not interested in someone outside of core building it and then contributing it, I assume?

Alex Miller (Clojure team)19:10:10

it's not a matter of interest but rather that it's hard to come backwards from a big giant solution to the problems being addressed

Alex Miller (Clojure team)19:10:56

like if someone rewrote most of next.jdbc and offered it to you, I think you would be reticent to just merge that, even if it was a change you were already considering

seancorfield19:10:01

Are there any design docs around that would provide insight into what a vthread-powered core.async should look like? Or is this just an idea in Rich's head at the moment? Yeah, we don't want to do the work and then get it turned down, only to have Rich build something similar within core/Contrib.

seancorfield19:10:22

Would love to talk with Rich about this...

Alex Miller (Clojure team)19:10:38

just idle water cooler level chatter

seancorfield19:10:18

OK, well, let him know that we're seriously interested in it -- if he is interested and has bandwidth to discuss in more detail.

Alex Miller (Clojure team)19:10:36

something I have been working on in async (really this dates back a couple years to work from Ghadi) is https://clojure.atlassian.net/browse/ASYNC-248 which I'm hoping to get merged this week pending review from Rich

Alex Miller (Clojure team)19:10:05

@seancorfield @hiredman I think you should be able to see this filter https://clojure.atlassian.net/issues/?filter=10035 which is a prioritized list of open core.async issues that I work from

seancorfield19:10:01

Yeah, with four assigned to @hiredman 🙂

Alex Miller (Clojure team)19:10:14

everything you mentioned above is near the top of that already

Alex Miller (Clojure team)19:10:29

well I don't really look at that :)

Alex Miller (Clojure team)19:10:13

I mean I don't look at assignments, I do use this report :)

seancorfield19:10:45

I know, just pointing out that a lot of past activism on some of those top issues has come from my colleague 🙂

Alex Miller (Clojure team)19:10:58

I am aware :) and I appreciate the help