Paradigms of Artificial Intelligence Programming (in Ruby)


Since I never can get enough projects, I’ve decided to start on something I’ve thought about doing for a long time. There are several reasons for doing it, but foremost among them is that I want to get back to playing with AI, and I want to have a project with many small pieces that I can do when I have some time over. If it ends up being educational or useful for others at the same time, well, I’m not complaining!

So what is it?

Well, first I’d like to introduce a book. It’s called Paradigms of Artificial Intelligence Programming or PAIP for short. It’s written by Peter Norvig, who’s also written several other books about AI. Currently he’s the Director of Research at Google. PAIP is probably both my favorite book about AI, and my favorite book about Common Lisp. It’s a really great book. Really. If you have any interest in one of those two subjects you should get hold of it. PAIP doesn’t cover cutting edge AI, but rather takes the historic view and looks at several examples from different eras, going from the first programs to some later, quite advanced things.

I’ve read it numerous times, went through the code and tweaked it and so on. It’s lots of fun. But that was a few years ago. So basically, what I want to do is to go through the book again. But this time I’m going to write all the programs in Ruby – converting them from Common Lisp and then maybe tweak them a bit to make them more idiomatic. And I’m planning to post it here. Or rather, I’m going to post the actual source code to http://github.com/olabini/paipr. I’m going to blog about all the code I write. You don’t necessarily have to have the book, since I’m going to surround the code with some descriptions and explanations.

Once again then, why should anyone care? Well, I don’t know. No one might care. But for me personally it’s going to be an interesting experience converting idiomatic Common Lisp into idiomatic Ruby. It’s going to be fun to revisit the old approaches to AI. And it might serve as a good, code heavy introduction to the subject for anyone interested in it.

I do have the permission from Peter Norvig to do this. The Ruby code I write is covered by the MIT license, while any Lisp code posted as part of this exercise is covered by the license here: http://norvig.com/license.html.

Also note that I sometimes won’t write the most obvious Ruby – it will be good to have a few links to the original Lisp code.


18 Comments, Comment or Ping

  1. Joe Martinez

    This sounds really interesting – watching your repo at github.

    September 8th, 2008

  2. Brandon

    This sounds great. I have been considering doing something similar in Ruby with many of my college machine learning algorithms.

    September 8th, 2008

  3. Hey, sounds great! I’ll be looking forward to it, AI is a big passion of mine.

    I’ll pick up PAIP as well, so I’ll be able to follow along.

    Best of luck!

    September 8th, 2008

  4. Hey Ola, I know that you will write the code in Ruby, but just out of curiosity, what Common Lisp interpreter / environment would you use on Mac OS X?

    September 8th, 2008

  5. Brandon:

    Sounds interesting. Do it! I would read it at least. =)

    September 9th, 2008

  6. Mariano:

    Well, that’s a good question. I haven’t done much Lisp programming on the Mac – my current installation is SBCL, and it’s got a really good reputation, so that’s what I would recommend.

    September 9th, 2008

  7. Wonderful idea, and very good timing! I bought PAIP last week, and I’ve been eating it up. I’ve also fallen in love with SBCL + SLIME as a result. But as I’m much more experienced with Ruby than with Common Lisp, I’m also looking forward to seeing how you translate his Lisp into Ruby.

    September 9th, 2008

  8. over cutting edge AI, but rather takes the historic view and looks at several examples from different eras, blog.39.net/99nr/going from the first programs to some later, quite dvanced things.I’ve read it numerous times, went through the code and tweaked

    October 1st, 2008

  9. Wonderful idea, and very good timing! I bought PAIP last week, and I’ve been eating it up. I’ve also fallen in love with blog.39.net/99nrw/ SBCL + SLIME as a result. But as I’m much more experienced with Ruby than with Common Lisp, I’m also looking forward to seeing how you translate his Lisp into Ruby.

    October 1st, 2008

  10. I have owed a lot to you for JRuby: it just wiped out all my deployment headaches.

    Now, my mouth waters imagining to see those alogrithms in Ruby.

    I wish all the best for your effort.

    george

    January 2nd, 2009

  11. Conrad Taylor

    Ola, I was also considering to do the same thing after asking Peter Norvig today about his future publications via e-mail. It’s good to see that I’m not the only one that has the same feelings about PAIP being implemented in idiomatic Ruby. Also, I’m glad that I performed a search before beginning this work.

    Very nice work,

    -Conrad

    May 24th, 2009

  12. Really exciting. Refreshes memory of AI and Neural Networks studied during my college days. Always thought at that time, I would be able to make a real world application out of this.

    Thanks for the post. I have started reconsidering my thoughts.

    June 18th, 2009

  13. goudswak

    Very Nice! I just went through all the chapter 2 stuff and it is really cool. Been starting to ply with some AI concepts and really love Ruby though I’ve just been working with it for about a week. This has been very useful to me -Thanks!

    October 29th, 2010

Reply to “Paradigms of Artificial Intelligence Programming (in Ruby)”