Edward Hieatt's blog



Edward HieattEdward Hieatt
GoGaRuCo
edit Posted by Edward Hieatt on Saturday April 18, 2009 at 04:27PM

We had a great time at GoGaRuCo yesterday. If you don't know already, we're live-blogging the conference at pivotallabs.com/gogaruco/blog. Follow along again today as we continue documenting the conference!

GoGaRuCo is being held in the Swedish American hall in San Francisco. It's a great venue. Here we are demoing Tracker at lunchtime yesterday.

GoGaRuCo 09 - Ruby People!

Edward HieattEdward Hieatt
GoGaRuCo Tracker demo
edit Posted by Edward Hieatt on Friday April 17, 2009 at 10:54PM

We had fun during lunch at GoGaRuCo talking to people about Tracker and demoing the app. Especially cool were the awesome Viking chairs we got to sit it.

GoGaRuCo 09 - Ruby People!

GoGaRuCo 09 - Ruby People!

Thanks to Ryan, David S and Chad for helping out!

Edward HieattEdward Hieatt
GogaRuCo talk: MacRuby & HotCocoa
edit Posted by Edward Hieatt on Friday April 17, 2009 at 06:23PM

The first talk of the conference is by Rich Kilmer on MacRuby & HotCocoa.

He's starting out by talking about the history of Apply and Ruby. The first time a version of Ruby was shipped with OS X was in 2002: Ruby 1.6.7 was shipped with OS X version 10.2. The next big development was in 2007, when Ruby 1.8.6, RubyGems, RubyCocoa and Rails were shipped with OS X version 10.5. Later this year, SnowLeopard will include Ruby 1.8.7, RubyGems, RubyCocoa and Rails 2.2.

MacRuby and HotCocoa - Rich Kilmer

Rich is telling us that one of Apple's goals is to make OS X the best platform for Ruby developers. Another is to make Ruby a first-class Cocoa programming language on OS X. He hopes that it will become the best Cocoa programming language - a pretty tall order.

RubyCocoa

Now we're diving into the history of RubyCocoa, by Fujimoto Hisakuni. It first emerged in 2001. It provided a bridge between Ruby and Objective-C. Rich is telling us that the first version of the installer wasn't great - it managed to delete his entire /Library directory. RubyCocoa first shipped with Leopard. Rich is showing us a RubyCocoa Hello World implementation. Wow, it's really long - about 20 lines. It's barely visible to people at the back of the room!

Rich is describing the problems with RubyCocoa. First, it's a bridge. Second, its messaging syntax is different. Third, Ruby uses green threads. Lastly, you ended up with 2 runtimes and 2 garbage collectors, which caused problems. In a nutshell, you could build apps with RubyCocoa, but probably not large, complicated ones.

MacRuby

Then MacRuby hit the scene. MacRuby 0.4 is built on top of Objective-C 2.0 and Ruby 1.9. Every Ruby class/object/method is an Objective-C class/object/method. That's great, because you get the dynamism of Ruby with the runtime and speed of Objective C: much better than a bridge.

Now we're seeing a MacRuby implementation of Hello World. Well, it's still about the same amount of code. There's still a lot of code around wiring things together and configuring things.

HotCocoa

And now, enter HotCocoa. Rich is showing us how to refactor the MacRuby Hello World example into HotCocoa. He's removing lots of code, bit by bit, and looking more and more like plain Ruby. Actually, it's looking a but Rails-y in places (e.g.

win = window :title => 'hello world', :frame => [0, 0, 200, 60]

He's down to 7 lines now of pure Ruby. Rich is telling us how a lot of the excitement around HotCocoa is because of its ability to simplify the configuration of your code.

Installing HotCocoa

Rich is giving us a live demo, using HotConsole (available on GitHub), of HotCocoa. HotConsole is written in HotCocoa. He's running simple Ruby code such as

{}.methods

and how he's also running code such as

w = window :title => 'hello'
b = button :title => 'push me'

Hey presto, a window pops up with a button labeled "push me" on it. Rich gets a round of applause!

MacRuby Experimental

Rich is going on to talk about MacRuby 0.5. Over Christmas break, Laurent stargin building a new VM for MacRuby, based on LLVM. He already has a functioning replacement for YARV. Other parts of Ruby 1.9 are being replaced with Objective-C code also (such as the garbage collector and built-ins). The JIT is actually just generating machine code, which means it's really fast: about 4 to 5 times faster than Ruby 1.9 (the goal is to pass them all). It won't use any libffi for external calls. It's passing many RubySpecs already. Laurent is also going to make it fully re-entrant and implement fully concurrent threading. His goal is to automatically generate Grand Central code.

All this could lead to some exciting developments, such as, in Rich's words, the ability to run Ruby on a "small device that runs OS X on a cellular network" :)

RubyCocoa Hello World - Rich Kilmer

We're out of time for Rich's talk. He's suggesting that you go to macruby.org to learn more.

There's a gig round of applause as Rich leaves the stage. Break time now!

Edward HieattEdward Hieatt
GoGaRuCo
edit Posted by Edward Hieatt on Thursday April 16, 2009 at 08:19PM

The first Golden Gate Ruby Conference (GoGaRuCo) starts tomorrow in San Francisco. Pivotal Labs is happy to be a sponsor of the event. Pivot David Stevenson will be giving a talk titled "Playing With Fire: Running Uploaded Ruby Code in a Sandbox". We have a booth where you can come by and chat with us; we'll be showing off Pivotal Tracker.

Also, Pivotal Labs will be hosting the live Justin.tv feed of the entire conference at pivotallabs.com/gogaruco. Pivot Chad Woolley will be live-blogging every talk at pivotallabs.com/gogaruco/blog and, when the conference is over, we'll make available videos of all the talks from the conference at pivotallabs.com/gogaruco/talks.

If you're coming to the conference, we're looking forward to seeing you there; otherwise, we hope you'll follow along from home, starting at pivotallabs.com/gogaruco!