This book is intended for Java developers, who are looking for a way to expand their skills and understand new paradigms of programming. Whether you know a little bit about functional languages, or you are just getting started, this book will get you up and running with how to use your existing skills in Clojure and functional programming.What You Will LearnUnderstand the tools for the Clojure world and how they relate to Java tools and standards (like Maven)Learn about immutable data structures, and what makes them feasible for everyday programmingWrite simple multi-core programs using Clojure's core concepts, like atoms, agents and refsUnderstand that in Clojure, code is data, and how to take advantage of that fact by generating and manipulating code with macrosLearn how Clojure interacts with Java, how the class loaders work and how to use Clojure from Java or the other way aroundDiscover a new, more flexible meaning of polymorphism and understand that OOP is not the only way to get itIn Detail
We have reached a point where machines are not getting much faster, software projects need to be delivered quickly, and high quality in software is more demanding as ever.
We need to explore new ways of writing software that helps achieve those goals. Clojure offers a new possibility of writing high quality, multi-core software faster than ever, without having to leave your current platform.
Clojure for Java developers aims at unleashing the true potential of the Clojure language to use it in your projects. The book begins with the installation and setup of the Clojure environment before moving on to explore the language in-depth. Get acquainted with its various features such as functional programming, concurrency, etc. with the help of example projects. Additionally, you will also, learn how the tooling works, and how it interacts with the Java environment.
By the end of this book, you will have a firm grip on Clojure and its features, and use them effectively to write more robust programs.Style and approach
An easy to follow, step-by-step, guide on how to start writing Clojure programs making use of all of its varied features and advantages. As this is a new language, certain new concepts are supported with theoretical section followed by simple projects to help you gain a better understanding and practice of how Clojure works.
Dean Wampler, Java expert and author of Programming Scala (O'Reilly), shows you how to apply FP principles such as immutability, avoidance of side-effects, and higher-order functions to your Java code. Each chapter provides exercises to help you practice what you've learned. Once you grasp the benefits of functional programming, you’ll discover that it improves all of the code you write.Learn basic FP principles and apply them to object-oriented programmingDiscover how FP is more concise and modular than OOPGet useful FP lessons for your Java type design—such as avoiding nullsDesign data structures and algorithms using functional programming principlesWrite concurrent programs using the Actor model and software transactional memoryUse functional libraries and frameworks for Java—and learn where to go next to deepen your functional programming skills
The 10 papers presented in this volume were carefully reviewed and selected from 26 submissions. They deal with fundamental principles and innovations in the design and implementation of programming languages and systems.
A new chapter on run-time program management covers virtual machines, managed code, just-in-time and dynamic compilation, reflection, binary translation and rewriting, mobile code, sandboxing, and debugging and program analysis tools. Over 800 numbered examples are provided to help the reader quickly cross-reference and access content.
This text is designed for undergraduate Computer Science students, programmers, and systems and software engineers.Classic programming foundations text now updated to familiarize students with the languages they are most likely to encounter in the workforce, including including Java 7, C++, C# 3.0, F#, Fortran 2008, Ada 2005, Scheme R6RS, and Perl 6.New and expanded coverage of concurrency and run-time systems ensures students and professionals understand the most important advances driving software today.Includes over 800 numbered examples to help the reader quickly cross-reference and access content.
If you're looking to learn more about the core libraries and dive deep into the Clojure language, then this book is ideal for you. Prior knowledge of the Clojure language is required.What You Will LearnMaximize the impact of parallelization, functional composition, and process transformation by composing reducers and transducersProcess and manipulate data using sequences, reducers, and transducers in ClojureModify and add features to the Clojure language using macrosExplore the features of category theory and custom data sources for logic programming in ClojureOrchestrate parallelism and concurrency using built-in primitives as well as community libraries in ClojureHandle data with asynchronous and reactive programming methodologies and leverage it using the core.async libraryTest your code with unit tests, specs, and type checks to write testable codeTroubleshoot and style your Clojure code to make it more maintainableIn 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.
Mastering Clojure gives you an insight into the nitty-gritty details and more advanced features of the Clojure programming language to create more scalable, maintainable, and elegant applications. You'll start off by learning the details of sequences, concurrency primitives, and macros. Packed with a lot of examples, you'll get a walkthrough on orchestrating concurrency and parallelism, which will help you understand Clojure reducers, and we'll walk through composing transducers so you know about functional composition and process transformation inside out. We also explain how reducers and transducers can be used to handle data in a more performant manner.
Later on, we describe how Clojure also supports other programming paradigms such as pure functional programming and logic programming. Furthermore, you'll level up your skills by taking advantage of Clojure's powerful macro system. Parallel, asynchronous, and reactive programming techniques are also described in detail.
Lastly, we'll show you how to test and troubleshoot your code to speed up your development cycles and allow you to deploy the code faster.Style and approach
This is an easy-to-follow project-based guide that throws you directly into the excitement of Clojure code. Mastering Clojure is for anyone who is interested in expanding their knowledge of language features and advanced functional programming.