Description
Explore the world of lightning fast Clojure apps with asynchronous channels, logic, reactive programming, and more
About This Book
• Discover Clojure's features and advantages and use them in your existing projects
• Explore lesser-known and more advanced features, constructs, and methodologies such as asynchronous channels, actors, logic programming, and reactive programming
• Measure and monitor performance, and understand optimization techniques
Who This Book Is For
If you're looking to learn more about its core libraries and delve into the Clojure language in detail, then this book is ideal for you. Prior knowledge of the Clojure language is required.
What You Will Learn
• Understand tools for the Clojure world and how they relate to Java tools and standards (such as Maven)
• Write simple multicore programs using Clojure's core concepts, such as atoms, agents, and refs
• Get to grips with Clojure's concurrency and state-management primitives in depth
• Analyze latency using the Criterium library
• Avoid reflection and boxing with type hints
• Maximize the impact of parallelization, functional composition, and process transformation by composing reducers and transducers
• Modify and add features to the Clojure language using macros
• Test your code with unit tests, specs, and type checks to write testable code
• Troubleshoot and style your Clojure code to make it more maintainable
In Detail
Clojure is a general-purpose language from the Lisp family with an emphasi
Chapter
Getting started with Clojure code and data
Namespaces, Packages,
and Tests
The classpath and the classloader
Chapter 2: Interacting with Java
Writing a simple image namespace
Exposing your code to Java
Chapter 4: Collections and Functional Programming
Basics of functional programming
Types of collections in Clojure
Specific collection types in Clojure
Chapter 5: Multimethods and Protocols
Using your Java knowledge
The Clojure model of state and identity
Software transactional memory and refs
Chapter 7: Macros in Clojure
Lisp's foundational ideas
Macros as code modification tools
Debugging your first macro
Module 2: Clojure High Performance Programming, Second Edition
Chapter 1: Performance by Design
A structured approach to the performance
The performance vocabulary
The latency numbers that every programmer should know
Chapter 2: Clojure Abstractions
Non-numeric scalars and interning
Identity, value, and epochal time model
Persistent data structures
Chapter 3: Leaning on Java
Inspecting the equivalent Java source
for Clojure code
Numerics, boxing, and primitives
Reflection and type hints
Using array/numeric libraries for efficiency
Resorting to Java and native code
Chapter 4: Host Performance
Measuring latency with Criterium
Asynchronous agents and state
Coordinated transactional ref and state
Dynamic var binding and state
Validating and watching the reference types
Java concurrent data structures
Clojure parallelization and the JVM
Parallelism with reducers
Chapter 6: Measuring Performance
Performance measurement and statistics
Chapter 7: Performance Optimization
Identifying performance bottlenecks
Profiling code with VisualVM
Chapter 8: Application Performance
I/O batching and throttling
Performance and queueing theory
Module 3: Mastering Clojure
Chapter 1: Working with Sequences
and Patterns
Defining recursive functions
Working with pattern matching
Chapter 2: Orchestrating Concurrency and Parallelism
Managing concurrent tasks
Executing tasks in parallel
Chapter 3: Parallelization Using Reducers
Using reduce to transform collections
Using fold to parallelize collections
Processing data with reducers
Chapter 4: Metaprogramming
with Macros
Reading and evaluating code
Quoting and unquoting code
Chapter 5: Composing Transducers
Understanding transducers
Chapter 6: Exploring Category Theory
Demystifying category theory
Using applicative functors
Chapter 7: Programming with Logic
Diving into logic programming
Thinking in logical relations
Chapter 8: Leveraging Asynchronous Tasks
Chapter 9: Reactive Programming
Reactive programming with fibers
and dataflow variables
Using Reactive Extensions
Using functional reactive programming
Building reactive user interfaces
Chapter 10: Testing Your Code
Chapter 11: Troubleshooting and Best Practices
Logging errors in your application