this looks like a job for... tomorrow!

MONOFOSDEM (tm)

I just got through watching Miguel's presentation as FOSDEM. If you've never seen Miguel give a presentation, you really should watch one. He has all the excitement and showmanship of Steve Jobs, only it's completely natural and spontaneous instead of super-polished. (As evidenced by the fact that things don't always go right.) I had suggested he appear on The Daily Show as "equal time" after Bill Gates pimped Vista on it.

I don't really know what the target audience is at FOSDEM, but this is a great talk for Windows developers interested in porting their apps to Mono. There's some history and background for the first ten minutes, but then he moves into how to use MoMA on your applications, the types of things it detects, and what they mean.

After that, it gets even more interesting (to me) as Miguel breaks down the data we have received from MoMA. He provides statistics about what types of apps people are running in the wild, how many we support, and approximately what it will take to get a larger chunk of them running on Mono.

The rest of the video shows some of the applications that are running today on Mono, like Miguel's port of Paint.Net, Mono usage in Second Life, and an attempt to display a game running on Unity's game engine.

As he came to the MoMA part, I was really proud and figured I would cut out that part and post it so people could check it out. As I continued watching, I realized it's a large part of the talk, so I'd just point people to the whole video instead. :)

The video is available here. It is called "FOSDEM2007-TurboCachingLinuxWithMono.ogg".

The video is encoded in Ogg, which I didn't have. To play it in Windows Media Player, you will need to download and install the Ogg codec, which was painless.

Running with Mono: Walkthrough

A few posts ago, I showed some images of what a Reversi project looked like running on .Net, Mono on Windows, and Mono on Linux. If you want to follow along at home, here's a walkthrough to running the game.

First, you need to go to CodeProject and download the game. I just downloaded the executable. Extract it to somewhere.

Mono on Windows
  1. Download the latest Mono setup package from the Mono project downloads page. Currently, the latest version is 1.2.3.1.
  2. Run the setup program. GTK# and XSP are optional. GTK# is for application using the GTK toolset. XSP is for running webforms. Since I'm only interested in Winforms, I generally do not install these.
  3. This should create a Mono 1.2.3.1 for Windows group in your start menu. In it, choose the "Mono-1.2.3.1 Command Prompt" program.
  4. Navigate to where you placed the executable.
  5. Run it using: "mono Reversi.exe"
Now you're not only losing Reversi to the computer, you are losing to the computer running Mono!

Mono on Linux (using VMWare player)
  1. Download the VMWare player here. This will allow you to run a virtual machine without installing a new operating system.
  2. Download the Mono 1.2.3 on openSUSE 10.2 VMware Virtual Image from the Mono download page.
  3. Run the VMWare player, and start up the openSUSE image.
  4. Once inside openSUSE, there are plenty of samples to play with.
  5. To get the Reversi game onto the image, either share a drive in Windows, and copy it to the openSUSE desktop, or open Firefox and download the executable again.
  6. The openSUSE image is set up so that double-clicking the "Reversi.exe" will automatically launch the game using Mono.
Now you're not only losing Reversi to the computer, you are losing to the computer running Mono on Linux!

NOTE: If you are not losing, I do not want to hear about it. I prefer to believe the computer is unbeatable.

Better Than a Mattress Sale

jackson had a good idea for today, and I thought I'd copy it. Since it's a holiday, I hacked on something other than Mono today. Before I worked on Mono, my open source community of choice was Jabber (fun fact: I did that webpage as well). Back then, I released a Jabber server written in VB.Net. One thing that I have laying around that I've never released is an XMPP client. Since it's written in VB.Net and uses the ToolStrip and MenuStrip controls, I figured I'd try to port it to Mono as another test case for the *Strip stuff.

I initially thought our VB runtime was missing too much and started rewriting it in C#. As I realized how much code there was, I decided that wasn't going to work. All of my logic and custom control libraries worked in VB, so I ended up leaving them as is. The main form was where most of the VB compiler magic ("My" classes) was creating problems, so I rewrote it in C# and used the other libraries as is.

After a day of hacking, I got something that I can at least make a screenshot out of:
I don't really know if I'll put any more time into it. Although I still find the project interesting, there's plenty to be done on Winforms 2.0 first.

Also, as the screenshot shows, I am currently running Vista. The plan was to dual-boot to see if I was ready to move. Vista had other intentions. It ate my XP partition. I didn't lose any data, but I don't have an XP partition I can successfully boot into anymore. I guess I'll use Vista this week, and determine which OS to reinstall cleanly this weekend. On the plus side, I didn't find any issues running Mono. :)

1.2.3: Where We're At

Recently we released Mono 1.2.3 (and Mono 1.2.3.1 yesterday). I am very proud of this release, for several reasons:
  • It's the first release since I've become a full time Mono developer.
  • It's the first release to incorporate MoMA feedback.
  • It's a tremendous improvement over 1.2.2, with over 100 MWF bugs fixed, and over 800 missing methods reported through MoMA implemented.
The biggest question of course, is "Is it ready to run your app?". The one thing I learned in school is that the answer to every computer question is "It depends".

.Net 1.1
If your app is running on the .Net framework version 1.1 and is fully managed, the answer is yes. We consider our support for 1.1 to be feature complete, and encourage everyone to try out their .Net 1.1 apps on Mono. If something isn't working, or looks wrong, it's most likely a bug, and we want to know about it. The bugzilla database for Mono in general is here, and the bugzilla database for MWF is here.

If your app makes unmanaged calls to the Windows API, well, you didn't really expect that to be cross platform, did you? You'll need to work around those calls to do the same thing in managed code, or avoid that code path when running on Mono. A quick scan with MoMA will report any time you are making an unmanaged call (they are labeled P/Invokes).

.Net 2.0
If your app is running on the .Net framework version 2.0, things are a bit trickier. Although there has been much progress done on MWF 2.0, there is still plenty that is unimplemented. MoMA is definitely your friend here. It will scan your app for any functionality you use that has not been implemented yet in Mono. Running it is pretty self explanatory, so I won't cover it here.

A lot of the stuff that is reported isn't necessary and you can work around it if you want your app running on Mono today. Of course, you may run into functionality that you can't live without. Either way, please submit the report at the end so we know what real-world functionality people need. (And if you are real adventurous, you can download the source code to Mono and try to implement what you need. We'd love to incorporate your contribution.)

An Example
Maybe you don't have an app or Mono isn't ready for your app yet, but you'd still like to see what Mono is capable of. I think one of the best places for examples is CodeProject. Looking for a non-trivial 1.1 app, I found this game of Reversi. I think I just like it because it animates the pieces, which alleviates the frustration stemming from the fact that I totally suck at Reversi.

Next time I'll do a guide of how to download Mono and run the game, but for a preview of what it looks like running on the various platforms:

MS .Net Framework / Windows XP

Mono 1.2.3 / Windows XP

Mono 1.2.3 / OpenSUSE 10.2

There's obviously a graphical glitch down the left side, but everything else works perfectly on both Windows and Linux, without any modification to the source code. Hopefully you will have a similar experience with your application!

Prerequisite: Introduction

Hi! I'm Jonathan Pobst. You may remember me from such Mono contributions as "ToolStrip: the one that looks like Microsoft Office" or "MoMA: that program just asking for a lawsuit from the Museum of Modern Art". Or you probably don't, but that's ok.

Since those contributions, I've been fortunate enough to be hired as a full time open source developer. I work mainly on Managed.Windows.Form (MWF): Mono's implementation of the .Net framework's System.Windows.Forms. Things that are specifically my areas are ToolStrip, MenuStrip, StatusStrip, FlowLayoutPanel, and TableLayoutPanel. I also maintain MoMA, and spend some time implementing some of the most needed SWF 2.0 functionality as reported by the MoMA reports submitted.

I decided I needed a blog because MWF is a really cool technology. But more importantly, it lends itself well to screenshots. I mean, I'm sure JIT optimizations and compilers are fascinating, but it's hard to convey that information with pretty screenshots, which is key. It's roughly akin to me trying to explain to my mom what I do for a living.

Another goal of mine is to reach out to Windows developers looking to get started with Mono. I've been developing on Windows since the early days of Visual Basic. I currently develop with Visual Studio 2005 on Windows XP. Hopefully, I can improve Mono's functionality and features for people developing on Windows, as well as help to lessen the learning curve for people with a Windows background. MoMA was my first effort at this, and I've been very happy with how well it has been received (over 17k page views and almost 1k submitted reports).

Or I'll post three times and then abandon my blog, like 95% of people who create a blog...