Description
Clojure is a new Lisp that runs on the JVM and CLR and offers novel approaches to writing highly concurrent programmes. Rather than relying on cumbersome locking primitives, Clojure provides a set of powerful, immutable-by-default data types, as well as language-level support for mutating them in controlled ways. We'll look at just enough Clojure syntax to get a sense of how this approach to managing concurrency-based complexity works. No prior knowledge of Clojure is assumed or required.
Syllabus :
1. Introduction
- Motivation
- Locks are Broken
- What is Clojure
- Atomic Datatypes
- Composite Datatypes
- Evaluation6mInterop
- Clojure's Approach to Concurrency
- Immutability
- Basic Ref Types
2. Vars
- What a Var Is
- Vars are bound per-thread
- Demo: vars and root bindings
- Demo: per-thread binding
- Demo: bindings, root bindings, and threads
3. Atoms
- Reference Types
- Atoms4mDemo: creating atoms
- Demo: dereferencing atoms
- Demo: updating atoms
- Demo: updating atoms with threads
- Demo: updating atoms with contention
4. Agents
- Agents
- Demo: creating and using agents
- Agents and Errors1mDemo: dealing with errors
5. Refs
- Refs
- Demo: reading and updating
- Macros
- Demo: concurrent writes
- Demo: reading without a tx
- Demo: reading with a tx
- Demo: coordinated reads
- The io! Macro
- Uniform State Transition
6. Miscellany
- Validators
- Demo: validators
- Watchers
- Demo: watchers
- Futures
- Demo: futures1mPromises
- Demo: promises
- Demo: promises and deadlock