« June 2007 | Main | August 2007 »

July 2007

July 29, 2007

IronRuby: a promising start

Creature II

It was fun watching all of the reactions to IronRuby this past week. Thank-you to everyone who took the time out to kick the tires and comment on what you found (both good and bad). I was particularly happy to see this exchange:

Antonio Cangiano downloaded the sources, compiled them successfully and ran some quick tests. He was disappointed to find that we didn't handle implicit type conversions correctly when doing arithmetic:

1/3.0 => 0

A few short hours later, Seo Sanghyeon responded with a blog post titled Teaching IronRuby math tricks. I really liked how Seo not only fixed the bugs in the sources, but he also spent some time writing up a detailed blog post on how Windows developers can apply the patch that he created to their copy of the source code. Teach 'em to fish and all that.

Not to be outdone, Josh Nursing wrote a detailed blog post, that gives you step-by-step instructions (complete with screen shots!) on how to build the project. He also fixes one of the bugs, and gives you step-by-step instructions on how he did it.

This is a great start for our nascent community. Thanks to your efforts, I could devote more time at OSCON working on cool demos, and talking to other open source developers. Starting Monday our team is going to be focusing on getting our sources out on Rubyforge as quickly as possible. Exciting times!

July 28, 2007

OSCON Wrap-up

OSCON is my favorite conference these days. I love it because it brings so many diverse people under a single umbrella for a week. For a week we can get together and experience new ideas from different communities and avoid the group-think in specialized technology conferences.

Some of my highlights of the week were:

Simon Peyton-Jones. He's a fabulous presenter, and had us stretching our minds for many hours throughout the conference. You can download the slides from his Taste of Haskell talk from the OSCON presentations page. Click the image below to see a video of Simon's Software Transactional Memory talk from the conference:

Karl Fogel. I met Karl accidentally at the very end of the conference while hanging out with Laurent Sansonetti. I am a big fan of Karl's Producing Open Source Software book, and I was surprised to hear that he had left Google to create a new non-profit organization to campaign for copyright reform in the US. Karl and Rick Falvinge of the Pirate Party had some very interesting things to say about the erosion of fundamental rights brought on by recent actions by copyright holders.

Ben Fry. I had no idea what he did before this conference, but his demo of his work on Processing  absolutely blew me away. Check out this video from his talk:

I spent quite a lot of time hanging out with folks from the Ruby community at the conference. The response was overwhelmingly positive on our new-found ability to build a accept contributions back into our IronRuby project. This really charges me up to begin the next phase of our project, where we will build out the IronRuby community so that we can accelerate the pace of the project. I can't wait!

Since I was already in Portland, I had a chance to give some other talks. On Tuesday night, I gave a 10 minute lightning talk on IronRuby at FOSCON 2007. It was held at a very funky bar called Holocene, which was a great location. Next year, though it would be really great if we could stand in front of the audience to give our talks :) The audience faced one way, and the presenter faced the other way, as you can see from the photo below:

On Thursday night, immediately after my OSCON talk, I went to give a talk at the Portland Area .NET User Group. It was held at the offices of Corillian, where Scott Hanselman currently works. I really enjoyed talking to this group; there was plenty of time for Q&A, unlike OSCON where talks were limited to only 45 minutes. I even got a chance to see Scott's shrink-wrapped copy of DOS 4.01!

This was a fantastic trip. Thanks to everyone who took the time out to talk to me. I really enjoyed our conversations, and I'm looking forward to next year!

July 23, 2007

A first look at IronRuby

IronRuby code gen

We've been working very hard over the past couple of months to get our first source code release ready. I'm happy to announce today the first drop of the IronRuby source code. IronRuby is licensed under very liberal terms as set out by the Microsoft Permissive License.

We're also happy to announce that we will be accepting source code contributions into the IronRuby libraries. Right now we have a lot of logistical work that we still need to do, but we fully intend on getting IronRuby onto Rubyforge by the end of August.

Some of you may be wondering why we are only accepting contributions into the libraries and not the entire compiler. It's because IronRuby is built on top of the Dynamic Language Runtime (DLR), and the public interfaces to the DLR are not complete at this time. Since the DLR will ship as part of the CLR in the future, we cannot accept contributions into the IronRuby compiler, at least initially. However, once the DLR matures and reaches 1.0 status with fully supported public interfaces, we will fully open up all parts of the IronRuby project for external contributions.

To start playing with this release, you'll need to build IronRuby. This release of IronRuby requires the .NET Framework 2.0 Redistributable. Just unzip the source code file, and run the build.cmd batch file to create a release-mode build of IronRuby.

You can kick the tires by typing some code interactively using our simple REPL console application. You'll find it at \bin\release\rbx.exe. You should add \bin\release to your path to make your life easier.

Next you should look at the unit tests under \tests\ruby\builtins. This will give you an idea of what works and what doesn't work in IronRuby. We've put most of our effort into Array and String; any other support that's in the libraries was put in there to support building Array and String features.

We have .NET interop working out of the box; you can import .NET libraries into your Ruby programs via require:


require 'mscorlib'
require 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Notice how you need to use the fully-qualified assembly name in require.

We don't have include working yet at top-level scope, so you'll need to either use fully-qualified type names or assign them to constants:


Window = System::Windows::Forms::Window

We also have pretty good performance in this release. We use a DLR feature called Dynamic Sites, which is our implementation of adaptive call-site method caching. Other than using Dynamic Sites, we have not done any other specific performance tuning for this release.

In micro-benchmarks which measure method call performance, we are significantly faster than Ruby 1.8.6. In micro-benchmarks which measure library performance, we are on par with Ruby 1.8.6; we expect to see performance improvements in these benchmarks in the future. In micro-benchmarks that involve raising exceptions, we are slower than Ruby 1.8.6; but if control flow on your program's critical path involves raising exceptions you may want to rethink your design :)

We're really interested in hearing what you have to say about this release. I'm at OSCON all week, so feel free to come up and say hello if you're attending. My IronRuby talk is this Thursday at 5:20pm, and I'll be busy cooking up a fun demo for that talk between now and then. If you're not at OSCON, feel free to send mail to jflam at the big software company in Redmond.

Last but most important, I'd like to thank the members of the IronRuby team: Tomas Matousek, and Haibo Luo for their hard work in getting this release out the door. Great job, guys!

Update

Some additional posts worth reading:

Scott Guthrie, who has a nice sample on using IronRuby with WPF

Jason Zander, on working with the open source community

Miguel de Icaza, for an outside perspective of our changes as a company

July 12, 2007

IronRuby plans revealed on .NET Rocks

.NET Rocks

Richard and Carl interviewed me a few weeks ago on .NET Rocks! We had a fun discussion about a whole range of topics from my experience emigrating to the Republic of Microsoft to why Ruby the language is important.

The interview is now live on their site. Enjoy!

July 01, 2007

Outlook Zen

I spent some time this week pimping out (actually whatever the opposite of pimping out is) Outlook to try and improve my workflow. I did my usual remove all toolbar / status bar trick, so Outlook now looks like this:

Outlook Zen

Next I wrote a couple of Outlook macros: one to take the selected items and move them to a folder called "Archive", and another that moves the selected items to a folder called "FollowUp". The FollowUp macro also creates a new to-do item bound for today so that it shows up in my task list.

Enum ItemOptions
    MarkAsRead
    MarkAsUnRead
    MarkAsTaskForToday
End Enum

Private Sub MoveToFolder(folder As String, options As ItemOptions) On Error Resume Next

Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem

Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)

Set objFolder = objInbox.Folders(folder)
If objFolder Is Nothing Then
    MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER"
End If

If Application.ActiveExplorer.Selection.Count = 0 Then
    'Require that this procedure be called only when a message is selected
    Exit Sub
End If

For Each objItem In Application.ActiveExplorer.Selection
    If objFolder.DefaultItemType = olMailItem Then
        If objItem.Class = olMail Then
            If options = MarkAsRead Then
                objItem.UnRead = False
            End If
            If options = MarkAsTaskForToday Then
                objItem.MarkAsTask olMarkToday
            End If
            objItem.Move objFolder
        End If
    End If
Next

Set objItem = Nothing
Set objFolder = Nothing
Set objInbox = Nothing
Set objNS = Nothing

End Sub

Sub MoveSelectedMessagesToArchive() MoveToFolder "Archives", MarkAsRead End Sub

Sub MoveSelectedMessagesToFollowUp() MoveToFolder "FollowUp", MarkAsTaskForToday End Sub

Now keybindings in Outlook are horribly broken. There's no way to assign a macro to an arbitrary key binding. Instead, you have to bind the macro to a toolbar button; that's what the two toolbar buttons (text-only) do. To activate those two toolbar buttons, I bound them to ALT-Q (archive) and ALT-W (follow-up) respectively. By binding to keys on the left-hand side of the keyboard, I can filter email with my left hand, while navigating my emails via the cursor up/down keys with my right hand.

If the Outlook team can add the ability to bind arbitrary keystrokes to macros (or better yet, to provide parameterized macros) I'd be in heaven. This way I could defer a task for a known period of time via something like ALT-W 7 for make this task due in 7 days.

I also learned about two very useful Outlook keys: ALT-F1 and ALT-F2, which will selectively hide your navigation bar and to-do bar respectively (try it, you'll like it). I'm a very keyboard driven guy, so this arrangement makes me very happy now.

Are there any other useful Outlook tips folks would like to share?

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from John Lam. Make your own badge here.

April 2008

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Blog powered by TypePad