Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Clojure for Domain-specific Languages
- ISBN-101782166505
- ISBN-13978-1782166504
- PublisherPackt Publishing
- Publication dateDecember 18, 2013
- LanguageEnglish
- Dimensions7.5 x 0.61 x 9.25 inches
- Print length268 pages
Product details
- Publisher : Packt Publishing
- Publication date : December 18, 2013
- Language : English
- Print length : 268 pages
- ISBN-10 : 1782166505
- ISBN-13 : 978-1782166504
- Item Weight : 1.05 pounds
- Dimensions : 7.5 x 0.61 x 9.25 inches
- Customer Reviews:
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
- 2 out of 5 stars
Promising Title, Fails To Deliver
Reviewed in the United States on January 18, 2014What a great title, eh? Clojure's a fantastic language for writing
DSLs, and yet it's a hard topic get into. A good book on the subject
is just what the Clojure ecosystem needs.
Sadly, this isn't that book.
The biggest problem is that there's hardly any content about writing
DSLs. This is a ~240 page book, and about 200 of that is just "Intro
to Clojure" stuff. That would be fine, but there are much better
introductory books out there.
Filler aside, that leaves maybe 40 pages that are actually about writing
DSLs. Sadly it's the weakest stuff in the book. It consists of two
examples of using Clojure to wrap existing Java libraries. One's a
Twitter client, the other's a wrapper around Java's Date & Calendar
classes. And there's no way around saying this - both are badly written.
It would be a terrible shame if any beginner in Clojure read this
stuff and thought it was a good way to proceed. What should be a
simple function to read a config file into a map is presented in an
overwrought, brittle and O(n^2) complex fashion. Macros are used
frequently but never appropriately. Clojure code drops down into Java
interop for no good reason at all. And the author seems to have an
obsession with dynamically-binding variables, regardless of whether
it's appropriate. I strongly suspect the writer doesn't understand
what they're for. Either way, the Twitter DSL is going to break as
soon as you do anything interesting with it, like delay the results.
So is there anything here to like? Yes, the author is quite lucid. His
technical writing reads easily. I hope he writes a book on another
topic one day - but he'll need to be far better versed in the
material.
8 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 1 out of 5 stars
Not much about DSLs
Reviewed in the United States on January 2, 2014More than half of this book is just an introduction to Clojure and Clojure tools. Only one chapter out of eleven is actually about making a DSL using macros and only one example is given, a tiny Twitter DSL that probably would have been better if implemented with ordinary functions instead of macros. Even in this chapter, the text strays off into general matters.
If a Twitter API should have a cool DSL as part of it, the obvious candidate is a DSL for building Twitter query strings, like ClojureQL for SQL. The Twitter DSL in this book doesn't even touch the idea, but uses plain strings for queries.
If you're thinking about making a DSL in Clojure: 1) try to use ordinary functions first, and 2) don't buy this book.
3 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 3 out of 5 stars
A short introduction for Clojure and DSL
Reviewed in the United States on February 8, 2014Besides its lean way of defining Clojure concepts and what a Domain Specific Language is with easy to follow examples, what I do like most is the comprehensive appendixes which directs you to broaden the scope of the book.
Chapter 1
Goal: to have an understanding as to when and where to use a DSL.
A DSL is a language dedicated to solving only one type of problem. The language can't make the problem domain less complex, but it can separate the complexities of the problem for the person using the language. Generally speaking, a DSL only simplifies the nomenclature of the problem domain but never completely removes it. The same terms used to solve the problem need to persist within the language, so that the expressions can be written and understood by those familiar with that particular domain.
We should also ask ourselves if we even need a DSL when trying to solve our problems, because sometimes they add more layers of complexity than the original problem.
Chapter 2:
Design concepts are well and simply defined. My favorite part is the anti patterns part where each of them is described with do and don't examples of code.
Chapter 3:
Takes you from the beginning of downloading Emacs24 and leiningen to create a working emacs leiningen structure on your computer from configuration to shortcuts step by step.
Chapter 4:
Key concepts of Clojure are given with a few examples, but readers who are unfamiliar with Clojure better overview an intro to Clojure before diving into this chapter to maximize their understandings.
and so on...
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 4 out of 5 stars
Good introduction to Clojure for DSL authors
Reviewed in the United States on February 8, 2014" if you can solve a problem without writing a macro, don’t write one. It’ll be easier to debug, easier to understand, and easier to compose later. Only reach for macros when you need new syntax, or when performance demands the code be transformed at compile time."
Very common saying among Lisp programmers.
And yet I read the Clojure for Domain specific Languages with great enthusiasm. It is littered with tips and ways of writing macros!
The book gives me good explanations how to write good macros. Read page 177-209 and you mastered a DSL for Twitter interaction! If you are skeptic about how magnificent Clojure is, read the chapters up to page 177, which are a great introduction for a programmer of any skill-level.
I recommend this book. It get's the job done - you get to know Clojure from the ground up and you get to know why Clojure is a good fit for a custom DSL. The narrative style is not as funny, or witty, to really enthuse the reader like P. van Linden's "Expert C" or Goetz "Java Concurrency". On the other hand, the prose is light enough to keep me eagerly reading. You will learn how to write good looking code and you will learn how to write a DSL in Clojure.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 2 out of 5 stars
Good introduction, but too much filler
Reviewed in the United States on January 18, 2014Chapters 1, 9, 10, and 11 are worth reading if you are an intermediate Clojure programmer and want to learn about DSLs in Clojure.
Chapter 1 explains what DSLs are, why and when you should use them, and how the power and flexibility of Clojure lends itself nicely to making DSLs. The chapter also shows some popular Clojure DSLs in action. It's a nice introduction.
The last three chapters of the book guide the reader in creating a Twitter DSL, unit testing that DSL, and finally making that DSL a Java-callable Clojure class. Whether or not such an application should be implemented using DSLs at all is up to the judgement of the reader. Regardless, it's a great hands-on example of how Clojure can be used to make DSLs.
My low rating is due to the fact that most of this book is useless filler that's been written about many times already. I thought Chapters 2 to 8 were completely unnecessary. These chapters are an overview of the philosophy and the features of Clojure. I skimmed them because that is not why I chose to read this book. Perhaps this information would be useful to beginners, but a novice Clojure programmer should not even be learning about DSLs yet. Besides, there are already way too many 'introduction to Clojure' books for a beginner to choose from. Instead of these chapters, I wish the book talked about macros more in depth because they are used extensively in the final chapters.
[...]
One person found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 2 out of 5 stars
Mostly an intro to clojure
Reviewed in the United States on April 14, 2014Most of this book is a intoduction to clojure. If you are a clojure programmer, looking for advice on DSL design, this book does not deliver that.
The book isn't a bad introduction, but the mismatch between what is purports to do and what it does will probably leave most readers misled. If you are considering this book, take a good look at the ToC. It is accurate -- the title is not.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 1 out of 5 stars
Terrible
Reviewed in the United States on February 20, 2014This book has very little in it about DSLs. It is terrible, and not worth the $50 price tag. As a general purpose Clojure book it fails as well, being inferior to the more well-known books on Clojure.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again

