Explicit and Implicit Parallel Functional Programming


Book Description

This book investigates the relation between the two conflicting goals of explicitness and abstraction, for the implementation of parallel functional languages and skeletons. The first part describes the implementation of the parallel Haskell extension Eden in layers of increasing abstraction. The author derives a minimal monadic sublanguage for elementary parallel coordination, and discusses a generic runtime system for parallel computations, major parts of which are Haskell. The second main part concentrates on parallel skeletons - abstract algorithmic patterns with parallel implementation. Exemplarily, the author discusses implementations for data parallel skeletons (map, map-reduce, Google-MapReduce), and for topology skeletons, which describe interaction and communication in regularly structured process networks. The book is an in-depth study of parallel functional programming, both for researchers interested in the first part, and for professionals seeking new impulses for practical development of parallel programs. It shows that functional languages provide a suitable abstraction level to reason about parallel programming and to circumvent its complexity.




Research Directions in Parallel Functional Programming


Book Description

Programming is hard. Building a large program is like constructing a steam locomotive through a hole the size of a postage stamp. An artefact that is the fruit of hundreds of person-years is only ever seen by anyone through a lOO-line window. In some ways it is astonishing that such large systems work at all. But parallel programming is much, much harder. There are so many more things to go wrong. Debugging is a nightmare. A bug that shows up on one run may never happen when you are looking for it - but unfailingly returns as soon as your attention moves elsewhere. A large fraction of the program's code can be made up of marshalling and coordination algorithms. The core application can easily be obscured by a maze of plumbing. Functional programming is a radical, elegant, high-level attack on the programming problem. Radical, because it dramatically eschews side-effects; elegant, because of its close connection with mathematics; high-level, be cause you can say a lot in one line. But functional programming is definitely not (yet) mainstream. That's the trouble with radical approaches: it's hard for them to break through and become mainstream. But that doesn't make functional programming any less fun, and it has turned out to be a won derful laboratory for rich type systems, automatic garbage collection, object models, and other stuff that has made the jump into the mainstream.




Implicit Parallel Programming in PH


Book Description

Parallel machines are now affordable and available to many users in the form of small symmetric shared-memory multiprocessors (SMPs). Unfortunately, programming practices have not kept pace with this hardware advance. The vast majority of developers still write applications in sequential programming languages that do not exploit multiple processors. The traditional approaches for adding parallelism to applications are prone to introducing new, strange, and difficult-to-eliminate bugs. In this important new text, the authors offer a completely different vision of the future, where parallel programming is the default and sequential programming is a special case. The foundation of this vision is an implicitly parallel programming language, pH, which is the result of two decades of research by the authors. A dialect and extension of the standard nonstrict and purely functional language Haskell, pH is essentially Haskell with implicitly parallel semantics. pH's extensions to Haskell comprise a disciplined approach to shared parallel state, so that a pH program-even a beginner's program-is implicitly parallel. The authors have developed this text over ten years while teaching implicit parallel programming to graduate students at MIT and specialized short courses to undergraduates and software professionals in the U.S., Japan, and India.




Functions, Objects and Parallelism


Book Description

This book aims to show how programming will be changed by the concepts of parallel systems and how these concepts relate to the ideas of functions and objects. To demonstrate the kind of programming that can be done on these systems, the research language Balinda K is used. The book will also enhance the reader's grasp of the concepts of concurrency and modular programming, reviewing these from the perspectives of application programming in a parallel language. The book should interest graduate and senior undergraduate students of computer science and computer engineering, and IT professionals working in a multiprocesing or distributed computing environment.










Mastering Functional Programming


Book Description

Learn how functional programming can help you in deploying web servers and working with databases in a declarative and pure way Key Features Learn functional programming from scratch Program applications with side effects in a pure way Gain expertise in working with array tools for functional programming Book Description 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 learn Write reliable and scalable software based on solid foundations Explore the cutting edge of computer science research Effectively solve complex architectural problems in a robust way Avoid unwanted outcomes such as errors or delays and focus on business logic Write parallel programs in a functional style using the actor model Use functional data structures and collections in your day-to-day work Who 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.




Parallel and Concurrent Programming in Haskell


Book Description

If you have a working knowledge of Haskell, this hands-on book shows you how to use the language’s many APIs and frameworks for writing both parallel and concurrent programs. You’ll learn how parallelism exploits multicore processors to speed up computation-heavy programs, and how concurrency enables you to write programs with threads for multiple interactions. Author Simon Marlow walks you through the process with lots of code examples that you can run, experiment with, and extend. Divided into separate sections on Parallel and Concurrent Haskell, this book also includes exercises to help you become familiar with the concepts presented: Express parallelism in Haskell with the Eval monad and Evaluation Strategies Parallelize ordinary Haskell code with the Par monad Build parallel array-based computations, using the Repa library Use the Accelerate library to run computations directly on the GPU Work with basic interfaces for writing concurrent code Build trees of threads for larger and more complex programs Learn how to build high-speed concurrent network servers Write distributed programs that run on multiple machines in a network