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
After reading and using Quick Clojure, you'll come away with first-hand knowledge and advice on how to quickly adopt, use, and apply Clojure without all the theoretical baggage that bigger books can sometimes bring.
What You'll LearnWork with data structures and their syntax
Discover OOP in Clojure with patterns, polymorphisms, pattern matching, and concurrency
Use conventions, organization, and namespaces in Clojure
Create command-line apps
Build various Clojure projects with the Leiningen IDE tool and framework
Who This Book Is For
Programmers with experience. A Java background would be helpful, but not required.
The book supplies a conceptual framework for different aspects of parallel algorithm design and implementation. It first addresses the limitations of traditional programming techniques and models when dealing with concurrency. The book then explores the current state of the art in concurrent programming and describes high-level language constructs for concurrency. It also discusses the historical evolution of hardware, corresponding high-level techniques that were developed, and the connection to modern systems, such as multicore and manycore processors. The remainder of the text focuses on common high-level programming techniques and their application to a range of algorithms. The authors offer case studies on genetic algorithms, fractal generation, cellular automata, game logic for solving Sudoku puzzles, pipelined algorithms, and more.
Illustrating the effect of concurrency on programs written in familiar languages, this text focuses on novel language abstractions that truly bring concurrency into the language and aid analysis and compilation tools in generating efficient, correct programs. It also explains the complexity involved in taking advantage of concurrency with regard to program correctness and performance.
If you are a PHP developer with knowledge of object-oriented programming, this book is for you. You do not need prior experience with functional programming.What You Will LearnDeclare functions/callables and find out how to manipulate and call themWrite pure functions to get more robust code that can be easily testedLearn to compose function using various techniquesUse a functional approach to find readable solutions to common issuesUtilize performance optimization techniques such as laziness, memorization, and parallelizationBuild the business logic of applications with the functional paradigmTest functional code and know how to speed up test runs using parallel testingUnderstand the impact and limitation of functional programming in PHPIn Detail
A functional approach encourages code reuse, greatly simplifies testing, and results in code that is concise and easy to understand. This book will demonstrate how PHP can also be used as a functional language, letting you learn about various function techniques to write maintainable and readable code.
After a quick introduction to functional programming, we will dive right in with code examples so you can get the most of what you've just learned. We will go further with monads, memoization, and property-based testing. You will learn how to make use of modularity of function while writing functional PHP code.
Through the tips and best practices in this book, you'll be able to do more with less code and reduce bugs in your applications. Not only will you be able to boost your performance, but you will also find out how to eliminate common loop problems. By the end of the book, you will know a wide variety of new techniques that you can use on any new or legacy codebase.Style and approach
This is an easy-to-follow, definitive guide on developing applications using a functional paradigm with PHP. It will guide you through functional programming with the help of real-life examples.
Accessible structure guides the student through various programming languages
Seamlessly integrated practice exercises
Online support materials
Advance Praise for Lee’s Programming Languages: An Active Learning Approach
"The Programming Languages book market is overflowing with books, but none like this. In many ways, it is precisely the book I have been searching for to use in my own programming languages course. One of the main challenges I perpetually face is how to teach students to program in functional and logical languages, but also how to teach them about compilers. This book melds the two approaches very well."
-- David Musicant, Carleton College
If you're a finance professional who is currently using VBA (Excel) to perform financial calculations and quantitative analysis, and would like to use Clojure instead to improve their efficiency, then this book is for you.
Basic knowledge of financial concepts is essential. Basic programming knowledge would also be an added advantage.What You Will LearnQuickly and effectively represent data and calculations using ClojureUse Clojure's basic language tools such as laziness, immutability, and firstclass functions to solve real-world problemsExplore mathematical derivatives to generate different wave formsGet acquainted with the advanced approaches to calculating and transforming data, and building algorithmsUse Clojure's functions to access, update, and compose data structuresBe introduced to the concept of sideeffecting behavior and the different ways to handle itCompose simple and exponential functions together to get a buy or sell signalIn Detail
Clojure is a dynamic programming language with an emphasis on functional programming. Clojure is well suited to financial modeling as it is a functional programming language. Such languages help developers work with high-level mathematical abstractions without having to implement low-level code that handles the arithmetic operations.
Starting with the importance of representing data and calculations effectively, this book will take you all the way to being competent in financial analytics and building financial applications.
First, we introduce the notions of computation and finance, which will help you understand Clojure's utility to solve real-world problems in many domains, especially finance. Next, we will show you how to develop the simple-moving-average function by using the more advanced partition Clojure data transformation function. This function, along with others, will be used to calculate and manipulate data.
You will then learn to implement slightly more complicated equations, how to traverse data, and deal with branching and conditional dispatch. Then, the concept of side-effecting and its various approaches are introduced, along with the strategy of how to use data as the interface to other systems. Finally, you will discover how to build algorithms while manipulating and composing functions.Style and approach
This book is a practical step-by-step tutorial that provides a basic overview of the concepts but focuses on providing the skills required to analyze data.