Saturday, June 30, 2007

rocaml interview leftovers

I put together a mini-interview with Mauricio Fernandez about his new Ruby/OCaml bridge, rocaml. You can read most of it over at Linux Journal, but here’s a little bit that didn’t fit in too well over there.

zenspider has talked before about wanting to build a OCaml module for RubyInline, what are the chances that you and ROCaml might become involved in something like that?

I am not sold on the advantages of RubyInline in the case of Objective Caml, and its philosophy differs to some extent from rocaml’s, as exemplified by the way it converts Ruby values into native OCaml types and vice versa.

RubyInline makes sense for C because it can be used for small routines that can make use of low-level knowledge of the implementation (such as the RArray, RString, RFloat, etc. structures) to make some operation faster. This is where embedding C code in your Ruby sources is a good idea, since creating an extconf.rb and a separate source file just isn’t worth it for a function taking but a few lines of code. On the other hand, when you don’t need access to Ruby’s C API and your C code is pretty general (except maybe for the fact that it takes simple Ruby VALUEs), putting it in a separate file seems more sensible.

rocaml, on the other hand, is more about writing OCaml code that doesn’t know it’s being called from Ruby, both for practical (code reuse, ability to migrate more functionality from Ruby to OCaml if needed…) and efficiency reasons.

Adding OCaml support to RubyInline via rocaml is not amongst my priorities; as I said, it doesn’t make that much sense for the kind of things I’m using rocaml for at the moment. But it doesn’t seem hard, so I will take a look at it.

Monday, June 11, 2007

JRuby 1.0 -- Congratulations guys!

I’m a day late on this one, but the JRuby team cut their 1.0 release yesterday. This release has targeted 1.8 compatibility, and they’ve done a great job. Performance still lags a bit, but I think they’re on the right track to get things going there too.

I’m looking forward to seeing what these guys pull out of their hat over the next six months. I really hope they spend more time on performance than on adding 1.9 features, but since I’m not sending in patches I don’t have a lot of say in it. I’m also hoping that the next six months sees more cross-pollination between XRuby, rubinius, and JRuby—the different approaches are each paying off in different ways so far.

I’ve installed the 1.0 binary release of JRuby (an incredibly easy install, by the way) and run it through the LogWatchR time tests I’ve been running, but I get the same results as last time (with the 0.9.9 release) so I won’t bother recreating those tables here.

Friday, June 01, 2007

June Blogging Contest

June brings us to the sixth, and final, month of the On Ruby/Apress blogging contest. It’s been a great ride, and I’d like to thank the fine folks at Apress for making it happen.

This month, David Berube, author of Practical Ruby gems, will be our guest judge. In honor of David’s book, I wanted to close things out with a Ruby Gems theme:

“Other than Rails, what is your favorite Ruby Gem, and why?”

Write a blog entry about your favorite gem. Tell the world what it’s good for and how to use it and drop a URL in the comments below. If we think you’ve written te winning entry, you’ll get three Apress books of your choice. Simple as that.

Can’t narrow it down to just one gem? No problem, you can enter more than once. Already entered and can’t think of anything to do? Come back and read the other entries—who knows, you just might find that gem that you’ve been looking for.

Good luck, and get writing!