5
votes

Is core.async a replacement to Lamina or does it intend to become a replacement for Lamina?

If not, are there clear situations where one is preferable over the other?

2
The many flavors of concurrency in Clojure may be interesting - adambard.com/blog/clojure-concurrency-smorgasbordedbond
I saw that and although it was a great article, it was a bit too 'nice' to answer my question I think.shmish111

2 Answers

14
votes

I'm the author of Lamina. I think core.async is a well-made library, with a lot more clarity in its design than Lamina. There are things that I think Lamina is better at, mostly related to introspection, performance, and extensibility.

The big problem I have with core.async is that in addition to a stream abstraction, it brings along an execution model (everything happens on the core.async thread pools), which means that if you use it anywhere, it constrains the design and implementation of everything else in your codebase.

I've seen a number of "async" libraries made that expose streams as core.async channels, which means that you can only use the libraries if you're comfortable using the core.async execution model.

I'm about to release a library that tries to be a "minimal" stream representation that can be used in place of core.async, Lamina, Java blocking queues, etc. called Manifold. A Manifold stream can be coerced to a core.async channel, Lamina channel, and so on, and any of these things can be coerced back into a Manifold stream.

I think the "async" landscape is still quite young, and there are a lot of unexplored problems w.r.t. how well the abstractions scale, how easy they are to debug in production, and so on. The JVM provides a lot of tools for introspection, but since the async mechanisms use a complete different execution model we're basically starting over again from scratch. I wouldn't tell you to use Lamina over core.async, but I would caution that core.async is an application-level abstraction, not a library-level one.

3
votes

core.async and Lamina are two different projects and they aren't intended to replace each other. Actually, they could play nicely together -if you want to-.
Lamina is a stream oriented approach, while core.async is message oriented.

Which one to use is up to you. In Lamina, the important thing is the callbacks you define for the channel, while in core.async, channels and go blocks are decoupled, and this is more flexible and modular.