NHacker Next
login
▲Clojure Async Flow Guideclojure.github.io
78 points by simonpure 4 hours ago | 33 comments
Loading comments...
robto 3 hours ago [-]
I've been meaning to try this out, from my read it's a declarative way to get some structured concurrency. I work in a codebase that heavily uses core.async channels to manage concurrency and you really need to pay close attention to error handling. When you're spawning new threads you need to set up your own custom machinery to re-throw errors on a chans, close chans, and it looks like core.async.flow is a way to do all of this declaratively.

Just like `core.async` itself was a frontrunner of Virtual Threads on the JVM, I view `core.async.flow` as the Clojure version of the upcoming [0]Structured Concurrency JEP. I do wonder if it will use that under the hood once it becomes stable, the same way `core.async` is planning to move away from the `go` macro to just have it dispatch a virtual thread.

[0]https://openjdk.org/jeps/453

725686 3 hours ago [-]
Is Clojure still a thing? I sure would hope so, but I haven't seen much of Clojure activity in HN recently.
aeonik 3 hours ago [-]
The language itself is still getting updates, a new major release was just dropped a month or two ago.

I do find that for about 5 years things seemed to be slowing down. Though I keep seeing it pop up, and new exciting projects seem to pop up from time to time.

Just today I saw an article about Dyna3, a relational programming language for AI and ML that was implemented on top of Clojure.

I miss the Strange Loop conference. I think a lot of Clojure buzz was generated there. Clojure West and a few others so a decent job, but the quality of the talks at Strange Loop were second to none. Not that it was a Clojure specific conference, but it had that focus on elegance that I don't see very often, and the organizer was a something like the Prince of Clojure, if I recall correctly.

I'm still enjoying the language, and all my projects still build and run just fine.

The major frustration I have with the platform is 3D graphics. That's a JVM issue overall though.

17 minutes ago [-]
raspasov 53 minutes ago [-]
I just saw a small 3D demo running at 120fps+ that some of the newer JVM vector APIs supposedly enable.

Link to demo @ timestamp: https://youtu.be/UVsevEdYSwI?t=653

My experience with 3D graphics is minimal, but I'm curious to know if these newer developments are significant in any way for 3D work.

725686 1 hours ago [-]
I absolutely loved Hickey's talks even when I never used Clojure more than for a few simple examples.
dapperdrake 2 hours ago [-]
They even invited Guy Lewis Steele, Jr. hos talk is on YouTube and was awesome. His meta-notation is explained more expansively in a paper on his Oracle page.
ethersteeds 2 hours ago [-]
As others have said, Clojure is still a thing. For anyone catching up with Clojure again after some time: check out Babashka! Think bash scripts, written in Clojure. It's delightful.

https://babashka.org/

KingMob 30 minutes ago [-]
It is, but the community has been shrinking in recent years.

FWIW, Google Trends shows the hype peaking in 2016, but I doubt that reflects usage as much as buzz.

Instead, if you look at the annual State of Clojure survey results, which solicits opinions directly from the community, the number of responders peaked in 2020 at ~2500, and is down to ~1500 for the most recent 2024 survey.

- 2020 State of Clojure - https://www.surveymonkey.com/results/SM-CDBF7CYT7/

- 2024 State of Clojure - https://www.surveymonkey.com/results/SM-hht04mGydwZ6Nqr7N8vj...

xanth 2 hours ago [-]
I was asking the same question today after investigating XTDB¹ (a Clojure centric bitemporal DB) and went looking for a batteries included WebAssembly framework like Blazor²

1. https://xtdb.com/

2. https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz...

didibus 53 minutes ago [-]
I'm not sure, but maybe you can use Blazor with ClojureCLR. It's a feature complete Clojure for .net
casion 2 hours ago [-]
There's more clojure users than ever before and the team is active and afaik larger than ever before.

Things just mature and hype isn't as cool when you heard it 5 years ago.

raspasov 59 minutes ago [-]
Very much still a thing. Even on HN: https://hn.algolia.com/?dateRange=all&page=1&prefix=false&qu...
tombert 2 hours ago [-]
I still use it. They finally fixed my biggest complaint about it a year ago, which is that you couldn't use vanilla Clojure lambdas for the Java functional interface, and so you'd have to reify that interface and it was bulky and ugly. Now it works fine so long as the interfaces actually have the @FunctionalInterface attribute.

Not every project uses @FunctionalInterface, but I've been trying to add it to places [1] [2] [3], and now I'm able to use Clojure in a lot more places.

[1] https://github.com/LMAX-Exchange/disruptor/pull/492

[2] https://github.com/apache/kafka/pull/19234

[3] https://github.com/apache/kafka/pull/19366

chamomeal 3 hours ago [-]
I’d say clojure is very alive and happy. I’m a clojure newb and have been having a super fun time getting into it. Lots of very neat tools are in active development (babashka is the best thing that’s happened to my developer life in a while!!)

The small-medium sized community is actually fantastic for learning. The big names in the community are only a slack away, and everybody is so enthusiastic.

shaunxcode 3 hours ago [-]
:yes #{of course it is}
3 hours ago [-]
chr15m 2 hours ago [-]
Is Make still a thing? I sure would hope so, but I haven't seen much of Make activity in HN recently.
kasajian 1 hours ago [-]
Funny. I was just thinking about dismissing Clojure for a project I'm going to work on because I was concerned about it's lack of ability to work with async calls. I'm too used to how async in JavaScript and C#, and I'm not sure I'd want to work in an environment that doesn't have a simple way to structure async calls. It doesn't necessarily have to be async / await. Just some attention to the issue rather than completely ignoring it.
raspasov 48 minutes ago [-]
That has always been one of Clojure's main strengths (async & concurrency). With the new JVM VirtualThreads, things are looking better than ever.

The transition of core.async specifically to VirtualThreads is still WIP as far as I understand, but with minimal tweaks, 90% of the benefits are already there, even with the current latest version.

didibus 57 minutes ago [-]
Async/await for Clojure: https://github.com/xadecimal/async-style
beders 47 minutes ago [-]
You can get basically all variations of async coding with Clojure a la carte.
user3939382 3 hours ago [-]
I think LISP is cool and want to use it more but I have 0 appetite to learn the toolchain and debug etc for JVM. You have Racket but Clojure ecosystem is already tiny.
raspasov 2 hours ago [-]
That’s a common misconception. JVM toolchain is way better than the hellscape that are most other language ecosystems. Maven, for example, works reliably and is rock-solid. The only unsolved problem is if you get two libraries/frameworks requesting another dependency, but with different incompatible versions. But I don’t think most other ecosystems solve that painlessly either.

Debug specifically is state-of-the-art. Look at YourKit, or any debugger included with common IDEs.

None of those tools has a shiny Visual 2025 aesthetic, but again, they work reliably and are going to work the same way a year from now.

sieabahlpark 2 hours ago [-]
[dead]
tombert 2 hours ago [-]
Leiningen and deps.edn shield you a bit from the awfulness of Java project management. They feel a lot more like something you'd see in Node.js or something, but it still gets dependencies from Maven Central.

Debugging and profiling is still somewhat Java based, and yeah that's can be irritating, but you get used to it.

Personally I do think that it's worth it; Clojure is a very pleasant language that has no business being as fast as it is, and core.async is an absolutely lovely concurrency framework if you can convert your logic into messaging, and you have Haskell-style transactional memory for stuff that can't be. So many problems become less irritating in Clojure.

dapperdrake 2 hours ago [-]
Is clj-boot still a thing or was it ever a thing?

It or or was a build tool like Leiningen.

Volundr 32 minutes ago [-]
Boot seems to have pretty much stalled out. I think the builtin Clojure CLI/deps.edn killed off what momentum it did have.
tombert 1 hours ago [-]
I've never used clj-boot. I've historically mostly used Leiningen but for the last year or so I finally migrated over to deps.edn.
dapperdrake 2 hours ago [-]
Clojure taught me lisp where CL failed. Turns out that Scheme and Clojure as a lisp-1 are great for learning.

Switched to SBCL for the faster star-up times. Now lisp-2 also feels more comfortable.

judge123 1 hours ago [-]
For me, the real 'click' moment with core.async wasn't just about replacing callbacks. It was realizing I could model entire business processes as a system of communicating channels. It completely changed how I think about system design.
nromiun 1 hours ago [-]
This is cool. So basically you create a group of threads and you can treat them as one unit. Trio does something similar (structured concurrency) with async functions for Python. Are these OS threads or green threads?
didibus 55 minutes ago [-]
They can be OS threads or green threads, you can choose.
nromiun 21 minutes ago [-]
Are OS threads still the default and you have to pass a virtual thread executor to use virtual threads?
2 hours ago [-]
yayitswei 1 hours ago [-]
See also for related ideas: missionary/electric for frontend and rama for backend. I wish for a unified interface combining the best of all three!
Abdii430 2 hours ago [-]
https://www.facebook.com/profile.php?id=61579582377159