Tuesday, March 06, 2007

Book Review: Everyday Scripting with Ruby

My son and I have been reading Everyday Scripting with Ruby by Brian Marick since I got my copy of it shortly after the interview I did with him.

I really like Brian's way of teaching Ruby, and plan on recommending this book widely. (I may need to just buy a stack of copies to give out at work.) This is one of the best books from the 'Facets of Ruby' series by the Pragmatic Programmers.

My favorite feature of the book is the incremental approach. In the first two sections ('The Basics' and 'Growing a Script') he writes a very pragmatic chapter showing how to do something, then a 'referency' (I know, it's not a real word) chapter that goes into more depth about the concept just introduced. The third section ('Working in a World Full of People') follows the pattern less strictly, but still pulls in both the pragmatic and the reference material.

If you're getting started with Ruby, or know someone who is, this is a great book for you.

Monday, March 05, 2007

JRuby 0.9.8 Released!

At 5:24 PM (MST) today (March 5th), the JRuby team announced their 0.9.8 release! (Download it here.) This huge news for JRuby and Ruby in general.

On hearing the news of the impending release rubinius developer brixen (Brian Ford) wrote:

"Congratulations to one fine group of folks. 2007 will be the year Ruby breaks out, and YARV and JRuby are definitely leading the charge. I love those JRuby folks for all they're doing for Ruby."

This release includes well over 200 bug fixes, along with a number of enhancements. As of 0.9.8, JRuby is passing better than 98% of the Ruby on Rails unit tests running — according to firebrigade, Rails won't even pass all of it's tests on plain old Ruby; so this is pretty amazing. JRuby's String, Numeric, and Array classes have been rewritten to improve performance and increase correctness. Perhaps the best news is on the optimization front, where number of bottlenecks have been elinated, leading to greater than 6x speed gains. While it's still experimental, the JRuby compiler is also an exciting addition.

The JRuby community is also picking up steam. New to this release is a new core committer, Nick Sieger. Recently, Tom Enebo has been trying out a new bug fixing strategy — I think it's a variation of the Feynman Problem-Solving Algorithm:

  1. write down the problem
  2. think very hard
  3. write down the answer.
(attributed to Murray Gell-Mann). Tom's approach is like this:
  1. post a bug report to the mailing list
  2. wait a couple of hours
  3. Bill Dortch fixes it
This would seem an ideal way to fix problems in Ruby implementations, and I recommend other implementors (of JRuby or otherwise) give it a try.

The JRuby team also called out a non-core developer for his excellent work:

Special thanks to Marcin Mielzynski for his tireless work in rewriting a number of core classes to be much more correct and quick. His attention to detail has rooted out many corner cases.
I think every project has some people like this on it. Kudos to the JRuby team for taking the time to recognize some of them. And congrats to Marcin for his great work.

Programming in Haskell

I just heard about: Programming In Haskell — given the recent call for a good Haskell book over on ruby-talk, this is pretty timely. It's getting good reviews, so I'll have to check it out.

Another JRuby Adventure With Super Bill!

Tom: We need to check ENV (a RubyGlobal) for TZ when calling localtime. Any takers? http://jira.codehaus.org/browse/JRUBY-643

-Tom

Bill: Fixed (I think...). See patch

Uh oh, it looks like trouble in JRuby-land. It took Bill 16 hours to fix this one. Is he slowing down?


Tom: Another Rail unit test failure.... http://jira.codehaus.org/browse/JRUBY-654


"%01.3f" % nil should throw TypeError

Please take the challenge and fix this (Bill? :) )

Bill: Fixed, in an ugly, hacky, temporary way. See patch.

Yay! Bill's not a mere human afterall. This fix only took two hours. That last one must have been an abberation.

Friday, March 02, 2007

February's Contest Winner

This month, we (the judges) were a little bit more on the ball, but that doesn't mean our job was any easier. With eighteen entries (and one that was too late), we had a lot of quality writing to work through.

Each judge read every entry and assigned it a ranking of 3 (the best) through 1 (umm, not the best?). I then tallied the scores (the top eight entries were separated by 2 points — one with 9, two with 8, and five with 7), and we had a clear winner. Last month, there were several entries tied at the top, so we went back through the top scorers and re-rated them to select the best entry in January.

After our scoring, we ended up choosing Gabe da Silveira's Ruby Blocks as Closures. I've sent Gabe an email asking about which books we should be sending out.

So, go read this month's winning entry (heck, leave Gabe a message of congratulations while you're at it). Then, take a look at the other entries and see what you think. Feel free to drop a omment here with your thoughts when you're done.