From First Steps to Professional Mastery in Functional Programming
Introduction: Why Clojure?
- The Complexity Crisis
- Three Pillars
- Who This Book Is For
- How This Book Is Organized
- What You Will Be Able To Do
- A Note on Versions
Chapter 1: Getting Started, Installation and Your First Program
- The Clojure Ecosystem Landscape
- Installing the Tooling
- Your First REPL Session
- Writing Your First File
- Development Environment Setup
- Exercise: Your First Project
- Common First-Time Pitfalls
Chapter 2: The Lisp Foundation, Syntax and Evaluation
- S-Expressions and the Uniform Data Model
- The Read-Eval-Print Loop
- Special Forms vs Functions
- Naming and Namespace Conventions
- Reading Clojure Code
- Exercises
Chapter 3: Data Structures, The Heart of Clojure
- Vectors and Lists
- Maps and Keywords
- Sets and Strings
- Persistent Data Structures Explained
- Transients for Performance
- Comparing with Other Languages’ Collections
- Exercises
Chapter 4: Functions and Functional Programming
- Defining Functions
- First-Class and Higher-Order Functions
- Pure Functions and Side Effects
- Destructuring Deep Dive
- Thread Macros and Flow Control
- Composing Functions
- Exercises
Chapter 5: Immutability and State Management
- Why Immutability?
- Atoms
- Refs and Software Transactional Memory
- Agents
- Vars and Dynamic Binding
- Choosing the Right State Mechanism
- Exercises
Chapter 6: Sequences and Lazy Evaluation
- The Sequence Abstraction
- Core Sequence Functions
- Lazy Sequences
- Performance of Laziness
- Reduction and Transducers
- Working with Collections in Practice
- Exercises
Chapter 7: Macros, Metaprogramming with Code as Data
- What Are Macros?
- Writing Your First Macro
- Common Macro Patterns
- Macro Debugging and Testing
- When NOT to Use Macros
- Reading Library Macros
- Exercises
Chapter 8: Concurrency and Parallelism
- The Concurrency Problem
- Thread Pools and Executors
- Core.Async for Message Passing
- Clojure’s STM in Practice
- Parallel Reduction and Transducers
- Manifold: An Alternative to core.async
- Parallel Reduction with clojure.core.reducers
- Testing Concurrent Code
- Exercises
Chapter 9: Protocols, Multimethods, and Polymorphism
- Protocols
- Records
- Multimethods
- Types and the deftype/defrecord Distinction
- Extensibility Patterns
- Exercises
Chapter 10: Java Interoperability
- Calling Java from Clojure
- JavaBeans Syntax
- Importing and Namespaces
- Implementing Java Interfaces
- Building JVM Libraries
- Common Interop Patterns
- Exercises
Chapter 11: Performance and Optimization
- Understanding Clojure Performance
- Type Hints and Primitives
- Profiling Tools
- Memory Management
- Common Performance Pitfalls
- Benchmarking Methodology
- Exercises
Chapter 12: Testing and Quality Assurance
- Clojure.Test
- Spec and Data-Driven Testing
- Malli: High-Performance Data Specification
- Property-Based Testing with test.check
- Mocking and Stubbing
- Test-Driven Development in Clojure
- Continuous Integration
- Exercises
Chapter 13: Build Tools, Dependency Management, and Project Structure
- The clojure CLI Tool
- deps.edn Deep Dive
- Leiningen
- Dependency Management
- Project Structure Conventions
- Build Profiles and Environments
- Publishing Libraries
- Exercises
Chapter 14: REPL-Driven Development
- The Philosophy of REPL-Driven Development
- REPL Workflows
- Tools for Advanced REPL Use
- Debugging with the REPL
- Building with the REPL
- REPL-Driven Testing
- Exercises
Chapter 15: Web Development and Application Architecture
- Web Frameworks Overview
- Building a REST API
- Template Engines and Frontend Integration
- Database Integration
- Running Project: Building a Transaction API
- Application Architecture Patterns
- Authentication and Security
- Exercises
Chapter 16: ClojureScript and Full-Stack Development
- ClojureScript Compilation
- Shadow-CLJS
- Reagent and React Integration
- Full-Stack Patterns
- ClojureScript Ecosystem
- Deployment of ClojureScript Apps
- Running Project: TxFlow Frontend
- Exercises
Chapter 17: The Modern Clojure Ecosystem
- Documentation Tools
- Logging and Observability
- Configuration Management
- Deployment and DevOps
- Structured Logging
- Metrics and Observability with OpenTelemetry
- Secrets Management
- CI/CD Pipeline Example
- Community Resources
- The Future of Clojure
- How Experienced Clojurists Approach Problem-Solving
- Running Project: Deploying TxFlow to Production
- Exercises
Conclusion: The Clojure Way Forward
- What Makes Clojure Unique
- When to Choose Clojure
- The Career Dimension
- A Final Meditation on Simplicity
Appendix A: Glossary of Clojure Terms
Appendix B: Quick-Reference Syntax Cheat Sheet
- Basic Syntax
- Data Structures
- Destructuring Patterns
- Thread Macros
- Java Interop
- State Management Quick Reference
Appendix C: Core Function Reference Table
- Sequence Functions (clojure.core)
- Collection Functions
- Predicate Functions
- Math and Numeric Functions
- String Functions (clojure.string)
Appendix D: Naming Conventions Cheat Sheet
- Namespace Names
- Function and Variable Names
- Keyword Names
- Metadata Conventions
- File Extension Conventions
