Clojure Programming demonstrates the language’s flexibility by showing how it can be used for common tasks like web programming and working with databases, up through more demanding applications that require safe, effective concurrency and parallelism, data analysis, and more. This in-depth look helps tie together the full Clojure development experience, from how to organize your project and an introduction to Clojure build tooling, to a tutorial on how to make the most of Clojure’s REPL during development, and how to deploy your finished application in a cloud environment.
Chas Emerick is the founder of Snowtide Informatics, a small software company in Western Massachusetts. Since 2008, he has helped to develop the core Clojure language and many Clojure open source projects. Chas writes about Clojure, software development practices, entrepreneurship, and other passions at cemerick.com.
Brian Carper is a professional programmer in the field of psychological research. He uses Clojure for data analysis and web development. He's the author of a Clojure-to-CSS compiler and relational database library, and writes about Clojure and other topics at http://briancarper.net.
Christophe Grand is an independent consultant, based near Lyon, France. He tutors, trains and codes primarily in Clojure. A participant in developing the core Clojure language, he also authored the Enlive and Moustache libaries and is a contributor to Counterclockwise, the Clojure IDE for Eclipse. Christophe writes on Clojure at clj-me.cgrand.net.
Author Jason Swartz demonstrates why Scala’s concise and expressive syntax make it an ideal language for Ruby or Python developers who want to improve their craft, while its type safety and performance ensures that it’s stable and fast enough for any application.Learn about the core data types, literals, values, and variablesDiscover how to think and write in expressions, the foundation for Scala's syntaxWrite higher-order functions that accept or return other functionsBecome familiar with immutable data structures and easily transform them with type-safe and declarative operationsCreate custom infix operators to simplify existing operations or even to start your own domain-specific languageBuild classes that compose one or more traits for full reusability, or create new functionality by mixing them in at instantiation
This second edition covers recent language features, with new chapters on pattern matching, comprehensions, and advanced functional programming. You’ll also learn about Scala’s command-line tools, third-party tools, libraries, and language-aware plugins for editors and IDEs. This book is ideal for beginning and advanced Scala developers alike.Program faster with Scala’s succinct and flexible syntaxDive into basic and advanced functional programming (FP) techniquesBuild killer big-data apps, using Scala’s functional combinatorsUse traits for mixin composition and pattern matching for data extractionLearn the sophisticated type system that combines FP and object-oriented programming conceptsExplore Scala-specific concurrency tools, including AkkaUnderstand how to develop rich domain-specific languagesLearn good design techniques for building scalable and robust Scala applications
Each chapter shows you various examples of functional thinking, using numerous code examples from Java 8 and other JVM languages that include functional capabilities. This book may bend your mind, but you’ll come away with a much better grasp of functional programming concepts.Understand why many imperative languages are adding functional capabilitiesCompare functional and imperative solutions to common problemsExamine ways to cede control of routine chores to the runtimeLearn how memoization and laziness eliminate hand-crafted solutionsExplore functional approaches to design patterns and code reuseView real-world examples of functional thinking with Java 8, and in functional architectures and web frameworksLearn the pros and cons of living in a paradigmatically richer world
If you’re new to functional programming, check out Josh Backfield’s book Becoming Functional.
The first edition of this book was released as Programming Scala.
Our industry is moving toward functional programming, but your object-oriented experience is still valuable. Scala combines the power of OO and functional programming, and Pragmatic Scala shows you how to work effectively with both. Updated to Scala 2.11, with in-depth coverage of new features such as Akka actors, parallel collections, and tail call optimization, this book will show you how to create stellar applications.
This thorough introduction to Scala will get you coding in this powerful language right away. You'll start from the familiar ground of Java and, with easy-to-follow examples, you'll learn how to create highly concise and expressive applications with Scala. You'll find out when and how to mix both imperative and functional style, and how to use parallel collections and Akka actors to create high-performance concurrent applications that effectively use multicore processors.
Scala has evolved since the first edition of this book, and Pragmatic Scala is a significant update. We've revised each chapter, and added three new chapters and six new sections to explore the new features in Scala. You'll learn how to:Safely manage concurrency with parallel collections and Akka actorsCreate expressive readable code with value classes and improved implicit conversionsCreate strings from data with no sweat using string interpolationCreate domain-specific languagesOptimize your recursions with tail call optimization
Whether you're interested in creating concise, robust single-threaded applications or highly expressive, thread-safe concurrent programs, this book has you covered.
What You Need:
The Scala compiler (2.x) and the JDK are required to make use of the concepts and the examples in this book.
In large projects, it can get difficult keeping track of all the interdependencies of the code base and how its state changes at runtime. Functional Programming helps us solve these problems. It is a paradigm specifically designed to deal with the complexity of software development. This book will show you how the right abstractions can reduce complexity and make your code easy to read and understand.
Mastering Functional Programming begins by touching upon the basics such as what lambdas are and how to write declarative code with the help of functions. It then moves on to more advanced concepts such as pure functions and type classes, the problems they aim to solve, and how to use them in real-world scenarios. You will also explore some of the more advanced patterns in the world of functional programming, such as monad transformers and Tagless Final. In the concluding chapters, you will be introduced to the actor model, implement it in modern functional languages, and explore the subject of parallel programming.
By the end of the book, you will have mastered the concepts entailing functional programming along with object-oriented programming (OOP) to build robust applications.What you will learnWrite reliable and scalable software based on solid foundationsExplore the cutting edge of computer science researchEffectively solve complex architectural problems in a robust wayAvoid unwanted outcomes such as errors or delays and focus on business logicWrite parallel programs in a functional style using the actor modelUse functional data structures and collections in your day-to-day workWho this book is for
If you are from an imperative and OOP background, this book will guide you through the world of functional programming, irrespective of which programming language you use.
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 structuresCreate, develop and publish libraries, using the Leiningen toolInteract with the local computer that’s running your applicationManage network communication protocols and librariesUse techniques for connecting to and using a variety of databasesBuild and maintain dynamic websites, using the Ring HTTP server libraryTackle application tasks such as packaging, distributing, profiling, and loggingTake on cloud computing and heavyweight distributed data crunchingDive into unit, integration, simulation, and property-based testingClojure 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.
The first half of the book takes you through Clojure’s unique design and lets you try your hand at two Clojure projects, including a web app. The holistic course in second half provides you with critical tools and resources, including ways to plug into the Clojure community.Understand the basic structure of a Clojure expressionLearn how to shape and control code in a functional wayDiscover how Clojure handles real-world state and concurrencyTake advantage of Java classes and learn how Clojure handles polymorphismManage and use libraries in a Clojure projectUse the core.async library for asynchronous and concurrent communicationExplore the power of macros in Clojure programmingLearn how to think in Clojure by following the book’s seven-week training course