core-async

slipset 2026-06-24T16:33:50.691479Z

I know that exceptions thrown in a go-loop gets swallowed and the loop dies. You install a UncaughtExceptionHandler. What I’m curious about is the design decision behind this. IMO anything other than dying silently would been a better choice?

dpsutton 2026-06-24T16:36:52.182269Z

uncaughtexception handler is on a thread and goloops don’t pin to a single thread though, right?

Alex Miller (Clojure team) 2026-06-24T16:39:03.184119Z

ideally you would not throw in the first place

Alex Miller (Clojure team) 2026-06-24T16:39:54.754729Z

you can set the default uncaught exception handler

2026-06-24T16:46:59.188779Z

> IMO anything other than dying silently would been a better choice? do you mean like catching all exceptions and just returning them or some other error-like value? that doesn't really seem like a clear win over forcing users to explicitly do that

slipset 2026-06-24T16:49:40.329769Z

I guess the problem is that we’re not forcing the user to do that. Basically your program starts failing silently. Which trips me up every time.

slipset 2026-06-24T16:50:11.348919Z

And, yes, my code shouldn’t throw, and yes I should have installed the default uncaught exception handler.

Alex Miller (Clojure team) 2026-06-24T17:02:08.846459Z

What are you doing that's throwing?

slipset 2026-06-24T17:04:49.692399Z

Stupid stuff

slipset 2026-06-24T17:06:02.639009Z

Sort of not asking for help, just the reasoning behind. I guess core.async is for experts is a good enough answer.

neumann 2026-06-24T17:06:58.745939Z

This still trips me up too.

dpsutton 2026-06-24T17:07:02.746679Z

I treat core async for communication and not execution. So error handling isn't as core as concept

2026-06-24T17:14:31.238569Z

What I see very often is core.async being used in a future like pattern, communicating the result of one shot execution of a function or something, and when you do that there is an expectation of exception propagation, maybe even cancellation, etc, all the things that you get of the box with futures

2026-06-24T17:16:51.914289Z

And you can do that (like I said I see it a lot), but given how core.asymc works and what it actually provides, there is less friction using it like a network communication channel, just in process

2026-06-24T17:20:52.505299Z

https://youtu.be/ROor6_NGIWU?si=ysEbfh_kNjucSSXN is a talk rich gave I think a little before core.async's initial release, so I suspect it contains a lot of the context for core.async

2026-06-24T17:26:18.833769Z

But I also don't know that it is a super unified vision, like this predates transducers on channels, and if you have the network kind of view, putting processing "inside" your queues doesn't seem right

2026-06-24T18:21:38.584249Z

@slipset almost sounds like you're wanting behaviour closer to manifold. https://github.com/clj-commons/manifold

2026-06-24T23:40:14.309119Z

It trips me up too. But it's also how threads behave. Like if you create a new thread and execute stuff in it. I see core.async as a pretty low level API, and then likely you'll want to create a bit of your own attraction on top. Manifold being a commonly used one. For example I made https://github.com/xadecimal/async-style which gives you full JS-like promise APIs over core.async. Small plug: I have a pretty large second version coming soon that adds full sound structured concurrency and JS for await ... style async-iterators.

2026-06-25T00:10:11.005649Z

Also, in Go, which maybe it was inspired by a bit, Go is a statement, so it returns nothing. If you want to "return an error" you put it explicitly on a channel of your own. And if an exception is thrown inside the Go, it crashes the entire application.