Getting started with Core.Async, Var, Atom, Agents & Refs
Introduction: Clojure propose different primitives to build concurrent programs. When I started looking at Clojure, the topic was fairly blurry in my mind and I couldn’t understand why it was done differently. The way I see it now is:
The concurrency primitives of Clojure was made for the same reason we went from assembly to some higher level language: Easier abstraction that makes your program simpler to reason about. At the end of the day, It still relies on the low level primitives we have in other languages such as Mutex and Semaphore but the abstraction it creates allows for programs that are not only safer but also simpler to understand and reason about. Once we understand that, we need to grasp that fundamentally, there’s two ways to communicate and interact with subsystems:
- Message passage communication: that’s what we found in the nature! Independant subsytem that communicate with each...