Posts Tagged by Lisp
Learning Clojure – my books
| 11-May-2012 | Posted by Sonia Hamilton under Clojure, Lisp, Ruby |
I’ve been playing with Lisp and now Clojure for a couple of years now. Here’s a list of the books I’ve read on my journey to Clojure enlightenment (I’ve still got a long way to go…).

My first Clojure book wasn’t even about Clojure, it was about Lisp! One Sunday afternoon I was lurking in the computer section of a local bookshop (a great way to spend a Sunday afternoon), and came across Land of Lisp. I’d heard about Lisp, that “obsolete” language that used to be used for Artificial Intelligence but who uses it nowadays? Anyway, the cover was colourful and the cartoons were great, and before I knew it I’d read a couple of chapters and wanted to know about this Lisp stuff and I bought the book.

But after reading it for a while and getting sidetracked by Scheme and the greatest book every written about programming, Land of Lisp languished on my bookshelf. The example used in the book (yet another game) didn’t relate to my day-to-day use of programming. I was getting lost because I wasn’t doing any exercises, and Lisp just didn’t seem to be an acceptable Lisp.

Seven Languages in Seven Weeks pointed me towards Erlang, Haskell and Clojure. Ah-hah! Clojure – runs on the JVM (so I can use it machines where I can’t/don’t want to install stuff, just like JRuby). A modern Lisp with cleaned up syntax that has access to all the Java libraries for doing real world stuff. I’m hooked!

At a Ruby on Rails Oceania (RORO) meetup someone was raving about The Joy of Clojure. So I drank from the firehose and my brain exploded and nothing made sense. As Steve Yegge (a fellow Googler) says in the intro, “you’ll learn fast” – but only if you’re already comfortable with Lisp. The book moves too fast, the explanations are cryptic, and it seems to bounce all over the place. Another book to languish on my book shelf.

My next book Practical Clojure was where things started to make sense. It’s more directed at beginners and just explains how the language works. But it’s a thin book (not enough detail) and some sections just seem to be reprints of the API (function foo does this and here’s a 5 line example; function bar does this and here’s a 5 line example). No real digging into the how and why of using Clojure.

And onto my favourite Clojure book – Clojure Programming by Emerick et al. Like many O’Reilly books it’s definitive. Lots of detailed examples, clear explanations, great diagrams, coverage of related areas (eg Clojure for web programming). Example code comparing how you do things in Clojure with other languages (Java, Python, Ruby). This is the book where I’ve really started to understand Clojure.
Now I’m working through the 4clojure problem list (really interesting). Then I’ll probably buy some more books from The Clojure Bookshelf. And continue reading Paul Graham’s On Lisp (I got it printed through Lulu). And one day I’ll reach enlightenment :-)

Ruby, Lisp, Python
| 20-Mar-2012 | Posted by Sonia Hamilton under Lisp, Python, Ruby |
Up late tonight reading about Emacs Lisp, I came across Tour de Babel by Steve Yegge comparing different languages (C, C++, Java, etc), and why he likes Lisp and Ruby so much. I’m stuck in stodgy Python land at the moment, this is balm for the soul:
Anyway, Ruby stole everything good from Perl; … for the most part, Ruby took Perl’s string processing and Unix integration as-is, meaning the syntax is identical, and so right there, before anything else happens, you already have the Best of Perl. And that’s a great start, especially if you don’t take the Rest of Perl.
But then Matz took the best of list processing from Lisp, and the best of OO from Smalltalk and other languages, and the best of iterators from CLU, and pretty much the best of everything from everyone. And he somehow made it all work together so well that you don’t even notice that it has all that stuff.
LISP – downloading SICP videos, JRuby
| 05-May-2011 | Posted by Sonia Hamilton under Git, Lisp, Ruby |
I’m busy learning LISP/Scheme at the moment (in order to later move on to Clojure). And, improving my programming learning LISP is :-)
I’m following along with the MIT SICP videos, but got tired of manually downloading each video. So I wrote a quick little script to download all the videos – get_sicp. Next, a script for the UC Berkeley SICP videos (getting through the flash player should be a learning experience).
I’ve also been getting good mileage out of JRuby. I was complaining a few weeks ago about not being able to run Ruby on production servers (and therefore having to learn Python). Well JRuby is the perfect solution – installing/building Ruby on production servers is often verboten, but most production servers already have a JVM so installing JRuby in ${HOME} is a non-brainer and doesn’t litter /usr. Good: Ruby – fun, Python – <snore>.
Python, Lambda, Closures
| 05-Apr-2011 | Posted by Sonia Hamilton under Lisp, Python, Slug |
(apologies to slug planeteers for the duplicate info).
A very interesting post from André Pang about some issues he came across with lamdas and closures in Python. Well, interesting to me because I’m playing with Lisp and Python at the moment…
Some links from his blog, in case the original post ever disappears:
- the question and responses on stackoverflow
- an example of the perils of Python’s scoping rules with for/while/if
- Wikipedia – differences in semantics of closures
A nice snippet of code to remind me of the issues:
def callback(msg):
print msg
funcList=[]
for m in ('do', 're', 'mi'):
# funcList.append(lambda: callback(m))
funcList.append(lambda m=m: callback(m))
for f in funcList:
f()
Lisp and Python
| 27-Mar-2011 | Posted by Sonia Hamilton under Lisp, Perl, Python, Ruby |
I’m bored, so I’m going to learn Lisp. Why am I bored? I hurt my knee at BJJ and have to take a week or two off training :-( Fortunately it’s not too bad and I’ll be back getting beaten up (and beating up) soon!
I came across this fun looking book that inspired me – Land of Lisp – I started reading it in Dymocks and couldn’t put it down. But years ago I’d read Paul Graham’s blog and recently Joel Spolsky on The Perils of Java Schools. I was really surprised to learn that university Computer Science departments have stopped teaching pointers and recursion because they teach Java or .NET. I remember the joy :twisted: in 2nd year Comp Sci of watching half the class being weeded out by Data Structures, then another half being weeded out the following semester by Functional Programming.
And here’s a post by Peter Christensen on who uses Lisp.
Oh yeh, I’m also learning Python – it seems the sanest general purpose scripting language around. Ruby is great and I love it, but it’s often not available (try telling Bank X or Phone Company Y that you’re going to install Ruby on several hundred of their production Solaris servers, see what sort of reaction you get). And Perl is unmaintainable line noise and shell scripts are tedious.
What kicked this all off? This great SlashDot post on why Expensify doesn’t hire .NET programmers :-)
PS I like Paul Graham’s Tweet on the book: “Turns out the border between genius and insanity is a pretty cheery place”.

Recent Comments
<<EOF>>was eaten...cat <>~/.vi...