Drowning in unnecessary complexity, unmanaged state, and tangles of spaghetti code? In the best tradition of Lisp, Clojure gets out of your way so you can focus on expressing simple solutions to hard problems. Clojure cuts through complexity by providing a set of composable tools--immutable data, functions, macros, and the interactive REPL. Written by members of the Clojure core team, this book is the essential, definitive guide to Clojure. This new edition includes information on all the newest features of Clojure, such as transducers and specs. Clojure joins the flexibility and agility of Lisp with the reach, stability, and performance of Java. Combine Clojure's tools for maximum effectiveness as you work with immutable data, functional programming, and safe concurrency to write programs that solve real-world problems. Start by reading and understanding Clojure syntax and see how Clojure is evaluated. From there, find out about the sequence abstraction, which combines immutable collections with functional programming to create truly reusable data transformation code. Clojure is a functional language; learn how to write programs in a functional style, and when and how to use recursion to your advantage. Discover Clojure's unique approach to state and identity, techniques for polymorphism and open systems using multimethods and protocols, and how to leverage Clojure's metaprogramming capabilities via macros. Finally, put all the pieces together in a real program. New to this edition is coverage of Clojure's spec library, one of the most interesting new features of Clojure for describing both data and functions. You can use Clojure spec to validate data, destructure data, explain invalid data, and generate large numbers of tests to verify the correctness of your code. With this book, you'll learn how to think in Clojure, and how to take advantage of its combined strengths to build powerful programs quickly. What You Need: Java 6 or higher Clojure 1.9
"Clojure programming ... This functional programming language not only lets you take advantage of Java libraries, services, and other JVM resources, it rivals other dynamic languages such as Ruby and Python. With this comprehensive guide, you'll learn Clojure fundamentals with examples that relate it to languages you already know"--P.  of cover.
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 emphasis on functional programming. It has some interesting concepts and features such as immutability, gradual typing, thread-safe concurrency primitives, and macro-based metaprogramming, which makes it a great choice to create modern, performant, and scalable applications. This learning path aims at unleashing the true potential of the Clojure language so you can use it in your projects. It begins with installing and setting up the Clojure environment before moving on to explore the language in depth. You'll get acquainted with its various features such as functional programming, concurrency, reducers, transducers, core.async and core.logic, and so on with a great level of detail. Moving on, you'll also learn how to enhance performance using Java interoperability and JVM-specific features from Clojure; you'll even master language features such as asynchronous channels, actors, logic programming, reactive programming, metaprogramming, and so on. This learning path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products: Clojure for Java Developers by Eduardo Diaz Clojure High Performance Programming, Second Edition by Shantanu Kumar Mastering Clojure by Akhil Wali Style and approach This is an easy-to-follow, step-by-step guide to start writing Clojure programs, making use of all of its varied features and advantages.
If you are a Clojure developer who is interested in using Reactive Programming to build asynchronous and concurrent applications, this book is for you. Knowledge of Clojure and Leiningen is required. Basic understanding of ClojureScript will be helpful for the web chapters, although it is not strictly necessary.
This is a short, practical guide that will teach you everything you need to know to start writing high performance Clojure code. This book is ideal for intermediate Clojure developers who are looking to get a good grip on how to achieve optimum performance. You should already have some experience with Clojure and it would help if you already know a little bit of Java. Knowledge of performance analysis and engineering is not required. For hands-on practice, you should have access to Clojure REPL with Leiningen.
For weeks, months —nay!—from the very moment you were born, you’ve felt it calling to you. At long last you’ll be united with the programming language you’ve been longing for: Clojure! As a Lisp-style functional programming language, Clojure lets you write robust and elegant code, and because it runs on the Java Virtual Machine, you can take advantage of the vast Java ecosystem. Clojure for the Brave and True offers a “dessert-first” approach: you’ll start playing with real programs immediately, as you steadily acclimate to the abstract but powerful features of Lisp and functional programming. Inside you’ll find an offbeat, practical guide to Clojure, filled with quirky sample programs that catch cheese thieves and track glittery vampires. Learn how to: *Wield Clojure’s core functions *Use Emacs for Clojure development *Write macros to modify Clojure itself *Use Clojure’s tools to simplify concurrency and parallel programming Clojure for the Brave and True assumes no prior experience with Clojure, the Java Virtual Machine, or functional programming. Are you ready, brave reader, to meet your true destiny? Grab your best pair of parentheses—you’re about to embark on an epic journey into the world of Clojure!
With more than 150 detailed recipes, this cookbook shows experienced Clojure developers how to solve a variety of programming tasks with this JVM language. The solutions cover everything from building dynamic websites and working with databases to network communication, cloud computing, and advanced testing strategies. And more than 60 of the world’s best Clojurians contributed recipes. Each recipe includes code that you can use right away, along with a discussion on how and why the solution works, so you can adapt these patterns, approaches, and techniques to situations not specifically covered in this cookbook. Master built-in primitive and composite data structures Create, develop and publish libraries, using the Leiningen tool Interact with the local computer that’s running your application Manage network communication protocols and libraries Use techniques for connecting to and using a variety of databases Build and maintain dynamic websites, using the Ring HTTP server library Tackle application tasks such as packaging, distributing, profiling, and logging Take on cloud computing and heavyweight distributed data crunching Dive into unit, integration, simulation, and property-based testing Clojure Cookbook is a collaborative project with contributions from some of the world’s best Clojurians, whose backgrounds range from aerospace to social media, banking to robotics, AI research to e-commerce.