Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Clojure Data Structures and Algorithms Cookbook

You're reading from   Clojure Data Structures and Algorithms Cookbook 25 recipes to deeply understand and implement advanced algorithms in Clojure

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781785281457
Length 216 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rafik Naccache Rafik Naccache
Author Profile Icon Rafik Naccache
Rafik Naccache
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Revisiting Arrays FREE CHAPTER 2. Alternative Linked Lists 3. Walking Down Forests of Data 4. Making Decisions with the Help of Science 5. Programming with Logic 6. Sharing by Communicating 7. Transformations as First-class Citizens Index

Preface

The invention of Lisp by John McCarthy in 1958 is certainly one of the most seminal events in the history of computer science. Originally intended as a way of porting Alonzo Church's lambda calculus theory into the realm of computer programs, Lisp pioneered many original ideas, such as higher order functions, recursion, and even garbage collection that proved to be so highly pragmatic that practically every modern high-level programming language of today is very likely built on some significant Lisp legacy.

However, beyond any practical or technical contribution, Lisp's most important trait is undeniably its unparalleled expressiveness. It's simplistic, yet its extremely elegant syntax propels it as a privileged tool for creative computer scientists, one which you could use as a powerful "building material" to erect algorithmic monuments without worrying about ancillary implementation details. It's certainly this ability of abstracting away "incidental complexity" that made Lisp the language for conducting Artificial Intelligence experiments, for instance.

Clojure, as a modern Lisp language, leverages this extraordinary expressive power to provide a platform that is highly suitable for algorithmic exploration. The abstractions it offers, the functional approach it suggests, as well as the built-in concurrency it supports, are all valuable facilities that enable straight and noise-free problem solving, which is an alternative way of approaching algorithms' design and sometimes, even innovative out-of-the-box thinking.

This book tries to underpin this idea. Using Clojure, we'll consider seven areas of algorithmic challenges and try to address them by taking advantage of all the power that we can get from this Lisp dialect. Besides, while choosing these seven problem domains, I tried to attain two main objectives. First, I wanted to tackle algorithms that have concrete real-world usage, and theory in the recipes will only be present to serve well-defined use cases in our everyday work with computers. Second, I tried to come up with material as varied as possible, so that the recipes cover a wide range of topics, from compressing files and building parsers to designing HTML5 interactive games and assembling type inferencers.

As far as the recipes' general layout is concerned, at the beginning, you will be given a thorough introduction to the intuition and the theory behind the algorithm being studied. Then, I will elaborate on every recipe's detail, making sure that I've explained every step and extensively commented the code. At the end of every recipe, you will see a sample usage of what has been implemented. This way, you will be guided through the whole process: the algorithm inception, its implementation, and its testing. In this process, I hope to have had mirrored the Clojure interactive workflow, in which the developer builds their program function by function, going back and forth to his/her REPL.

I really enjoyed the process of writing this book. I can, for sure, assert that the Clojure promise of high expressive power has been fulfilled for this particular project, as I came up with quite complex algorithmic implementations with reasonable effort while being really productive. My only wish is that you, by the end of this work, will be as convinced by Clojure and Lisp as I am.

You can reach me at @turbopape on Twitter, I'll answer, with extreme pleasure, all your questions.

lock icon The rest of the chapter is locked
Next Section arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image