Essential insights from Hacker News discussions

Clojure Async Flow Guide

Here's a summary of the themes expressed in the Hacker News discussion about Clojure:

Clojure's Continued Relevance and Activity

Despite concerns about its visibility on Hacker News, many users affirm that Clojure is still a relevant and active language. Updates are ongoing, with a major release occurring recently. The language is seen as mature, and while the initial "hype" may have subsided, actual usage and community engagement persist.

  • "shaunxcode: :yes #{of course it is}"
  • "aeonik: The language itself is still getting updates, a new major release was just dropped a month or two ago."
  • "cas1on: There's more clojure users than ever before and the team is active and afaik larger than ever before."
  • "cas1on: Things just mature and hype isn't as cool when you heard it 5 years ago."

Community and Learning Experience

The Clojure community is described as small to medium-sized, but also as fantastic for learning. Users appreciate the accessibility of prominent community members and the general enthusiasm. For newcomers, the learning process is reported as being fun and engaging, with helpful tools available.

  • "chamomeal: 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."
  • "chamomeal: 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!!)"

Key Tools and Ecosystem Developments

Several specific tools and ecosystem developments were highlighted as positive contributions to the Clojure experience. babashka is frequently mentioned as a delightful tool that has significantly improved developer workflows, particularly for scripting. The evolution of build tools, with deps.edn largely supplanting clj-boot, is also noted.

  • "chamomeal: Lots of very neat tools are in active development (babashka is the best thing that’s happened to my developer life in a while!!)"
  • "ethersteeds: 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."
  • "tombert: I've historically mostly used Leiningen but for the last year or so I finally migrated over to deps.edn."
  • "Volundr: Boot seems to have pretty much stalled out. I think the builtin Clojure CLI/deps.edn killed off what momentum it did have."

JVM Interoperability and Toolchain

While the JVM can sometimes be a point of friction, many users find the Clojure-on-JVM experience to be manageable and even beneficial. Improvements in Java functional interface handling have made interoperability smoother, particularly with the @FunctionalInterface attribute. The JVM toolchain, including build tools like Maven and debugging capabilities, is defended as robust and reliable.

  • "tombert: 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."
  • "tombert: 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."
  • "tombert: 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."
  • "raspasov: JVM toolchain is way better than the hellscape that are most other language ecosystems. Maven, for example, works reliably and is rock-solid."
  • "raspasov: Debug specifically is state-of-the-art. Look at YourKit, or any debugger included with common IDEs."
  • "user3939382: 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."

Concurrency and Asynchronous Programming

Concurrency is repeatedly cited as a core strength of Clojure, particularly with core.async. The upcoming JVM Virtual Threads (JEP 453) are seen as a positive development that will further enhance Clojure's concurrency story, with core.async.flow being a Clojure-native approach to structured concurrency. The ability to model complex systems as communicating channels is also a significant benefit.

  • "robto: 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."
  • "kasajian: 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."
  • "didibus: Async/await for Clojure: https://github.com/xadecimal/async-style"
  • "raspasov: That has always been one of Clojure's main strengths (async & concurrency). With the new JVM VirtualThreads, things are looking better than ever."
  • "beders: You can get basically all variations of async coding with Clojure a la carte."
  • "judge123: 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."

Developer Experience and Language Philosophy

Clojure is praised for its pleasant language design, its approach to immutability, and its functional paradigm, which many find leads to more robust and less irritating solutions. The pursuit of elegance, reminiscent of talks from the now-defunct Strange Loop conference, is also a sentiment shared by some users.

  • "aeonik: I'm still enjoying the language, and all my projects still build and run just fine."
  • "725686: I absolutely loved Hickey's talks even when I never used Clojure more than for a few simple examples."
  • "dapperdrake: Clojure taught me lisp where CL failed. Turns out that Scheme and Clojure as a lisp-1 are great for learning."
  • "tombert: So many problems become less irritating in Clojure."

Specific Concerns and Future Directions

While generally positive, some users express specific concerns, such as the perceived limitations in 3D graphics capabilities, which are acknowledged as a broader JVM issue. The exploration of WebAssembly frameworks like Blazor and their potential integration with Clojure (e.g., ClojureCLR) is also a point of discussion, indicating interest in expanding Clojure's reach.

  • "aeonik: The major frustration I have with the platform is 3D graphics. That's a JVM issue overall though."
  • "raspasov: I just saw a small 3D demo running at 120fps+ that some of the newer JVM vector APIs supposedly enable."
  • "xanth: 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²"
  • "didibus: I'm not sure, but maybe you can use Blazor with ClojureCLR. It's a feature complete Clojure for .net"