Programming Clojure
eldavojohn writes "Programming Clojure by Stuart Halloway was very near to the perfect book for me. It covers many things common to many Lisp languages while highlighting in moderate detail the things that make Clojure unique and worthy of some attention. The book spends a large amount of time dealing with the intricacies of interfacing fluidly with Java (down to a package rewrite inside a large project). This fits me perfectly as a Java programmer, and I now feel ready to experiment with peppering functional language capabilities into an object oriented language. The book also strives to show how to simplify multithreading through functional programming, which is good because I find multithreading in Java a serious headache that few are good at. Programming Clojure, released in May 2009, is currently the only book out there devoted to Clojure, and the introduction is written by the language's creator, Rich Hickey, who says, 'What is so thrilling about Stuart's book is the extent to which he "gets" Clojure.' The book earns its place on the Pragmatic Bookshelf by guiding the user through rewriting a part of Ant into a new build tool called Lancet — adding to the project what you just learned about Clojure at the end of each chapter." Keep reading for the rest of eldavojohn's review.
Programming Clojure
author
Stuart Halloway
pages
304
publisher
The Pragmatic Bookshelf
rating
8/10
reviewer
eldavojohn
ISBN
978-1-934356-33-3
summary
A firm definition of Clojure via examples coupled with the beginnings of actually programming Clojure.
First, a lot of you are probably wondering what Clojure is and asking me why you should care at all about it. Well, Clojure is a functional programming (FP) language that runs on top of the extremely pervasive Java Virtual Machine and in doing so seems to offer a simpler way of multithreaded programming. It belongs to the family of languages that are Lisps and as a result this book covers a lot of remedial material that is common to other Lisp languages. If you're a serious lisp programmer, you'll be able to skip some of this book (the intro will guide you). Clojure has rarely been mentioned on Slashdot with the resulting comments revealing largely confusion or considering it a buzzword. It's going to be hard to write this review about the book instead of the language being that 99% of what I know about Clojure comes from this book. If you work through this book linearly, you must also use the command line read-eval-print loop (REPL) that, similar to Ruby's IRB, allows you to get hands on with Clojure and Halloway's examples.
Both Hickey and Halloway are very active in Clojure development. In fact, Halloway has a video out on types and protocols, new developments in Clojure 1.2 since the book went to print. Halloway does a good job at providing examples, keeping the book pragmatic and showing you the "wrong" way before incrementally showing you how to correctly accomplish various goals in Clojure. But he loses two points on this review for two reasons. One is that he over evangelizes about Clojure. It would lend a lot more credibility to everything else he says if he would just relent and abstain a bit from painting Clojure as the best language for any task. This ties into my second point which is the fact that books on programming languages are supposed to give the reader two very valuable things: knowledge of when to use the language and knowledge of when not to use the language. Programming Clojure is lacking in the latter--this is not a unique problem as most books about a language really sell their language. All too often in my professional career I see a solution and think, "Wow, that really was not the right tool for the job." (I'm looking at you, Java) Clojure definitely has its strengths and weaknesses despite very little evidence of the latter in this book although I was directed to a QCon presentation where the author speaks more about where Clojure excels in real life.
That said, the book is a great fit for the object oriented Java developer who does not also code a lisp-like language regularly. I say that because Chapter Two deals with reviewing all of the facets of Clojure--most of which are found in other Lisp languages which might be seen as remedial to a proficient Lisp developer. However, before you skip it entirely, there are important notes that Halloway injects into these chapters ranging from how not to do things in Clojure to the minute differences and implications they hold. Chapter Five dives into the fundamentals and features of functional programming in Clojure. This chapter was especially useful to me as I'm not used to languages featuring things like lazy sequences, caching of results or tail-call optimization. Working through the examples in Chapter Five really opened my eyes to some of the more powerful aspects of FP. Like how an infinite sequence can easily be handled by Clojure and its laziness allows you to only pay for what you need from that sequence. While definitions of infinite sequences are also possible in Haskell or Python, Clojure brings this capability to the JVM (not that anything is preventing a more verbose Java library from handling such structures).
Chapter Three focuses a lot on Clojure's interaction with Java and does a great job of showing you how to rewrite part of your Java project into Clojure and run it on the JVM. This includes calling Java from Clojure, creating and compiling Clojure into java classes, handling Java exceptions in Clojure and ends with the beginning work in Lancet (the build tool the book strives to create using what we learn in each chapter). It also contains a bit on optimizing your performance when working with Java in Clojure. This theme continues through the book as Halloway knows that one of Clojure's main selling points is that it can be so much faster than Java if you're willing to put in the extra work and planning to utilize pure functional programming.
In Java, everything is an object. In Scheme, everything is a list. Well in Clojure, the main staple is sequences which brings us to Chapter Four: Unifying Data with Sequences. While this chapter succeeds in teaching how to load data into sequences, how to consume data from sequences and how to force evaluation of lazy sequences, it felt like one of the weakest chapters in the book. This is all necessary in learning Clojure but Halloway skimps on examples and could stand to add some more examples on what is and isn't seq-able, seq-ing on various things and performing functions on various things.
Multicore chips are all the rage these days. And right now it seems that developers are by and large content with coding single threaded applications. But that may change in the future when the user expects more than a few cores in usage. In the introduction, Halloway argues a few reasons why we all should use Clojure and one of those reasons happens to be the somewhat sound logic that we will all have cores coming out of our ears in the near future. That means that as a developer you have the option to spawn more threads which means coordination of threads which means you will be forced to do the dirty dance of concurrency. Chapter Six is entirely devoted to this and, honestly, I reread a lot of this chapter as there are several update mechanisms and models that you can use to manage concurrency in Clojure. Unsurprisingly there is no silver bullet for concurrency even in Clojure. This book has but a handful of figures and their formatting leaves much to be desired but the two in this chapter are necessary references for deciding if you should use refs and software transactional memory, atoms, agents, vars or classic Java locks. This is a potent chapter that ends with a snake game implementation in Clojure demonstrating some basic concurrency. While Clojure protects you from some classically complex issues and may make concurrency vastly more succinct, it still requires a lot of thought and planning. Halloway provides good direction but clearly hands on experience is a necessity in this realm.
Chapter Seven focuses entirely on macros and is somewhat disheartening in that it presents an extremely powerful feature of Clojure that is also very complex. Halloway gives two rules and an exception for Macro Club. The first rule is: "Don't Write Macros." The second rule is: "Write Macros if That Is the Only Way to Encapsulate a Pattern." The exception is you can also write macros if it makes calling your code easier. Halloway does a good job of explaining the basics of macros in Clojure and breaks them down via a taxonomy into categories and examples of macros in Clojure. Macros are a necessity when you're trying to augment Clojure by adding features to it or if you are creating a Domain-Specific Language (DSL). Macros in Clojure do seem easier than macros in most other Lisp languages. At the end of Chapter Seven, you create a basic DSL for Lancet which was helpful even though I was left feeling helpless in the face of macros. Despite the complexity of macros in Chapter Seven, Eight's multimethods are similar to Java polymorphism and was much easier to wrap my head around than macros. Multimethods are used very infrequently (seven times in the five thousand lines that compose the Clojure core).
Chapter Nine is unfortunately less than twenty pages and deals with "Clojure in the Wild." You would think that a book in the series of Pragmatic Programmer would have more pragmatism than the features of a language with Lancet but let's face it--Clojure is a relatively young language. Nine covers automated tests, data access and web development. The automated testing is a short section on Clojure's test-is packaging. The database stuff appears to be little more than wrappers around the already mature JDBC. The web development consists of an intro to Compojure which is similar to web.py and Sinatra. Compojure shows a lot of promise in reducing the amount of code one needs to write a basic web application. It lacks the feature set and support that Rails has with rapidly building CRUD applications but holds a lot of potential to be flushed out into something similarly powerful. Halloway says his introductions to these projects should "whet your appetite for the exciting world of Clojure development" but I think a more accurate description is that these brief brushes with functional projects leaves the reader ravenously blinded by hunger for more.
Some final thoughts on the book: I caught only two very minor typos in the book. It's all English and code. There were no pictures or illustrations in this book except for one on page 96 in which a tiny drawing appears named Joe who asks a question about vectors. Oddly enough, I didn't find Joe on any of the other three hundred pages. It was very easy to work through this book from cover to cover and the example code was very instrumental in my understanding of Clojure. As a Java monkey, rereading sections seemed a requirement although the book is concise enough for me to enjoy in my free time over one week. Halloway cites mostly websites and utilizes tinyurl to reference blogs like Steve Yegge's blog and frequently he references Wikipedia. Only three of his many citations are other printed books (although one of them is Gödel, Escher, Bach: An Eternal Golden Braid). Halloway's greatest strength is the engaging examples (like the Hofstadter Sequence) that he picks and provides to the user and I hope that future editions of the book build on this as well as expand on the growing base of Clojure projects out there. His github is rife with both instructive and pragmatic examples that could stand to be included in a future book.
Some final thoughts on the language: Clojure holds a lot of potential that is yet to be realized. I cannot say yet whether the succinct syntax offers a good balance between quick coding and readability. To the uninitiated, the code can look like a jumble of symbols. Yes, we escape the verbosity of Java and the kingdom of nouns but is what Clojure offers (a neighboring kingdom of verbs) better? While Clojure is concise, it requires a lot of keywords which required a lot of usage look up when starting. Clojure code is potent and powerful. A mere five thousand lines of Clojure code create your engine--the core of the language. I assume this brevity is due to ingenious reuse that Clojure can offer but I would hate to be the person to maintain that code if I was not the author. What's better is that this code is quickly conjured at the REPL if you wish to read it yourself or augment a feature. A sage coworker who has seen much more than I in this business of software development recommended Clojure to me. He was right that it is a very interesting and innovative language but in my opinion it has a long way to go before it becomes the next Ruby or Java. Clojure needs an equivalent to Ruby on Rails and it's fighting an uphill battle against all the developers like myself that left college with so much object oriented coding and so little functional programming (although Scheme is my alma mater's weed out course). If you find yourself stagnating and are thirsty for some continuing education in the form of a stimulating challenge, I recommend Clojure (and this book on Clojure). Hopefully Clojure's full potential is realized by the community and it finds its deserved place in many developer's tool sets as the right tool for some jobs.
You can find Programming Clojure in three DRM-free formats and hard copy from the publisher's site. For a sample of the author's writing and to get a feel for how he injects Clojure code into it, check out his blogs on his company's website.
You can purchase Programming Clojure from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Both Hickey and Halloway are very active in Clojure development. In fact, Halloway has a video out on types and protocols, new developments in Clojure 1.2 since the book went to print. Halloway does a good job at providing examples, keeping the book pragmatic and showing you the "wrong" way before incrementally showing you how to correctly accomplish various goals in Clojure. But he loses two points on this review for two reasons. One is that he over evangelizes about Clojure. It would lend a lot more credibility to everything else he says if he would just relent and abstain a bit from painting Clojure as the best language for any task. This ties into my second point which is the fact that books on programming languages are supposed to give the reader two very valuable things: knowledge of when to use the language and knowledge of when not to use the language. Programming Clojure is lacking in the latter--this is not a unique problem as most books about a language really sell their language. All too often in my professional career I see a solution and think, "Wow, that really was not the right tool for the job." (I'm looking at you, Java) Clojure definitely has its strengths and weaknesses despite very little evidence of the latter in this book although I was directed to a QCon presentation where the author speaks more about where Clojure excels in real life.
That said, the book is a great fit for the object oriented Java developer who does not also code a lisp-like language regularly. I say that because Chapter Two deals with reviewing all of the facets of Clojure--most of which are found in other Lisp languages which might be seen as remedial to a proficient Lisp developer. However, before you skip it entirely, there are important notes that Halloway injects into these chapters ranging from how not to do things in Clojure to the minute differences and implications they hold. Chapter Five dives into the fundamentals and features of functional programming in Clojure. This chapter was especially useful to me as I'm not used to languages featuring things like lazy sequences, caching of results or tail-call optimization. Working through the examples in Chapter Five really opened my eyes to some of the more powerful aspects of FP. Like how an infinite sequence can easily be handled by Clojure and its laziness allows you to only pay for what you need from that sequence. While definitions of infinite sequences are also possible in Haskell or Python, Clojure brings this capability to the JVM (not that anything is preventing a more verbose Java library from handling such structures).
Chapter Three focuses a lot on Clojure's interaction with Java and does a great job of showing you how to rewrite part of your Java project into Clojure and run it on the JVM. This includes calling Java from Clojure, creating and compiling Clojure into java classes, handling Java exceptions in Clojure and ends with the beginning work in Lancet (the build tool the book strives to create using what we learn in each chapter). It also contains a bit on optimizing your performance when working with Java in Clojure. This theme continues through the book as Halloway knows that one of Clojure's main selling points is that it can be so much faster than Java if you're willing to put in the extra work and planning to utilize pure functional programming.
In Java, everything is an object. In Scheme, everything is a list. Well in Clojure, the main staple is sequences which brings us to Chapter Four: Unifying Data with Sequences. While this chapter succeeds in teaching how to load data into sequences, how to consume data from sequences and how to force evaluation of lazy sequences, it felt like one of the weakest chapters in the book. This is all necessary in learning Clojure but Halloway skimps on examples and could stand to add some more examples on what is and isn't seq-able, seq-ing on various things and performing functions on various things.
Multicore chips are all the rage these days. And right now it seems that developers are by and large content with coding single threaded applications. But that may change in the future when the user expects more than a few cores in usage. In the introduction, Halloway argues a few reasons why we all should use Clojure and one of those reasons happens to be the somewhat sound logic that we will all have cores coming out of our ears in the near future. That means that as a developer you have the option to spawn more threads which means coordination of threads which means you will be forced to do the dirty dance of concurrency. Chapter Six is entirely devoted to this and, honestly, I reread a lot of this chapter as there are several update mechanisms and models that you can use to manage concurrency in Clojure. Unsurprisingly there is no silver bullet for concurrency even in Clojure. This book has but a handful of figures and their formatting leaves much to be desired but the two in this chapter are necessary references for deciding if you should use refs and software transactional memory, atoms, agents, vars or classic Java locks. This is a potent chapter that ends with a snake game implementation in Clojure demonstrating some basic concurrency. While Clojure protects you from some classically complex issues and may make concurrency vastly more succinct, it still requires a lot of thought and planning. Halloway provides good direction but clearly hands on experience is a necessity in this realm.
Chapter Seven focuses entirely on macros and is somewhat disheartening in that it presents an extremely powerful feature of Clojure that is also very complex. Halloway gives two rules and an exception for Macro Club. The first rule is: "Don't Write Macros." The second rule is: "Write Macros if That Is the Only Way to Encapsulate a Pattern." The exception is you can also write macros if it makes calling your code easier. Halloway does a good job of explaining the basics of macros in Clojure and breaks them down via a taxonomy into categories and examples of macros in Clojure. Macros are a necessity when you're trying to augment Clojure by adding features to it or if you are creating a Domain-Specific Language (DSL). Macros in Clojure do seem easier than macros in most other Lisp languages. At the end of Chapter Seven, you create a basic DSL for Lancet which was helpful even though I was left feeling helpless in the face of macros. Despite the complexity of macros in Chapter Seven, Eight's multimethods are similar to Java polymorphism and was much easier to wrap my head around than macros. Multimethods are used very infrequently (seven times in the five thousand lines that compose the Clojure core).
Chapter Nine is unfortunately less than twenty pages and deals with "Clojure in the Wild." You would think that a book in the series of Pragmatic Programmer would have more pragmatism than the features of a language with Lancet but let's face it--Clojure is a relatively young language. Nine covers automated tests, data access and web development. The automated testing is a short section on Clojure's test-is packaging. The database stuff appears to be little more than wrappers around the already mature JDBC. The web development consists of an intro to Compojure which is similar to web.py and Sinatra. Compojure shows a lot of promise in reducing the amount of code one needs to write a basic web application. It lacks the feature set and support that Rails has with rapidly building CRUD applications but holds a lot of potential to be flushed out into something similarly powerful. Halloway says his introductions to these projects should "whet your appetite for the exciting world of Clojure development" but I think a more accurate description is that these brief brushes with functional projects leaves the reader ravenously blinded by hunger for more.
Some final thoughts on the book: I caught only two very minor typos in the book. It's all English and code. There were no pictures or illustrations in this book except for one on page 96 in which a tiny drawing appears named Joe who asks a question about vectors. Oddly enough, I didn't find Joe on any of the other three hundred pages. It was very easy to work through this book from cover to cover and the example code was very instrumental in my understanding of Clojure. As a Java monkey, rereading sections seemed a requirement although the book is concise enough for me to enjoy in my free time over one week. Halloway cites mostly websites and utilizes tinyurl to reference blogs like Steve Yegge's blog and frequently he references Wikipedia. Only three of his many citations are other printed books (although one of them is Gödel, Escher, Bach: An Eternal Golden Braid). Halloway's greatest strength is the engaging examples (like the Hofstadter Sequence) that he picks and provides to the user and I hope that future editions of the book build on this as well as expand on the growing base of Clojure projects out there. His github is rife with both instructive and pragmatic examples that could stand to be included in a future book.
Some final thoughts on the language: Clojure holds a lot of potential that is yet to be realized. I cannot say yet whether the succinct syntax offers a good balance between quick coding and readability. To the uninitiated, the code can look like a jumble of symbols. Yes, we escape the verbosity of Java and the kingdom of nouns but is what Clojure offers (a neighboring kingdom of verbs) better? While Clojure is concise, it requires a lot of keywords which required a lot of usage look up when starting. Clojure code is potent and powerful. A mere five thousand lines of Clojure code create your engine--the core of the language. I assume this brevity is due to ingenious reuse that Clojure can offer but I would hate to be the person to maintain that code if I was not the author. What's better is that this code is quickly conjured at the REPL if you wish to read it yourself or augment a feature. A sage coworker who has seen much more than I in this business of software development recommended Clojure to me. He was right that it is a very interesting and innovative language but in my opinion it has a long way to go before it becomes the next Ruby or Java. Clojure needs an equivalent to Ruby on Rails and it's fighting an uphill battle against all the developers like myself that left college with so much object oriented coding and so little functional programming (although Scheme is my alma mater's weed out course). If you find yourself stagnating and are thirsty for some continuing education in the form of a stimulating challenge, I recommend Clojure (and this book on Clojure). Hopefully Clojure's full potential is realized by the community and it finds its deserved place in many developer's tool sets as the right tool for some jobs.
You can find Programming Clojure in three DRM-free formats and hard copy from the publisher's site. For a sample of the author's writing and to get a feel for how he injects Clojure code into it, check out his blogs on his company's website.
You can purchase Programming Clojure from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Any sufficiently complex programming language will, over time, expand its features until it reinvents LISP.
Who here has ever heard of this "Clojure"? Would it have killed /. to explain things just a little bit in the summary?
/rant on
LISP? My claim has always been that people who think in functional programming come from out space and are secretly trying to take over the world by twisting computer languages to be something completely alien.
I mean, LISP is to programming languages like Babylon 5 is to SciFi. Cdr and car? /rant off
The rallying cry of the army of idiots...
are forced to reinvent it.
I presume that explains the existence of Clojure.
But hey, on top of Java. This now means your browser can run Lisp.
One of the nice things about Clojure is Rich's willingness to dispense with old names that have gone stale with time. Clojure has no 'car' or 'cdr' functions. 'cons'(truct) lives on, as its mnemonic is useful.
Well the code's there, it's not just going to disappear if Oracle abandons it. And it's free. So if it meets people's needs then there's no reason they should refuse to use it just because it's no longer supported.
Since no one and their uncle is using Java for its portability anymore (maybe the nice folks at Limewire still are), and since Java is so piss-poor at multithreading that even with books hardly anyone is willing to attempt it...
It's beyond me why people don't just use a different damn language. I lost my objectivity on this years ago; is Java ridiculously easy to learn for the kids these days or something? Is it like Pascal for the new millenium? I think I'd rather try to make Pascal thread properly than Java, frankly.
Well, Clojure is a functional programming (FP) language that runs on top of the extremely pervasive Java Virtual Machine
I'll pass.
While FP permits some useful constructs (like Ruby's blocks), writing everything as a FP is a pain in the ass. Combining FP with Java cranks it up from mildly interesting albeit somewhat annoying to full-blown annoying.
Posting as anonymous because it's a knee jerk reaction. I just can't stand the bloat associated with the JVM.
So what, just write your own.
(define (car z)
(z (lambda (p q) p)))
(define (cdr z)
(z (lambda (p q) q)))
An excellent troll attempt, except you sound too much like twitter talking about "M$".
Can you provide some evidence to back this theory?
Sure, no one knows what Oracle is going to do here except Larry Ellison, but that isn't stopping Java development.
Android?
IBM?
There's already Apache Harmony, and IBM has their JDK. If the Sun/Oracle JVM goes away, it's not the end of the world. As a matter of fact, that would probably be a *good* thing. Java has languished behind C# and .NET in terms of language features (you can argue all you want if they're useful or not), and JDK7 is still a pipe dream. The community would be able to solve these deadlocks and such without Sun's BS control of the language.
As you read through the many comments that will be posted on this article, please keep the following advice in mind: People who spell it LISP are not qualified to judge modern (read: post-1984) Lisp-family languages, probably having 100% of their exposure come from a one-hour lecture and small homework assignment in a programming languages course taught by someone who thought that Common Lisp is a single-paradigm functional language.
I actually like car and cdr, because of the equal length of their names and the ease with which you can combine them in various forms to get specific pieces of a nested list, such as caddaddr. However, my approach to programming is that the name of a function is not as important as the language it finds itself in. You could write car and cdr for Basic and it still wouldn't be a good language to write real software in.
Have you ever done any Android development? Sure, it's using Java the language, but Dalvik is hardly a full-featured JVM. Also, Sun's mobile APIs have been discarded in favor of Android-specific class libraries. Android development can barely be considered Java development.
Apache Harmony is basically a dead project. We haven't seen anything useful out of it yet, and likely never will.
IBM is off in their own world, writing custom software for big clients running on expensive IBM hardware.
It's doubtful the Java community will be able to bring the JVM up to par with .NET, or Java up to par with C#, even if they had full reign. It's mainly a resource problem, rather than one of agreement. It will take a huge amount of effort to make the JVM viable again.
In Clojure you would likely use destructuring to dig pieces out of a sequence, avoiding explicit function calls altogether. Agreed that languages need more than just good naming conventions. In Clojure's case, that 'more' is a careful set of abstractions, including some for modeling time. A good conceptual overview on time, state, and identity is online at http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey.
Oh yes, JVM is dying, and that's why JVM for Java 7 will improve HotSpot and will be eventually merged with JRockit - so that you would be able to monitor the one last breath of the dying platform with one of the best VM monitoring systems in the world - and complemented with a superior GC. All that only so that it could feel well while dying. Sure.
Ezekiel 23:20
"Programming Clojure" is a great book. Any book on a new programming language is going to evangelize the language - it's up to the reader to keep an open mind and decide for herself that it's a good fit for what they do. The book is started to get a bit dated now with Clojure up to release 1.2 now, but is still worth getting in eBook form to get a good understanding of the language fundamentals. I would also recommend the "Joy of Clojure" which is in early-access from Manning. They take a different approach to learning Clojure and are both useful to learn Clojure. Even if you aren't planning of using Clojure, it's worth a read to understand some FP concepts and apply them in [insert your fav lang here].
Android does not use any variety of Sun JVM. It uses Dalvik, which runs its own bytecode.
But nobody sane is going to build extensions to Java on their own. Without Sun, there's nobody in charge of developing the Java language. It's going to be a long time before it progresses, and the far more likely result is that it will shrivel and die. Good riddance. Dalvik can be adapted to run other languages, and everyone will move on.
in three...two...one...
Good people go to bed earlier.
In all seriousness there are two concepts are are especially onerous and difficult to do well in computer science:
1.) Asynchronous code (threads).
2.) Self modifying code (functional programming).
Both concepts are difficult for typical developers to get right. What the world needs is a revolutionary approach to these two topics such that average developers have the necessary tools to produce quality code for multi-core machines.
Someone needs to take design patterns to the concrete level and create design pattern libraries that model asynchronous and self-modifying code in robust ways that the common API programmer can use.
In my opinion trying to bring robustness to asynchronous code by using self-modifying code is going the wrong direction: compounding one onerous concept with one just as equally onerous.
What meaning does Contents of Address portion of Register and Contents of Decrement portion of Register have for anyone? Only 123 of the IBM 704s were built and sold, and they have long since disintegrated into the dust from which they were formed. The thing ran on vacuum tubes for goodness sakes! IBM sold its last one before Kennedy took office.
When our name is on the back of your car, we're behind you all the way!
That sounds fantastic! But I don't think people will want to wait until 2017 or 2018, when that would all finally be production-ready.
Well, Newtonian physics or calculus for instance were also developed long before Kennedy took office. Does that make them any less valid than they were, say, 50 years ago?
Not a stupid question at all seeing as how we're talking about IBM 704s and not... functional programming languages or something like that.
I am concerned about using this for large software engineering problems about having data and methods scattered loosely about the code because Clojure does not enforce encapsulation. That brings up the old joke about "Chinese programming in LISP": an hour later you will have forgotten what you coded. More recent versions of LISP such as Scheme implement OOP more soundly that the version in Clojure.
Soem of the nice thing in Clojure like the rich set of set-notation are not LISP-specific. There is talk of putting these in Java 1.8.
Exactly. That was the big problem I had with the book: it's written for Java programmers. I am intrigued by the language, but I would much prefer a book that treats the language on its own terms.
My other car is a cdr.
"These people look deep within my soul and assign me a number based on the order in which I joined" --Homer re:
What they stand for doesn't really matter that much. You have to name the two elements of a pair something, and as long as the name is arbitrary it may as well be easily composed the way car and cdr are. But if you want to name them something else, that's fine, too.
I just don't think that a language can be judged based on the names it uses for these things. It's not like they're hard to remember if you actually use Lisp and, in that regard, they are no different from a wide variety of other names in various languages, including but not limited to cout, println, < as a class inheritance syntax, variable sigils, etc.
All that being said, I think we can probably agree that the terminology of the 704 was stupid to begin with.
Groovy, Scala, Clojure (which I'd never heard of), Jython, JRuby, Beanshell etc. all say bollocks to that. Java 7 also delivers dynamic invocation which is likely to mean even more new languages will appear that utilise the JVM.
So, uhhhhh, when will Java 7 actually be production-ready? I know they're saying "late 2010", but that's still a long way off.
Before Java 7, we only ever waited two years between major revisions. Java 6 was released over 3.5 years ago. That's not very promising for what are basically just incremental improvements.
My other car is a cdr.
Well mine is a CDR-W.
I'm a good cook. I'm a fantastic eater. - Steven Brust
What meaning does Contents of Address portion of Register and Contents of Decrement portion of Register have for anyone?
I don't know, what meaning does Source Index, Destination Index and Base Pointer etc. have for anyone?
Ezekiel 23:20
Why is that a big deal?
(defun first (l) (car l))
(defun rest (l) (cdr l))
There. Was that so hard?
(first mylist)
(rest mylist)
- For the complete works of Shakespeare: cat
Sure, no one knows what Oracle is going to do here except Larry Ellison
I admire your confidence...
If you want radical improvements, go mess with Groovy. Java is a mature language with a mature feature set and doesn't change rapidly for pretty obvious reasons. The invokedynamic thing is anticipated by dynamic languages, but it doesn't stop you from using them right now if you want.
Everything's on its way out. As a society we go through programming languages faster than socks. If you only target "in" languages, you will be spending more time learning than doing. Most languages are "good enough" to get the job done. Stop chasing shiny new features that may improve productivity by 2%, if you are lucky, and when you master it, you'll find it's time to retire anyhow.
Table-ized A.I.
I'd much rather write a functor instance than a factory, even though they implement the same mathematical construct. There's much less boilerplate to write. Boilerplate kills productivity.
If you go meta, then a dynamic language is generally the smoother route. But there are ways to adjust in static languages. The devil's in the details.
Table-ized A.I.
Go, use Scala, and you can use functors instead of factories whenever you want.