Saturday, December 30, 2006

Functional Programming Resources for Ruby

I wanted to make this a bigger post, but I just don't have time. Here's two great resources for learning how to use Lisp-style higher-order functions in Ruby.

The first is Nate Murray's presentation, which is based on videos of the classic Structure and Interpretation of Computer Programs. When I say based, it's very directly based, in fact it literally translates some of the Lisp examples into Ruby before going into original implementations of the techniques. The Ruby used is actually imperfectly idiomatic, in some cases, but the original implementations are quite elegant, even tasty.

The second is James Gray's Higher-Order Ruby, which is based on the Mark-Jason Dominus book Higher-Order Perl, which I love. It's also very directly based, in that a lot of the examples are direct translations from Perl to Ruby. This was very useful to me when I first learned Ruby, since the direct translation has a side effect of illustrating differences and similarities in the two languages. The Ruby in these examples is much more idiomatic.

I revisited Higher-Order Perl recently, and I'm hoping to expand on these techniques in either Perl, Ruby, or even Lisp (I'm using DrScheme on Mac OS X and I love it), in another post in the future.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.