Google and HMOs

by Miguel de Icaza

A couple of weeks ago, I was reading when I found a link to the Michael Moore new movie Sicko playing at Moore had made some comments at the time about his position on the leaked movie. When I saw this on reddit I thought it was a joke, but there it was in

So I watched the entire thing at the time, I was up until 4am in the morning watching it.

Tonight am going with Laura and some friends that did not see it to watch it again at the theater.

A Handful of Events

For years I have been incredibly annoyed at the power that special interest groups have over policy making in the United States. It all begun by reading Howard Zinn, Noam Chomsky and the progressive sites.

Around that time there were a series of events happening, but I was too busy with the Moonlight hack-a-thon.

Luis Villa posted a link to Larry Lessig post where he has decided to move his work and activism in a different direction, a much needed one: . You should read the whole thing, but here are some bits that I found interesting:

If you've been reading these pages recently, you'll know my allergy to that word. But this friend's use of the term not to condemn me, but rather as play, made me recognize just how general this corruption is. Of course he would expect I was in the pay of those whose interests I advanced. Why else would I advance them? Both he and I were in a business in which such shilling was the norm. It was totally reasonable to thus expect that money explained my desire to argue with him about public policy.

I don't want to be a part of that business. And more importantly, I don't want this kind of business to be a part of public policy making. We've all been whining about the "corruption" of government forever. We all should be whining about the corruption of professions too. But rather than whining, I want to work on this problem that I've come to believe is the most important problem in making government work.

And so as I said at the top (in my "bottom line"), I have decided to shift my academic work, and soon, my activism, away from the issues that have consumed me for the last 10 years, towards a new set of issues: Namely, these. "Corruption" as I've defined it elsewhere will be the focus of my work. For at least the next 10 years, it is the problem I will try to help solve.

The other thing that bothered me at the time was that one of the Supreme Court Justices in the United States became an apologist for torture:

The conservative jurist stuck up for Agent Bauer, arguing that fictional or not, federal agents require latitude in times of great crisis. "Jack Bauer saved Los Angeles. ... He saved hundreds of thousands of lives," Judge Scalia said. Then, recalling Season 2, where the agent's rough interrogation tactics saved California from a terrorist nuke, the Supreme Court judge etched a line in the sand. [...]

So there you have it, America making sound legal decisions based on the hit-show 24.

Google and HMOs

The US is a country that has grown to believe that two differing points of view should be given "equal time" to portray their position regardless of the value of the arguments.

Except things are not fair and not equal in a country where you get the best democracy that money can buy.

So Michael Moore presents a film in 2007 after 30 years of HMO propaganda and will be up against a multi-billion dollar industry that will use every tool at their disposal to keep the profits rolling, and the health service at the lowest possible level.

And now we have Google's Health Advertising team pitching their services to a rotten industry (from Boingboing).

They are willing to help this industry catapult the propaganda:

Many of our clients face these issues; companies come to us hoping we can help them better manage their reputations through "Get the Facts" or issue management campaigns. Your brand or corporate site may already have these informational assets, but can users easily find them?

We can place text ads, video ads, and rich media ads in paid search results or in relevant websites within our ever-expanding content network. Whatever the problem, Google can act as a platform for educating the public and promoting your message. We help you connect your company’s assets while helping users find the information they seek.

If you're interested in learning more about issue management campaigns or about how we can help your company better connect its assets online, email us. We'd love to hear from you! Setting up these campaigns is easy and we're happy to share best practices.

Ah, "Get The Facts" campaigns to better manager company reputations. Where have I heard that one before?.

Sure, Google could keep selling their ads and do Get the Facts campaigns out, but actively reaching out to this rotten industry saddens me.

Update: An official response from Google.

Posted on 30 Jun 2007

Jonathan Pobst's: Banshee Integration with Nike+ Accessory

by Miguel de Icaza

For Hack Week, Jonathan Pobst did a pretty cool hack: he added support for Banshee to work with the Nike+ Accessory on iPods.

From his blog:

I decided that part of my Hack Week would be to venture from my "happy place" of Winforms in Visual Studio and write something in GTK# using MonoDevelop. I chose to write a plugin for Banshee that allows it to sync with and display files generated by taking your iPod for a run with the Nike+ accessory. Oh, and using Moonlight, just because it seemed fashionable.

Posted on 29 Jun 2007

Hack Week: Ankit

by Miguel de Icaza

Ankit from the Mono/MonoDevelop team had a fantastic idea: embedding VIM into MonoDevelop.

Watch the video:

He shows:

  • Code completion/intellisense with VIM/MonoDevelop.
  • Class/method combo boxes for navigation.
  • Full duplex communication between the two of them.

Posted on 29 Jun 2007

Valgrind Support for Mono

by Miguel de Icaza

During hack week, I took an afternoon to add Valgrind support for Mono symbols. It was kind of a hackternoon thing.

Mono works great with Valgrind, but when there is an error in unmanaged code stack traces only contain symbols from the native libraries and do not contain information from the JITed code. During the Moonlight hacking sprint we used Valgrind extensively for finding errors in our code and it was becoming annoying to manually lookup addresses from stack traces and match them up with Mono's -v output. Today the output looks like this:

==22441== Mismatched free() / delete / delete []
==22441==    at 0x4020E26: operator delete(void*) (in /usr/lib/valgrind/x86-linux/
==22441==    by 0x5EB49FA: Value::FreeValue() (value.cpp:261)
==22441==    by 0x5EB4AAC: value_free_value (value.cpp:275)
==22441==    by 0x66E5E60: ???
==22441==    by 0x66E4587: ???
==22441==    by 0x66E3FF1: ???
==22441==    by 0x66E3DE5: ???
==22441==    by 0x66E3D35: ???
==22441==    by 0x809D294: mono_runtime_class_init (object.c:329)
==22441==    by 0x815920C: mono_jit_compile_method (mini.c:10905)
==22441==    by 0x81595C4: mono_jit_runtime_invoke (mini.c:11081)
==22441==    by 0x809FD34: mono_runtime_invoke_array (object.c:2616)


This app is the culrpit for the above stacktrace. A developer first reaction to the "???" text is to panic.
Today we lower the panic alert level.

At the beginning of the hackternoon, I did not know it, but Nat had written a script that achieved similar results:

I added a new client API to Valgrind that JIT compilers can use to register generated code with Valgrind so that the actual method name is displayed on the stack traces, the new output looks like this for the same error:

==22478== Mismatched free() / delete / delete []
==22478==    at 0x4020E26: operator delete(void*) (vg_replace_malloc.c:244)
==22478==    by 0x5EB49FA: Value::FreeValue() (value.cpp:261)
==22478==    by 0x5EB4AAC: value_free_value (value.cpp:275)
==22478==    by 0x66E5E60: (wrapper managed-to-native) Mono.NativeMethods:value_free_value (Mono.Value&)
==22478==    by 0x66E4587: System.Windows.DependencyObject:SetValue (System.Windows.DependencyProperty,System.Windows.Media.Color)
==22478==    by 0x66E3FF1: System.Windows.Media.SolidColorBrush:.ctor (System.Windows.Media.Color)
==22478==    by 0x66E3DE5: Desklets.Monitor:.cctor ()
==22478==    by 0x66E3D35: (wrapper runtime-invoke) Desklets.Monitor:runtime_invoke_void (object,intptr,intptr,intptr)
==22478==    by 0x809D294: mono_runtime_class_init (object.c:329)
==22478==    by 0x815920C: mono_jit_compile_method (mini.c:10905)
==22478==    by 0x81595C4: mono_jit_runtime_invoke (mini.c:11081)
==22478==    by 0x809FD34: mono_runtime_invoke_array (object.c:2616)

The patch is here.

Support your Valgrind/Mono addiction by voting my idea up.

Posted on 29 Jun 2007

Moonlight Desklets Update

by Miguel de Icaza

Everaldo has a nice update on the result from the HackWeek on the Moonlight/Gtk#-based desklets project.

Check Everaldo's blog for more details.

Posted on 29 Jun 2007

Hack Week: Moonlight Desklets.

by Miguel de Icaza

The folks over at #desklets have been making some progress on their hack for week.

Andreia wrote an SVG to XAML conversion tool that is very handy to import artwork from tools like Inkscape into XAML.

Everaldo did a screencast of a few desklets that the folks have been working on during Hack Week:

YouTube Video:

Gtk#/Moonlight Desklets in action

Some screenshots, because they look nicer than the YouTube video:


These are of course not as advanced as other desklets systems, this was written only in a couple of days, but we have a few interesting things in them that we think are interesting concepts in general:

  • A new launch tool called "mopen" that can launch either XAML files directly, or can launch applications that are contained in a directory (directory/default.xaml, directory/default.exe and eventually directory/default.XX where XX is an extension for a scripting language supported by Mono: Boo, IronPython, Javascript, etc).
  • mopen can launch multiple applications into the same Mono virtual machine and isolate each desklet from each other using Application Domains. This feature is important to us because it means that only one Mono Virtual Machine, Gtk# and Moonlight are loaded at a given time to run multiple applications at the same time.
    The way we did this was by adding a "--host" command line option. You can instruct your desklets (or in fact any program that can be opened with mopen) to go into a specific container. You would for example load all your stable desklets into one VM:
    	$ mopen --host desklets clock
    	$ mopen --host desklets calendar
    	$ mopen --host desklets flickr
    	$ mopen --host desklets picasa

    But keep your development desklets into a separate VM to prevent bringing everything down:
    	$ mopen --host devel stockapplet
  • Security System: today deskltes run without a security sandbox. We will be working on the Silverlight security system for Mono. Once that is implemented users will be able to run untrusted code into the sandboxed environment.
    The new Silverlight security system is a lot easier to understand than the old CAS, so we are looking forward to implement this (it is also a requirement for the Moonlight browser plugin).
  • Mono: we get to leverage our favorite CLI-based languages (C#, Boo, IronPython, Nemerle or any other language that targets the CLI) and we get to leverage the CLI APIs.

Another one

Desklets are of course not a new thing, Google and Yahoo both ship desklet systems. OSX and Vista have widgets and gadgets as well. Gnome has gDesklets, KDE has SuperKaramba.

This is merely our take on the challenge as part of Novell's hack week and it is also a good way of exercising our Moonlight engine, the Gtk# binding, Mono and try to learn something new in the process.

Marek's weather applet

If you have not seen them, you should check out what other folks at Novell are doing during their hack week. There are some videos here. Today it seems to be strongly slanted towards Evolution and panel applets.

Posted on 28 Jun 2007

Desklets and Getting Started with XAML

by Miguel de Icaza

Jackson has written a fantastic tutorial on his blog (and I think it should be moved to the Mono web site as a Guide). check it out: A Mono Developers Guide To Writing XAML.

For those of you participating in the #desklets effort, the above is a good getting started guide on XAML.

Posted on 26 Jun 2007

HackWeek: Moonlight-based Desklets for the Desktop

by Miguel de Icaza

I have yet to choose what I will do for Hackweek (likely do tech support for those trying to use Moonlight to spice up their desktop apps), but I helped a little bit on the Desklets project that Everaldo initiated:

As you can see, although the clock is transparent it is still showing the title bar, am not sure what is the right way these days of removing it. I do not think its using a POPUP window, is it?

Some folks from the Moonlight group (and other Mono hackers) are building a new desklet infrastructure for the desktop. The idea is here: Implement Desklets Using Moonlight and some sample code is available already in moon/desklets/lameclock as a reference in our Anonymous SVN repository.

You will need to install Moonlight to get it going.

You can watch a video of the new tool "mopen" launching the clock desklet that I hacked in a few minutes. The animation does a double fade: fade from clock to config and from config to clock. We could use more complex animations, using the Storyboard and Animation features, but this is what I cooked in 10 minutes:

Posted on 25 Jun 2007

Video Capture of Moonlight in Action

by Miguel de Icaza

I finally managed to do video capture, I ended up using ffmpeg for generating the file.

This shows the Surface Silverlight application running in Linux with Moonlight. It also shows two modified versions of it:

  • The first replaces pictures with bezier paths (the Mono logo) and a "live" clock photo.
  • The second one introduces a video playing live as part of the surface.

Watch the video here.

Posted on 25 Jun 2007

Hack Week Begins

by Miguel de Icaza

The next week is Hack Week at Novell, where all engineers in the Open Source group get to work on their own pet ideas during their work hours.

There is an idea database here:

Posted on 25 Jun 2007

Concert Weekend

by Miguel de Icaza

Nice week for concerts: Music Party in Paris on the 21st, Cesaria Evora in Boston on Saturday and Manu Chao today.

Posted on 24 Jun 2007

Banshee Media Player Goes to Windows

by Miguel de Icaza

Scott Peterson posts a screenshot of his progress, Banshee now starts up on Windows with Mono/Gtk# (there is a buglet somewhere that prevents it from running with the .NET Framework):

If you want to track other Summer of Code projects, check our weekly status reports here

Posted on 24 Jun 2007

Moonlight Demo/Interview in French

by Miguel de Icaza

Didier Girard met me at my hotel on Friday and we did a quick interview with a demo, which you can see on video (since I have yet to figure out how to do screen captures myself).

In the demo you can see Moonlight and the Gtk# binding to Moonlight in action as well as various assorted samples.

See it here.

Posted on 24 Jun 2007

Paris Dinner

by Miguel de Icaza

Jetlag caused me to not get any good sleep in my trip to Paris. On Friday I was woken up at 3:30pm by the hotel staff asking whether they could clean the room. Oops. I overslept.

That afternoon I met with Mono contributor Olivier Dufour (Winforms GUI for Bitsharp/MonoTorrent, and more recently the author of our new Javascript engine for Moonlight) and with Fabrice Bellard.

I am a fan of Fabrice Bellard since he wrote lzexe on the DOS days. He later wrote the smallest C compiler, then Tiny C Compiler, QEMU, FFMPEG and many other wonderful hacks.

Olivier blogged our dinner with Guy Lunardi from Novell here.

It was a pleasure to interrogate them about their hacking projects and to get the history behind Fabrice's projects.

Posted on 23 Jun 2007

Mono Sightings

by Miguel de Icaza

If you are curious about the state of the Mono Debugger, check out Martin Baulig's detailed blog on the work he has been doing to improve the debugger and add support for AppDomains (ie, debugging ASP.NET and Silverlight applications).

Scott Peterson got Banshee launching on Windows, see his report.

The Google Summer of Code students have been doing a great job, see their status reports here.

And finally, a nice article from Ars Technica on the Moonlight hack-a-thon.

Posted on 22 Jun 2007

Moonlight hack-a-thon

by Miguel de Icaza

Some member of the hack-a-thon team have blogged about this, here are some blog entries:

My good friend Joshua at Microsoft sets the record straight: we did not know anything about Silverlight 1.1 before its announcement. And thanks to Joshua for the nice blog message.

Posted on 22 Jun 2007

Implementing Silverlight in 21 Days

by Miguel de Icaza

The past 21 days have been some of the most intense hacking days that I have ever had and the same goes for my team that worked 12 to 16 hours per day every single day --including weekends-- to implement Silverlight for Linux in record time. We call this effort Moonlight.

Needless to say, we believe that Silverlight is a fantastic development platform, and its .NET-based version is incredibly interesting and as Linux/Unix users we wanted to both get access to content produced with it and to use Linux as our developer platform for Silverlight-powered web sites.

Am now on a flight to Paris to show the results of 20 days of intense work that the team has implemented. It is hard to contribute to the effort sitting on a plane when the tree is changing every 10-20 minutes.

There is technically still some time left to improve what we can show.

You can see our screenshot-log to see our progress or the Moonlight Project Planning Page.

Testing Silverlight on Linux

At this point we do not have a packaged release of Silverlight for Linux and we still have to sort out a few things that would have to be done in order to ship a ready-to-use plugin.

But if you are curious or want to contribute to the effort check our page for information on downloading, compiling and getting started with the project.

Demo of Silverlight Airlines Demo

Progress on the Silverlight Airlines, June 20th.

How the Hackathon got Started

At the Mix conference this year, after the open source panel, I had a chance to meet with Marc Jalabert from Microsoft France who invited me to participate in a re-play of the Mix event in Vegas, this time in Paris.

Although Marc had sent me an email on May 9th, I did not notice his email until he pinged me back again on the 28th of May and got his confirmation on the 31st to participate at Mix in Paris. On the 31st he suggested:

We suggest you speak during the conference keynote and show a preview of moonlight if you already have something to show.

But on the 31st, other than having learned about Silverlight, explored how to decode video, experiment a little with video and started planning for an implementation we had nothing to show. Nothing am telling you. Also, May was a busy month for me HR-wise as we were hiring new developers to join the Mono team.

By 1pm on Thursday the 31st, I posted this to our internal Novell Mono mailing list (edited to remove all the embarrassing parts) calling for a hack-a-thon:

  Hello folks,
      The organizers of ReMix 07 in Paris (ReMix is the repeat of the
  Microsoft Mix conference) have offered us a 10 minute slot to talk
  about Mono and demo whatever it is that we have done with Mono's
      There are two problems: other than a video (rendered in blue,
  instead of natural colors) and a rectangle that moves, we do not have
      The second problem is that this event is in June 21st so that leaves
  very little time to get things in shape.
      Now, it might very well be the case that we should not show anything
  and we should not rush things out, but it is also a major opportunity,
  and I think it would be foolish not to take advantage of this.
      I do not think we need to demo things embedded in the browser, but
  it would be useful to demo something loaded from a XAML file (video,
  rectangles, bezier paths, and some limited maybe C# controlled
  animation, to avoid doing the full animation framework).   
          * We have a XAML parser written in C# but I have not checked on
            its state nor checked whether it can do more than just the
            basics (like doing data type conversion).
          * Microsoft suggested (and made a good point for it) that the 
            XAML parser be implemented in native code (as 99% of the 
            objects created by XAML are never manipulated by managed
            So we will end up with a C-based XAML parser, whether it is 
            a good idea to do this now, and not reuse the managed one
            is open to discussion.
          * Other than the rectangle (that is currently not even
            rendering) and the video (without audio) I got nothing.
          * We would need to bind the C implementation to C#, and I think
            that we can use the same model that Mike used for Gtk#.
            Not gapi, but the overall model where we mirror the class
            hierarchy in C# that exists in C++ (in this case, the class
            is determined by C#, not by C++, but you get the idea).
          * I have decided to use Cairo for now (David convinced me on 
            the grounds of hardware acceleration).
      We would need a dedicated hack team to drop whatever it is that they
  are doing for this noble cause.    The question is: who wants to
  participate in an intense two-week hackathon to make it happen?
      Obviously, not everyone can work on this at the same time, and
  having too many people would make things difficult to coordinate.   But
  who is interested?

We modified the Silverlight Surface demo to show a live clock and the Mono Logo.

The Team

The team was assembled quickly in response to the email, a limited group from the Mono team to avoid having too many coordination conflicts.

Sebastien, our resident security expert and also maintainer of our GDI+ implementation was the first to reply an hour after my posting. Sebastien would in the next few days be in charge of implementing most of the rendering primitives:

  Me. I haven't looked SL much outside the new security model (and I have
  the feeling this isn't what you have in mind for the demonstration ;-)
  but I have heard about that Cairo-thing.

Jackson who in the past worked on our IL assembler and has been working for a few years on our managed Windows.Forms implementation and been maintaining the Tree and Text controls in Windows forms followed up with:

  I'm in.  Not exactly sure which area would be best for me to get started
  on, so if anyone has suggestions...otherwise I'll just pick something
  without the words text or tree in it.

Jeff Stedfast, who had been working on MonoDevelop for the last couple of months and works with me in the Cambridge office followed up:

  I am down with the dope!

  count me in.

Jeff's first task would be to fix audio in the media player. He would eventually rewrite the video playback engine so we could provide Video brushes in all of its glory and implement the audio support.

Some other people signed up on IRC, so I do not have their early sign up messages. By Sunday things started to get in shape team-wise. Some folks had started work already and became the de-facto maintainers of those pieces of code:

  • Jackson started work on the Expat-based XAML parser (we wanted to use a small XML parser so we can eventually make this a small download as well).
  • Everaldo started work on the browser plugin.

At this point I got the feeling that "DependencyObject" and "DependencyProperty" might be playing a role more important than I had originally thought of. My initial reaction to DependencyObject was a mix between "ugh" and "its kind of clever". At the time it seemed important, but did not quite grasp its importance, I asked Rolf (of Visual Basic compiler in Visual Basic) fame to take over that.

Eventually we would end up with a complete type system and I would describe if it wasn't for the fact that it is still changing and being refactored. Our "Value::Kind" enumeration just vanished and became part of our "Type" class in a valiant effort by Rolf to clean up the code base.

Chris Toshok started work on timelines, which as a dependency required him to start work on transformations as well. He would later take over the entire animation, clock, and frame rendering infrastructure pieces.

The rest of the Mono team was charged with keeping an eye on the rest of the project, continue to fix bugs and provide us with cover for our fresh project. They also would help when we ran into problems (like helping out with performance on Monday the 18th when we were things were not looking great for the Surface demo).

In addition other Novell employees (Atsushi Enomoto, JB Evain, Marek Safar and Mark Probst) are indirectly working on Moonlight. JB by improving Cecil and his Linker (originally funded by the Google Summer of Code, thanks Google!) that would allow us to shrink our existing assemblies into assemblies that would be identical to the Silverlight ones.

Atsushi has done most of our WCF platform, JSon serialization, Marek by implementing LINQ for our C# 3 compiler and its underlying infrastructure and Mark will be working on the JIT support for the new Silverlight security system and of course everyone else in the Mono team that continues to improve our runtime.

Various members from the Mono community have also contributed to Moonlight directly or indirectly through their contributions to the Olive sub-project: Stephen, Joel, Olivier, Antonello, Marek and many more am missing.

The Development: Early Choices

My original plan was to write the low-level rendering engine in C and expose some sort of "scene" API that the managed world would control. With only a few primitives and a handful of operations on those primitives this idea sounded passable. The first code checked into the tree was written in C with the usual Gtk+-like programming pattern and a glib-like object system.

The early tests of Silverlight content rendering side-by-side with SVG content.

There were a few factors that altered the design: the advice from Scott Guthrie and Jason Zander during my trip to the Compiler Lab; David Reveman's [1] (the wizard behind Glitz, Xgl and Compiz) suggestion for moving the engine into the compositing manager and early changes to the class hierarchy that moved me away from C.

I discussed with Scott Guthrie and Jason Zander that I wanted to do as much as possible in managed code, but they made an interesting observation. XAML content might have a few thousand objects defined here and there, but most applications would only care about a couple of high-level objects: a handful of buttons, handles, animations, and so forth but it was not worth having all of those objects in managed memory and for a graphics intensive system we wanted to minimize the number of managed to unmanaged transitions.

The above being said, in 20 days we really had no time to implement two versions and compare whether these assumptions were correct or not.

The other consideration to move away from C# to C at the time had to do with the early conversations with David Reveman who wanted to hardware accelerate this. The idea was to turn the Silverlight high-level operations into a scene description that we could transfer from the client applications directly onto the compositing manager (On modern X installations this is what actually puts the bits on the screen and what has enabled all those spicy effects like the rotating cube).

The idea here is that the Silverlight client could detect if it was running under a compositing manager that offered rendering on the server and it would off-load all the rendering to the layer that can talk directly to the OpenGL hardware.

As the hack-a-thon got started and I started introducing a C-virtual function here and a C-virtual function there, the second time I had to change the hierarchy I got annoyed, bit the bullet and moved the code to C++.

We kept our use of C++ features to a bare minimum, it helped us in quite some cases and in some other cases we hated it. A proper rant about C++ will have to wait for another day.

At least we stayed within the confines of the "C" family of languages.

[1] David Reveman is one of the main wizards behind the graphics revolution going on in Linux: Glitz, Xgl and Compiz. He also happens to be based in the Cambridge office and host an international crowd at his fabulous apartment for drinks.


The project was originally organized over email but the day-to-day technical discussions moving into a private IRC channel.

We did use email as a way of communicating with some of the developers on other time zones to either pass the baton and as a poor man's bug-tracking system.

We did have a handful of one-to-one phone conversations when we started to merge things together: some components were independent of each other and due to the hacking intensity during this period.

The crowd in America would go to sleep and Atsushi (Japan) and Rolf (Spain) would take over development for the next eight hours until we were able to catch up again: Everaldo in Sao Paolo, Sebastien in Canada, Jeff, Alan in Boston and later Jackson, and myself on the East Coast (due to our sleeping hours) and Chris on the West Coast.

This is basically how we do things in the Mono team, except this time we were under tight pressure.

The Documentation

The .NET API to Silverlight shipped with very little in the form of documentation, but a lot of it could be inferred from the Silverlight 1.0 API and from the WPF API.

The Silverlight .NET API is a flatter API than WPF is, but in some cases (the work that Chris did on animations) we would internally on the C++ side implement some of the classes that are found on the bigger brother of Silverlight as support infrastructure for it.

The API reference that we used was what was available on the Visual Studio Object Browser (or Mono's equivalent command line tool: monop).

Second Week

Alan McGovern (of BitSharp fame) would be arriving to Boston a week after the hack-a-thon and we asked him to start work on a Silverlight-based designer and on bits of the C# API (exercising our C++ code).

At this point the class hierarchy was no longer the "early" check-in that was more focused on "scenes" but instead mirrored the C# API one-to-one. Also, the type system had been in place and we had to come up with a mechanism to provide the equivalent to object identity and boxing to communicate between C# and C++. Keeping the two sets of typecodes in sync had become a source of frustration which lead to Chris and Rolf to write some sanity checking scripts and auto-generate one from the other.

During this week the C# binding came to life. We had been doing all of our work in C++ and testing every new class by sticking the new object, brush, opacity setting, transformation, animation, storyboard and flag into a single demo. One ugly demo with CNN and the Colbert Report spinning on the background.

The object system was designed with reference counts in mind, similar to The GObject system and also has the notion of "sunk" references. By the end of the week we had not really paid much attention to proper object management and ownership and problems started to creep up when we had to properly shutdown (say, when loading a second XAML file in the same Surface that might have been animated).

Chris fixed the reference counting before the weekend and we closed the week. This is more or less what happened during the week, based on my partial log:

June 14th:

  • Text renders (Jeff).
  • Radial gradients (Sebastien).
  • Attached properties are now handled by Canvas on changed children.
  • Implemented the downloader (Toshok).
  • Managed downloader (Miguel).
  • Mouse enter/leave events (Miguel).
  • It is possible to load images from the net
  • everaldo gets plugin using <object> embedding instead of the hack we were using.

June 15th:

  • Inlines and Runs in text
  • Performance improvements
  • Mouse event routing to individual objects.
  • Loading of custom objects from XAML files using assemblies.
  • Everaldo gets plugin to change surfaces with javascript.
  • Sebastien starts work on porting the surface to Gtk# with Silverlight, just in case.

June 16th

  • Loading of xaml dependency files (Miguel, Jackson).
  • Toshok optimizes rendering using bounding boxes.
  • Jackson hooks this dependency loader.
  • Jeff refactors the video engine to make it reusable.
  • C# bindings.

June 17th

  • Jeff implement VideoBrush
  • Sebastien implements the various image properties, so that they render with the specified parameters.
  • Event system updated, Surface now gets events in the correct order.
  • Animation parser fixes, surface animations are now properly timed.
  • Everaldo added support for XAML content in HTML pages (referenced with '#' in a url).
  • Jackson got support for x:Class on XAML loading.

June 18th:

  • Rolf implemented support for nullable types in the Moon typesystem and bindings to map Nullable in the C# code to our C++ Nullables.
  • Jeff implemented support for having VideoBrushes share a MediaElement.
  • Jeff implements brushes for Runs.
  • Paolo helps with the profiling of Moonlight's Surface and helps us get interaction smoother.
  • Chris and Sebsatien worked on tuning the performance for rendering on the screen.
  • Chris improves animations and screen refreshes, and sets up xlib-based image surfaces.
  • Jackson completes Path Data parsing, the underlying infrastructure was done by Sebsatien enabling the remaining samples from Sam Ruby's sample site to render.
  • Jackson and Sebastien implement the various segments that are missing for the Path rendering
  • Jackson implemented XAML support for <Run/>

June 19th:

  • Javascript bridge to DependencyObjects works, the Javascript-controlled XAML Clock sample works now.
  • Collection iterators are implemented
  • Work on proper browser shutdown.
  • Many missing managed bindings are implemented by Rolf.

Some stats

In the last 20 days, the team:

  • Made 1,228 commits to the SVN repository (Everaldo was the lucky commiter for revision r80000 in our tree).
  • Wrote 24,373 lines of C++
  • Wrote 1,367 lines for the C# binding to Gtk# and the Mozilla C# host.
  • Wrote 13,207 lines of C# class libraries (not including the ongoing work on an open source Javascript compiler for the DLR from Olivier, nor including the fine work going on to implement LINQ, nor upgrade our C# compiler and runtime).

What Worked And Did Not Work

There are various factors that I think worked very well for the project:

  • The availability of Cairo.
  • Pango for doing text rendering.
  • The team background and familiarity with Mono, C#, C, C++, Gtk+, X11, Cairo and Pango.
  • Valgrind. Best C/C++ debugging tool in the world. When the bugs get nasty Valgrind was able to pinpoint the problems while we mixed Mozilla, Mono, Cairo and our runtime library.

Some of the things that we need to sort out and have been problematic:

  • Cairo performance, we probably need to learn how to better employ Cairo, but there are some bottlenecks in there that are quite bad.
  • Alternatively we can mix rendering with Cairo with rendering with Antigrain (shared RGB buffer) or we could explore replacing Cairo with Antigrain.
  • Cairo does not offer options to render the end cap and start cap differently.
  • Cairo needs to offer an "alpha" enabled version for sources, not only "_set_source_rgba", but allow the "a" to exist for patterns and sources.
  • Pango text rendering with Cairo, two problems:
    • Rotated text looks terrible and even miss-aligned. Antigrain has a "round-off" mode that makes these rendering glitches go away, it would require us to port pango-cairo to use Agg though. See what it looks like.
    • Ligatures do not seem to be implemented, this is a problem for rendering arabic strings as it renders each character in its standalone form instead of the linked way. Pango does this, but we could not figure out why it does not work with Cairo (see image showing Linux spelled in Arabic).

Future Directions

I did not think we would be able to get this far in 21 days, I was hoping at most to have a simple XAML file loading and some animations going but the team really achieved an incredible project . I think we are still quite impressed that it could be done.

But there is still much work left to do to before we can work flawlessly as a Silverlight plugin.

There are still some important chunks of work missing: from ensuring that everything we have implemented is complete to completing large chunks of work that are still missing.

One of the major areas that needs work is the C# to browser integration as well as improving the browser plugin which only recently started working. Some work has been done (all on our public SVN repository) but the pieces came in too late to be integrated.

We have a to-do list for some of the remaining tasks.

Future Directions: Gtk# Widget and the Gnome Desktop

Although Silverlight is intended to be used in a web browser we think it would be very useful to Linux desktop programmers to have Silverlight reusable as a widget.

We already have been talking to a few folks about how we can help them improve and spice up their desktop applications with Silverlight. Obvious choices are all the existing Gnome/Mono based applications, but ever since we got started on this, the idea of writing a "Media Center" sort of UI has been making the rounds.

I have for years talked about my desire of having a "Flash on a Widget" widget for Gtk+, an idea that was not very popular back in the days when Flash was considered only a technology to do animations.

We finally have such a widget and it can be scripted, hosted, embedded or extended from any ECMA CLI compliant language: all the traditional static languages for .NET as well as the new batch of dynamic languages that take advantage of the Dynamic Language Runtime (DLR).

Larry of F-Spot fame for example has already prototyped F-Spot integration with the Surface demo:

He also has this mode printing PDFs already.

Future Directions: Media Codecs

Currently we are using the fantastic ffmpeg video library but for the sake of distribution in some countries we might have to write a new video/audio backend.

Novell will be requiring copyright assignments or contributions to be made under the MIT X11 license to Moonlight to ensure that we can ship this plugin with proprietary drivers if necessary (and also to relicense Moonlight for embedded system users).

Future Directions: Silverlight Designer

We will be working on a simple designer for Silverlight written in Silverlight itself. We hope to achieve:

  • Allowing Linux users to develop rich user experiences in Linux without having to learn XAML by memory or requiring a Windows machine with Blend to design UIs.
  • To integrate this directly into our MonoDevelop IDE so people can create web sites using Silverlight (Michael Hutchinson of aspnet-edit, another Google SoC graduate will be joining us in September).
  • By developing Silverlight in Silverlight we will also allow the MacOS crowd that currently can consume Silverlight content but not produce it to participate in the production ecosystem.

Future Directions: Logo

We need a logo for the Moonlight project, so we can print T-Shirts.

Jackson suggested on irc for the Silverlight Airlines demo:

<jackson> also, we should totally add snakes, time permitting


If you want to help on the effort, the best thing to do is to get the source code, instructions are here and post your questions or suggestions to the Mono Olive discussion group.

Posted on 21 Jun 2007

Interview with Brad Abrams

by Miguel de Icaza

A very nice interview with Brad Abrams from Microsoft on various topics.

He talks about Silverlight, creating Silverlight content that is indexable and the current state and future directions of Silverlight.

Also interesting for the Silverlighters among us is ScottGu's "My 'Lap Around Silverlight' Talk at TechEd" it is now available for watching online.

Posted on 18 Jun 2007

Government Spies

by Miguel de Icaza

What I found fascinating about the accidental leak of the intelligence agencies in the US was not the dollar amount (48 billion, 60 billion, to me they are just very large numbers) but the poor quality of the powerpoint presentation.

I wont rehash the argument that powerpoint presentations are bad, we all know that by now, but the unclassified data is fairly revealing.

Slides like this look like a 13-year old shrine to their crush.

That slide is an embarrassment to the whole human species. Someone please hide that before the aliens invade or we will lose our chances of being taken seriously.

It seems like the agencies are a few cycles behind the latest computing fads. I fully expect the CIA to launch a "Extreme Spying" program next year: two spies working together to spy, fund some militant group or torture while the one making side comments and writing tests.

Posted on 10 Jun 2007

Little Snippet of News

by Miguel de Icaza

For the Windows.Forms crowd out there using Moma, this is form Jonathan Pobst's weekly status report:

This week:
- Implemented AutoSize for: Form, Button
- Finished 2.0 versions of: Button, ColumnHeader, Splitter, ScrollBar, 
ScrollableControl, Panel, and GroupBox.

Winforms 2.0 Autosize is soon coming to your nearest Linux workstation.

Mono's LINQ support

Marek now has where, group, into implement for LINQ expressions on SVN.

Posted on 08 Jun 2007

Paris, June 21st

by Miguel de Icaza

Bon jour France!

I will be attending a replay of Microsoft Mix'07 in Paris on June 21st at Le Cirque d'hiver.

We are working around the clock to demo Silverlight on Linux (our own open source version of it).

You can track the progress in our screenshots page. It would be best if I could figure out how to make a video of it so you could see what we have come up with so far (Atsushi Enomoto, Chris Toshok, Everaldo Canuto, Jackson Harper, Jeff Stedfast, Rolf Bjarne, Sebastien Pouliot and myself).

Question: Whats the hip thing to use to record video on Linux these days? Many years ago I used a tool that generated flash files but I do not remember what it was nor where in the machine it lives.

Spare time: I got some time to kill on the 20th and the 22nd, and the morning of the 23rd, anyone interested in getting together and discuss all things Mono, Linux, Gnome?

Posted on 07 Jun 2007

Porting Windows.Forms application to Linux using Mono

by Miguel de Icaza

Jonathan Pobst has written a terrific guide that explains how Windows.Forms developers can port their Windows.Forms applications to Linux using Mono.

Check it out.

Posted on 04 Jun 2007

Flight of the Conchords on HBO

by Miguel de Icaza

Back in 2005 I saw an amazing half hour stand-up show on HBO with a band called the Flight of the Conchords, New Zealands fourth most popular digi-folk paradists.

They now got their own show, this is one of the best news for the summer.

Fans of the Conchords can watch an episode here here.

Posted on 04 Jun 2007

Rodrigo, Mark and Marek Join Novell's Mono Team

by Miguel de Icaza

A few more developers have joined the Mono team at Novell.

Rodrigo Kumpera and Mark Probst have joined the Mono team to work on the Mono Virtual Machine and will be working with Dick, Massi, Paolo and Zoltan to work on various tasks: improving our performance, reducing the memory usage, port maintenance.

As warm up exercises Rodrigo is completing the Mono VM verifier and Mark Probst is implementing the Silverlight security system for our Mono-based implementation.

Marek Safar, who has been a long-time contributor to the C# compiler (he implemented CLS compliance, did a big push to improve our error and warning system, implemented extension methods and C# 3 delegate type inference) will be joining us to work on the C# 3 compiler (building on a lot of the work that Scott did).

Silverlight Security

The Silverlight security system (described here, here and here in Shawn Farkas' blog) promises to be very useful.

Unlike CAS that was hard to understand, the Silverlight security model is very simple and can be explained in a couple of minutes. This should be useful very useful to folks running untrusted code like SecondLife.

Posted on 04 Jun 2007

Interview with Michael Meeks

by Miguel de Icaza

Daniel James interviews Michael Meeks. Michael has been involved in the desktop starting with Gnome from around 1998 when he single handedly wrote the Gnumeric Excel import functionality.

He currently leads the effort at Novell, this is truly a great interview. Michael radiates excitement in this interview, it is a pleasure to read.

Posted on 02 Jun 2007

C# and Silverlight

by Miguel de Icaza

InfoQ is reporting that:

"First of all, C# won't be fully supported in Silverlight. Unlike VB, Python, Ruby, and JavaScript, C# does not support the Dynamic Language Runtime and cannot be hosted for runtime compilation in Silverlight."

This is a bit of a stretch. What happens is that Silverlight will ship with compiler/interpreters that can compile source code written in Javascript, Python, Ruby and Visual Basic to native code.

But Silverlight will not include a C# compiler on the client side. You will still be able to author libraries and assemblies with C# and write your application with it, you just wont be able to dump a C# source file over the network and expect that to be compiled and ran on the client machine.

That being said, Mono does have a C# compiler written in C# and we could ship that compiler, and people could use this as a dependency if they wanted to.

Now, what would be an adorable hack would be to relicense Mono's C# compiler commercially to Microsoft and have them distribute it for Silverlight ;-)

Thanks to some fine contributions, Mono's C# 3.0 compiler is in great shape (missing some things, but they will be done in no time).

Posted on 01 Jun 2007

Blowback, Seymour Hersh inteview

by Miguel de Icaza

From the Seymour Hersh interview on the US and Lebanon.

GORANI: The Senora government, in order to counter the influence of Hezbollah in Lebanon would be covertly according to your reporting funding groups like Fatah al-Islam that they're having issues with right now?

HERSH: Unintended consequences once again, yes.


HERSH: Well, the United States was deeply involved. This was a covert operation that Bandar ran with us. Don't forget, if you remember, you know, we got into the war in Afghanistan with supporting Osama bin Laden, the mujahadin back in the late 1980s with Bandar and with people like Elliott Abrams around, the idea being that the Saudis promised us they could control -- they could control the jihadists so we spent a lot of money and time, the United States in the late 1980s using and supporting the jihadists to help us beat the Russians in Afghanistan and they turned on us. And we have the same pattern, not as if there's any lessons learned. It's the same pattern, using the Saudis again to support jihadists, Saudis assuring us they can control these various group, the groups like the one that is in contact right now in Tripoli with the government.


HERSH: [...] Condoleezza Rice, the secretary of state, has been very articulate about it. We're in the business now of supporting the Sunnis anywhere we can against the Shia, against the Shia in Iran, against the Shia in Lebanon, that is Nasrullah. Civil war. We're in a business of creating in some places, Lebanon in particular, a sectarian violence.

The blowback discussion seems to be the political equivalent mistake of introducing new species and then wondering what went wrong.

Except biologists do not get to claim that the rabbit population in New Zealand exploded and became a problem because "Rabbits hate our freedoms". There had to be a downside to being a scientist.

Lebanon War of 06

Last year, while the US claimed they were doing everything in their power to negotiate stopping the '06 Lebanon War (and as usual in these cases, taking as much time to show up and enforce anything and block any attempts at real progress) those that got their news from outlets outside the Foxosphere-of-influence [*] knew that these claims were far from honest.

Its nice to find out -again- that we were right and they were as usual lying.

Once again, am shocked! shocked!

[*] Foxosphere: About 90% of the news outlets in the US, with notable exceptions like the comedy central fake news line up.

Summer Wars

Last year I read an interesting article about managing wars from a PR standpoint.

Just like Bush administration waited over the summer to introduce the Iraq War, as "From a marketing point of view, you don't introduce new products in August." There is a similar rule for launching unpopular wars and attacks, although I can not longer find the article anymore, the thesis is simple: launch those attacks during the summer.

You introduce these during the summer because Universities in the US are on vacation, and Universities are a central hub of information and organization.

Lets test the theory and see see what this summer has in store for us.

Posted on 01 Jun 2007

The other side of Giuliani

by Miguel de Icaza

Rolling Stone magazine is running Giuliani: Worse than Bush article (from reddit).

Printer friendly version here.

Posted on 01 Jun 2007