XNA on Windows 8 Metro

The MonoGame Team has been working on adding Windows 8 Metro support to MonoGame.

This will be of interest to all XNA developers that wanted to target the Metro AppStore, since Microsoft does not plan on supporting XNA on Metro, only on the regular desktop.

The effort is taking place on IRC in the #monogame channel on irc.gnome.org. The code is being worked in the develop3d branch of MonoGame.

Posted on 19 Apr 2012 by Miguel de Icaza

Contributing to Mono 4.5 Support

For a couple of weeks I have been holding off on posting about how to contribute to Mono, since I did not have a good place to point people to.

Gonzalo has just updated our Status pages to include the differences betwee .NET 4.0 to .NET 4.5, these provide a useful roadmap for features that should be added to Mono.

This in particular in the context of ASP.NET 4.5, please join us in mono-devel-list@lists.ximian.com.

Posted on 13 Apr 2012 by Miguel de Icaza

Modest Proposal for C#

This is a trivial change to implement, and would turn what today is an error into useful behavior.

Consider the following C# program:

struct Rect {
	public int X, Y, Width, Height;
}

class Window {
	Rect bounds;

	public Rect Bounds {
		get { return bounds; }
		set {
			// Some code that needs to run when the	property is set
			WindowManager.Invalidate (bounds);
			WindowManager.Invalidate (value);
			bounds = value;
		}
	}
}

Currently, code like this:

Window w = new Window ();
w.Bounds.X = 10;

Produces the error:

Cannot modify the return value of "Window.Bounds.X" because it is not a variable

The reason is that the compiler returns a copy of the "bounds" structure and making changes to the returned value has no effect on the original property.

If we had used a public field for Bounds, instead of a property, the above code would compile, as the compiler knows how to get to the "Bounds.X" field and set its value.

My suggestion is to alter the C# compiler to turn what today is considered an error when accessing properties and doing what the developer expects.

The compiler would rewrite the above code into:

Window w = new Window ();
var tmp = w.Bounds;
tmp.X = 10;
w.Bounds = tmp;

Additionally, it should cluster all of the changes done in a single call, so:

Window w = new Window ();
w.Bounds.X = 10;
w.Bounds.Y = 20;

Will be compiled as:

Window w = new Window ();
var tmp = w.Bounds;
tmp.X = 10;
tmp.Y = 20;
w.Bounds = tmp;

To avoid calling the setter for each property set in the underlying structure.

The change is trivial and wont break any existing code.

Posted on 11 Apr 2012 by Miguel de Icaza

Can JITs be faster?

Herb Sutter discusses in his Reader QA: When Will Better JITs save Managed Code?:

In the meantime, short answer: C++ and managed languages make different fundamental tradeoffs that opt for either performance or productivity when they are in tension.

[...]

This is a 199x/200x meme that’s hard to kill – “just wait for the next generation of (JIT or static) compilers and then managed languages will be as efficient.” Yes, I fully expect C# and Java compilers to keep improving – both JIT and NGEN-like static compilers. But no, they won’t erase the efficiency difference with native code, for two reasons.

First, JIT compilation isn’t the main issue. The root cause is much more fundamental: Managed languages made deliberate design tradeoffs to optimize for programmer productivity even when that was fundamentally in tension with, and at the expense of, performance efficiency. (This is the opposite of C++, which has added a lot of productivity-oriented features like auto and lambdas in the latest standard, but never at the expense of performance efficiency.) In particular, managed languages chose to incur costs even for programs that don’t need or use a given feature; the major examples are assumption/reliance on always-on or default-on garbage collection, a virtual machine runtime, and metadata.

This is a pretty accurate statement on the difference of the mainstream VMs for managed languages (.NET, Java and Javascript).

Designers of managed languages have chosen the path of safety over performance for their designs. For example, accessing elements outside the boundaries of an array is an invalid operation that terminates program execution, as opposed to crashing or creating an exploitable security hole.

But I have an issue with these statements:

Second, even if JIT were the only big issue, a JIT can never be as good as a regular optimizing compiler because a JIT compiler is in the business of being fast, not in the business of generating optimal code. Yes, JITters can target the user’s actual hardware and theoretically take advantage of a specific instruction set and such, but at best that’s a theoretical advantage of NGEN approaches (specifically, installation-time compilation), not JIT, because a JIT has no time to take much advantage of that knowledge, or do much of anything besides translation and code gen.

In general the statement is correct when it comes to early Just-in-Time compilers and perhaps reflects Microsoft's .NET JIT compiler, but this does not apply to state of the art JIT compilers.

Compilers are tools that convert human readable text into machine code. The simplest ones perform straight forward translations from the human readable text into machine code, and typically go through or more of these phases:

Optimizing compilers introduce a series of steps that alter their inputs to ensure that the semantics described by the user are preserved while generating better code:

An optimization that could be performed on the high-level representation would transform the textual "5 * 4" in the source code into the constant 20. This is an easy optimization that can be done up-front. Simple dead code elimination based on constant folding like "if (1 == 2) { ... }" can also be trivially done at this level.

An optimization on the medium representation would analyze the use of variables and could merge subexpressions that are computed more than once, for example:

	int j = (a*b) + (a*b)

Would be transformed by the compiler into:

	int _tmp = a * b;
	int j = _tmp + _tmp;

A low-level optimization would alter a "MULTIPLY REGISTER-1 BY 2" instruction into "SHIFT REGISTER-1 ONE BIT TO THE LEFT".

JIT compilers for Java and .NET essentially break the compilation process in two. They serialize the data in the compiler pipeline and split the process in two. The first part of the process dumps the result into a .dll or .class files:

The second step loads this file and generates the native code. This is similar to purchasing frozen foods from the super market, you unwrap the pie, shove it in the oven and wait 15 minutes:

Saving the intermediate representation and shipping it off to a new system is not a new idea. The TenDRA C and C++ compilers did this. These compilers saved their intermediate representation into an architecture neutral format called ANDF, similar in spirit to .NET's Common Intermediate Language and Java's bytecode. TenDRA used to have an installer program which was essentially a compiler for the target architecture that turned ANDF into native code.

Essentially JIT compilers have the same information than a batch compiler has today. For a JIT compiler, the problem comes down to striking a balance between the quality of the generated code and the time it takes to generate the code.

JIT compilers tend to go for fast compile times over quality of the generated code. Mono allows users to configure this threshold by allowing users to pick the optimization level defaults and even lets them pick LLVM to perform the heavy duty optimizations on the code. Slow, but the generated code quality is the same code quality you get from LLVM with C.

Java HotSpot takes a fascinating approach: they do a quick compilation on the first pass, but if the VM detects that a piece of code is being used a lot, the VM recompiles the code with all the optimization turned on and then they hot-swap the code.

.NET has a precompiler called NGen, and Mono allows the --aot flag to be passed to perform the equivalent process that TenDRA's installer did. They precompile the code tuned for the current hardware architecture to avoid having the JIT compiler spend time at runtime translating .NET CIL code to native code.

In Mono's case, you can use the LLVM optimizing compiler as the backend for precompiling code, which produces great code. This is the same compiler that Apple now uses on Lion and as LLVM improves, Mono's generated code improves.

NGen has a few limitations in the quality of the code that it can produce. Unlike Mono, NGen acts merely as a pre-compiler and tests suggest that there are very limited extra optimizations applied. I believe NGen's limitations are caused by .NET's Code Access Security feature which Mono never implemented [1].

[1] Mono only supports the CoreCLR security system, but that is an opt-in feature that is not enabled for desktop/server/mobile use. A special set of assemblies are shipped to support this.

Optimizing JIT compilation for Managed Languages

Java, JavaScript and .NET have chosen a path of productivity and safety over raw performance.

This means that they provide automatic memory management, arrays bounds checking and resource tracking. Those are really the elements that affect the raw performance of these languages.

There are several areas in which managed runtimes can evolve to improve their performance. They wont ever match the performance of hand-written assembly language code, but here are some areas that managed runtimes can work on to improve performance:

>Alias analysis is simpler as arrays are accessed with array operations instead of pointer arithmetic.

Intent: with the introduction of LINQ in C#, developers can shift their attention from how a particular task is done to expressing the desired outcome of an operation. For example:

var biggerThan10 = new List;
for (int i = 0; i < array.Length; i++){
    if (array [i] > 10)
       biggerThan10.Add (i);
}	
	

Can be expressed now as:

var biggerThan10 = x.Where (x => x > 10).Select (x=>x);
	
// with LINQ syntax:
var biggerThan10 = from x in array where x > 10 select x;

Both managed compilers and JIT compilers can take advantage of the rich information that is preserved to turn the expressed intent into an optimized version of the code.

Extend VMs: Just like Javascript was recently extended to support strongly typed arrays to improve performance, both .NET and Java can be extended to allow fewer features to be supported at the expense of safety.

.NET could allow developers to run without the CAS sandbox and without AppDomains (like Mono does).

Both .NET and Java could offer "unsafe" sections that would allow performance critical code to not enforce arrays-bounds-optimization (at the expense of crashing or creating a security gap, this can be done today in Mono by using -O=unsafe).

.NET and Mono could provide allocation primitives that allocate objects on a particular heap or memory pool:

	var pool = MemoryPool.Allocate (1024*1024);

	// Allocate the TerrainMesh in the specified memory pool
	var p = new pool, TerrainMesh ();

	[...]
	
	// Release all objects from the pool, all references are
	// nulled out
	//
	Assert.NotEquals (p, null);
	pool.Destroy ();
	Assert.Equals (p, null);
	

Limiting Dynamic Features: Current JIT compilers for Java and .NET have to deal with the fact that code can be extended dynamically by either loading code at runtime or generating code dynamically.

HotSpot leverages its code recompiled to implement sophisticated techniques to perform devirtualization safely.

On iOS and other platforms it is not possible to generate code dynamically, so code generators could trivially devirtualize, inline certain operations and drop features from both their runtimes and the generated code.

More Intrinsics: An easy optimization that JIT engines can do is map common constructs into native features. For example, we recently inlined the use of ThreadLocal<T> variables. Many Math.* methods can be inlined, and we applied this technique to Mono.SIMD.

Posted on 04 Apr 2012 by Miguel de Icaza

Microsoft's new Open Sourced Stacks

Yesterday Microsoft announced that another component of .NET would be open sourced. The entire ASP.NET MVC stack is now open source, including the Razor Engine, System.Json, Web API and WebPages.

With this release, they will start accepting external contributions to these products and will be running the project like other open source projects are.

Mono and the new Stacks

We imported a copy of the git tree from Codeplex into GitHub's Mono organization in the aspnetwebstack module.

The mono module itself has now taken a dependency on this module, so the next time that you run autogen.sh in Mono, you will get a copy of the aspnetwebstack inside Mono.

As of today, we replaced our System.Json implementation (which was originally built for Moonlight) and replaced it with Microsoft's implementation.

Other libraries like Razor are next, as those are trivially imported into Mono. But ASP.NET MVC 4 itself will have to wait since it depends on extending our own core ASP.NET stack to add asynchronous support.

Our github copy will contain mostly changes to integrate the stack with Mono. If there are any changes worth integrating upstream, we will submit the code directly to Microsoft for inclusion. If you want to experiment with ASP.NET Web Stack, you should do this with your own work and work directly with the upstream maintainers.

Extending Mono's ASP.NET Engine

The new ASP.NET engine has been upgraded to support C# 5.0 asynchronous programming and this change will require a number of changes to the core ASP.NET.

We currently are not aware of anyone working on extending our ASP.NET core engine to add these features, but those of us in the Mono world would love to assist enthusiastic new developers of people that love async programming to bring these features to Mono.

Posted on 28 Mar 2012 by Miguel de Icaza

Mono 2.11.0 is out

After more than a year of development, we are happy to announce Mono 2.11, the first in a series of beta releases that will lead to the next 2.12 stable release.

Continuous Integration

To assist those helping us with testing the release, we have setup a new continuous build system that builds packages for Mac, OpenSUSE and Windows at http://wrench.mono-project.com/Wrench.

Packages

To test drive Mono 2.11 head to our our downloads page and select the "Alpha" section of the page to get the packages for Mac, Windows or Linux.

The Linux version is split up in multiple packages.

The Windows version ships with Gtk+ and Gtk#

The Mac version ships with Gtk+, Gtk#, F#, IronPython and IronRuby and comes in two versions: Mono Runtime Environment (MRE) and the more complete Mono Development Kit (MDK).

At this stage, we recommend that users get the complete kit.

Runtime Improvements in Mono 2.11

There are hundreds of new features available in this release as we have accumulated them over a very long time. Every fix that has gone into the Mono 2.10.xx series has been integrated into this release.

In addition, here are some of the highlights of this release.

Garbage Collector: Our SGen garbage collector is now considered production quality and is in use by Xamarin's own commercial products.

The collector on multi-CPU systems will also distribute various tasks across the CPUs, it is no longer limited to the marking phase.

The guide Working with SGen will help developers tune the collector for their needs and discusses tricks that developers can take advantage of.

ThreadLocal<T> is now inlined by the runtime engine, speeding up many threaded applications.

Full Unicode Surrogate Support this was a long standing feature and has now been implemented.

C# 5.0 -- Async Support

Mono 2.11 implements the C# 5.0 language with complete support for async programming.

The Mono's class libraries have been updated to better support async programming. See the section "4.5 API" for more details.

C# Backend Rewrite

The compiler code generation backend was rewritten entirely to support both IKVM.Reflection and System.Reflection which allowed us to unify all the old compilers (mcs, gmcs, dmcs and smcs) into a single compiler: mcs. For more information see Backend Rewrite.

The new IKVM.Reflection backend allows the compiler to consume any mscorlib.dll library, instead of being limited to the ones that were custom built/crafted for Mono.

In addition, the compiler is no longer a big set of static classes, instead the entire compiler is instance based, allowing multiple instances of the compiler to co-exist at the same time.

Compiler as a Service

Mono's Compiler as a Service has been extended significantly and reuses the compiler's fully instance based approach (see Instance API for more details).

Mono's compiler as a service is still a low-level API to the C# compiler. The NRefactory2 framework --shared by SharpDevelop and MonoDevelop-- provides a higher level abstraction that can be -- used by IDEs and other high-level tools.

C# Shell

Our C# interactive shell and our C# API to compile C# code can in addition to compiling expressions and statements can now compile class definitions.

4.5 API

4.5 Profile Mono now defaults to the 4.5 profile which is a strict superset of the 4.0 profile and reuses the same version number for the assemblies.

Although .NET 4.5 has not yet been officially released, the compiler now defaults to the 4.5 API, if you want to use different profile API you must use the -sdk:XXX switch to the command line compiler.

Because 4.5 API is a strict superset of 4.0 API they both share the same assembly version number, so we actually install the 4.5 library into the GAC.

Some of the changes in the 4.5 API family include:

  • New Async methods
  • WinRT compatibility API
  • Newly introduced assemblies: System.Net.Http, System.Threading.Tasks.Dataflow

The new System.Net.Http stack is ideal for developers using the C# 5.0 async framework.

Debugging

The GDB support has been extended and can pretty print more internal variables of Mono as well as understanding SGen internals.

The soft debugger has seen a large set of improvements:

  • Single stepping is now implemented using breakpoints in most cases, speeding it up considerably.
  • Calls to System.Diagnostics.Debugger:Log()/Break () are now routed to the debugger using new UserLog/UserBreak event types.
  • S390x is now supported (Neale Ferguson).
  • MIPS is now supported.
  • Added new methods to Mono.Debugger.Soft and the runtime to decrease the amount of packets transmitted between the debugger and the debuggee. This significantly improves performance over high latency connections like USB.

Mac Support

Mac support has been vastly extended, from faster GC by using native Mach primitives to improves many features that previously only worked on Linux to extending the asynchronous socket support in Mono to use MacOS X specific primitives.

New Ports

We have completed the Mono MIPS port.

Performance

As a general theme, Mono 2.11 has hundreds of performance improvements in many small places which add up.

Posted on 22 Mar 2012 by Miguel de Icaza

Mono and Google Summer of Code

Students, get your pencils ready for an intense summer of hacking with the Google Summer of Code and Mono!

Check out the Mono organization Summer of Code Project site.

Posted on 16 Mar 2012 by Miguel de Icaza

Cross Platform Game Development in C#

If you missed the live session on Cross Platform Game Development in C# from AltDevConf you can now watch presentation.

You can also check the videos for all the AltDevConf presentations.

Posted on 16 Mar 2012 by Miguel de Icaza

Working With SGen

As SGen becomes the preferred garbage collector for Mono, I put together the Working With SGen document. This document is intended to explain the options that as a developer you can tune in SGen as well as some practices that you can adopt in your application to improve your application performance.

This document is a complement to the low-level implementation details that we had previously posted.

Posted on 05 Mar 2012 by Miguel de Icaza

Gtk+ and MacOS X

We have released a new build of Mono 2.10.9 (Beta) with the latest version of Gtk+2 containing dozens of bug fixes done by the Lanedo team to improve the quality of Mono/Gtk+ apps on OSX.

This is still a beta release, please take it out for a spin, we are almost ready to graduate this as our stable Mono package.

Posted on 05 Mar 2012 by Miguel de Icaza

Phalanger's PHP on Mono/.NET Updates

The Phalanger developers have published an updated set of benchmarks of their PHP compiler running on top of .NET vs PHP and Cached PHP, and the results are impressive:

There are two cases on the language shootout where they are slower than PHP (out of eighteen cases) and they are also slower on eight of thirtyone microbenchmarks.

But in general with real applications like WordPress and MediaWiki, the performance gains are impressive.

Posted on 05 Mar 2012 by Miguel de Icaza

C# for Gaming: Slides

You can now get the Slides for my Mono for Game Development talk.

Or you can go straight to the resources for the talk.

Posted on 11 Feb 2012 by Miguel de Icaza

C# for Gaming: AltDevConf This Weekend

It is a great honor to participate this weekend on the online AltDevConf conference. This is an online two-day event

Our goal is twofold: To provide free access to a comprehensive selection of game development topics taught by leading industry experts, and to create a space where bright and innovative voices can also be heard. We are able to do this, because as an online conference we are not subject to the same logistic and economic constrains imposed by the traditional conference model.

I will be participating in the talk on Cross Platform Game Development using C# with Matthieu Laban and Philippe Rollin.

You can register here for our session on Saturday at 3pm Eastern Standard Time, noon Pacific Time, and 9pm Paris Time.

If you are located in the Paris time zone, that means that you get to enjoy the talk sipping a tasty hot chocolate with some tasty baguettes.

Posted on 09 Feb 2012 by Miguel de Icaza

Mono in 2011

This was a very interesting year for Mono, and I wanted to capture some of the major milestones and news from the project as well as sharing a bit of what is coming up for Mono in 2012.

I used to be able to list all of the major applications and great projects built with Mono. The user base has grown so large that I am no longer able to do this. 2011 was a year that showed an explosion of applications built with Mono.

In this post I list a few of the high profile projects, but it is by no means an extensive list. There are too many great products and amazing technologies being built with Mono, but a comprehensive list would take too long to assemble.

Xamarin

The largest event for Mono this year was that the team working on Mono technologies at Novell was laid off after Novell was acquired.

We got back on our feet, and two weeks after the layoffs had taken place, the original Mono team incorporated as Xamarin.

Xamarin's goal is to deliver great productivity and great tools for mobile developers. Our main products are Mono on iOS and Mono on Android.

These products are built on top of the open source Mono project and the MonoDevelop project. We continue to contribute extensively to these two open source projects.

Launching Xamarin was a huge effort for all of us.

Xamarin would not have been possible without our great customers and friends in the industry. Many people cared deeply about the technology and helped us get up and running.

In July, we announced an agreement with Attachmate that ensured a bright future for our young company.

A couple of days later, we were ready to sell the mobile products that had been previously developed at Novell, and we started to provide all existing Novell customers with ongoing support for their Mono-based products.

Half a year later, we grew the company and continued to do what we like the most: writing amazing software.

Meanwhile, our users have created amazing mobile applications. You can see some of those in our App Catalog.

C# Everywhere

On the Mobile Space: This year Sony jumped to C# in a big way with the introduction of PS Suite (see the section below) and Nokia adopted Windows Phone 7 as their new operating system.

And we got you covered on Android and iOS for all of your C# needs.

On the Browser: we worked with Google to bring you Mono to Native Client. In fact, every demo shown at the Google Native Client event on December 8th was powered by Mono.

On the Desktop: this year we added MacOS X as a first-class citizen in the world of supported Mono platforms. We did this by introducing MonoMac 1.0 and supporting Apple's MacStore with it.

Games: continue to take advantage of C# blend of performance and high-level features. Read more on my GDC 2011 post.

It is a wild new world for C# and .NET developers that were used to build their UI using ASP.NET or Winforms only. It has been fascinating to see developers evolve their thinking from a Microsoft-only view of the world to a world where they design libraries and applications that split the presentation layer from the business logic.

Developers that make this transition will be able to get great native experiences on each device and form factor.

Sony PSSuite - Powered by Mono

At GDC, Sony announced that PS Suite was built on top of Mono. PS Suite is a new development stack for cross-platform games and cross-platform applications to run on Android devices and Sony Vita.

The PS Suite presentation is available in this video.

In particular, watch the game in Video 2 to get a feeling for the speed of a 3D game purely written in managed code (no native code):

Some of the juicy details from the GDC announcement:

  • PS Suite will have an open appstore model, different than the traditional game publishing business.
  • Open SDK, available for everyone at launch time.
  • PS Suite supports both game development with Sony's 3D libraries as well as regular app development.
  • Cross-platform, cross-device, using the ECMA Common Intermediate Language.
  • Code in C#, run using Mono.
  • GUI Designer called "UI Composer" for non-game applications.
  • The IDE is based on MonoDevelop.
  • Windows-simulator is included to try things out quickly.

MonoDevelop on PSSuite:

PS Suite comes with a GUI Toolkit and this is what the UI composer looks like:

Google Native Client

Google Engineers ported Mono to run on the sandboxed environment of Native Client. Last year they had added support for Mono code generator to output code for Native Client using Mono's static compiler.

This year Google extended Native Client to support Just in Time Compilation, in particular, Mono's brand of JIT compilation. This was used by all three demos shown at the Google Native Client event a couple of days ago:

Unity Powered Builder

This is another game built with Unity's Native Client code generator:

To get the latest version of Mono with support for Native Client, download and build Mono from Google's branch on github.

Mono 2.10

This was the year of Mono 2.10. We went from a beta release for Mono 2.10 in January to making it our new stable release for Mono.

While the world is on Mono 2.10, we have started our work to get Mono 2.12 out in beta form in January.

Mono on Android

This year we launched Mono for Android, a product that consists of port of Mono to the Android OS, C# bindings to the native Java APIs and IDE support for both MonoDevelop and Visual Studio.

The first release came out in April, it was rough around the edges, but thanks to the amazing community of users that worked with us during the year, we solved the performance problems, the slow debugging, vastly improved the edit/debug/deploy cycle and managed to catch up to Google's latest APIs with the introduction of Mono for Android 4.0.

Mono on iOS

Just like Android, we have been on a roll with MonoTouch.

In short, this year:

  • We kept up with Apple's newly introduced APIs (UIKit, iCloud, Airplay, Bluetooth, Newstand, CoreImage).
  • Integrated XCode 4's UI designer with MonoDevelop< and added support for storyboards.
  • Added the option of using LLVM for our builds, bringing thumb support and ARMv7 support along the way.

We started beta-testing a whole new set of features to be released early next year: a new unit testing framework, a heap profiler, integrating MonoTouch.Dialog in the product and improving the debug/deploy process.<

Mono for iOS has been on the market now for two years, and many products are coming to the market based on it.

Phalanger

Phalanger is a PHP compiler that runs on the .NET and Mono VMs and is powered by the Dynamic Language Runtime.

It is so complete that it can run both MediaWiki and WordPress out of the box. And does so by running faster than they would under PHP.

This year the Phalanger guys released Phalanger 3.0 which now runs on Mono (previously they required the C++/CLI compiler to run).

Phalanger's performance is impressive as it is just as fast as the newly announced Facebook HipHop VM for PHP. The major difference being that Phalanger is a complete PHP implementation and the HipHopVM is still not a complete implementation.

The other benefit of Phalanger is that it is able to participate and interop with code written in other .NET languages as well as benefitting from the existing .NET interop story (C, C++).

CXXI

Our technology to bridge C# and C++ matured to the point that it can be used by regular users.

Compiler as a Service

This year our C# compiler was expanded in three directions:

  • We completed async/await support
  • We completed the two code output engines (System.Reflection.Emit and IKVM.Reflection).
  • We improved the compiler-as-a-service features of the compiler.

Our async/await support is scheduled to go out with the first preview of Mono 2.11 in early January. We can not wait to get this functionality to our users and start building a new generation of async-friendly/ready desktop, mobile and server apps.

One major difference between our compiler-as-a-service and Microsoft's version of the C# compiler as a service is that we support two code generation engines, one generates complete assemblies (like Microsoft does) and the other one is able to be integrated with running code (this is possible because we use System.Reflection.Emit and we can reference static or dynamic code from the running process).

We have also been improving the error recovery components of the compiler as this is going to power our new intellisense/code completion engine in MonoDevelop. Mono's C# compiler is the engine that is powering the upcoming NRefactory2 library.

You can read more about our compiler as a service updates.

Unity3D

Unity is one of Mono's major users. At this point Unity no longer requires an introduction, they went from independent game engine a few years ago to be one of the major game engine platforms in the game industry this year.

The Unity engine runs on every platform under the sun. From the Consoles (PS3, Wii and XBox360) to iPhones and Androids and runs on your desktop either with the Unity3D plugin or using Google's Native Client technology. The list of games being built with Unity keeps growing every day and they are consistently among the top sellers on every app store.

Mono is the engine that powers the scripts and custom code in games and applications built with Unity3D and it also powers the actual tool that users use to build games, the Unity3D editor:

The editor itself it implemented in terms of Unity primitives, and users can extend the Unity3D editor with C#, UnityScript or Boo scripts dynamically.

One of my favorite games built with Unity3D is Rochard was demoed earlier this year on a PS3 at the GDC and is now also avaialble on Steam:

Microsoft

Just before the end of the year, Microsoft shipped Kinectimals for iOS systems.

Kinectimals is built using Unity and this marks the first time that Microsoft ships a software product built with Mono.

Then again, this year has been an interesting year for Microsoft, as they have embraced open source technologies for Azure, released SDKs for iOS and Android at the same time they ship SDKs for their own platforms and shipped various applications on Apple's AppStore for iOS.

MonoDevelop

We started the year with MonoDevelop 2.4 and we finished after two major releases with MonoDevelop 2.8.5.

In the course of the year, we added:

  • Native Git support
  • Added .NET 4.0 project support, upgraded where possible to XBuild/MSBuild
  • MonoMac Projects
  • XCode 4 support for MonoMac, MonoTouch and Storyboards
  • Support for Android development
  • Support for iOS5 style properties
  • Major upgrade to the debugger engine
  • Adopted native dialogs on OSX and Windows

Our Git support was based on a machine assisted translation of the Java jGit library using Sharpen. Sharpen has proved to be an incredibly useful tool to bring Java code to the .NET world.

SGen

Our precise collector has gotten a full year of testing now. With Mono 2.10 we made it very easy for developers to try it out. All users had to do was run their programs with the --sgen flag, or set MONO_ENV_OPTIONS to gc=sgen.

Some of the new features in our new Garbage Collector include:

  • Windows, MacOS X and S390x ports of SGen (in addition to the existing x86, x86-64 and ARM ports).
  • Lock-free allocation to improve scalability (we only take locks when we run out of memory).
  • Work stealing parallel collector and a parallel nursery collector, to take advantage of extra CPUs on the system to help with the GC.
  • Work on performance and scalability work, as our users tried things out in the field, we identified hot-spots in SGen which we have been addressing.

As we are spending so much time on ARM-land these days, SGen has also gained various ARM-specific optimizations.

SGen was designed primarly to be used by Mono and we are extending it beyond being a pure garbage collector for Mono, to support scenarios where our garbage collector has to be integrated with other object systems and garbage collectors. This is the case of Mono for Android where we now have a cooperative garbage collector that works hand-in-hand with Dalvik's GC. And we also introduce support for toggle references to better support Objective-C environments like MonoTouch and MonoMac.

XNA and Mono: MonoGame

Ever since Microsoft published the XNA APIs for .NET, developers have been interested in bringing XNA to Mono-based platforms.

There was a MonoXNA project, which was later reused by projects like SilverXNA (an XNA implementation for Silverlight) and later XNAtouch an implementation of XNA for the iPhone powered by MonoTouch. Both very narrow projects focused on single platforms.

This year, the community got together and turned the single platform XNATouch into a full cross-platform framework, the result is the MonoGame project:

Platform Support Matrix

Currently MonoGame's strength is on building 2D games. They already have an extensive list of games that have been published on the iOS AppStore and the Mac AppStore and they were recently featured in Channel 9's Coding For Fun: MonoGame Write Once Play Everywhere.

An early version of MonoGame/XnaTouch powers SuperGiantGame's Bastion game on Google's Native Client. Which allows users of Windows, Mac and Linux desktop systems to run the same executable on all systems. If you are running Chrome, you can install it in seconds.

Incidentally, Bastion just won three awards at the Spike VGA awards including Best Downloadable Game, Best Indie Game, and Best Original Score.

The MonoGame team had been relatively quiet for the most part of 2011 as they were building their platform, but they got into a good release cadence with the MonoGame 2.0 release in October, when they launched as a cross-platform engine, followed up with a tasty 2.1 release only two weeks ago.

With the addition of OpenGL ES 2.0 support and 3D capabilities to MonoGame, 2012 looks like it will be a great year for the project.

Gtk+

Since MonoDevelop is built on top of the Gtk+ toolkit and since it was primarily a Unix toolkit there have been a few rough areas for our users in both Mac and Windows.

This year we started working with the amazing team at Lanedo to improve Gtk+ 2.x to work better on Mac and Windows.

The results are looking great and we want to encourage developers to try out our new Beta version of Mono, which features the updated Gtk+ stack.

This new Gtk+ stack solves many of the problems that our users have reported over the past few months.

Hosting Bills

I never tracked Mono downloads as I always felt that tracking download numbers for open source code that got repackaged and redistributed elsewhere pointless.

This summer we moved the code hosting from Novell to Xamarin and we were surprised by our hosting bills.

The major dominating force are binaries for Windows and MacOS which are communities that tend not to download source and package the software themselves. This is the breakdown for completed downloads (not partial downloads, or interrupted ones) for our first month of hosting of Mono:

  • 39,646 - Mono for Windows (Runtime + SDK)
  • 27,491 - Mono for Mac (Runtime)
  • 9,803 - Mono for Windows (Runtime)
  • 9,910 - Mono for Mac (Runtime + SDK)

  • Total: 86,850 downloads for Windows and Mac

These numbers are only for the Mono runtime, not MonoDevelop, the MonoDevelop add-ins or any other third party software.

It is also worth pointing out that none of our Windows products (MonoDevelop for Windows, or Mono for Android on Windows) use the Mono runtime. So these downloads are for people doing some sort of embedding of Mono on their applications on Windows.

At this point, we got curious. We ran a survey for two days and collected 3,949 answers. These is the summary of the answers:

What type of application will you run with Mono?

This one was fascinating, many new users to the .NET world:

The best results came form the free-form answers in the form. I am still trying to figure out how to summarize these answers, they are all very interesting, but they are also all over the map.

Some Key Quotes

When I asked last week for stories of how you used Mono in 2011, some of you posted on the thread, and some of you emailed me.

Here are a couple of quotes from Mono users:

I can't do without Mono and I don't just mean the iOS or Android dev with C# but MonoMac and Mono for *nix too. Thanks for everything; from the extraordinary tools to making hell turn into heaven, and thank you for making what used to be a predicament to effortless development pleasure.

I don't think we could have achieved our solutions without Mono in enterprise mobile development. It addresses so many key points, it is almost a trade secret. We extensively use AIR and JavaScript mobile frameworks too but ultimately we desperately need 1-to-1 mapping of the Cocoa Touch APIs or tap into low level features which determines our choice of development platform and frameworks.

That's where Mono comes in.

Gratefulness and paying polite respects aside, the key tenets of Mono we use are:

  • shared C# code base for all our enterprise solutions - achieving the write once, compile everywhere promise with modern language and VM features everyone demands and expects in this century
  • logical, consistent and self-explanatory wrapper APIs for native services - allows us to write meta APIs of our own across platforms
  • low latency, low overhead framework
  • professional grade IDE and tools
  • native integration with iOS tools and development workflow
  • existence of satisfactory documentation and support
  • legal clarity - favorable licensing options
  • dedicated product vision via Xamarin - commercial backing
  • community support

Koen Pijnenburg shared this story with me:

We've been in touch a few times before and would like to contribute my story. It's not really an interesting setup, but a real nice development for Mono(Touch). I've been developing app for iPhone since day 1, I was accepted in the early beta for the App Store. On launch day july 2008, 2 of the 500 apps in the App Store were mine, my share has decreased a lot in the past years ;)

I really, really, really like football(soccer), maybe you do also, I don't know. In september 2008 I created the first real soccer/football stats app for the iPhone called My Football. This was a huge succes, basically no competition at that time. In 2009 I released My Football Pro, an app with 800 leagues worldwide, including live data for more then 100 leagues. Since then I created lots of apps, all created with the iPhone SDK and with Objective-C.

Since the launch of MonoTouch, it merged the best of two worlds in my opinion. I've been a Mono/.NET developer for years before the iPhone apps, for me it was love at first line of code.

The last year I've increased my work with MonoTouch / Droid /MonoGame(Poppin' Frenzy etc ;)), and focused less on working with native SDK's only. Since our My Football apps are at the end of their lifecycle in this form, we are working on a new line of My Football apps. Our base framework supporting our data, is built with Mono, and the apps UI will be built with MonoTouch / MonoDroid / WP7 etc.

Included is the screenshot of our first app built with the framework, My Football Pro for iPad. It has a huge amount of data, stats / tables / matches / live data for more then 800 leagues worldwide. We think it's a great looking app!

Working with MonoTouch is fantastic and just wanted you to know this!

Mono on Mainframes

This year turned out to show a nice growh in the deployment of Mono for IBM zSeries computers.

Some are using ASP.NET, some are using Mono in headless mode. This was something that we were advocating a few years ago, and this year the deployments went live both in Brazil and Europe.

Neale Ferguson from Sinenomine has kept the zSeries port active and in shape.

Mono and ASP.NET

This year we delivered enough of ASP.NET 4.0 to run Microsoft's ASP.NET MVC 3.

Microsoft ASP.NET MVC 3 is a strange beast. It is licensed under a great open source license (MS-PL) but the distribution includes a number of binary blobs (the Razor engine).

I am inclined to think that the binaries are not under the MS-PL, but strictly speaking, since the binaries are part of the MS-PL distribution labeled as such, the entire download is MS-PL.

That being said, we played it safe in Mono-land and we did not bundle ASP.NET MVC3 with Mono. Instead, we provide instructions on how users can deploy ASP.NET MVC 3 applications using Razor as well as pure Razor apps (those with .cshtml extensions) with Mono.

2012, the year of Mono 2.12

2012 will be a year dominated by our upcoming Mono release: Mono 2.12. It packs a year worth of improvements to the runtime, to our build process and to the API profiles.

Mono 2.12 defaults to the .NET 4.x APIs and include support for .NET 4.5.

This is going to be the last time that we branch Mono for these extended periods of time. We are changing our development process and release policies to reduce the amount of code that is waiting on a warehouse to be rolled out to developers.

ECMA

We wrapped up our work on updating the ECMA CLI standard this year. The resulting standard is now at ISO and going through the standard motions to become an official ISO standard.

The committee is getting ready for a juicy year ahead of us where we are shifting gears from polish/details to take on significant extensions to the spec.

Posted on 21 Dec 2011 by Miguel de Icaza

CXXI: Bridging the C++ and C# worlds.

The Mono runtime engine has many language interoperability features but has never had a strong story to interop with C++.

Thanks to the work of Alex Corrado, Andreia Gaita and Zoltan Varga, this is about to change.

The short story is that the new CXXI technology allows C#/.NET developers to:

  • Easily consume existing C++ classes from C# or any other .NET language
  • Instantiate C++ objects from C#
  • Invoke C++ methods in C++ classes from C# code
  • Invoke C++ inline methods from C# code (provided your library is compiled with -fkeep-inline-functions or that you provide a surrogate library)
  • Subclass C++ classes from C#
  • Override C++ methods with C# methods
  • Expose instances of C++ classes or mixed C++/C# classes to both C# code and C++ as if they were native code.

CXXI is the result of two summers of work from Google's Summer of Code towards improving the interoperability of Mono with the C++ language.

The Alternatives

This section is merely a refresher of of the underlying technologies for interoperability supported by Mono and how developers coped with C++ and C# interoperability in the past. You can skip it if you want to get to how to get started with CXXI.

As a reminder, Mono provides a number of interoperability bridges, mostly inherited from the ECMA standard. These bridges include:

  • The bi-directional "Platform Invoke" technology (P/Invoke) which allows managed code (C#) to call methods in native libraries as well as support for native libraries to call back into managed code.
  • COM Interop which allows Mono code to transparently call C or C++ code defined in native libraries as long as the code in the native libraries follows a few COM conventions [1].
  • A general interceptor technology that can be used to intercept method invocations on objects.

When it came to getting C# to consume C++ objects the choices were far from great. For example, consider a sample C++ class that you wanted to consume from C#:

class MessageLogger {
public:
	MessageLogger (const char *domain);
	void LogMessage (const char *msg);
}

One option to expose the above to C# would be to wrap the Demo class in a COM object. This might work for some high-level objects, but it is a fairly repetitive exercise and also one that is devoid of any fun. You can see how this looks like in the COM Interop page.

The other option was to produce a C file that was C callable, and invoke those C methods. For the above constructor and method you would end up with something like this in C:

/* bridge.cpp, compile into bridge.so */
MessageLogger *Construct_MessageLogger (const char *msg)
{
	return new MessageLogger (msg);
}

void LogMessage (MessageLogger *logger, const char *msg)
{
	logger->LogMessage (msg);
}

And your C# bridge, like this:

class MessageLogger {
	IntPtr handle;

	[DllImport ("bridge")]
	extern static IntPtr Construct_MessageLogger (string msg);

	public MessageLogger (string msg)
	{
		handle = Construct_MessageLogger (msg);
	}

	[DllImport ("bridge")]
	extern static void LogMessage (IntPtr handle, string msg);

	public void LogMessage (string msg)
	{
		LogMessage (handle, msg);
	}
}

This gets tedious very quickly.

Our PhyreEngine# binding was a C# binding to Sony's PhyreEngine C++ API. The code got very tedious, so we built a poor man's code generator for it.

To make things worse, the above does not even support overriding C++ classes with C# methods. Doing so would require a whole load of manual code, special cases and callbacks. The code quickly becomes very hard to maintain (as we found out ourselves with PhyreEngine).

This is what drove the motivation to build CXXI.

[1] The conventions that allow Mono to call unmanaged code via its COM interface are simple: a standard vtable layout, the implementation of the Add, Release and QueryInterface methods and using a well defined set of types that are marshaled between managed code and the COM world.

How CXXI Works

Accessing C++ methods poses several challenges. Here is a summary of the components that play a major role in CXXI:

  • Object Layout: this is the binary layout of the object in memory. This will vary from platform to platform.
  • VTable Layout: this is the binary layout that the C++ compiler will use for a given class based on the base classes and their virtual methods.
  • Mangled names: non-virtual methods do not enter an object vtable, instead these methods are merely turned into regular C functions. The name of the C functions is computed based on the return type and the parameter types of the method. These vary from compiler to compiler.

For example, given this C++ class definition, with its corresponding implementation:

class Widget {
public:
	void SetVisible (bool visible);
	virtual void Layout ();
	virtual void Draw ();
};

class Label : public Widget {
public:
	void SetText (const char *text);
	const char *GetText ();
};

The C++ compiler on my system will generate the following mangled names for the SetVisble, Layout, Draw, SetText and GetText methods:

__ZN6Widget10SetVisibleEb
__ZN6Widget6LayoutEv
__ZN6Widget4DrawEv
__ZN5Label7SetTextEPKc
__ZN5Label7GetTextEv

The following C++ code:

	Label *l = new Label ();
	l->SetText ("foo");
	l->Draw ();	

Is roughly compiled into this (rendered as C code):

	Label *l = (Label *) malloc (sizeof (Label));
	ZN5LabelC1Ev (l);   // Mangled name for the Label's constructor
	_ZN5Label7SetTextEPKc (l, "foo");

	// This one calls draw
	(l->vtable [METHOD_PTR_SIZE*2])();

For CXXI to support these scenarios, it needs to know the exact layout for the vtable, to know where each method lives and it needs to know how to access a given method based on their mangled name.

The following chart explains shows how a native C++ library is exposed to C# or other .NET languages:

Your C++ source code is compiled twice. Once with the native C++ compiler to generate your native library, and once with the CXXI toolchain.

Technically, CXXI only needs the header files for your C++ project, and only the header files for the APIs that you are interested in wrapping. This means that you can create bindings for C++ libraries that you do not have the source code to, but have its header files.

The CXXI toolchain produces a .NET library that you can consume from C# or other .NET languages. This library exposes a C# class that has the following properties:

  • When you instantiate the C# class, it actually instantiates the underlying C++ class.
  • The resulting class can be used as the base class for other C# classes. Any methods flagged as virtual can be overwritten from C#.
  • Supports C++ multiple inheritance: The generated C# classes expose a number of cast operators that you can use to access the different C++ base classes.
  • Overwritten methods can call use the "base" C# keyword to invoke the base class implementation of the given method in C++.
  • You can override any of the virtual methods from classes that support multiple inheritance.
  • A convenience constructor is also provided if you want to instantiate a C# peer for an existing C++ instance that you surfaced through some other mean.

This is pure gold.

The CXXI pipeline in turn is made up of three components, as shown in the diagram on the right.

The GCC-XML compiler is used to parse your source code and extract the vtable layout information. The generated XML information is then processed by the CXXI tooling to generate a set of partial C# classes that contain the bridge code to integrate with C++.

This is then combined with any customization code that you might want to add (for example, you can add some overloads to improve the API, add a ToString() implementation, add some async front-ends or dynamic helper methods).

The result is the managed assembly that interfaces with the native static library.

It is important to note that the resulting assembly (Foo.dll) does not encode the actual in-memory layout of the fields in an object. Instead, the CXXI binder determines based on the ABI being used what the layout rules for the object are. This means that the Foo.dll is compiled only once and could be used across multiple platforms that have different rules for laying out the fields in memory.

Demos

The code on GitHub contains various test cases as well as a couple of examples. One of the samples is a minimal binding to the Qt stack.

Future Work

CXXI is not finished, but it is a strong foundation to drastically improve the interoperability between .NET managed languages and C++.

Currently CXXI achieves all of its work at runtime by using System.Reflection.Emit to generate the bridges on demand. This is useful as it can dynamically detect the ABI used by a C++ compiler.

One of the projects that we are interested in doing is to add support for static compilation, this would allow PS3 and iPhone users to use this technology. It would mean that the resulting library would be tied to the platform on which the CXXI tooling was used.

CXXI currently implements support for the GCC ABI, and has some early support for the MSVC ABI. Support for other compiler ABIs as well as for completing the MSVC ABI is something that we would like help with.

Currently CXXI only supports deleting objects that were instantiated from managed code. Other objects are assumed to be owned by the unmanaged world. Support for the delete operator is something that would be useful.

We also want to better document the pipeline, the runtime APIs and improve the binding.

Posted on 19 Dec 2011 by Miguel de Icaza

2011: Tell me how you used Mono this year

I have written a summary of Mono's progress in the year 2011, but I want to complement my post with stories from the community.

Did you use Mono in an interesting setup during 2011? Please post a comment on this post, or email me the story and tell me a little bit about it.

Posted on 15 Dec 2011 by Miguel de Icaza

Porto Alegre

We are traveling to Porto Alegre in Brazil today and will be staying in Brazil until January 4th.

Ping me by email (miguel at gnome dot org) if you would like to meet in Porto Alegre to talk hacking, Mono, Linux, open source, iPhone or if you want to enlighten me about the role of scrum masters as actors of social change.

Happy holidays!

Posted on 14 Dec 2011 by Miguel de Icaza

Farewell to Google's CodeSearch

It seems that part of Steve Jobs' legacy was to give Larry Page some advise: focus. This according to Steve Jobs' recently published biography.

So Larry Page took the advise seriously and decided to focus. His brand of focus is to kill projects that were distracting to their goals. One of them, -and the one I cared the most about- was CodeSearch..

What did CodeSearch do for programmers?

The CodeSearch service was a unique tool as it indexed open source code in the wild.

Codesearch is one of the most valuable tools in existence for all software developers, specifically:

  • When an API is poorly documented, you could find sample bits of code that used the API.
  • When an API error codes was poorly documented, you could find sample bits of code that handled it.
  • When an API was difficult to use (and the world is packed with those), you could find sample bits of code that used it.
  • When you quickly wanted to learn a language, you knew you could find quality code with simple searches.
  • When you wanted to find different solutions to everyday problems dealing with protocols, new specifications, evolving standards and trends. You could turn to CodeSearch.
  • When you were faced with an obscure error message, an obscure token, an obscure return value or other forms of poor coding, you would find sample bits of code that solved this problem.
  • When dealing with proprietary protocols or just poorly documented protocols, you could find how they worked in minutes.
  • When you were trying to debug yet another broken standard or yet another poorly specified standard, you knew you could turn quickly to CodeSearch to find the answers to your problems (memories of OAuth and IMAP flash in my head).
  • When learning a new programming language or trying to improve your skills on a new programming language, you could use CodeSearch to learn the idioms and the best (and worst practices).
  • When building a new version of a library, either in a new language, making a fluent version, making an open source version, building a more complete version you would just go to Codesearch to find answers to how other people did things.

It is a shame that Google is turning their back on their officially stated mission "To organize the world‘s information and make it universally accessible and useful". It is a shame that this noble goal is not as important as competing with Apple, Facebook, Microsoft, Twitter and Yelp.

Comparing Search Engines

While writing this blog entry, I fondly remembered how Codesearch helped me understand the horrible Security framework that ships with iOS. Nobody informed the Apple engineers that "Security through obscurity" was not intended for their developer documentation.

In this particular case, I was trying to understand the semantics of kSecReturnData. How to use this constant and how it interacts with the keyring system is both tricky, and poorly specified in Apple's docs. Sometimes things fail without any indication of what went wrong, other than "error". So I used CodeSearch to figure this out (along with some other 30 constants and APIs in that library that are just as poorly documented).

These are the results of looking for this value in three search engines as of this morning.

First Contender: GrepCode

GrepCode shows absolutely nothing relevant. But shows a bunch of Java packages with no context, no code snippets and if you make the mistake of drilling down, you wont find anything:

Not useful.

Second Contender: Codease

Codase is indexing 250 million lines of code, usually it takes minutes to get this page:

Maybe the server will come back up.

Third Contender: Koders

Koders is part of Black Duck, and searching for the term renders a bunch of matches. Not a single one of the results displayed actually contain a single use of the kSecReturnData constant. And not a single one of the snippets actually show the kSecReturnData constant. It is as useful as configuring your browser to use StumbleUpon as your search engine:

Not useful.

Google's CodeSearch

And this is what Codesearch shows:

The big innovation on Google's search engine is that it actually works and shows real matches for the text being searched, with a relevant snippet of the information you are looking for.

We are going to be entering the dark ages of software research in the next few months.

Is there a hacker White Knight out there?

Running a service like Codesearch is going to take a tremendous amount of resources. There are major engineering challenges involved and hosting a service like this can not be cheap. It is probably not even profitable.

Larry Page's Google has already dropped the project. We can only hope that in a few years Sergey Brin's Google or Eric Schmidt's Google will bring this service back.

Microsoft is too busy catching up to Google and wont have any spare resources to provide a Bing for code search. And if they did, they would limit the search to Win32 APIs.

Thanks!

I should thank Google for funding that project for as long as they did as well as the Google engineers that worked on it as long as they could. Over the years, it helped me fix problems in a fraction of the time and helped me understand complicated problems in minutes.

The Google engineers whose projects just got shutdown for in the name of strategy and focus are probably as sad as all of us are.

On the plus side, I get to share this rant on Google Plus with a dozen of my friends!

Posted on 29 Nov 2011 by Miguel de Icaza

Updated Documentation Site

Jeremie Laval has upgraded our Web-based documentation engine over at docs.go-mono.com. This upgrade brings a few features:

New Look: Base on Jonathan Pobst's redesign, this is what our documentation looks like now:

Better Links: Links to pages on the site will now properly open the left-side tree to the documentation you linked to. This has been an open request for about six years, and it got finally implemented.

Search: the search box on the web site uses Lucene to search the text on the server side, and shows you the matching results as you type:

Easier to Plug: MonoDoc/Web now easily supports loading documentation from alternate directories, it is no longer limited to loading the system-configured documentation.

No more frames: For years we used frames for the documentation pages. They had a poor experience and made the code uglier. They are now gone.

Powered by Mono's SGen: We have reduced the memory consumption of our web documentation by switching to Mono's Generational GC from Boehm's. The load on the server is lower, responses are faster and we scale better.

The source code changes are now on GitHub in the webdoc module.

We have also added Google Analytics support to our web site to help us determine which bits of documentation are more useful to you.

Posted on 22 Nov 2011 by Miguel de Icaza

Hiring Mono Runtime Hackers

As Mono grows on servers, mobile and desktop platforms, we are looking to hire programmers to join our Mono Runtime team.

The Mono Runtime team owns the code generator, the just-in-time and ahead-of-time compilers, the garbage collector, the threadpool and async layers in the runtime and mostly works in the C-side of the house.

If you are a developer with low-level experience with virtual machines, just in time compilers or love garbage collection, real time processing, or you read every new research paper on incremental garbage collection, hardware acceleration, register allocation and you are interested in joining our young, self-funded and profitable startup, we want to hear from you.

Send your resumes to jobs@xamarin.com

Posted on 18 Oct 2011 by Miguel de Icaza

Upcoming Mono Releases: Change in Policies

We have historically made stable releases of Mono that get branched and maintained for long periods of time. During these long periods of time, we evolve our master release for some four to five months while we do major work on the branch.

Historically, we have had done some of these large changes since we have rewritten or re-architected large parts of our JIT, or our garbage collector, or our compilers.

There were points in the project history where it took us some 9 months to release: seven months of new development followed by two months of beta testing and fixing regressions. With Mono 2.6 we tried to change this, we tried to close the release time to at most six months, and we were relatively good at doing this with 2.8 and 2.10.

We were on track to do a quick Mono 2.12 release roughly around May, but with the April bump in the road, this derailed our plans.

Since 2.10.0 was released two things happened:

  • On Master: plenty of feature work and bug fixing.
  • On our 2.10 branch: bug fixes and backporting fixes from master to 2.10

Now that things have settled at Xamarin and that we are getting Mono back into continuous integration builds we are going to release our first public beta of the upcoming Mono, it will be called Mono 2.11.1. We will keep it under QA until we are happy with the results and we will then release Mono 2.12 based on this.

But after Mono 2.12, we want to move to a new development model where we keep our master branch always in a very stable state. This means that new experimental features will be developed in branches and only landed to the master branch once they have been completed.

Our goal is to more quickly bring the features that we are developing to our users instead of having everyone wait for very long periods of time to get their new features.

New Features in Mono 2.11

These are some of the new features availalable in Mono 2.11:

  • We refactored our C# compiler to have two backends one based on Cecil, one based on Reflection.Emit. Fixing some important usability properties of our compiler.
  • Implemented C# 5 Async.
  • Our C# compiler has TypedReference support (__refvalue, __reftype and __makeref).
  • Our compiler as a service can compile classes now and has an instance API (instantiate multiple C# compiler contexts independently).
  • Added the .NET 4.5 API profile and many of the new async APIs to use with C# 5.
  • Improved our new Garbage Collector: it is faster, it is more responsive and it is more stable. It has also gained MacOS/iOS native support.
  • We made System.Json available on every profile.
  • We added Portable Class Library support.
  • We added tooling for Code Contracts
  • We added a TPL Dataflow implementation
  • We added fast ThreadLocal support
  • We brought our ASP.NET implementation to the year 2011 and it now sports a new enormously cute error page as opposed to that error page that we have which transports you mind back to 1999.
  • Mono's debugger now supports attaching to a live process (deferred support)
  • Our socket stack is faster on BSD and OSX, by using kqueue (on Linux it uses epoll already).
Posted on 14 Oct 2011 by Miguel de Icaza

WinRT and Mono

Today Joseph mentioned to me that some of our users got the impression from my previous post on WinRT that we would be implementing WinRT for Linux. We are not working on a WinRT UI stack for Linux, and do not have plans to.

WinRT is a fabulous opportunity for Mono, because Microsoft is sending a strong message: if you want your code to run in multiple scenarios (server, desktops, sandboxed environments), you want to split your UI code from your backend code.

This is great because it encourages developers to think in terms of having multiple facades for the same code base and the direction that we have been taking Mono on in the last few years.

Use the native toolkit on each platform to produce an immersive user experience, and one that leverages the native platform in the best possible way.

These are the APIs that we envision .NET developers using on each platform:

  • Windows: WinRT, Winforms, WPF (fallbacks: Gtk#, Silverlight)
  • MacOS: MonoMac (fallback: Gtk#, Silverlight)
  • Linux: Gtk#
  • Android: MonoDroid APIs
  • iOS: MonoTouch
  • Windows Phone 7: Silverlight
  • XBox360: XNA-based UI

Even if a lot of code could be reused from Moonlight, WinRT is a moving target. It is not clear that the Linux desktop, as we know it today, is keeping up with the growth of other consumer environments. I talked to Tim about this at Build.

Head-less WinRT

There are some GUI-less components of WinRT that *do* make sense to bring to Mono platforms. There is already an implementation of some bits of the headless WinRT components being done by Eric.

The above effort will enable more code sharing to take place between regular .NET 4 apps, WP7 apps, Mono apps and WinRT apps.

Posted on 26 Sep 2011 by Miguel de Icaza

WinRT demystified

Windows 8 as introduced at Build is an exciting release as it has important updates to how Microsoft envisions users will interact with their computers, to a fresh new user interface to a new programming model and a lot more.

If you build software for end-users, you should watch Jensen Harris discuss the Metro principles in Windows 8. I find myself wanting to spend time using Windows 8.

But the purpose of this post is to share what I learned at the conference specifically about WinRT and .NET.

The Basics

Microsoft is using the launch of Windows 8 as an opportunity to fix long-standing problems with Windows, bring a new user interface, and enable a safe AppStore model for Windows.

To do this, they have created a third implementation of the XAML-based UI system. Unlike WPF which was exposed only to the .NET world and Silverlight which was only exposed to the browser, this new implementation is available to C++ developers, HTML/Javascript developers and also .NET developers.

.NET developers are very familiar with P/Invoke and COM Interop. Those are two technologies that allow a .NET developer to consume an external component, for example, this is how you would use the libc "system (const char *)" API from C#:

	[DllImport ("libc")]
	void system (string command);
	[...]

	system ("ls -l /");
	

We have used P/Invoke extensively in the Mono world to create bindings to native libraries. Gtk# binds the Gtk+ API, MonoMac binds the Cocoa API, Qyoto binds the Qt API and hundred other bindings wrap other libraries that are exposed to C# as object-oriented libraries.

COM Interop allows using C or C++ APIs directly from C# by importing the COM type libraries and having the runtime provide the necessary glue. This is how Mono talked with OpenOffice (which is based on COM), or how Mono talks to VirtualBox (which has an XPCOM based API).

There are many ways of creating bindings for a native library, but doing it by hand is bound to be both tedious and error prone. So everyone has adopted some form of "contract" that states what the API is, and the binding author uses this contract to create their language binding.

WinRT

WinRT is a new set of APIs that have the following properties:

  • It implements the new Metro look.
  • Has a simple UI programming model for Windows developers (You do not need to learn Win32, what an HDC, WndProc or LPARAM is).
  • It exposes the WPF/Silverlight XAML UI model to developers.
  • The APIs are all designed to be asynchronous.
  • It is a sandboxed API, designed for creating self-contained, AppStore-ready applications. You wont get everything you want to create for example Backup Software or Hard Disk Partitioning software.
  • The API definitions is exposed in the ECMA 335 metadata format (the same one that .NET uses, you can find those as ".winmd" files).

WinRT wraps both the new UI system as well as old Win32 APIs and it happens that this implementation is based on top of COM.

WinRT Projections

What we call "bindings" Microsoft now calls "projections". Projections are the process of exposing APIs to three environments: Native (C and C++), HTML/Javascript and .NET.

  • If you author a component in C++ or a .NET language, its API will be stored in a WinMD file and you will be able to consume it from all three environments (Native, JavaScript and .NET).

    Even in C++ you are not exposed to COM. The use of COM is hidden behind the C++ projection tools. You use what looks and feels like a C++ object oriented API.

    To support the various constructs of WinRT, the underlying platform defines a basic set of types and their mappings to various environment. In particular, collection objects in WinRT are mapped to constructs that are native to each environment.

    Asynchronous APIs

    Microsoft feels that when a developer is given the choice of a synchronous and an asynchronous API, developers will choose the simplicity of a synchronous API. The result usually works fine on the developer system, but is terrible when used in the wild.

    With WinRT, Microsoft has followed a simple rule: if an API is expected to take more than 50 milliseconds to run, the API is asynchronous.

    The idea of course is to ensure that every Metro application is designed to always respond to user input and to not hang, block or provide a poor user experience.

    Async programming has historically been a cumbersome process as callbacks and state must be cascaded over dozens of places and error handling (usually poor error handling) is sprinkled across multiple layers of code.

    To simplify this process, C# and VB have been extended to support the F#-inspired await/async pattern, turning async programming into a joy. C++ got a setup that is as good as you can get with C++ lambdas and Javascript uses promises and "then ()".

    Is it .NET or Not?

    Some developers are confused as to whether .NET is there or not in the first place, as not all of the .NET APIs are present (File I/O, Sockets), many were moved and others were introduced to integrate with WinRT.

    When you use C# and VB, you are using the full .NET framework. But they have chosen to expose a smaller subset of the API to developers to push the new vision for Windows 8.

    And this new vision includes safety/sandboxed systems and asynchronous programming. This is why you do not get direct file system access or socket access and why synchronous APIs that you were used to consuming are not exposed.

    Now, you notice that I said "exposed" and not "gone".

    What they did was that they only exposed to the compiler a set of APIs when you target the Metro profile. So your application will not accidentally call File.Create for example. At runtime though, the CLR will load the full class library, the very one that contains File.Create, so internally, the CLR could call something like File.Create, it is just you that will have no access to it.

    This split is similar to what has been done in the past with Silverlight, where not every API was exposed, and where mscorlib was given rights that your application did not have to ensure the system safety.

    You might be thinking that you can use some trick (referencing the GAC library instead of the compiler reference or using reflection to get to private APIs, or P/Invoking into Win32). But all of those uses will be caught by AppStore review application and you wont be able to publish your app through Microsoft's store.

    You can still do whatever ugly hack you please on your system. It just wont be possible to publish that through the AppStore.

    Finally, the .NET team has taken this opportunity to do some spring cleaning. mscorlib.dll and System.dll have been split in various libraries and they have moved some types around.

    Creating WinRT Components

    Microsoft demoed creating new WinRT components on both C++ and .NET.

    In the .NET case, creating a WinRT component has been drastically simplified. The following is the full source code for a component that adds 2:

    
    	public sealed class AddTwo {
    		public int Add (int a, int b)
    		{
    			return a + b;
    		}
    
    		public async IAsyncOperation SubAsync (int a, int b)
    		{
    			return a - await (CountEveryBitByHand (b));
    		}
    	}
    	

    You will notice that there are no COM declarations of any kind. The only restriction is that your class must be sealed (unless you are creating a XAML UI component, in that case the restriction is lifted).

    There are also some limitations, you can not have private fields on structures, and there is not Task<T> for asynchronous APIs, instead you use the IAsyncOperation interface. Update to clarify: the no private fields rule is only limited to structs exposed to WinRT, and it does not apply to classes.

    UI Programming

    When it comes to your UI selection, you can either use HTML with CSS to style your app or you can use XAML UI.

    To make it easy for HTML apps to adhere to the Metro UI style and interaction model, Microsoft distributes Javascript and CSS files that you can consume from your project. Notice that this wont work on the public web. As soon as you use any WinRT APIs, your application is a Windows app, and wont run in a standalone web browser.

    .NET and C++ developers get to use XAML instead.

    There is clearly a gap to be filled in the story. It should be possible to use Microsoft's Razor formatting engine to style applications using HTML/CSS while using C#. Specially since they have shown the CLR running on their HTML/JS Metro engine.

    Right now HTML and CSS is limited to the Javascript use.

    In Short

    Microsoft has created a cool new UI library called WinRT and they have made it easy to consume from .NET, Javascript and C++ and if you adhere by their guidelines, they will publish the app on their appstore.

    Xamarin at BUILD

    If you are at build, come join us tonight at 6:30 at the Sheraton Park hotel, just after Meet the Experts. Come talk about Mono, Xamarin, MonoTouch, MonoDroid and MonoMac and discuss the finer points of this blog over an open bar.

    Comments

    There is a long list of comments in the moderation queue that are not directly related to WinRT, or bigger questions that are not directly related to WinRT, .NET and this post's topic, so I wont be approving those comments to keep things on focus. There are better forums to have discussions on Metro.

  • Posted on 15 Sep 2011 by Miguel de Icaza

    Xamarin and Mono at the BUILD Conference

    Continuing our tradition of getting together with Mono users at Microsoft conferences, we are going to be hosting an event at the Sheraton Hotel next to the conference on Thursday at 6:30pm (just after Ask the Experts).

    Come join us with your iOS, Android, Mac and Linux questions.

    Posted on 14 Sep 2011 by Miguel de Icaza

    MonoDevelop 2.6 is out

    Lluis just released the final version of MonoDevelop 2.6.

    This release packs a lot of new features, some of my favorite features in this release are:

    • Git support.
      • It not only provides the regular source code control commands, it adds full support for the various Git idioms not available in our Subversion addin.
      • Based on Java's JGit engine
      • Ported to C# using db4Object's sharpen tool. Which Lluis updated significantly
      • Logging and Blaming are built into the editor.
    • Mac support:
      • Our fancy MonoMac support lets you build native Cocoa applications. If you have not jumped into this Steve Jobs Love Fest, you can get started with our built-in templates and our online API documentation.
      • Native File Dialogs! We now use the operating system file dialogs, and we even used our own MonoMac bindings to get this done.
      • You can also check my Mac/iOS-specific blog for more details.
    • Unified editor for Gtk#, ASP.NET, MonoTouch and MonoDroid: we no longer have to track various forks of MonoDevelop, they have all converged into one tree.

    The above is just a taste of the new features in MonoDevelop 2.6. There are many more nominate your own!

    Congratulations to the MonoDevelop team on the great job they did!

    And I want to thank everyone that contributed code to MonoDevelop, directly or indirectly to make this happen.

    Posted on 07 Sep 2011 by Miguel de Icaza

    Learning Unix

    As I meet new Unix hackers using Linux or Mac, sometimes I am surprised at how few Unix tricks they know. It is sometimes painful to watch developers perform manual tasks on the shell.

    What follows are my recommendations on how to improve your Unix skills, with a little introduction as to why you should get each book. I have linked to each one of those books with my Amazon afiliates link, so feel free to click on those links liberally.

    Here is the list of books that programmers using Unix should read. It will only take you a couple of days to read them, but you will easily increase your productivity by a whole order of magnitude.

    The Basics

    The Unix Programming Environment by Kernighan and Pike is a must-read. Although this is a very old book and it does not cover the fancy new features in modern versions of Unix, no other book covers in such beauty the explanation of the shell quoting rules, expansion rules, shell functions and the redirection rules.

    Every single thing you do in Unix will use the above in some form or shape, and until you commit those to memory you will be a tourist, and not a resident.

    Then you will learn sed and basic awk, both tools that you will use on a daily basis once you become proficient. You do not have to ever be scared of sed or regular expressions anymore.

    Save yourself the embarrassment, and avoid posting on the comments section jwz's quote on regular expressions. You are not jwz.

    It will take you about a week of commuting by bus to read it. You do not have to finish the book, you can skip over the second part.

    Unix Boot Camp

    While Kernighan's book is basic literacy, you need to develop your muscles and you need to do this fast and not buy a book so thick and so packed with ridiculous screenshots that you will never get past page 20.

    Get UNIX for the Impatient. This book is fun, compact and is packed with goodies that will make you enjoy every minute in Unix.

    Learn Emacs

    Emacs has had a strong influence in Unix over the years. If you learn to use Emacs, you will automatically learn the hotkeys and keybindings in hundreds of applications in Unix.

    The best place to learn Emacs is to launch Emacs and then press Control-h and then t. This is the online tutorial and it will take you about two hours to complete.

    The knowledge that you will gain from Emacs will be useful for years to come. You will thank me. And you will offer to buy me a beer, which I will refuse because I rather have you buy me a freshly squeezed orange juice.

    Tooting my own horn

    Learn to use the Midnight Commander.

    The Midnight Commander blends the best of both worlds: GUI-esque file management with full access to the Unix console.

    The Midnight Commander is a console application that shows 2 panels listing two different directories side-by-side and provides a command line that is fed directly to the Unix shell.

    The basics are simple: use the arrow keys to move around, Control-S to do incremental searches over filenames, Control-t to tag or untag files and the F keys to perform copy, move or delete operations. Copy and Move default to copy to the other panel (which you can conveniently switch to by pressing the tab key).

    There is no better way of keeping your file system organized than using my file manager.

    Becoming a Power User

    If you can not quench your thirst for knowledge there is one last book that I will recommend. This is the atomic bomb of Unix knowledge.

    Unix Power Tools is a compilation of tricks by some of the best Unix users that got compiled into a huge volume. This is a book of individual tricks, each about a page long, ideal to keep either on your bedside or in the restoom to pick a new trick every day.

    Mavis Beacon

    At this point you might be thinking "I am awesome", "the world is my oyster" and "Avatar 3D was not such a bad movie".

    But unless you touch-type, you are neither awesome, nor you are in a position to judge the qualities of the world as an oyster or any James Cameron movies.

    You have to face the fact that not only you are a slow typist, you do look a little bit ridiculous. You are typing with two maybe three fingers on each hand and you move your head like a chicken as you alternate looking at your keyboard and looking at your screen.

    Do humanity a favor and learn to touch type.

    You can learn to touch type in about three weeks if you spend some two to three hours per day using Mavis Beacon Teaches Typing.

    Mavis Beacon costs seventeen dollars ($17). Those seventeen dollars and the sixty three hours you will spend using it will do more to advance your carreer than the same sixty three hours spend reading editorials on Hacker News.

    Classics

    All of the books I list here have stood the test of time. They were written at a time when books were designed to last a lifetime.

    Unlike most modern computer books, all of these were a pleasure to read.

    Posted on 06 Sep 2011 by Miguel de Icaza

    And we are back: Mono 2.10.3

    This is Xamarin's first official Mono release.

    This is a major bug fix release that addresses many of the problems that were reported since our last release back on April 25th.

    The detailed release notes have all the details, but the highlights of this release include:

    • MacOS X Lion is supported: both the Mono runtime and Gtk+ as shipped with Mono have been updated to run properly on Lion. This solves the known problems that users had running MonoDevelop on MacOS X.
    • Vastly improved WCF stack
    • Many bug fixes to our precise garbage collector.

    Major features continue to be developed in the main branch. Currently we are just waiting for the C# 5.0 Asynchronous Language support to be completed to release that version.

    Mono 2.10.3 also serves as the foundation for the upcoming Mono for Android 1.0.3 and MonoTouch 4.1.

    You can get it from Mono's Download Site.

    Currently we offer source code, Windows and MacOS packages. We will publish Linux packages as soon as we are done mirroring the contents of the old site that contains the Linux repositories.

    On C# 5.0

    Our new compiler, as you might know, has been rewritten to support two backends: a System.Reflection.Emit backend, and the brilliant IKVM.Reflection backend.

    The C# 5.0 support as found on master contains the C# 5.0 support as shipped by Microsoft on their latest public release.

    To try it out, use -langversion:future when invoking the compiler. You can try some of our samples in mono/mcs/tests/test-async*.cs

    Posted on 04 Aug 2011 by Miguel de Icaza

    MonoDevelop on Lion

    We here at Xamarin are as excited as you are about the release of Lion. But unfortunately we're not quite ready to support you on Lion yet, and MonoDevelop doesn't work quite right. We're working around the clock to make MonoDevelop work perfectly on Lion, and we'll let you know as soon as it's ready.

    Update on July 29th: We have most of the fixes in place for Mono and will issue a build for testing on the Alpha channel soon.

    Posted on 20 Jul 2011 by Miguel de Icaza

    Novell/Xamarin Partnership around Mono

    I have great news to share with the Mono community.

    Today together with SUSE, an Attachmate Business Unit, we announced:

    • Xamarin will be providing the support for all of the existing MonoTouch, Mono for Android and Mono for Visual Studio customers.
    • Existing and future SUSE customers that use the Mono Enterprise products on their SLES and SLED systems will continue to receive great support backed by the engineering team at Xamarin.
    • Xamarin obtained a perpetual license to all the intellectual property of Mono, MonoTouch, Mono for Android, Mono for Visual Studio and will continue updating and selling those products.
    • Starting today, developers will be able to purchase MonoTouch and Mono for Android from the Xamarin store. Existing customers will be able to purchase upgrades.
    • Xamarin will be taking over the stewardship of the Mono open source community project. This includes the larger Mono ecosystem of applications that you are familiar with including MonoDevelop and the other Mono-centric in the Mono Organization at GitHub.

    We are a young company, but we are completely dedicated to these mobile products and we can not wait to bring smiles to every one of our customers.

    Roadmaps

    Our immediate plans for both MonoTouch and Mono for Android is to make sure that your critical and major bugs are fixed. We have been listening to the needs of the community and we are working to improve these products to meet your needs. You can expect updates to the products in the next week.

    In the past couple of months, we have met with some of our users and we have learned a lot about what you wanted. We incorporated your feature requests into our products roadmaps for both the MonoTouch and the Mono for Android products.

    Another thing we learned is that many companies need to have a priority support offering for this class of products, so we have introduced this. It can be either be purchased when you first order MonoTouch or Mono for Android, or you get an upgrade to get the priority support.

    Next Steps

    Our goals are to delight software developers by giving them the most enjoyable environment, languages and tools to build mobile applications.

    We are thankful to everyone that provided feedback to us in our online form that we published a month ago. Please keep your feedback coming, you can reach us at contact@xamarin.com. We are reading every email that you send us and you can use my new miguel at new company dot com email address to reach me.

    We will be at the Monospace conference this weekend at the Microsoft NERD Center, hope to see you there!

    Remember to purchase early and often so we have the resources to bring you the best developer tools on the planet.

    Posted on 18 Jul 2011 by Miguel de Icaza

    Update on Mono

    I have a posted an update on Mono and the upcoming release of Mono 2.12.

    Posted on 06 Jul 2011 by Miguel de Icaza

    Mono Consultants

    We are getting flooded with paid support requests for Mono. Developers looking for us to fix bugs in Mono, to do some custom work, to port applications, libraries and adjust Mono for some specific needs.

    But we are trying to be a product company as opposed to a support company.

    We still want to help the Mono user community, and with all of the Mono talent out there, at least we can use this opportunity to get both groups in touch: the users that want custom engineering done, with the talented list of hackers.

    If you are a consultant available to do custom engineering and support for customers, we would love to put you in touch with people that need the custom engineering done. Email us at contact@xamarin.com, in the subject line, specify that you are available for custom engineering, and in the body of the message list both your Mono skills (C# or C coding) and your availability to engage on those gigs.

    We will then get you in touch with users that needs the work done.

    Posted on 30 Jun 2011 by Miguel de Icaza

    Xamarin Joy Factory

    Setting up a new company consumes a lot of time. Specially as we are developing as fast as we can not one, but two products: .NET for iPhone and .NET for Android.

    Structurally, we are better off than we were the first time that we built these products. We have more developers working on each product than we did the first time around, so progress is faster. But we also had to swap the developers around: those that wrote Foo, can not work on Foo again. This is just one of the things that we have to do to ensure a clean room implementation.

    Our vision is to create happy developers. We did that in the past by bringing the C# language, garbage collection, LINQ, strongly typed APIs, Parallel FX, intellisense and inline documentation to iPhone and Android developers. And by making it possible for the world's 6 million .NET developers to reuse their skills on the most popular mobile platforms.

    This time around, we are doing even more. We are addressing many of the frustrations that developers had with the old products and making sure that those frustrations go away.

    Nat and myself complement each other very well here. This means that there are a lot of new things that will be present in our offering that we never did in the past.

    There is a new level of polish that those familiar with Nat's previous products had (SUSE Studio, NLD/SLED, Ximian Desktop). Everyone at Xamarin can feel that Nat is hard at work when they noticed that one of the first things Nat did was to engage six design firms and an army of technical writers to ensure that our products go from "Nice" to "Amazing". And that was on his second week as CEO, a lot has happened since.

    I do not want to give away everything that we are doing, it would ruin the surprise, but we are here to deliver joy to programmers everywhere.

    If you are interested in working with us, and making mobile development and .NET development a joy that everyone can enjoy, check out our Jobs page

    Where we are now

    It gives me great pleasure to say that we have elevated the discourse on the iPhone simulator and my Chicken-powered TweetStation is up and running with the new iOS product. The picture on the left is TweetStation powered by MonoTouch, the picture on the right is TweetStation powered by Xamarin's iPhone product:


    TweetStation on MonoTouch

    TweetStation on Xamarin iOS

    Update: TweetStation now starts up on Device! We have the static compiler working!

    We also have the delicious iOS5 APIs exposed as strongly-typed and intellisense-friendly C#. We are now updating the APIs from Beta1 to Beta2, which should be completed today or tomorrow.

    Our Android efforts are moving fast. Only this morning we got Layouts to render on the device. This is a lot of work, as it gets Dalvik to start Mono, and initializes our entire bridge and exercises the C# and Java bridge. In addition, we have identified and fixed a serious problem in the distributed garbage collector.

    We also have a number of surprises for everyone in MonoDevelop, we believe that you guys are going to love the new features for iPhone and Android development.

    There is still a lot of polish left to do. We are working as hard as we can to have Preview releases in your hands, but we feel confident that we will have a great product for sale by the end of the summer. We hope you will all max out your credit cards buying it.

    Posted on 28 Jun 2011 by Miguel de Icaza

    Xamarin recruits best CEO in the Industry

    I could not be more excited about this.

    Nat Friedman has joined Xamarin as a company founder and CEO this week.

    Nat and I have known each other and worked together on and off since the early days of Linux. In 1999, we started Ximian to advance the state of Linux, user experience and developer platforms - with many of our efforts brought to fruition after our acquisition by Novell in 2003.

    Anyone that has had the pleasure to work with Nat knows that ideas come in one side, and objects of desire come out on the other end.

    In mobile development, we've discovered a great opportunity: a need for products that developers love. And we are going to fill this need with great products that will make everyone's eyes shine every time they use our software.

    Update: Nat's most recent product was SUSE Studio.

    Posted on 25 May 2011 by Miguel de Icaza

    Announcing Xamarin

    Today we start Xamarin, our new company focused on Mono-based products.

    These are some of the things that we will be doing at Xamarin:

    • Build a new commercial .NET offering for iOS
    • Build a new commercial .NET offering for Android
    • Continue to contribute, maintain and develop the open source Mono and Moonlight components.
    • Explore the Moonlight opportunities in the mobile space and the Mac appstore.

    We believe strongly in splitting the presentation layer from the business logic in your application and supporting both your backend needs with C# on the server, the client or mobile devices and giving you the tools to use .NET languages in every desktop and mobile client.

    Development started early this morning, we will first deliver the iPhone stack, followed by the Android stack, and then the Moonlight ports to both platforms.

    The new versions of .NET for the iPhone and Android will be source compatible with MonoTouch and Mono for Android. Like those versions, they will be commercial products, built on top of the open core Mono.

    In addition, we are going to provide support and custom development of Mono. A company that provides International Mono Support, if you will.

    As usual, your feedback will help us determine which platforms and features are important to you. Help us by filling out our survey. If you give us your email address, we will also add you to our preview/beta list for our upcoming products.

    Fighting for Your Right to Party

    We have been trying to spin Mono off from Novell for more than a year now. Everyone agreed that Mono would have a brighter future as an independent company, so a plan was prepared last year.

    To make a long story short, the plan to spin off was not executed. Instead on Monday May 2nd, the Canadian and American teams were laid off; Europe, Brazil and Japan followed a few days later. These layoffs included all the MonoTouch and MonoDroid engineers and other key Mono developers. Although Attachmate allowed us to go home that day, we opted to provide technical support to our users until our last day at Novell, which was Friday last week.

    We were clearly bummed out by this development, and had no desire to quit, especially with all the great progress in this last year. So, with a heavy dose of motivation from my music teacher, we hatched a plan.

    Now, two weeks later, we have a plan in place, which includes both angel funding for keeping the team together, as well as a couple of engineering contracts that will help us stay together as a team while we ship our revenue generating products.

    Update: although there was a plan to get Angel funding, it turns out that we self-funded the whole thing in the end.

    Next Steps

    Our plan is to maximize the pleasure that developers derive from using Mono and .NET languages on their favorite platforms.

    We do have some funding to get started and ship our initial products. But we are looking to raise more capital to address the shortcomings that we could not afford to do before, these include:

    • Tutorials for our various developer stacks
    • API documentation for the various Mono-specific APIs
    • Dedicated Customer Support Software (assistly or getsatisfaction)
    • Upgrade our Bug system
    • Training
    • Consulting and Support
    • and Marketing: we have a best of breed developer platform, and we need the world to know. Our previous marketing budget is what the ancient Olmec culture referred to as Zero.

    Stay tuned for more, meanwhile, hope to see you in July at the Monospace conference in Boston!

    Posted on 16 May 2011 by Miguel de Icaza

    Dropbox Lack of Security

    I am a fan of Dropbox. It is a great tool, a great product, and clearly they have a passionate team over at Dropbox building the product.

    Dropbox recently announced an update to its security terms of service in which they announced that they would provide the government with your decrypted files if requested to do so.

    This is not my problem with Dropbox.

    My problem is that for as long as I have tried to figure out, Dropbox made some bold claims about how your files were encrypted and how nobody had access to them, with statements like:

    • All transmission of file data occurs over an encrypted channel (SSL).
    • All files stored on Dropbox servers are encrypted (AES-256)
    • Dropbox employees aren't able to access user files, and when troubleshooting an account they only have access to file metadata (filenames, file sizes, etc., not the file contents)

    But anyone that tried to look further came out empty handed. There really are no more details on what procedures Dropbox has in place or how they implement the crypto to prevent unauthorized access to your files. We all had to just take them at their word.

    This wishy-washy statement always made me felt uneasy.

    But this announcement that they are able to decrypt the files on behalf of the government contradicts their prior public statements. They claim that Dropbox employees aren't able to access user files.

    This announcement means that Dropbox never had any mechanism to prevent employees from accessing your files, and it means that Dropbox never had the crypto smarts to ensure the privacy of your files and never had the smarts to only decrypt the files for you. It turns out, they keep their keys on their servers, and anyone with clearance at Dropbox or anyone that manages to hack into their servers would be able to get access to your files.

    If companies with a very strict set of security policies and procedures like Google have had problems with employees that abused their privileges, one has to wonder what can happen at a startup like Dropbox where the security perimeter and the policies are likely going to be orders of magnitude laxer.

    Dropbox needs to come clear about what privacy do they actually offer in their product. Not only from the government, but from their own employees that could be bribed, blackmailed, making some money on the side or are just plain horny.

    Dropbox needs to recruit a neutral third-party to vouch for their security procedures and their security stack that surrounds users' files and privacy. If they are not up to their own marketed statements, they need to clearly specify where their service falls short and what are the potential security breaches that

    Unless Dropbox can prove that algorithmically they can protect your keys and only you can get access to your files, they need to revisit their public statements and explicitly state that Dropbox storage should be considered semi-public and not try to sell us snake oil.

    Posted on 19 Apr 2011 by Miguel de Icaza

    Save the Date: Monospace Conferece in Boston

    The dates for the MonoSpace conference have been announced: July 23rd to 25th, 2011. The event will take place at the Microsoft NERD Center.

    The organizers have just made a call for speakers. If you have an interesting topic to discuss, please submit a talk, we would love to hear from you.

    Posted on 18 Apr 2011 by Miguel de Icaza

    Save the Date: Monospace Conferece in Boston

    The dates for the MonoSpace conference have been announced: July 23rd to 25th, 2011. The event will take place at the Microsoft NERD Center.

    The organizers have just made a call for speakers. If you have an interesting topic to discuss, please submit a talk, we would love to hear from you.

    Posted on 18 Apr 2011 by Miguel de Icaza

    Mono Android and iPhone Updates

    Today we are happy to release Mono for Android 1.0 as well as MonoTouch 4.0.

    Both products allow you to use the C# language to write applications that run on Android and iOS devices.

    Both products are based on the latest Mono 2.10 core. The Parallel Frameworks can be used to write more elegant multi-threaded code across all devices, and automatically takes advantage of multiple cores available on the iPad2 and Xoom devices. The C# 4.0 is now the default as well as the .NET 4.0 APIs.

    Mono for Android

    Our Mono for Android debuts today after almost a year worth of development.

    Perhaps the most important lesson that we got from MonoTouch's success was that we had to provide a completely enabled platform. What we mean by this is that we needed to provide a complete set of tools that would assist developers from creating their first Android application, to distributing the application to the market place, to guides, tutorials, API documentation and samples.

    Mono for Android can be used from either Visual Studio Professional 2010 for Windows users, or using MonoDevelop on the Mac.

    Mono code runs side-by-side the Dalvik virtual machine in the same process:

    This is necessary since code running in Dalvik provides the user interface elements for Android as well as the hosting and activation features for applications on Android.

    APIs

    The Mono for Android API is made up of the following components: Core .NET APIs, Android.* APIs, OpenGL APIs and Java bridge APIs.

    Let us start with the most interesting one: Android.* APIs. These are basically a 1:1 mapping to the native Java Android APIs but they have been C#-ified, for example, you will find C# properties instead of set/get method calls, and you will use C# events with complete lambda support (with variables being automatically captured) instead of Java inner classes. This means that while in Java you would write something like:

    	// Java code
    	button.setOnClickListener (new View.OnClickListener() {
                 public void onClick(View v) {
    		button.setText ("Times clicked: " + Integer.toString(counter));
                 }
             });
    	
    	// C# code
    	button.Click += delegate {
    		button.Text = "Times clicked: " + counter;
    	};
    	

    In addition to the UI APIs, there are some 57 Android.* namespaces bound that provide access to various Android features like telephony, database, device, speech, testing and many other services.

    In what is becoming the standard in the Mono world, OpenGL is exposed through the brilliant OpenTK API. OpenTK is a strongly typed, Framework Design Guidelines-abiding binding of OpenGL. The benefit is that both Visual Studio and MonoDevelop can provide intellisense hints as you develop for the possible parameters, values and their meaning without having to look up the documentation every time.

    Finally, for the sake of interoperability with the native platform, we exposed many types from the Java.* namespaces (31 so far) that you might need if you are interoperating with third party libraries that might require an instance of one of those Java.* types (for example, a crypto stack might want you to provide a Javax.Crypto.Cipher instance. We got you covered.

    Core Differences

    Mono for Android has a few differences from MonoTouch and Windows Phone 7 when it comes to the runtime. Android supports JIT compilation while iOS blocks it at the kernel level and Windows Phone 7 has limitations.

    This means that developers using Mono on Android have complete access to System.Reflection.Emit. This in turn means that generics-heavy code like F# work on Android as do dynamic languages powered by the Dynamic Language Runtime like IronPython, IronRuby and IronJS.

    And of course, you can also use our own C# Compiler as a Service

    Now, although those languages can run on Mono for Android, we do not currently have templates for them. The Ruby and Python support suffer due to Android limitations. The Dalvik virtual needs to know in advance which classes you customize, and since it is not really possible to know this with a dynamic language, the use of Iron* languages is limited in that they cant subclass Android classes. But they can still call into Android APIs and subclass as much .NET class libraries as they want.

    Native User Interfaces

    MonoTouch and MonoDroid share a common runtime, a common set of class libraries, but each provides different user interface and device specific APIs.

    For example, this code takes advantage of iOS's UINavigationController and animates the transition to a new state in response to a user action:

    void OnSettingsTapped ()
    {
    	var settings = new SettingsViewController ();
    	PushViewController (settings, true);
    }
    	

    This is an equivalent version for Mono for Android:

    void OnSettingsTapped ()
    {
    	var intent = new Intent ();
    	intent.SetClass (this, typeof (SettingsActivity));
    	StartActivity (intent);
    }
    	

    We chose to not follow the Java write-once-run-anywhere approach for user interfaces and instead expose every single bit of native functionality to C# developers.

    We felt that this was necessary since the iOS and Android programming models are so different. We also wanted to make sure that everything that is possible to do with the native APIs on each OS continues to be possible while using Mono.

    For instance, if you want to use CoreAnimation to drive your user interactions, you should be able to leverage every single bit of it, without being forced into a common denominator with Android where nothing similar to this is available.

    Craig Dunn, one of the authors of the MonoTouch Programming Book, has written a nice Mosetta Stone document that compares side-by-side some of the key UI differences across platforms.

    He also has written the Restaurant Guide Sample which sports a unique user interface for Android, iOS and Windows Phone 7:

    You can take a look at this cross platform sample from GitHub.

    Split your Presentation from your Engine

    Faced with the diversity of platforms to support, both mobile and desktop, this is a good time to design, refactor and prepare your code for this new era.

    Today developers can use C# to target various UIs:

    To give your code the most broad reach, you should consider splitting your backend code from your presentation code. This can be done by putting reusable code in shared libraries (for example, REST clients) and shared business logic on its own libraries.

    By splitting your presentation code from your business logic code for your application, not only you gain the ability to create native experiences in each platform, you also get a chance to test your business logic/shared libraries more easily.

    Linking

    In Mono for Android when you build an application for distribution, we embed the Mono runtime with your application. This is necessary so your application is entirely self-contained and does not take any external dependencies.

    Mono for Android uses the Mono Linker to ensure that only the bits of Mono that you actually use end up in your package and that you do not pay a high tax for just using a handful of functions.

    For example, if you want to just use a method from XElement, you would only pay the price for using this class and any of its dependencies. But you would not end up bringing the entire System.XML stack: you only pay for what you use.

    During development a different approach is used: the Mono runtime is installed on your emulator or test device as a shared runtime. This minimizes both the build and deploy times.

    Mono for Android References

    Start with our documentation portal, there you will find our Installation Guide, a tutorial for your first C# Android application, our tutorials (many ported from their Java equivalents) and our How-To Guides and a large collection of sample programs.

    You can also explore the documentation for the Mono for Android API in a convenient to remember url: docs.mono-android.net.

    The first book of Mono for Android will be available on July 12th. In the meantime, we have created many tutorials and guides that will help you go

    I also strongly suggest those interested in parallel programming to check out the Patterns for Parallel Programming: Understanding and Applying Parallel Patterns with the .NET Framework 4. This is a free PDF, and is a must-read for anyone building multi-core applications.

    Thank You!

    Mono for Android would not have been possible without the hard work of the MonoDroid team at Novell. The team worked around the clock for almost a year creating this amazing product.

    The team was backed up by the Mono core team that helped us get C# 4.0 out, WCF, the linker, the LLVM support, improve the VM, extend the MonoDevelop IDE, scale Mono, improve our threadpool, support OpenTK, implement the Parallel Frameworks, ship dozens of betas for MonoDevelop, Mono and Mono for Android.

    Posted on 06 Apr 2011 by Miguel de Icaza

    Mono and Google Summer of Code

    We have been lucky enough that Google accepted Mono as a mentoring organization for the Google Summer of Code 2011

    This is a great opportunity for students to get involved with open source, contribute, learn and get paid for their work during the summer.

    We have a lot of ideas to choose from in our student projects page, ranging from virtual machine hacking, MacOS X improvements, MonoDevelop extensions, language bindings and even improving the Manos web application framework.

    Do not let our limited imagination stop you. Although there are plenty of ideas to choose from, students should feel free to come up with their own ideas. In the past years projects based on students' ideas have been very successful and we want to encourage more of those.

    Proposal submission is open until Friday April 8, so now is the time to join our wonderful community, discuss your project ideas and start working on those proposals.

    The Mono Summer of Code IRC channel is #monosoc on irc.gnome.org

    Posted on 30 Mar 2011 by Miguel de Icaza

    Monospace Conference: Boston, July 2011

    The Mono community is organizing the Monospace conference to be held in July in Boston. This event is being organized by Dale Ragan, Louis Salin and Paul Bowden.

    The organizers have just made a call for speakers.

    If you have an interesting technology that you would like to talk about during this 3-day event, you should submit a talk.

    Monospace is on a very aggressive schedule. The good news is that the entire Mono team will be participating in the event.

    Once the dates are set in stone, we will open registration. Currently we are thinking of hosting an event for some 200 attendees.

    Posted on 29 Mar 2011 by Miguel de Icaza

    Save your Cleverness

    Today, while discussing how @hipsterhacker reminds us some of our friends, Nat pointed me to this interview where Maciej has this beautiful nugget of wisdom:

    Q: The Pinboard about page says: "There is absolutely nothing interesting about the Pinboard architecture or implementation; I consider that a feature!"

    Can you explain why you think that's a feature?

    I believe that relying on very basic and well-understood technologies at the architectural level forces you to save all your cleverness and new ideas for the actual app, where it can make a difference to users.

    I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time rigging it together just for the joy of tinkering. So nowadays we see a lot of fairly uninteresting web apps with very technically sweet implementations.

    Too many people over-engineer their software to the point that you can no longer see what the software was supposed to do. Once people find a religion in one of the modern development fads, they tend to jump with both feet, and we end up with uninspiring user-facing software, but internally amazing.

    This disease is widespread. From everyone trying to turn their program into a platform (current fad: dependency injection), to trying to force programming models, to compulsively writing unit tests while ignoring the basic principles that unit tests can not be used to prove the absence of bugs (update: this is my favorite book on the subject; Namedrop alert: Bertrand Meyer introduced me to it).

    There is only one reason to throw away your life writing useless code and that is to train yourself. If you are writing this in a Karate Kid wax-on, wax-off kind of way, go ahead.

    But if you are building a product, you end up spending all of your time designing your architecture, and very little time in delivering a great experience.

    Premature architecture design is like premature optimization: you will be wrong about the things that actually mattered.

    Take the shortcut. Build the product. And if later, it turns out you made a design mistake, refactor the code. But at least you will have a product that your users love.

    Posted on 29 Mar 2011 by Miguel de Icaza

    Hardware Accelerated Video Playback in Moonlight

    David Reveman has just completed a series of optimizations in the Moonlight engine that allows Moonlight to take advantage of your GPU for the data intensive video rendering operations. This is in addition to the standard GPU hardware acceleration that we debuted a few weeks ago.

    This is what the video rendering loop looks like in Moonlight:

    Every one of those steps is an expensive process as it has to crunch to a lot of data. For example, a 720p video which has a frame size of 1280x720, this turns out to be 921,600 pixels. This frame while stored in RGB format at 8 bits per channel takes 2,764,800 bytes of memory. If you are decoding video at 30 frames per second, you need to at least move from the encoded input to the video 82 megabytes per second. Things are worse because the data is transformed on every step in that pipeline. This is what each step does:

    The video decoding is the step that decompresses your video frames. This is done one frame at a time, the input might be small, but the output will be the size of the original video.

    The decoding process generates images in YUV format. This format is used to store images and videos but and with previous versions of Moonlight, we had to convert this YUV data into an in-memory bitmap encoded in RGB format.

    The final step is to transfer this image to the graphics card. This typically involves copying the data from the system memory to the graphics card, and in Unix this goes through the user process to the X server process, which eventually moves the data to the graphics card.

    New Hardware Accelerated Framework

    The new hardware acceleration framework now skips plenty of these steps and lets the GPU on the system take over, this is what the new pipeline looks like:

    The uncompressed image in YUV format is sent directly to the GPU. Since OpenGL does not really know about YUV images, we use a custom pixel shader that runs on the graphics card to do the conversion for us and we also let the GPU take care of scaling the image.

    The resulting buffer is composited with the rest of the scene, using the new rendering framework introduced in Moonlight 4.

    Although native video playback solutions have been doing similar things for a while on Linux, we had to integrate this into the larger retained graphics system that is Moonlight. We might be late to the party, but it is now a hardware accelerated and smooth party.

    And what does this looks like? It looks like heaven.

    We were watching 1080p videos, running at full screen in David's office and it is absolutely perfect.

    Getting the Code

    The code is available now on Github and will be available in a few hours as a pre-packaged binary from our nightly builds.

    Posted on 23 Mar 2011 by Miguel de Icaza

    Kid's Games on the iPad

    My eight month old daugther loves her iPad.

    We have gotten a bunch of baby games, kids games and visualizations for her.

    But many of these apps have one fundamental issue: the author adds one or more buttons with useless stuff like "Provide Feedback", "Info", "Visit Web Site", "Check my Other Apps" and other assorted buttons on the screen:

    Now, perhaps the apps did great when used by a professional QA team in Daytona that reported back "yes, every animal in the app makes the proper sound, and the cows scroll as they are intended to".

    In this case, the "Main" button, will bring up a convenient page with options to send feedback to the author, to visit his web site and check out his other apps.

    This means that my daugther can not really enjoy her games without supervision, since every few seconds, she will end up visiting a web site in Safari.

    Joseph has a similar problem, he has equipped both of his kids with iPads, and they routinely report "the iPad broke", every time one of their games ends up in some lame web site for the developer.

    Developers for kid games should use slider switches if they really want to impose their hooks into their customers.

    Some Games

    On twitter Paul Hudson suggested a couple of games for 1-year olds: Uzu (my daughter also loves this one), BeBot and SoundTouch.

    I have found that she likes GarageBand a lot (we just have to be around to make sure we can reset the screen when she changes instruments).

    Posted on 23 Mar 2011 by Miguel de Icaza

    GDC 2011

    Three years ago, we were almost laughed out of the Game Developer Conference Show floor.

    C# as the heir to C++ back then was mostly an academic discussion. And there were only a few anecdotal examples of developers using C# for fast and safe scripting in games such as Second Life and Unity.

    Three years ago, C# as a scripting language for games had shared the reputation that Javascript had before the Ajax and Web 2.0 revolutions. It was a bad word. Anything short of C++ and assembly language was not up to the taste of most game developers. Ironically, developers were willing to take the hit of an interpreted languages to drive their games.

    It was perhaps Unity Technologies that started to change this when they adopted Mono as their scripting engine, giving their developers a choice of C#, strongly typed Javascript and Boo as programming languages to author their game's logic, effects and behaviors. They got the benefits of high-level languages, with the added performance of being compiled:

    A New Generation of Game Developers

    In the past years, a new generation of game developers have entered the stage. These are developers that have cut their teeth with Unity, XNA and frameworks like PyGame.

    They value malleability, rapid iteration and safe environments without crashing over raw performance. They have grown used to profiling their software and tuning the hot-spots instead of depending on hunches that lead to premature optimizing.

    This year things were very different at our booth. Lots of happy Unity users came by to talk about MonoDevelop, about the new soft debugger, and about the joy of using C# to build applications with Unity. Lots of people are working on big and small game titles using Mono.

    MonoTouch and MonoDroid also helped us gain visibility in this space. Lots of existing users, and users-to-be came to discuss Mono's state.

    But Mono has now spread its wings from being a pure extension system for C++-based systems (like Unity or the Sims3), to be used as the main language for building game engines and game frameworks.

    There is the 2D MonoGame (an open source effort previously known as XNAtouch) which supports iPhone, Android (and they are working on Windows and Mac backends).

    At the show, both DeltaEngine and Silicon Studio were showing pure C#-based 3D game engines powered by Mono. There were as well a number of stealth-mode projects and startups using Mono either as their scripting engine or the main runtime.

    Walking around the GDC show-floor, you could see Mono running in many booths thanks to Unity's overwhelming popularity.

    Perhaps my favorite Unity game at the show was Rochard, an upcoming PS3 game with interesting puzzles and the level of polish that you expect from a game like Ratchet and Clank (videos, screenshots).

    Helping Game Developers

    In the past couple of years we have made some changes to Mono that help developers use Mono as either a scripting system for an existing C or C++ code base, or for those using Mono as their main runtime.

    We still deliver all the bonus features that come from using C# and the CLI, like lambda functions, functional style-programming, garbage collection, type safety, iterators, generics and improve upon the basics to include:

    • Mobile profile: a minimal profile of class libraries that is better suited for mobile, embedded and console uses.
    • LLVM-based code optimizer: in addition to our standard code generator designed for JIT compilation, we now offer developers a choice to use the LLVM optimizing compiler to generate code. Modulo a handful of issues, the code generated is as good as the one you would get by doing low-level programming with C++.
    • SIMD intrinsics: we treat the various Vector data types in the Mono.Simd namespace as first-class types recognized by the JIT and mapped directly to hardware supported SIMD operations:
      		// This code:
      		using Mono.Simd;
      		
      		Vector4f Add (Vector4f one, Vector4f two)
      		{
      			return one + two;
      		}
      
      		// Is inlined by our LLVM code generator when invoked
      		// with the two statics first and second:
      		mov    first,%eax
      		movups (%eax),%xmm0
      		mov    second,%eax
      		movups (%eax),%xmm1
      		addps  %xmm1,%xmm0
      		
    • Unsafe execution: some of our users wanted to continue using Mono and C# for their code for compute intensive operations. We now offer an unsafe option that will remove all arrays bounds check from the code. This, needless to say, is incredibly unsafe as it would open the doors to the sort of bugs that are common in C++. But if you are dying to squeeze the last bit of performance and treat C# as a nicer C++ and are ready to make a commitment to debug memory-corruption bugs, we got you covered.
    • Runtime Continuations: to create lightweight co-routines that are not bound to threads and allow developers to suspend execution at any point without having to change their code, or require new compilers. Silicon Studio's Homei system uses it.

    Additionally, many developers are doing a little bit of embrace-and-extending the Mono runtime in creative ways to extend the CLI in new ways.

    We want for example to introduce both a [ForceInline] and a [UnsafeCode] attributes that can be applied to methods to hint the code generation engine to always inline a method, and to remove arrays-bounds-checking on a per-method basis.

    Hot Topics

    A hot topic at the GDC was when we would bring the new C# 5 "await" feature to Mono.

    C#'s await is a perfect solution to many of the problems that game developers face. Although there are solutions like Unity's co-routines, Mono Continuations/microthreads and Michael Hutchinson's open sourced micro-threading framework these features require a particular set of programming practices and pattern or support in the VM to do this.

    C# Await is beautiful in that it integrates directly into the language and allows developers to focus on the algorithm and not in the administrivia of suspending execution and the boilerplate involved.

    Which leads me to F#. The C# await functionality is based on F#'s Asynchronous Workflows which is available to everyone (thanks to Microsoft open sourcing the F# compiler and runtime).

    What is fascinating is what some people are doing with F# in games: they can use F# to express the game AI in more succinct terms than any other scripting language can do. Not being a game designer, I do not quite understand the domain space, but apparently F# is just what the doctor ordered for complicated AI behaviors.

    This coupled with async execution is a game engine developer's dream. But F# is not for everyone, there is a learning curve for getting to express problems in F# that is not suitable for game developers that have simple needs for their in-game logic.

    WPF: A Recurring Topic

    Many tool vendors (animation, pipeline, version control) have used WPF for their software or are planning on using it for new projects. These vendors have historically only supported Windows and are now looking at adding either Mac or Linux. This became almost a FAQ at the Mono booth: when are you going to ship WPF on Mac/Linux.

    We have no plans on building WPF. We just do not have the man power to build an implementation in any reasonable time-frame.

    Today, we offer a few suggestions to developers. Feel free to pick and choose:

    • Use Gtk# if you want to share the same code across all three platforms.
    • Split your UI code from the non-UI code and build a UI per system. On Windows, use WPF, on Mac use MonoMac, on Linux Gtk#. Or use gtk# on Mac and Linux.
    • For tools that are mostly OpenGL/DirectX based, use Windows.Forms, keeping in mind that some bug fixing or work around on their part might be needed as our Windows.Forms is not actively developed.

    If you can afford building two or three UIs

    Those are the toolkits you can use today to get your .NET-based tools working on multiple platforms. There are a number of longer-term options in the horizon that could be useful, but would require a concerted effort by the community to complete:

      Monomac.Winforms: assist the effort to have a Winforms look-alike API that happens to be based entirely on MonoMac and provides a native experience at the expense of dropping compatibility with some Winforms features.

      Create an SWT-like toolkit, like Eclipse did for Java, but this time for .NET. Mapping UI components to Cocoa, Gtk+ or WPF depending on the platform.

      Use Silverlight on Windows. And then use a modified version of Moonlight on Linux (and assist porting Moonlight to Mac) to get enough support to integrate with the native OS (menus, file dialogs, file system access) and to access and embed OpenGL in their applications.

      WPF implementation: not impossible, but this will require someone to fund some 15-20 developers to implement this enormous stack and some 2-3 years of work.

    Posted on 07 Mar 2011 by Miguel de Icaza

    Saturday Mono Update

    Following a long established tradition of doing a quick Mono update after we do a major release, we released Mono 2.10.1 to the world.

    There are four big features in this release that we backported from our master branch in addition to some 25 fresh bug fixes:

    • Support for running OrchardCMS on Linux. We also wrote a PostgreSQL backend for it. You can find the patches in this discussion.
    • The Parallel Framework's Default task scheduler has been switched to use our new and improved internal threadpool that we introduced with Mono 2.10. Previously it used its own (and amazing) scheduler, but did not share the same properties as .NET as there were by default two active threadpools, now there is only one.
    • Plenty of updates to the WCF stack.
    • OSX is a fast growing OS for Mono, this release brings performance counters for OSX as well as adding debugging symbols to all of our libraries if you install the CSDK package from our download page.

    There were also three important regressions from Mono 2.8 that have been fixed. We encourage everyone to use Mono 2.10.1.

    Posted on 26 Feb 2011 by Miguel de Icaza

    MVP Summit and GDC 2011

    Next week I will be in Bellevue, WA from Sunday to Wednesday to participate in the 2011 Microsoft MVP Summit.

    From Wednesday to Friday I will be San Francisco attending the Game Developer's Conference.

    Ping me if you want to get together.

    Posted on 25 Feb 2011 by Miguel de Icaza

    C# Compiler as a Service Update

    Our C# compiler-as-a-service library can now process any C# construct, it is no longer limited to expressions and statements.

    This means, that you can now enter entire class definitions in the command line:

    csharp> class Demo {
          >     public int Add (int a, int b)
          >     {
          >          return a + b;
          >     }
          > }
    csharp> new Demo ().Add (1, 3);
    4
    csharp>
    

    This work was done by the amazing Marek and is now available on Mono's master branch in github.

    This functionality can also be used for scripts, in particular in Unix, you can now create C# "source executable" files, like this:

    bash$ cat demo.cs
    #!/usr/bin/csharp
    class Demo {
    	public dynamic Add (dynamic a, dynamic b)
    	{
    		return a + b;
    	}
    }
    Console.WriteLine (new Demo ().Add ("this is", " cute"));
    bash$ chmod +x demo.cs
    bash$ ./demo.cs
    this is cute
    bash$
    

    Multiple Compiler Instances

    In addition, we turned the static API Evalutor.Eval (string expression), into an instance API. The instance API allows developers that are embedding the C# compiler-as-a-service in their application to have different contexts.

    This required the entire compiler to be updated from being a giant set of static classes that could safely use global variables and state into a state that was properly encapsulated.

    The API is now richer, we provide a way to configure the compiler settings using a settings class. This can be populated either manually, or by using the build-in command-line parser for compiler options. The following sample shows how this could be used:

    using Mono.CSharp;
    using System;
    
    class Runner {
    	static int Main (string [] args)
    	{
    		var r = new Report (new ConsoleReportPrinter ());
    		var cmd = new CommandLineParser (r);
    		
    		var settings = cmd.ParseArguments (args);
    		if (settings == null || r.Errors > 0)
    			Environment.Exit (1);
    
    		var evaluator = new Evaluator (settings, r);
    
    		evaluator.Run ("class Demo { public static int Add (int a, int b) { return a+b; }}");
    		evaluator.Run ("print (Demo.Add (1,2));");
    		return 0;
    	}
    }

    Testers Wanted

    This revamped compiler will be part of Mono 2.12, but we would love to get users to test the new functionality and to help us identify any problems early on, before we even release this code.

    We do provide a convenient sln file that you can use the compiler as a service, and it works both in Visual Studio/.NET and Mono.

    Silverlight

    We have not tested this with Silverlight, but in theory, it should now work fine with it. We would love to see someone build an interactive shell like the one we did with Gtk# but hosted on the browser:

    Posted on 24 Feb 2011 by Miguel de Icaza

    Well, Actually

    Why you are not getting laid

    As software developers, we develop habits that allow us to build products that work and do not fail under stress. Every software developer knows what an "off-by-one" error is, and like the Karate Kid, we train extensively so we can avoid those traps. We learn how to avoid these and other similar software problems and we sharpen our skills to find logic errors.

    As we mature as developers, finding logic errors and incomplete solutions becomes our way of life. It defines us.

    But our engineering strength is also our social weakness. Countless times as engineers you will find yourself interrupting someone telling a story, an anecdote or a joke to correct a false assumption, provide an extra fact that the narrator overlooked, give a bigger perspective on the problem or point out that the joke premise is actually flawed.

    You can identify this behavior because the person interrupting usually starts with the phrase "Well, actually...".

    As a kid, I thought this was my strength. I knew a little bit more than my sister. So whenever she would say something, I would quickly interject something like "Well, actually, the origin of the word Shih Tzu means Lion Dog and has nothing to do with the dog's digestive patterns".

    Yes, I was really fun to hang out with.

    As a child, I wondered why my sister could make friends and keep them so easily, while I could not. It would take me years to discover this. And now, as a public service I am sharing with you, my fellow geek friends, what I learned.

    Whoever pulls a "well, actually" almost always shifts the conversation to himself. And now we are no longer following along with your friend's joke, we get to learn how much more you know about the limitations of the Sun Protection Factor scale in sunblock products.

    You are doing it wrong

    As a seasoned engineer, you need to learn control your impulses. Having dealt with my own well, actually problem, I can attest that adjusting this social behavior might even get you laid.

    Jokes are funny because they surprise us. But a joke is not funny if you have to present a 30-page document setting up every little detail. An ill-placed "Well, actually" will get your colleagues to abandon in an instant the water cooler conversation and escape to the peaceful solitude of their workstations.

    Range of Action

    You can find full-time well-actually folks both in person or monitoring your every quip on twitter.

    Even the most rudimentary of the well-actuallistas is able to spoil even the best Ricky Gervais material.

    Twitter being a medium limited to 140 character is like catnip for patronizing douchebags. They can not resist the urge to point out logic flaws in your minimalist observation.

    This is particularly a problem for those of us that love to tweet things that amuse us or that we find amusing. Fear of a barrage of factoids from an omitted detail can be paralyzing.

    Dealing with the Well Actually crowd

    The well-actually crowd wants as much as everyone else to participate in the conversation. They want to be loved.

    But instead of rolling with the punches and participating in a brainstorm of ideas and exploding humor, they contribute interruptions, facts and details that merely produce stop energy on an ongoing discussion. They turn the center of attention towards them.

    The well-actually crowd means well. They want to be loved, they just have not realized that they are undermining their own quest for friends.

    If you are a sagacious well-actuallista you need to understand that you are not outwitting anyone. It takes more intelligence to build a joke, tell a funny anecdote or narrate a gripping story than it takes to nitpick.

    You are not impressing anyone with your hard earned encyclopedic knowledge that you obtained by spending hours on the Internet. You are just making everyone around you realize that you are as much fun to have lunch with as a flaming turd in a bag.

    Those of us in the receiving end of a well-actually, need to start an awareness campaign. Perhaps using Twibbons to cure this disease. Unlike many diseases, this awareness program will lead to a cure.

    While being technically correct is the best kind of correct, what you don't realize is that while you enjoy the triumph of your well-actually, everyone around you is secretly hoping that you choke on a bucket of cocks.

    Practical Solutions

    In the office, we have lots of talented engineers and at one point or another one of us will interject a well placed "well, actually" at an innapropriate moment.

    These days we are fully aware of this social disease and we strive to avoid it. When someone interrupts a discussion with a well-actually you can hear someone say:

    "Did you just well-actually me?"

    Which is basically a way of saying "That has nothing to do with the topic, but thanks for derailing us" without having to go into the explanation and getting lost on the tangent.

    This is a good first step. In our case, we have printed copies of the Ok, It's Time To Explain Some Stuff Patronizing Douchebag Trollcat in two sizes: a full-size well-actually cat, and a small one that is given as an award to the douchiest interruption:

    Okay it’s time to explain some stuff patronizing douchebag trollcat

    On the Internet, you can try to point the patronizing douchebag to this blog post. Or if you have no patience, just click "block" on twitter.

    Posted on 17 Feb 2011 by Miguel de Icaza

    Moonlight 4 Preview 1 is out

    Yesterday we released Moonlight 4, Preview 1.

    This release of Moonlight completes the Moonlight 3 feature set and includes many features from Silverlight 4. Check out our release notes for the list of things that are currently missing from our Silverlight 4 support.

    Rendering

    Moonlight rendering system uses a painter's algorithm coupled with culling to reduce the amount of rasterization that needs to take place.

    For example, if we had these objects all rendered at the same location, on top of each other:

    A simple implementation would render the triangle, then the rectangle and then the circle, and we would get this result:

    Moonlight optimizes this rendering by computing the bounding boxes of each element and determining which objects are completely obscured. In this case, the triangle never needs to be rendered as it is fully covered.

    Since we have the entire graph scene in memory, we can push all the rendering to the X server without ever having to pull data back from it.

    Each visible element on Silverlight derives from the class UIElement and Moonlight tracks the bounding box for all of each individual element. As you compose elements, the aggregate bounding box is computed. For example, a canvas that hosts these three UIElements would have a bounding box that contains all three of them:

    New Rendering Features

    With Silverlight 3, Microsoft introduced two large important changes to the framework: 3D transformations on objects and support for pixel shaders. Both of these are applied to every visual element in Silverlight (this is implemented in the class UIElement).

    In addition to the properties inherited from Silverlight 2, UIElements now have two new properties: Projection and Effect.

    The Projection property is a 3D matrix transformation (the 3D variation of the 2D affine transform that is available in most 2D graphics APIs). Silverlight exposes both the raw 3D matrix or a set of convenient properties that are easier to use and require no understanding of the interactions of the twelve elements of the 3D matrix (see this page for an explanation).

    Just like 2D affine APIs typically expose convenience methods to scale, rotate, skew and translate, the PlaneProjection properties allow developers to focus on those components.

    You can see a sample here.

    Effects follow a similar pattern. The blur and drop-shadow effects are given convenient names and accessors (BlurEffect and DropShadowEffect but Silverlight exposes an API to create programmable pixel shaders that go beyond these two simple cases.

    The ShaderEffect allows users to load pixel shaders written using the High Level Shader Language (HLSL). Here is a sample app showing pixel shaders in action.

    3D transformations and pixel shaders require that the contents of a UIElement are rendered to an intermediate output surface. The 3D transformation and shader effect is applied when this surface is composited onto the parent output surface. This compositing operation can be accelerated using graphics hardware.

    From our previous example, the three elements would be rendered into a 2D surface, and the actual transformation can be done in the hardware:

    Finally, the third new rendering upgrade was the introduction of a bitmap cache that can be applied to a UIElement. When a UIElement is flagged for being bitmap cached, the same kind of intermediate surface rendering and hardware accelerated compositing is performed as for elements with 3D transformations or pixel shaders. The contents of bitmap cache elements are also rendered once and kept on a bitmap that is later composited. This can improve performance vastly for complex controls with many interlocking pieces: instead of computing and re-rendering the entire contents every time, the bitmap cache is used.

    This of course has some visible effect. If you instruct Silverlight to use a bitmap cache, and then you zoom-in the contents, you will see the result get pixelated. You can learn more about this on the BitmapCache documentation.

    Moonlight's New Rendering Pipeline and GPU Acceleration

    Both effects and projections can be implemented purely in software. Effects can be implemented by providing a small interpreter for HLSL code and projections by performing the rendering in software and compositing the results.

    David Reveman, the hacker behind Compiz joined the Moonlight team last year to implement the new rendering primitives, but also to figure out how we could hardware accelerate Moonlight. The results of his work are available on yesterday's release of Moonlight 4.

    The rendering pipeline was modified. Now, whenever a UIElement has either a Projection, an Effect or has the the flag BitmapCache set the entire UIElement and its children are rendered into a surface that is then off-loaded for the GPU to render.

    When OpenGL is available on the system, the composition of UIElements is entirely done by the GPU.

    Moonlight will use the GPU to accelerate for compositing, perspective transformations and pixel shaders if the hardware is present without having to turn this on. Silverlight by default requires developers to opt into hardware acceleration and has its own set of features that it will hardware accelerate.

    In general, Moonlight uses the GPU more than Silverlight does, except in the case of DeepZoom, where we still do not accelerate this code path.

    Gallium3D

    Our new rendering pipeline is built using OpenGL and Gallium3D.

    Gallium is an engine that is typically used to implement OpenGL. In our case, we use the Gallium3D API when we need to fallback to software rendering 3D transforms on Linux. Otherwise we go through the OpenGL pipeline:

    If we were to only support Linux/X11, Gallium3D would have been a better choice for us. But we want to allow the Moonlight runtime to be ported to other windowing systems (Like Wayland on Linux) and other operating systems.

    Room for Growth

    Now that we have this 3D accelerated platform in place, it is easy to fine-tune specific UIElements to be hardware accelerated.

    This first release did only the basics, but we can now trivially use hardware decoders for video and have that directly composited in hardware with the rest of a scene, or we can offload image transformations entirely to the hardware on a type-by-type basis and of course, DeepZoom.

    Object Lifecycle

    Objects in moonlight live in two spaces, low-level components live in C++ and are surfaced to C#. Typically this means that we have code that looks like this in C++:

    	//
    	class MyElement : public UIElement {
    	  protected:
    		MyElement ();
    	  private:
    	        // fields and methods for MyElement go here
    	}
    	

    In C# we create a mirror, like this:

    
    	public class DependencyObject {
    		// Points to the C++ instance.
    		IntPtr _native;
    	}
    	

    When a user wrote in C# "new MyElement", we would P/Invoke into C++ code that does "new MyElement", get a pointer back to this instance and store it in the "_native" field.

    In the other direction, if we created a C++ object and then we had to "surface" it to the managed world, we would initialize the object based on our C++ "this" pointer.

    We could create instances of MyElement in C++, and when this instance needs to be surfaces to the managed world, we would create an instance of the managed object, and store the pointer to the underlying C++ object in the _native pointer.

    In the Moonlight 2.0 days we used to have C++ objects that would only create managed objects on demand. At the time, we did this to avoid creating thousands of managed objects when loading a XAML file when only a handful of those would be controlled by user code.

    The Moonlight runtime, running in pure C++ code, surfaced objects to the C# world and we tracked the object life cycle with good old reference counts. But with Silverlight 2, we started to see problems with the design as it was possible to end up with cycles. These cycles did not happen only in the C++ side or the C# side, but they spanned the boundaries. This made it very hard to debug and it made it hard to keep Moonlight from not leaking memory.

    Templates for example could create these cycles.

    With Moonlight 4, we have landed a new life cycle management system that works like this:

    • Every C++ object that we create always points to a managed counterpart. Gone are the days where the managed peer was created only when needed.
    • Every C++ instance field that points to a DependencyObject subclass goes through this cool C++ templated class that notifies managed when the reference changes.
    • There are no ref/unref pairs surrounding stores to instance fields in c++ anymore.

    Now our base class in C++ has this:

    	// Our entire hierarchy exposed to managed code
    	// derives from EventObject
    	class EventObject {
            	GCHandle managed_handle;
    	}
    	

    Now all the c++ objects exist and are kept alive solely by their managed peers (there are some rare exceptions for things like async calls) and the whole graph is traversable by Mono's GC because all stores to c++ instance fields result in a managed ref between the respective peers.

    With the new code, we no longer live in a world of refs/unrefs (again, except for some rare cases) and whenever we assign to a C++ field that points to a managed object we notify the managed peer of the change.

    We were not able to ship Moonlight 4 with our new garbage collection system (Sgen) as we ran into a couple of hard to track down bugs at the last minute, but we are going to switch it on again soon.

    Future Work

    There is still room for improvement, and now that we know how to cook this kind of code, the goal is to use Mono's new GC in Moonlight more extensively.

    We want to teach SGen to scan the C++ heap and track references to managed objects, dropping another potential source of problems and reducing the code needed. We would also love to go back to only creating managed objects on demand.

    Platform Abstraction Layer

    Moonlight was originally designed as a Linux-only, X11-only plugin for rendering Silverlight content. Developers constantly ask us whether they could run Moonlight on platform XX that is either not Linux or does not use X11.

    The amount of work to port Moonlight 2 to those kinds of scenarios was so overwhelming that most people abandoned the efforts relatively quickly.

    With Moonlight 4, we have introduced a new platform abstraction layer that will make it simpler for developers to port the Moonlight engine to other platforms.

    Whether you want hardware accelerated user experiences in your video game or you want to put Moonlight on a the FreezeMaster 10000 Domestic Fridge with an Internet Connection and SmoothStreaming running on a barebones ARM CPU, you can now enjoy this in the comfort of your home.

    We have done some minimal tests to exercise the API and can run the Moonlight engine on both MacOS and Android. You can look at exclusive footage of the animation test suite running on OSX and on Android.

    If you are like me, not much of a click-on-the-video kind of person, and would rather get a screenshot, you can bask on the smooth colors of this screenshot on Android or in this delightful test on MacOS.

    We are currently not planning on completing that work ourselves, so this is a fabulous opportunity for a caffeine-driven hacker to complete these ports.

    Some possibilities, from the top of my head include being able to use Silverlight to design parts of your user experience for apps on the Mac AppStore (think MoonlightView in your MonoMac apps), or for your Android app.

    Using Expression beats coding cute animations and futuristic UIs by hand. That is why every major video game embeds ScaleForm, the embeddable Flash runtime for handling the UI.

    New XAML Parser

    Our original XAML parser was written in C++, this worked fine for Moonlight 1, but with Moonlight 2 it started to become obvious that we were spending too much time calling back from C++ to C# to create managed objects.

    This was acceptable up to version 2, but it no longer scaled with Moonlight 3. Too much time was spent going back and forth between the C++ world and the C# world. Those following the development of Moonlight would have noticed that every couple of weeks a new extra parameter to the xaml_load function was added to deal with yet another callback.

    The new XAML parser is entirely written in C#, is faster and more reliable.

    And lots more

    Check out our release notes for Moonlight 4 Preview 1.

    Posted on 16 Feb 2011 by Miguel de Icaza

    Three Months and Ten Days

    That is the time between our last major Mono release and the new hotness: Mono 2.10.

    New in this release:

    Check out our Mono 2.10 release notes for all the details.

    Posted on 16 Feb 2011 by Miguel de Icaza

    Nokia Simplifies the Mobile Landscape

    On Friday, Nokia announced that they were adopting WP7 as their operating system. Although some open source advocates might see this as a set-back for Linux, Android is already the best-selling Linux OS of all times. Meanwhile, as a Ben Zander student, all I see is possibility and the the world of opportunities that this opens to developers.

    Although they will continue shipping Symbian for a while, they are effectively sun-setting it. Just like you can still purchase Itanium systems from HP, nobody really develops for those anymore.

    Nokia had this chart to offer on Friday:

    This is fascinating turn of events for C# developers as Nokia will make WP7 more relevant in the marketplace, making C# the lingua-franca of all major mobile operating systems. This astute chart explains why I am basking in joy:

    C# and the ECMA CLI everywhere!

    Now, certainly lots of developer houses can afford to build their software once for each platform. This is fine if your VC has a mandate to "spend that cash quickly" or if you have a surplus of interns at your disposal.

    Now, if trollcats have taught us one thing is that users like the UI of their apps to be as native as possible. That is, mind-blowingly beautiful on iOS and try to match the carpet on the others.

    Other snake oil vendors will tell you that you can use the same code across all platforms and still deliver an emotional experience to your users. I agree, you can deliver the same emotion of disgust when using a cross platform toolkit.

    With Mono we have taken a different approach, based on our own failures from the past. We give developers access to all of the native APIs in the platform to create the best possible user experience, and exploit every single last bit of functionality available on the platform.

    We advise our users to split their user interface code from the engine, or their business logic. Developers should create a native experience for their mobile apps: one per platform. For example, consider Angry Birds on iOS and Angry Birds on Blackberry. Each version adapts to provide the best user experience available on the platform.

    This is a grand time to be a mobile developer. This chart illustrates the elegant balance of native experience and code sharing available to C# developers:

    Update: As much as I have enjoyed responding to the comments on this blog post, the comments are now closed. I will make an exception with anyone that wants to follow up on an existing discussion. For everyone else, if you have something to share, write it on your blog.

    Posted on 14 Feb 2011 by Miguel de Icaza

    On Reflector

    Red Gate announced that their Reflector tool would soon become a paid-for app. A few years ago they bought the rights to Reflector from Lutz Roeder and started maintaining two editions of the product: a free version and a commercial version with extra features. Many people in the .NET community feel unhappy about that decision.

    Whether Red Gate's decision is good or not for them is up to other blogs to discuss. I am grateful that over the years Reflector ran with Mono's Windows.Forms implementation and that the maintainers were careful to keep the code running with Mono.

    Of course, I would always like more an open source equivalent to a proprietary tool, and while Reflector was a free download, it was never open source.

    Some believe that in response to the announcement we created a competitor to Reflector. We did not.

    We have had a decompiler in Mono for a few years now. First, we had a decompiler contributed to MonoDevelop by Andrea and we later replace it with the one that was developed by JB Evain:

    The current decompiler in MonoDevelop actually originated not as a decompiler, but as a flow-analysis tool in 2005. It was part of db4Object's Native Queries. Native Queries were a way of getting some of the benefits of LINQ without any compiler support. It worked by reassembling the AST at runtime from a stream of IL instructions. For example, you could use the following C# code to query a database:

    IList  pilots = db.Query  (delegate(Pilot pilot) {
    	return pilot.Points == 100;
    });
    	

    The Query method would decompile the code in the delegate and reconstruct the abstract syntax tree and determine that the expression to query was pilot.Points == 100.

    JB Eventually expanded hi IL Manipulation library Cecil to contain a decompiler built based on the ideas of flow analysis. JB described this back in December of 2008 as part of a Hack Week followed by a hack-a-thon:

    During the last Hack-Week, I started refactoring Cecil.FlowAnalysis, and since then, I’ve been working pretty seldom on it. It was last month that I decided to give it a kick, and even took a week of vacations to organize a CodeCamp with friends to give it a boost and have fun altogether

    The decompiler is just one of the various tools built with Cecil and has been a standard component of MonoDevelop for a long time (it is part of MonoDevelop 2.4).

    Although yesterday in response to the announcement, a WPF UI was created for the Cecil.Decompiler.dll, this is not the only effort. There is also an older Cecil Studio that uses Windows.Forms that was created a few years ago and of course, our own MonoDevelop assembly browser.

    We welcome contributions to the decompiler for people interested in improving the core, regardless of their preference for a UI built on top of it:

    That being said, JB has been working on a new system that goes beyond decompilation and will be demoed at QCon next month. Stay tuned for his demo.

    Posted on 04 Feb 2011 by Miguel de Icaza

    Adult Principles, from JPBarlow

    A few days ago, John Perry Barlow twetted a series of Adult Principles, and I enjoyed reading them. When he was asked where they came from, he said:

    They're from a list I assembled for myself on the eve of my 30th birthday. Many years ago.

    This is the collected set from his twitter feed:

    Adult Principle #1: Be patient. No matter what.

    Adult Principle #2: Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn't say to him.

    Adult Principle #3: Never assume the motives of others are, to them, less noble than yours are to you.

    Adult Principle #4 Expand your sense of the possible.

    Adult Principle #5 Don’t trouble yourself with matters you truly cannot change.

    Adult Principle #6 Don't ask more of others than you can deliver yourself.

    Adult Principle #7 Tolerate ambiguity.

    Adult Principle #8 Laugh at yourself frequently.

    Adult Principle #9 Concern yourself with what is right rather than who is right.

    Adult Principle #10 Try not to forget that, no matter how certain, you might be wrong.

    Adult Principle #11 Give up blood sports.

    Adult Principle #12 Remember that your life belongs to others as well. Don't risk it frivolously.

    Adult Principles #13 Never lie to anyone for any reason. (Lies of omission are sometimes exempt.)

    Adult Principle #14 Learn the needs of those around you and respect them.

    Adult Principle #15 Avoid the pursuit of happiness. Seek to define your mission and pursue that.

    Adult Principle #16 Reduce your use of the first personal pronoun.

    Adult Principle #17 Praise at least as often as you disparage.

    Adult Principle #18 Admit your errors freely and quickly.

    Adult Principle #19 Become less suspicious of joy.

    Adult Principle #20 Understand humility.

    Adult Principle #21 Remember that love forgives everything.

    Adult Principle #22. Foster dignity.

    Adult Principle #23. Live memorably.

    Adult Principle #24. Love yourself.

    Adult Principle #25. Endure.

    A small detour, he also tweeted

    If you want a new, improved mate, try treating the one you have better.
    Posted on 21 Jan 2011 by Miguel de Icaza

    Help us test Mono 2.10

    Andrew has just released the packages for our first preview of Mono 2.10, we published sources and packages for SLES, OpenSUSE, RHEL, Windows and MacOS X here:

    http://mono.ximian.com/monobuild/preview/download-preview

    From our draft release notes, here are some of the highlights in this release:

    As well as containing a pile of bug fixes.

    As I mentioned last year, we are moving to a faster release schedule to get important features out for our users faster. For instance, our SGen garbage collector has been vastly improved and should perform better under load, and our ParallelFX got some real-life testing which helped us improve it significantly.

    SGen Technical Discussion

    Mark has been blogging the technical details about the architecture of the SGen garbage collector, you can read the documents here:

    Posted on 19 Jan 2011 by Miguel de Icaza

    Your Own Sandbox

    Since the beginning of time, men have sought to find a way of creating a sandbox for untrusted code running on their Mono virtual machine.

    Those of you familiar with Silverlight's security system, commonly referred as CoreCLR Security, have wondered "how can I get me some of dat". Today Sebastien wrote a How-to guide for those of you interested in creating your own secure sandboxes like Moonlight or Unity3D have done.

    From his blog:

    So what was missing was not facts but orientation. It kind of make sense, most people are not doing an open source implementation of Silverlight, we are. However we're providing a lot of cool (yes it is ;-) stuff within - stuff, like coreclr, xaml, the cecil-based linker... that can be reused in other projects. So the missing piece is an how to for people wishing to enable CoreCLR when embeding mono in their own application. It does not bring a lot of new facts but, hopefully, it will order them in a more useful way.
    Posted on 13 Jan 2011 by Miguel de Icaza

    Mono at CES: More Games

    During today's Nvidia press conference at CES, a the Monodroid-powered DeltaEngine was shown running the SoulCraft Tech Demo:
    CES Video.

    Although today's demo was powered by MonoDroid the engine is a cross-platform .NET game engine, it runs on on Mono-powered systems like Linux, MacOS X, MonoTouch and MonoDroid as well as Microsoft .NET powered systems like the XBox360, Windows Phone 7 and Windows:


    If you have an iPad, you can try the Zombie Party game on the AppStore, it is the first game powered by DeltaEngine. ExDream is the group behind DeltaEngine.

    For information on how the demo was built check out this blog post. The engine will be open sourced this year.

    Posted on 06 Jan 2011 by Miguel de Icaza

    Mono for Android

    Now that we feel that we have fixed all the embarrassing bugs in Mono for Android, so we have opened up our Mono for Android preview program to anyone that wants to take it out for a spin.

    Mono for Android brings the full Mono VM to Android. We use a library profile that is better suited for mobile devices, so we removed features that are not necessary (like the entire System.Configuration stack, just like Silverlight does).

    In addition to bringing the core ECMA VM to Android, we bound the entire set of Android Dalvik APIs to C# and in the process C#-ified them. This includes using C# properties for metadata (less XML config file messing around), exposing C# events, C# properties, strongly typed generic types where necessary, implicit conversions where needed, using the C# API style, IEnumerable where appropriate (to let you LINQ over your Dalvik, and we turn IIterable into IEnumerables for you).

    On the OpenGL front, we brought the same OpenTK library that is popular among .NET developers on both Windows, Linux and iPhone, so you can share the same OpenGL logic across all platforms.

    Unlike iOS where the JIT is not supported, Mono on Android supports the full JIT, so you can use Reflection.Emit and dynamic code compilation as much as you want.

    This initial release only comes with templates for C#, but other .NET compilers should work, as long as they reference Mono for Android's libraries (as we removed a few methods that make no sense on mobile devices).

    Support for OSX

    Through the lifetime of our preview program, Mono for Android only supported Windows development using Visual Studio. Today we are also releasing support for developing Android applications on MacOS X using MonoDevelop.

    Getting Started

    Please check our Welcome page, it contains installation instructions, links to tutorials, mailing lists, chat rooms and more.

    I strongly advise our users to join our mailing list and to check the previous discussions on the mailing list for some tasty insights.

    You can also browse the API that we expose to C# developers.

    Upcoming Features

    We are working as fast and as hard as we can to complete Mono for Android. This includes Linux support and bringing MonoDevelop to Windows, for users that can not run Visual Studio 2010 Professional.

    Giving us Feedback

    Please provide your feedback on the product directly on our mailing list, as this is what the MonoDroid developers monitor. Bug reports should be filed on Novell's Bugzilla.

    Posted on 04 Jan 2011 by Miguel de Icaza

    Open Source Contribution Etiquette

    Some developers, when faced with fixing, or adding a feature to an open source project are under the mistaken impression that the first step before any fixing takes place, or before adding a new feature takes place is to make the code "easier for them" to work on.

    "Easier for them" usually is a combination of renaming methods, fields, properties, locals; Refactoring of methods, classes; Gratuitous split of code in different files, or merging of code into a single file; Reorganization by alphabetical order, or functional order, or grouping functions closer to each other, or having helper methods first, or helper methods last. Changing indentation, aligning variables, or parameters or dozen other smaller changes.

    This is not how you contribute to an open source project.

    When you contribute fixes or new features to an open source project you should use the existing coding style, the existing coding patterns and stick by the active maintainer's choice for his code organization.

    The maintainer is in for the long-haul, and has been working on this code for longer than you have. Chances are, he will keep doing this even after you have long moved into your next project.

    Sending a maintainer a patch, or a pull request that consists of your "fix" mixed with a dozen renames, refactoring changes, variable renames, method renames, file splitting, layout changing code is not really a contribution, it is home work.

    The maintainer now has to look at your mess of a patch and extract the actual improvement, wasting precious time that could have gone to something else. This sometimes negates the effort of your "contribution".

    If you really have an urge to refactor the code, first of all, discuss the changes with the maintainer with the rationale for the changes. If the maintainer agrees with the changes, make sure that you keep your refactoring and changes independent from code fixes, it makes reviewing the code a lot simpler.

    The alternative, to keep your fork, is usually a guarantee that your effort will be wasted, and wont help other users. People have tried to do this. It is attempted every year, by hunders of developers who in tbe back of their minds are thinking "I can do better" and "I wont make the same mistakes". After 18 years doing open source I can probably think of a handful of project forks that have survived and flourished. Out of hundreds of such failures. So the odds are not good.

    So respect the original coding style, and if you want to make refactoring changes, discuss this with the maintainer.

    Posted on 31 Dec 2010 by Miguel de Icaza

    For your OOXML Conspiracy Theories

    The staff at Groklaw has never really tolerated any dissent when it came to OOXML. They spent years advocating against OOXML only to have OOXML emerge not only stronger, but also with an ISO stamp of approval.

    Today they tried to insinuate that my involvement and opinion on OOXML was somehow the result of the 2006 Microsoft/Novell agreement.

    Their conspiracy theory falls apart as our active involvement on OOXML goes back to the year 2005, 11 months before there is any agreement between Microsoft and Novell.

    My interest in the file format interop problem goes back to 1998-1999 when I wrote the Gnumeric spreadsheet and both Michael and his brother started contributing a plugin for reading and writing Excel files.

    My involvement with OOXML started in 2005, when Jack Messman was still Novell's CEO and the company was in the middle of various legal disputes with Microsoft. Not the best environment for collaboration between companies.

    ECMA was starting a new working group to look into standardizing OOXML, and since we were already members of ECMA (as part of our work on C# and CLI) I recommended that we should participate in the effort to come up with solid documentation that we sorely needed for improving OpenOffice's interoperability story. ECMA had been great in particular for the CLI, in large part thanks to Sam Ruby at IBM who pushed for the file format to be specified (the original drafts did not document the actual assembly file format, only the instruction set).

    In 2005, one of our major goals was to make Linux suitable for enterprise desktop deployments, and interoperability with Microsoft protocols and file formats was key to this strategy. We were the major contributors to OpenOffice outside of Sun (and perhaps still are) and what mattered to us was to get a good spec we could use to fix customer issues that prevented us from deploying the Linux desktop to enterprise customers.

    For years, we had been reverse engineering Word and Excel. This was our chance of getting important information on the file formats. Our work in this area today benefits every OpenOffice and Gnumeric users.

    So we attended and participated in the ECMA OOXML meetings starting with the initial meeting on December 15th. I blogged about this publicly on November 2005, and so did Novell which on the same month Novell blogged about our participation on the Open Invention Network (we were founding members) and was actively promoting OpenOffice.. The minutes of this meeting and every other meeting ever since are available to all ECMA members.

    It was our team that pushed to get the entire Formula Spec in OOXML back in 2006 (those 700 pages of formula specs, the ones that actually make spreadsheets work) as well as filing piles of issues as we prototyped the work with Gnumeric and OpenOffice. And all of this happened before any Novell-Microsoft agreement.

    My involvement after setting up the initial participation was superficial, as the actual hackers working on OpenOffice and Gnumeric took over (Jody Goldberg and Michael Meeks). These were important years for Mono, and that is where my energy has been going since about 2002.

    The 2006 agreement with Microsoft did not impact much of my work, despite Mono being something where interop could really be helped.

    The ECMA work on OOXML brought hackers together and allowed our teams to interact as people looking for some shared goals instead of interacting as foes. In my experience face-to-face meetings, like the ECMA working groups, help smooth out human relationships that might have been poisoned by preconceived biases.

    But the interop agreement certainly allowed other collaborations and meetings in other areas with Microsoft, for example, it lead to various components used by Mono to become open source, and to our Moonlight/Silverlight collaboration.

    So two full months into having signed an agreement with Microsoft, I wrote my first pro-OOXML post, largely based on a news report that I felt was misguided. We had been working on this at this point for a year, and clearly people with no actual office experience had already formed an opinion.

    In retrospect, had I known that double standards, hypocrisy and character assassination would become the tool of choice of the anti-OOXML crowd I would not have said a thing.

    The energy that went into stopping OOXML could have been better used in actually completing the formula spec for ODF, which almost four years later is still not part of the ISO spec. In the eyes of the ISO world, it remains an "implementation specific" work. But "advocacy" is a little bit like watching the TV, it is relatively easy. While actually working on improving open source, or open standards is equivalent to going to work. It requires skills, time and longs hours of difficult work (particularly if you are working on the OpenOffice code base).

    As for the March agreement of 2010, it is absolutely brilliant. Microsoft is funding our OpenOffice team to develop open source code that will improve the OOXML import and export capabilities and we help drive the OOXML standard forward based on the experience that we will gain from doing this work.

    If you do not like us doing this work, there is an easy solution for you: do not open or save files in OOXML format with OpenOffice.

    See what I did there Trevor? I found out what bothered you emotionally, decomposed the problem, and BAM! I provided you with a solution. It is called teamwork, Trevor.

    Michael Meeks from our OpenOffice team provides more color as he was the one actively working on this.

    Posted on 21 Dec 2010 by Miguel de Icaza

    Brazil

    Tomorrow we are flying to Porto Alegre in Brazil to spend two weeks in a nice, warm climate tasting delicious foods and hanging out with good friends.

    If you are a Porto Alegre-based Linux-ista, Mono-ista, Android-ista, MacOS-hacker-ista, .NET-ista, C#-ista, or, iPhonista and would like to get together for coffee, lunch or dinner, drop me an email.

    Posted on 16 Dec 2010 by Miguel de Icaza

    MonoReports: Report Designer and Reporting Engine

    This is quite cool, Tomasz Kubacki has released a report engine and designer that runs on Mono:

    MonoReports has a nice Gtk# based GUI designer that runs on Linux, Mac and Windows and can generate reports that you can later run GUI-less.

    From Tomasz announcement:

    • Simple layouting - if control in section is growable and will grow due to assigned data, engine will do layouting to make report look properly
    • Page breaking - Monoreports engine will break or keep together report sections whatever is needed
    • Generating and running reports from designer and code.
    • PDF export
    • Reporting engine is not tightly coupled with gtk/cairo stuff, therefore it's reasonably easy to write new export backends (e.g. html, or xls for example).

    He also made a six minute video walkthrough of MonoReports's features.

    Posted on 09 Dec 2010 by Miguel de Icaza

    Mono: What we are Cooking

    Although everything we do is public in some form or another, folks that are not keeping track of things might be wondering what the Mono team at Novell has been up to.

    Here are some of the projects that we have been working on, and that we expect to release in the next three months, some sooner, some later. You are welcome to join us in testing, all you need is to get comfortable building Mono from git.

    Bundling F#, IronPython, IronRuby and UnityScript: Now that all of these languages are open source, we want more people to use them, and we want to remove any friction that there might be in getting started. So we are doing a push to provide packages on Linux and bundle with our OSX installer all of them.

    The first three languages are from Microsoft, the third one is from Unity, and it is a strongly-typed and class-based incarnation of JavaScript. The lightweight syntax of Javascript, with the components necessary to produce optimal native code.

    Getting F# to build and run on Mono was a challenge on its own. This is not a language that many of us were familiar with, but we are now at a point where things are baked. We should be uploading our modified version of F# to the fsharp organization on GitHub.

    MonoDevelop's Git support: MonoDevelop 2.6 will come with Git support. Originally Lluis prototyped this by calling out to the system Git, but this is not very elegant and also hard to make reliable and work smoothly across Windows, Linux and MacOS. So Lluis used db4object's tool to convert Java source code into C# source code to bring Eclipse's jGit into Mono as NGit. Now MonoDevelop has a full managed Git implementation that works the same on Windows, Linux and MacOS.

    MonoDevelop's Online Template System: To help developers get up and running with any kind of interesting .NET project, we are going to make MonoDevelop use an online gallery system and we are going to open it up for contributions.

    New Profiler: our new profiler is a complete new implementation that obsoletes the old logging profiler, the old heap-shot profiler and the old heap-buddy profiler and our old statistical profiler into a single profiler that does it all, does it better, and does it well.

    This new profiler was already used to pinpoint bugs and performance problems in our own web server, our Parallel Frameworks and inspired Alan to write a leak detector for Moonlight.

    MonoDevelop's Profiler GUI: The companion to our new profiler. Currently it only has a CPU profiling mode, but in the future we will add a GUI for memory profiling as well.

    Mono on Android: we are very close to shipping Mono on Android. The experience right now is very close to what we want.

    This has taken longer than we anticipated, but mostly because we are providing a full binding to the Android APIs. Not just a subset. This is made possible by Google publishing the Android API contract in XML form.

    WCF: Our WCF implementation so far has been the Silverlight client profiler and its mirror on the server. This is clearly not sufficient for many of our users, so we have redoubled our efforts to fill in all the gaps in WCF. Mono 2.10 will have better coverage for WCF, but it wont be complete. That is still some ways off.

    MonoDevelop support for MonoDroid: Currently our entire toolchain is Visual Studio based, just because we figured this is where the majority of developers would be. We are hard at work to bring the same experience to MonoDevelop users on MacOS and Linux.

    Upgrade MonoTouch to Mono 2.8: Currently our MonoTouch product is based on our older Mono 2.6 release, and there are too many features in Mono 2.8 that users want.

    One feature in particular that we are working on is the use of LLVM's optimizing compiler for Mono on the iPhone. As MonoTouch is entirely batch-compiled and has no JIT, we can use the LLVM backend of Mono instead of our codegen backend to generate smaller and faster code.

    And this is only weeks after we pushed our jumbo 3.2.2 release.

    Deploy Cecil/Light: Cecil is JB's library that we use every time we need to process ECMA CIL images. Debuggers, compilers, assembly browsers, linkers, mergers, spliters, injectors, decompilers and many other tools in Mono are built with Cecil.

    JB has revamped Cecil to be a lot lighter memory-wise, and has improved its API. This new version has been already deployed on most of our master trees in GitHub and will be available to everyone on the next iteration.

    C# Compiler to use IKVM Engine: Our C# compiler has historically used System.Reflection.Emit as its code generation engine. We are adding a second backend to the compiler, this time Jeroen Frijters's IKVM.Reflection engine.

    This will eliminate the need to have our compilers "bound" to an mscorlib profile. This means that we will no longer need various hacks that we have in place to build special compilers to target special profiles of Mono. Just one compiler for all API profiles.

    VB Compiler using Cecil Engine: Rolf updated the Visual Basic compiler to use Cecil as its backend engine.

    Upgrade our Online API documentation: a very much needed upgrade to our documentation system is ongoing, based on Jonathan's Kipunji ASP.NET MVC documentation engine and Jackson's hard work to productize it. We are going to move our documentation to this new system. You can preview our new documentation system here: MonoMac's Documentation Test Site.

    Hopefully, this time, we will make our documentation editable on the web.

    Moonlight GPU Acceleration and Perspective 3D transforms: this project has been underway for a little more than a year and I blogged about the GPU Acceleration recently.

    GPU acceleration is based on the fine work from Gallium, and also has made Moonlight's engine more reusable as a general purpose accelerated framework.

    Moonlight's RichText control: this is basically a word-processor on a widget. And who better to work on this than Chris Toshok who originally wrote XWord for Unix almost 13 years ago and which lead to the creation of LessTif.

    Moonlight Test Suite: We are up to 47.77% of the Silverlight 4 test suite passing. This is a really big number considering that we only started work on Silverlight 4 features very recently. We have been making progress at about 3% every week.

    Moonlight Beta: as the stars of codecs, tests and MS-PL code align, we are getting ready to do the first public beta of Moonlight 4 early next year.

    Moonlight Platform Abstraction Layer: We did a proof of concept port of Moonlight to Android and OSX to improve Moonlight's Platform Abstraction Layer. It should now be possible to reuse the Moonlight engine in other platforms and operating systems. Think of this as a "porting kit". You get the source, get it running elsewhere and if it breaks, you get to keep both pieces.

    MonoMac: we just released MonoMac 0.4 and we are now adding support for creating self-contained application bundles that developers can redistribute themselves or even submit to the Apple AppStore for MacOS.

    MonoMac has been a lot of work, mostly, due to popular contributions. There is a nice emerging community of new contributors to Mono that has sparked in the last few weeks.

    Garbage Collector Performance Tuning: with Mono 2.8 we shipped our new copying and precise collector and we made it easy for users to try it out (mono --with-gc=sgen). With the information we have collected, we are now improving the reliability and performance of the collector.

    Sgen already helped us get up to 30% performance boosts on ASP.NET workloads, and the new results are nothing short of amazing. We can not wait to share this with the world (or you can try it out today by building Mono from master).

    System.Xaml: The venerable desktop version of the XAML parser is coming to Mono in our next release.

    Precise Stack Scanning for SGen: we have also added support for precise stack scanning that will be useful in a few workloads.

    One surprising thing that we found out, and this will come as a shocker to many --it certainly was for me--, precise stack scanning over conservative scanning requires a lot of extra memory to keep stack maps. Unless you have some particular need to use precise stack scanning, you will be better off memory-wise and CPU-wise using conservative stack scanning.

    Concurrent GC with SGen: as you can guess, SGen has been great for Mono, and more concurrent configurations of GC scanning will be supported in our next release. Some were disabled in 2.8, some are new.

    Moonlight and DeepZoom: we had a decent DeepZoom implementation, but now we have a fabulous one. And by fabulous I mean, we pass Microsoft's tests :-)

    Intellisense for Android's markup: Atsushi created a DTD for us to bundle with MonoDroid to let users at least edit their Android UI XML with auto-complete in Visual Studio.

    ParallelFX: our parallel FX in Mono 2.8 was the first time that we distributed it. We have been working on improving its performance, distribution and balancing algorithms.

    Update: both the ParallelExtra samples gallery and Microsoft Biology Foundation are now runnable.

    Monodevelop Addins: Lluis launched the Beta for MonoDevelop's Addins system. You can use this to publish your MonoDevelop add-ins to your users, maintain multiple versions of them and get cute statistics on your add-in.

    This is the app-store of MonoDevelop addins, except they are all free. For example, this shows that in the last 7 days, 144 users installed the MonoMac addin:

    And that is what has kept us busy since the releases of Mono 2.8, Moonlight 2, MonoDevelop 2.4 and MonoTouch 3.2.

    January and February will be busy months for us as we release betas for Moonlight 3/4, MonoDevelop 2.6, Mono 2.10 and the official launch of MonoDroid 1.0.

    Posted on 09 Dec 2010 by Miguel de Icaza

    Gtk# designer on OSX

    Happy to see that Gtk+ and Gtk# on MacOS are complete enough that the MonoDevelop GUI designer can be used there to build UIs.

    In the past, we had to use Linux to do all of our GUI design. Now our Gtk+ GUI design on OSX is self-hosting:

    You need the latest Mono and MonoDevelop to get this working.

    Posted on 08 Dec 2010 by Miguel de Icaza

    Mono Introspect: Binding GObject-based APIs for use in Mono

    Alan McGovern, the hacker behind the amazing Moonlight GC tracking device has started work on a tool to bind the new Gtk+ 3.0-based APIs that use GObject instrospection for Mono consumption.

    Check out his project hosted in Github's mono-introspect module.

    Posted on 06 Dec 2010 by Miguel de Icaza

    Beautiful Hack: Using Mono's Profiler to find Hard Memory Leaks

    Alan McGovern of MonoTorrent, Moonlight and Mono Introspect fame has written a blog post explaining how he used the new Mono Profiling interface to write a custom memory leak detector for Moonlight.

    His post is a step-by-step document on how he created a new loadable profiling module that the Mono runtime uses. He then registers for listening to profiling events for the GC roots (MONO_PROFILE_GC_ROOTS) and then tracks the GC handle use.

    This is how he found a difficult memory leak involving Mono's VM, the browser Javascript VM and the C++ code that backed every Moonlight object.

    Hard core hacking reading.

    Posted on 06 Dec 2010 by Miguel de Icaza

    New iOS/OSX blog

    I have started a new blog on my iOS/OSX experiences with MonoTouch and MonoMac over at http://tirania.org/monomac.

    Posted on 30 Nov 2010 by Miguel de Icaza

    David Reveman lands GPU acceleration for Moonlight…

    David Reveman had a great birhtday present for me today. He just completed the hardware accelerated support for Moonlight.

    You can watch two quick videos I made today with David: Hardware acceleration with Moonlight and Moonlight 3D Perspective Support.

    In Moonlight hardware acceleration is used for a number of features:

    • Applying 3D transforms to any Silverlight objects (drawings, images, videos).
    • Accelerating rendering of surfaces by pre-caching the contents on hardware textures.
    • Pixel shaders.

    Although Silverlight is able to accelerate some pixel shaders, Moonlight is able to accelerate all custom pixel shaders.

    The code currently lives on GitHub and we are doing daily builds of Moonlight for users interested in trying it out.

    Posted on 23 Nov 2010 by Miguel de Icaza

    MonoDevelop 2.4.1 is out

    MonoDevelop 2.4.1 has been released. This release is focused mostly on bug fixes, but we still managed to add a few nice features:

    • we now support .NET 4.0 projects;
    • the Gtk# designer now works on OSX;
    • better native OS integration on Mac and Windows.
    • Improved support for XBuild projects

    Check out our release notes for the details about our changes.

    Posted on 22 Nov 2010 by Miguel de Icaza

    Fund Raising 2.0

    It occurs to me that in this whole debate over angels and VCs, there is an important third option that is missing from the table and I have been referring to it colloquially as "Social Network Offering", or SNO.

    The idea is that instead of raising money directly from an angel investor or a professional venture capitalist, you raise money through a network of friends, acquaintances and contacts in the industry.

    The startup to-be creates a prospectus with some basic information like the business they are in, the execution plan, and the capital requirements to go from startup to profitability, acquisition or another exit strategy.

    So far, that is not any different than any other financing option available for a startup. The difference is how the share holders are invited into this process. Instead of being a closed door event where the angel or the vc sets the terms, the founders of the company set the terms for the investment as well as the initial round of capital that they are trying to raise and offer this to the social network.

    The Social Network Offering round would be setup through an escrow system that would give different investors a chance to participate in the first round of finacing, and if enough startup capital is raised in this phase, the money is given to the company and shares are distributed to the investors. If the startup fails to raise enough capital, the money is returned to the investors.

    Social Network Offerings are transparent in nature. They would not work well if you are trying to create something in secret, something that nobody has ever heard of, since you would need a level of secrecy for this to work. But it would work great for business built around open-core, or business where the strategy is to do it better than existing offerings.

    Balance

    If you have a social network of friends that can help you raise this kind of cash, the advantages are:

    • Your social network knows you better than a new VC firm or an angel.
    • Individuals that have historically not had a channel to invest in startups, get a chance to participate. This is fairly unique.
    • Easier to keep the company vision intact.

    There are also some downsides to go with Social Funding: VCs can help you get a seasoned executive team in place, they assist you by filling the gaps during the early stages of the company, they let you tap into their network of companies and resources and they will not hesitate to course-correct any ideological problems that do not necessarily blend well with becoming profitable.

    What is your take?

    If you had a chance to invest on a high-tech startup, how much of your own money would you be willing to put up-front for something like this?

    Fill my survey here.

    Update: On twitter, @eoinh pointed out that one company already did something like this. They used Linked-In to raise 350,000 dollars through their contacts, and found matching funds from the government raising the total to 700,000.

    Posted on 17 Nov 2010 by Miguel de Icaza

    GitHub Organizations for IronLanguages and F#

    The IronPython and IronRuby languages are now under the "IronLanguages" umbrella and are being maintained using GitHub's Organization support.

    Tomas has also created an organization for F#, it currently hosts the MonoDevelop F# Add-In, and we are going to maintain there F#'s changes that we make in the open source world to get it tuned for Linux and OSX.

    Posted on 17 Nov 2010 by Miguel de Icaza

    F# MonoDevelop Add-In Available

    Tomas Petricek has announced the availability of the F# MonoDevelop Add-In.

    The add-in provides intellisense for MonoDevelop, inline documentation and access to the F# interactive shell. Most of the heavy lifting is done by the F# compiler itself which is used directly by the Add-In as a service:

    His blog also has screencasts on getting F# and the F# add-in installed on Linux and also shows how to create Gtk# applications with F#:

    Check his blog for more details.

    Posted on 16 Nov 2010 by Miguel de Icaza

    Mono Developer Room at FOSDEM

    Ruben has announced that FOSDEM 2011 was kind enough to host a Mono Developer Room at next year's conference.

    Ruben is organizing the talks, if you want to present, please submit a proposal for a presentation.

    There are plenty of topics to discuss: Gtk# and the Gnome desktop; MonoDevelop and MonoDevelop add-ins; Mono Runtime; Languages: Iron*, UnityScript, C# 4, F#; Server programming with Manos or ASP.NET.

    Posted on 15 Nov 2010 by Miguel de Icaza

    New Mono Log Profiler

    Paolo has checked into Mono's GIT repository our brand-new profiler for Mono applications.

    The new profiler is documented in detail here, and is available with Mono 2.9+ (this means: it is available if you build Mono from GIT, and will be part of the upcoming 2.10 release).

    We would love to hear your feedback on it, and we hope to have a UI integrated into MonoDevelop soon.

    Update: This is what one of the reports of the new profiler can produce, this is taken from running an ASP.NET application (a question that came up a few days ago on IRC):

           Heap shot 5 at 14.518 secs: size: 43684432, object count: 562907, class count: 543
                Bytes      Count  Average Class name
             10506984      87373      120 System.Collections.Hashtable.Slot[] (bytes: +1939272, count: +16161)
                   87346 references from: System.Collections.Hashtable
              8130304      87486       92 System.Int32[] (bytes: +1706912, count: +16164)
                   87346 references from: System.Collections.Hashtable
                   40 references from: System.Collections.Generic.Dictionary
                   30 references from: System.Globalization.NumberFormatInfo
              6846000      57050      120 System.Web.Caching.CacheItem (bytes: +1232880, count: +10274)
              4891432      87347       56 System.Collections.Hashtable (bytes: +904176, count: +16146)
                   28526 references from: System.Web.HttpStaticObjectsCollection
                   28525 references from: System.Threading.ReaderWriterLock
                   28524 references from: System.Web.SessionState.SessionStateItemCollection
              1597344      28524       56 System.Web.SessionState.InProcSessionItem (bytes: +287672, count: +5137)
                   28524 references from: System.Web.Caching.CacheItem
              1597344      28524       56 System.Web.SessionState.SessionStateItemCollection (bytes: +287616, count: +5136)
                   28524 references from: System.Web.SessionState.InProcSessionItem
    
    	This heapshot was taken 14.518 seconds after application startup, at the
    	time there were 562907 objects in the heap, of 543 different types,
    	using about 43 MB of memory.
    	
    Posted on 11 Nov 2010 by Miguel de Icaza

    F# Goes Open Source

    Last week, Don Syme announced that Microsoft has open sourced the F# compiler and the F# core libraries under the Apache 2 license.

    In addition, on Tuesday, Don also announced a new release that fixes a handful of bugs specifically for users targeting Mono.

    F# is a fascinating language, but I had not really spent much time with it as we could not really distribute it as an open source compiler limiting its usefulness in the Linux and Mac worlds. Now F# can become just another language that developers can use.

    F# supports asynchronous programming today, and it was the inspiration for C# 5.0's async support. There is no need to wait for C# 5 to come out, you can start using async workflows today with F# everywhere.

    MonoDevelop plugin

    At the F# in Education workshop Tomas Petricek announced his MonoDevelop add-in for F#. Although he has not released a binary add-in, the source code to his plugin is available here. It provides intellisense, parameter documentation, on-the-flight error underlying and support for the F# interactive shell from the IDE.

    Distributing F#

    Our plan is to distribute F# as part of Mono for both OSX and Linux. This will take some time, in the meantime, check fsxplat.codeplex.com for instructions on how to get started with F# on MacOS and Linux.

    It will likely run out of the box on Mono/Android and Mono/Wii. Since F# uses generics extensively, we do not know if it can be used to target the iPhone or the PS3 as both require Mono's full static compiler. We will be evaluating this in the coming weeks.

    Don, minutes after open sourcing F# enjoying a tasty meal.

    F# Resources

    These resources are straight from Don's blog:

    Posted on 11 Nov 2010 by Miguel de Icaza

    Visiting Redmond and PDC

    If you are attending PDC or at Microsoft and love Mono, .NET, Open Source, Linux, MacOS, iPhone, Silverlight, Android or WP7 and want to hang out, discuss, or debate the finer points of trollcats in contemporary society, drop me an email at miguel@novell.com.

    Alternatively, we can also indulge in some Java-driven schadenfreude or debate whether chubby pixels are worth staring at.

    I will be in Redmond from Tuesday afternoon until Friday night.

    Posted on 26 Oct 2010 by Miguel de Icaza

    IronRuby and IronPython Opportunities

    Yesterday, Jason Zander announced that the maintenance and future development of IronRuby and IronPython languages was being turned over to the Iron* communities.

    Microsoft reached out to some of the users of the Iron languages to take over the coordination for these projects. Together with JB Evain, Michael Foord, Jeff Hardy and Jimmy Schementi I agreed to help coordinate the future development of these languages. The Iron* community reaction to the opening of the process has been very supportive judging by the emails on the mailing list and the twitter responses.

    There are four pieces of code involved, all licensed under the Apache 2.0 license:

    Both IronPython and IronRuby will be developed like other open source projects without any of the limitations that previously existed. In particular, from my very Unix-centric view, we will be able to get the proper fixes into the Iron* languages to make them work out of the box on Linux and MacOS.

    Our Contributions

    Although we will help with the coordination efforts in the Iron languages as the community grows and evolves, we have some concrete tasks that we will be working towards right away:

    • Ensure that the Iron* languages build and work out of the box on Linux, MacOS and Unix.
    • Use Mono's Continuous build system to keep an eye on any regressions on IronRuby and IronPython.
    • Package the latest IronRuby and IronPython for Linux and MacOS.

    Opportunities

    Ruby and Python make programmers happy. They bring joy and smiles to programmers everywhere in the Unix world. Both have strong user bases on Linux and MacOS and there is a strong ecosystem of independent implementations for both Ruby and Python, each with their unique features.

    In Iron's case the major feature is being able to use your scripting language of choice while having access to all Mono APIs for building standalone applications or for extending existing applications like MonoDevelop, F-Spot, Banshee, SparkleShare and Tomboy.

    From my Unix-biased standpoint, this means that all of the libraries that we have been working on over the years from Gtk# for building desktop Gnome apps, to MonoMac for creating native Mac applications with the entire universe of .NET libraries at your disposal.

    The Iron* languages, combined with our MonoMac will make an appealing platform for building apps for the Mac AppStore.

    Another fascinating project is the Pyjama Educational Project. Pyjama is written in IronPython, Gtk#, and GtkSourceView and currently supports 5 DLR languages.

    Teaser

    As the announcement came out last night, Geoff Norton cooked this simple teaser of IronRuby on the iPhone.

    Check it out here.

    Posted on 22 Oct 2010 by Miguel de Icaza

    Missed Opportunities at Microsoft and Ray Ozzie Departure

    Microsoft has three big tasks ahead of itself: (a) make Azure successful; (b) make Windows Phone 7 successful; (c) keep the existing Windows and Office businesses printing money.

    There is probably not a lot of political support at this point to embark on more large-scale innovations at Microsoft while there are probably hundreds of smaller innovations that are waiting under all of their product groups.

    Ray Ozzie incubated a number of projects like Azure and Mesh at Microsoft that once they reached a level of usefulness were transferred to the product groups.

    He is probably leaving his position as Chief Architect at Microsoft as he transfers the Azure assets to the product group and he is once again left as a general without an Army. Starting new project and recruiting teams from scratch for new products has probably taken a toll on him and he is ready to move on.

    Missed Opportunities

    Back in June I blogged about what I would do if I was in charge of Windows 8: among other things, I would have created a Windows AppStore.

    This AppStore would have helped independent ISVs tremendously by opening the entire Windows user base as potential customer for Microsoft's products. It would have helped Microsoft make Windows even more relevant, and it would have done more to push native applications on Windows than anything else they have tried in the past.

    The Windows PC market is a market that is many times larger than today's iPhone market. It would have been a gold mine, and there would have been a renewed gold rush to ship "Windows AppStore-ready" applications for Windows.

    Hundreds of people at Microsoft must have had this idea, the question is why it never bubbled up to the top?

    Short of a Microsoft-powered AppStore, Intel has announced that their Windows Appstore will now include .NET software.

    On the one hand, Intel has now given up any attempts to make their AppStore be a cross-platform app-store, which I felt was a gracious thing for them to do, as it would have helped Linux.

    Financially, having a strong Windows-based appstore was probably the right thing to do for Intel. There was really no point in Intel undermining his own efforts by forcing people to use cross platform tools in the first place.

    If Microsoft was the one providing the AppStore, they would be reaching a much bigger market than what Intel hopes to reach.

    This could have been a great Ray-Ozzie level hack to pull at Microsoft. In the meantime, Apple today announced an AppStore, and they are going to get a bucket of apps and a bucket of developers to push software on their platform.

    Live Mesh

    Live Mesh had a lot of promise, but sadly, the groups working on it refused to open up the specs on time, and the product became fairly uninteresting over time.

    If you are going to open something for the world to see, you should be ready to let the world interoperate with it from the start. Otherwise you merely give your competitors the good ideas, and they throw away your bad ideas and avoid paying any of your strategy taxes.

    Posted on 20 Oct 2010 by Miguel de Icaza

    Shipping Smiles on the AppStore

    Happy days at Mono Central. Just a few months ago we decided that we should apply the lessons learned from MonoTouch to Mono on the Mac and we built a new set of .NET APIs for developing native Mac applications. We called this MonoMac.

    We recently brought tears of joy to developers by shipping it.

    MonoMac will be a great tool to build native Mac application using your favorite .NET programming language.

    We clearly have to take this to the next step as MonoMac is merely a binding to .NET. We are going to have to extend MonoDevelop to create fully self-contained applications that embed both your application, any library dependencies that it needs as well as the Mono runtime.

    The above really had not been my priority, as far as I was concerned "Download Mono and Install it" was a perfectly suitable solution. So you have Apple to thank for my change of heart.

    Hopefully we will have an experience as smooth as the MonoTouch experience has been.

    Posted on 20 Oct 2010 by Miguel de Icaza

    Bringing Smiles to the Faces of MacOS developers

    As part of our efforts to bring a superb developer experience to every platform in the world, we have made a new release of our bindings to the MacOS X APIs: MonoMac.

    We know that Mac users like to have a smooth installation experience, and we have worked hard to make this as simple as possible. Currently MonoMac is still not a 1.0 product, this is what developers need to do:

    The result is a .app that you can distribute to your users.

    The MonoMac API design is inspired by work that we did for MonoTouch.

    We have achieved a beautiful blend between C# and MacOS that will turn Mac developer's tears of pain into tears of joy.

    Community

    Update: to get started with MonoMac, you can join other MonoMac-ers on the IRC channel #monomac on server irc.gnome.org.

    We use the mono-osx mailing list to discuss the binding.

    Hackers

    If you want to get your hands on the source code for MonoMac, head over to GitHub and download both monomac and maccore. The former contains the MacOS-specific bindings, while the latter contains the shared code between MonoMac and MonoTouch.

    The introductory post to MonoMac still contains many useful links and design details, you might want to read that if you want to hack on MonoMac.

    Contributors

    Our API coverage right now is very complete. We will certainly add more C# features to the binding as we learn how developers are using the API, but that is a bit of an organic process.

    One area that we need help to improve the developer experience is to fill-in all the "summary" sections in our documentation. This information is shown during auto-complete/intellisense for the developer for classes, methods, enumeration values and properties.

    Details on how you can contribute to this are on this post of mine.

    Posted on 12 Oct 2010 by Miguel de Icaza

    A Mono Success Story of Biblical Proportions

    Read David Mitchell's experience in using Mono to reuse code between the Windows and Mac platforms.

    Posted on 07 Oct 2010 by Miguel de Icaza

    Mono 2.8 is out

    We have just released Mono 2.8 a major upgrade to the Mono developer platform. This release contains ten months worth of new features, stability fixes, performance work and bug fixes.

    The highlights of this release include:

    • C# 4.0
    • Defaults to the 4.0 profile
    • New Generational Garbage Collector
      • Use mono --gc=sgen or mono-sgen to use Mono with the new GC
    • New Frameworks from Mono MIT X11 and Microsoft MS-PL/Apache2:
      • ASP.NET 4.0
      • Parallel Framework: including PLINQ.
      • System.XAML
      • System.Dynamic
      • Managed Extensibility Framework
      • ASP.NET MVC 2
      • System.Data.Services.Client (OData client framework)
      • WCF Routing
      • .NET 4.0's CodeContracts
    • Performance:
      • Large performance improvements
      • LLVM support has graduated to stable
        • Use mono-llvm command to run your server loads with the LLVM backend
    • Version 2.0 of the embedding API
    • Removed the 1.1 profile and various deprecated libraries.
    • OpenBSD support integrated
    • Mono no longer depends on GLIB
    • Threadpool exception behavior .NET 2.0

    For the full details, check our detailed Mono 2.8 Release Notes

    Posted on 06 Oct 2010 by Miguel de Icaza

    The Mystery Behind the Hacking the Boston Museum of Fine Arts

    A decade ago some hackers went into the Boston Museum of Fine Arts and replaced the guided tour audio with their own content. The identity of the hackers remains a close guarded secret and one of Boston's biggest unsolved mystery's. Investigators could only agree on one thing: that the voice in the tape did not belong to Lev Davidovich Bronstein.

    I got my hands on the audio file back in 1999 and during one of my visits to MIT that year I saw the news paper coverage of the event. I vaguely remember the news article, but it described the reactions of the visitors and featured interviewed with shocked citizens.

    This is the recording.

    Update: Dylan tells me that the cat is out of the bag. Read the interview with BJ Novak here.

    Posted on 29 Sep 2010 by Miguel de Icaza

    Chicken Tikka Masala Burrito

    	toshok: oh man… chicken tikka masala burrito
    	toshok: i got it to share with conchita, but she's asleep on the couch...
    	

    20 seconds later:

    	toshok: it's so good, i might eat it all
    	
    Posted on 16 Sep 2010 by Miguel de Icaza

    Unix Stack Exchange: Call for Help

    Thanks to everyone that helped us get the Unix StackExchange group up and running.

    The site went into preview in record time, and then we went into Beta.

    My call for help: I am currently at 1,211 points, on 6th place answering questions on the site.

    So what I need you guys is to go and ask some interesting questions about Unix, Linux, Gnome in there, and I get to answer them with some awesome background.

    If you ever had a pressing Unix question, now is the time to ask it on the site, and help me get those points up.

    Posted on 14 Sep 2010 by Miguel de Icaza

    This was news to me

    I have been living in the US for 10 years, and I never thought that people that many of the people that went through college end up with huge debts that they had to repay for 30 years.

    This is probably creating a generation of graduates that is unable to take risks, start their own business, take a year off, launch the next startup or just catch a break.

    During the discussion today on Twitter, this link came up, this one as well as this infographic from College Scolarships:

    Posted on 13 Sep 2010 by Miguel de Icaza

    Great News for MonoTouch Users

    Apple has removed the restrictions that were introduced earlier this year (the famous section 3.3.1).

    Although Apple had not blocked any MonoTouch applications since the new rules were introduced, many developers either took a wait-and-see approach, or switched their development. We never stopped working on MonoTouch, just yesterday we released MonoTouch support for the new iOS 4.1 APIs. We did this within eight hours of the new operating system going public.

    With these new terms, the ambiguity is gone and C# lovers and enthusiasts can go back to using MonoTouch. Developers that like garbage collection and their strongly typed languages can resume their work.

    In addition, Apple has published their detailed review guidelines for application developers. This should help developers get their apps approved. And the MonoTouch Book is a great way to get started.

    Thank you!

    We would like to thank the MonoTouch community that stayed by our side all along and helped us improve MonoTouch and continued to build great applications during this time.

    Those of us that have a crush on iOS and .NET are grateful to Apple and the Apple employees that helped make these changes happen.

    Expanded MonoTouch iOS investment

    Although we continued to extend, improve and polish MonoTouch the older terms made it harder to justify taking on some larger tasks, the risk was high.

    We had some big projects in mind for MonoTouch. We are going to start prioritizing these new features, but we want to hear from our users, and we want to know what is more important to you. Please fill out this survey to tell us what do you think it would be more important to bring to MonoTouch.

    We will balance your input with our own "gut" (we would not be truth to the Stephen Colbert spirit if we didn't).

    ....and discounts!

    Joseph Hill has just told me that we are doing a 15% discount for the next two weeks for anyone buying MonoTouch. Use discount code "MONO-331" on http://monotouch.net/Store.

    We have also a surprise in store for existing MonoTouch customers that we will be announcing next week.

    Posted on 09 Sep 2010 by Miguel de Icaza

    Initial Thoughts on Oracle vs Google Patent Lawsuit

    Today Oracle sued Google over Java patents and copyrights that they claim Google's Android OS infringes. The lawsuit claims that Google knowingly infringed on those patents, and that the continued distribution of Google's Android is harming Oracle's Java Business.

    You can read the actual complaint, the patents referenced are:

    There is also a copyright lawsuit, but there are not enough details on the complaint to figure out what the claim is. Until there is a trial, we will not really know what is being asked here.

    Pundit Prediction Time!

    I would like to think that this is going to be solved with a quick settlement where Oracle will shake Google for a few billion dollars and the entire matter will be put behind.

    Oracle will likely want to settle with Google under terms that will only cover Google's own use as they want to go shaking other OEM trees for more cash.

    An unlikely scenario is for Google to pay the bills for all Android OEMs as they are coming out fast and strong from every corner of the world.

    It occurred to me that Oracle could sell all the Java assets to Google. But Google probably passed on this opportunity back when Sun was put on the market.

    What Jonathan Schwartz Knew

    Sun's Ex-CEO Jonathan Schwartz has recently taken to the blogwaves to blog about the things he could not tell us while he was a CEO of Sun. While he might have found a new voice for gossip from the Sun days, he will not say a word on this matter, because he was likely engaged in shopping the patent lawsuit around.

    Sun had created Java, but it turned out to be very difficult for Sun to monetize Java directly after the initial source code license deals that they struck with IBM, Microsoft, Oracle, Netscape and others. They created the J2EE market, just to find that other companies and startups executed better than they did on the systems that they had initially engineered.

    Sun was left in the uncomfortable position of being the owner of the technology that everyone was cashing out on, but they themselves had very few revenue streams for Java. Like Clemens Vasters joked on Twitter today:

    They had the Microsoft lawsuit cash and they had the embedded licensing business with Java Micro Edition and Java Standard Edition licensing deals.

    The open sourcing of Java was also carefully planned. By picking the GPL as their license, they ensured that embedded system OEMs and developers would have to negotiate a different license with Sun if they wanted to use the OpenJDK on their systems.

    There is very little public information on the Google/Sun split over Java ME and the creation of Dalvik. The rumors on the grapevine were that Google and Sun could not reach an agreement over the Java Micro Edition licensing. Sun wanted to sit in the middle between Google and the handset OEMs, while Google wanted to create a free-for-all operating system.

    When it became clear that they would not be able to reach an agreement, Google started a project to replace Java Micro Edition and they used some clever engineering techniques that blended the best of both worlds.

    It is likely that during these negotiations, Google threatened to build their own Java runtime and Sun countered with a list of patents. This would explain why Google went through the trouble of making the Dalvik virtual machine explicitly incompatible with the existing Java virtual machine instructions.

    Although Dalvik uses a different set of instructions, Google created a translator that recompiled Java code into Dalvik code, and with this, they worked around whatever licensing technicalities they were aware at the time of the negotiations.

    Needless to say, Sun was not happy with Dalvik. Not only because Sun had lost a large licensing deal, but also because it had the potential of becoming the de-facto Java virtual machine that everyone on the embedded space would pick instead of Sun's own Java Micro Edition.

    In late 2007 Google announced both Android and the Open Handset Alliance to the public. On the Java front, Sun had delivered on the promise of open sourcing Java, but it had been a rough year for Sun and it would get worse, in the next twelve months after the announcement, Sun stock would lose 80% of its value.

    Sun had their plates full, so Sun did not feel the need to react immediately to the Android threat, so they kept their grievances to themselves.

    But Jonathan started to shop the company in late 2008. The monetary value of the Java assets had been devaluated due to the open sourcing of the technology under the GPL. I am going to bet that the same careful planning that went into picking the GPL went into pitching the potential for lawsuits.

    The world had already witnessed the awesome iPhone and the eyes were on Google to deliver a killer phone. Jonathan must have known this and he must have been pitching this to the potential suitors.

    By the time Oracle bought Sun, they knew that they would be going after Google and anyone else with a big, fat checkbook that did not have a licensing deal in place.

    And that explains the Exodus of famous Java people from Sun shortly after the acquisition. The wheels of the lawsuit started spinning the moment the sale was done. Those employees are probably under NDA.

    Update: I was wrong, apparently Gosling was not under NDA and has confirmed exactly what I said above:

    Oracle finally filed a patent lawsuit against Google. Not a big surprise. During the integration meetings between Sun and Oracle where we were being grilled about the patent situation between Sun and Google, we could see the Oracle lawyer's eyes sparkle. Filing patent suits was never in Sun's genetic code. Alas....

    I hope to avoid getting dragged into the fray: they only picked one of my patents (RE38,104) to sue over.

    So now we know that Jonathan shopped Sun with a big "Sue Google" sign. So much for his visionary patent defense against Apple and of course this jewel:

    The most egregious of such suits was filed against Sun by Kodak (yes, the film photography people).

    Egregious, because Kodak had acquired a patent from a defunct computer maker (Wang) for the exclusive purpose of suing Sun over an esoteric technology, Java Remote Method Invocation (“Java RMI” – not exactly the first thing that comes to mind when you hear “Kodak”).

    And he was just playing Wang's role a couple of months ago.

    Update: this post from the Dalvik announcement era discussed how Dalvik's work around the license-from-Sun challenge.

    Some Background on the Java Patents

    The Java specification patent grant seems to be only valid as long as you have a fully conformant implementation:

    (a) fully implements the Specification including all its required interfaces and functionality;

    (b) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; and

    (c) passes the Technology Compatibility Kit (including satisfying the requirements of the applicable TCK Users Guide) for such Specification ("Compliant Implementation").

    This is more stringent than the Microsoft Community Promise that applies to .NET as the Community Promise only requires a minimum subset, it does not prevent supersets.

    This seems to be what the lawsuit is hinged upon.

    Is this it?

    I vaguely remember in one of the endless anti-Mono discussions that someone pointed (maybe it was Gosling himself?) that Java had a patent grant for anyone to implement under any conditions.

    They pointed to the spec. And I remember seeing this on the spec and thinking that it was a generous patent grant. Perhaps I was confused and the only patent grant is the one in the previous section, but if you know of the other document, please let me know.

    Sun's GPL

    By GPLing Java, Sun lost some of the exclusive rights that they used to have, in particular, anyone using the open sourced version of the OpenJDK is given the patent rights to run the software.

    The problem is that the rights are only available as long as you are using the GPL version of Java. Any patent grants are not available if you use a third-party licensed version of the Java virtual machine. In that case, it seems like the only option would be to to go back to the Sun licensing terms.

    Wishful thinking

    Too many engineering resources are devoted to Android at Google and at their partner companies, but I can not help to think that Google could migrate Android from Java to the ECMA/ISO CIL and C#.

    Unlike the Java patent grant, the Microsoft Community Promise for both C#, the core class libraries and the VM only require that you have a full implementation. Supersetting is allowed.

    Additionally, Microsoft has placed the .NET Micro Edition entirely under the Microsoft Public License which comes with an even more generous patent grant, and covers a superset of the code covered by ECMA/ISO 335.

    We have open source implementations of both, and even more luckily, the ECMA/ISO VM specification allows for different profiles, to allow for ultra-small or server-sized versions of the VM to be created. Ideal for mobile platforms.

    Google could settle current damages with Oracle, and switch to the better designed, more pleasant to use, and more open .NET platform.

    Some Humor

    There is a silver lining in this whole mess, and it is that the tweetosphere came up with a few funny tweets, here are my favorites:

    And while you are here

    I am very excited to see the first MonoTouch book published.

    Posted on 13 Aug 2010 by Miguel de Icaza

    Unix and Linux StackExchange

    Help create a non-tribal version of StackOverflow for Unix and Linux questions.

    As we know, tribalism makes you stupid. So let us commit to the Linux and Unix Q&A site powered by StackOverflow that will help answer questions for Unix and Linux users of all distributions and blends.

    At the time of this writing, only 91 users have committed.

    Tell your Solaris, FreeBSD, NetBSD, OpenBSD, Unix, OSX, Linux, Red Hat, Fedora, Ubuntu, Debian, Mandrake, Mint, Arch, Slackware, CentOS, Gentoo, OpenSUSE, friends to commit to it and help create a global community of Unix love.

    Posted on 05 Aug 2010 by Miguel de Icaza

    MonoTools 2 for VisualStudio has been released

    We just released Mono Tools for Visual Studio.

    There are four main features in MonoTools 2:

    • Soft debugger support.
    • Faster transfer of your program to the deployment system.
    • Support for Visual Studio 2010 in addition to 2008.
    • Polish, polish and more polish.

    Thanks to everyone that participated on our beta program for all of the bug reports and feedback!

    MonoTools is the foundation on which we are building the upcoming Mono for Android toolchain.

    New Long-Term Maintenance Mono Release

    With the introduction of MonoTools for Visual Studio, we are also moving our long-term maintenance Mono release from the Mono 2.4 release to Mono 2.6, the release that we announced last week.

    Getting Started

    Download our betas from this page. On Windows, you would install our plugin for either 2008 or 2010 and you need to install Mono 2.6.5 on the target platform (Windows, Linux or MacOS).

    On Linux, run `monotools-gui-server' or `monotools-server', this will let Visual Studio connect to your machine. Then proceed from Windows.

    On MacOS, double click on the "MonoTools Server" application.

    Once you run those, MonoTools will automatically show you the servers on your network that you can deploy to or debug:

    ASP.NET debugging with this is a joy!

    Soft Debugger

    This release is the first one that uses our new soft debugger. With is a more portable engine to debug that will allow our users to debug targets other than Linux/x86 for example OSX and Windows.

    This is the engine that we use on MonoTouch and that we are using for Mono on Android.

    Our previous debugger, a hard debugger, worked on Linux/x86 systems but was very hard to port to new platforms and to other operating systems. With our new soft debugger we can debug Mono applications running on Windows, helping developers test before moving to Linux.

    Faster Transfers

    When you are developing large applications or web applications, you want your turn around time from the time that you run hit Run to the site running on Linux to be as short as possible.

    Cheap Shot Alert: When dealing with large web sites, we used to behave like J2EE: click run and wait for a month for your app to be loaded into the application server.

    This is no longer the case. Deployments that used to take 30 seconds now take 2 seconds.

    Support for Visual Studio 2010

    Our plugin now supports the Visual Studio 2010 new features for plugin developers.

    This means you get a single .vsix package to install, no system installs, no registry messing around, no dedicated installers, none of that.

    The full plugin installs in 3 seconds. And you can remove it just as easily.

    Then you can just from VS's Mono menu pick "Run In Mono" and pick whether you want to run locally or remotely.

    We now also support multiple profiles, so you can debug from Visual Studio your code running on Linux boxes, Mac boxes or your local system.

    Polish and more Polish

    MonoTools was our first Windows software and we learned a lot about what Windows developers expected.

    We polished hundreds of small usability problems that the community reported in our last few iterations. You can also check our release notes for the meaty details.

    Appliances

    And we integrate directly with SuseStudio to create your ready-to-run appliances directly from Visual Studio.

    Posted on 03 Aug 2010 by Miguel de Icaza

    Mono has migrated to GitHub

    We have now migrated all of Mono's source code from the Subversion at our Cambridge office over to GitHub.

    We are going to be maintaining a migration FAQ and providing help to developers on irc.gnome.org channel #mono for the new setup.

    The web site has not been updated yet and we still reference Subversion urls, but this will be fixed in the next few days.

    Posted on 22 Jul 2010 by Miguel de Icaza

    Mono 2.8 Trick: tracing exceptions

    Mono has an strace-like feature built into the runtime. This is useful to see which methods are being called by your application, just invoke Mono with --trace.

    Our upcoming version has a neat new feature, when you use --trace=E:ExceptionName or --trace=E:all you get a stack trace of where the exception was thrown from:

    $ gmcs.exe
    mono$ gmcs missing.cs
    error CS2001: Source file `missing.cs' could not be found
    Compilation failed: 1 error(s), 0 warnings
    

    And now with tracing enabled, we do it setting the MONO_ENV_OPTIONS variable:

    mono$ MONO_ENV_OPTIONS=--trace=E:all gmcs missing.cs[0xb75136f0:] EXCEPTION handling: System.IO.FileNotFoundException: Could not find file "missing.cs".
    
    "{unnamed thread}" tid=0x0xb75136f0 this=0x0x53f18 thread handle 0x403 state : not waiting owns ()
      at System.IO.FileStream..ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool,System.IO.FileOptions) {0x00619}
      at System.IO.FileStream..ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) {0x00022}
      at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) {0x0004f}
      at System.IO.File.OpenRead (string) {0x0002c}
      at Mono.CSharp.Driver.Parse (Mono.CSharp.CompilationUnit) {0x00016}
      at Mono.CSharp.Driver.Parse () {0x00068}
      at Mono.CSharp.Driver.Compile () {0x00098}
      at Mono.CSharp.Driver.Main (string[]) {0x000a2}
      at (wrapper runtime-invoke) {Module}.runtime_invoke_int_object (object,intptr,intptr,intptr) {0x00033}
    error CS2001: Source file `missing.cs' could not be found
    Compilation failed: 1 error(s), 0 warnings
    
    Posted on 21 Jul 2010 by Miguel de Icaza

    Banshee Ships with Amazon Store Support

    Aaron just shipped Banshee 1.7.3 which lets you purchase MP3s from Amazon from the player directly.


    Banshee Amazon MP3 Store Screencast!

    Get it fresh!

    Posted on 21 Jul 2010 by Miguel de Icaza

    Building apps for the Retina Display

    While adding Retina Display support to TweetStation I learned a couple of tricks that I figured would help other developers.

    iOS 4 Points

    Apple's Retina Display conveniently doubles the number of pixels on each dimension, the previous iPhone display had 320x480 pixels while the new new phone has 640x960 pixels.

    To make existing applications run out of the box on these new displays Apple changed the units on the display and instead of using pixels they now use points. They are not really typographical points, but iOS "points". Both the old iPhones and the new iPhone have a resolution of 320x480 points.

    This means that existing code that absolutely positioned views on the screen will get the views laid out in the same positions regardless of the device that the code is running on.

    In UIKit points are interpreted based on the value of the UIView.ContentScaleFactor. If the value is 1.0 each point is mapped to one pixel. If the value is set to 2.0 each point is mapped to four pixels (2x on each dimension).

    UIKit layout and CoreGraphics rendering primitives will automatically take this factor into account and position and render accordingly.

    Images

    The Image loading routines have been extended to load higher-resolution images by default when you use UIImage.FromBundle. On Retina Displays the code will probe for a file@2x.ext filename when you request file.ext to be loaded. For example this loads the background texture you use:

    	texture = UIImage.FromBundle ("Images/texture.png");
    	

    TweetStation's images are here.

    Bitmaps and Inkscape

    All the icons and images on TweetStation were done using Inkscape. When I exported the icons they would invariably look blurry. For example, this is from my first attempt at getting the swipe menu on TweetStation working:

    I would just draw my icons on Inkscape and then export them as bitmaps. Inkscape would then anti-alias the result, you can see how the reply icon is not rendered properly:

    The Inkscape FAQ contains this bit of information that is very useful if you are drawing small icons:

    With the current renderer, it is not possible to completely get rid of antialiasing. However, it is possible to partially suppress it on export. Usually, antialiasing is unwelcome in horizontal and vertical lines which become "blurred". To work around this, make sure your horizontal/vertical edges are snapped on the pixel grid, and all strokes are a whole number of pixels wide. Then, export bitmap at the default 90dpi so that 1 px unit corresponds to 1 bitmap pixel. In the resulting bitmap, snapped color boundaries will be perfectly crisp.

    These are the settings that I use now to export the same graphic:

    I used guidelines on Inkscape to help me:

    This is the new version of the icon before it gets composited with the background

    To export the same image at high resolution, set the DPI in the dialog box to 180. Inkscape will automatically change the width and height for you.

    The other problem that I had was related to my centering code, this is what the rewteet icon looks like from the menu above:

    The blurry sides of the retweet icon were caused by the math code setting the X position of the image at a fraction of a point (0.5).

    After fixing both problems and adding a nice backdrop shadow, this is what the menu looks like:

    Graphics Context

    Loading images with more pixels for the background texture and the icons wont do you any good if you are drawing the images yourself.

    When you create a graphics context using the pre-iOS 4 APIs you will end up with a context that assumes that you are not aware of the Retina Display and hence will rescale your drawing up. When you create an image context of 100x100 points like this:

    	UIGraphics.BeginImageContext (new SizeF (100, 100));
    	

    You will end up with a context that has 200x200 points, but will automatically double all of your pen widths and will scale any images up. If you had a high-resolution image, it will first be scaled down when rendering to the context, then scaled up when rendering the data.

    To take advantage of the retina display you need to call a new method:

    	UIGraphics.BeginImageContextWithOptions (SizeF size, bool opaque, float scale);
    	

    If you set scale to zero, it will pick 1.0 for old display and 2.0 for retina displays. I use this helper method to support both iOS 3.x and iOS 4.0:

    	void BeginImageContext (SizeF size)
    	{
    		if (Graphics.HighRes)
    			UIGraphics.BeginImageContextWithOptions (size, false, 0);
    		else
    			UIGraphics.BeginImageContext (size);
    	}
    	

    This is how the swipe menu is rendered at high resolution:

    More

    Apple's Supporting Resolution Independence document has more information.

    Posted on 20 Jul 2010 by Miguel de Icaza

    Mono's Git Migration

    Mono's source code is being migrated to GitHub on July 22nd, starting at 9am Boston time.

    We are psyched that Github was kind enough to host Mono's large repositories for free on their system. We are also taking advantage of their new Organizations functionality.

    Gonzalo posted the following details about the migration:

    We are moving our source code repository to GitHub.
    
    On July 22nd ~9am EDT (1300 GMT) the subversion repository at "svn
    +ssh://mono-cvs.ximian.com/source" will be set to read-only mode and
    kept that way forever.
    
    We estimate that the process of migrating all the projects and moving
    them to GitHub will take more than 3 and less than 8 hours. Once it is
    completed we will send an email to this list with URLs to the new
    repositories, FAQs,...
    	

    If you have any questions about the migration, please ask them here and we will add them to our Git Migration FAQ.

    Posted on 20 Jul 2010 by Miguel de Icaza

    Fresh Mono Baked

    Andrew just announced Mono 2.6.7, the version that is replacing our long-term maintenance release of Mono with plenty of bug fixes as well as the following new features:

    • Microsoft's ASP.NET MVC2 is now bundled with Mono.
    • Upgraded xbuild tool (Mono's msbuild)
    • Upgraded our LINQ to SQL (DbLinq)
    • Upgraded our Soft Debugger
    • We now publish CentOS/RHEL packages.

    Our CentOS/RHEL packages install on /opt/novell/mono, just like our packages for SUSE Linux Enterprise and should not conflict with your own packages of Mono that you might have from some other sources.

    Posted on 20 Jul 2010 by Miguel de Icaza

    Microsoft Licensing Changes for IronRuby and IronPython

    If you check the latest versions of IronRubyIronPython or the Dynamic Language Runtime you will see that Microsoft has now relicensed the code from the Microsoft Permissive License to the Apache 2 License.

    Posted on 17 Jul 2010 by Miguel de Icaza

    Spaniard Anger Towards Mexicans

    It has been brought to my attention that the upcoming 200 year celebration of Mexico's independence from Spain on September 15th has lead to office unrest all across the country between teams that have both Mexicans and Spaniards working side-by-side.

    Spain might have won the world cup, but Mexico upgraded from being a colony of Spain and being subject to the will of the Kings of Spain, to a democracy subject to the will of drug dealers.

    To resolve this animosity, I propose we settle the score this September 15th with a cook-off between Spaniard food and Mexican food.

    I propose the cook-off from the Novell/Cambridge team be held at my place the weekend before the festivities to settle the score before the celebrations take place. We will make delicious tacos. Gonzalo will be making a Paella.

    Posted on 17 Jul 2010 by Miguel de Icaza

    New Mono Runtime Features

    With Mono 2.8 we want to make it very easy for developers to use the LLVM powered Mono engine and the new Mono Garbage Collector.

    Previously users had to build Mono from source code and choose as part of their build whether they wanted the Mono VM to be powered by LLVM or not and whether they wanted to use the Boehm GC or the new Generational GC. Typically users would have to keep multiple parallel Mono installations.

    This is no longer necessary.

    Mono 2.8 by default behaves just like any other Mono, by default you get the regular fast Mono JIT with the Boehm GC.

    You can then pass the --llvm flag to instruct the Mono runtime to use LLVM for code generation (much slower to JIT, but produces better code for long-running applications or compute intensive applications).

    To use the new garbage collector you pass the --gc=sgen command line argument.

    New MONO_ENV_OPTIONS

    We wanted users to try LLVM, SGen or the LLVM/Sgen combination without having to modify all of their launch scripts or existing tools so we introduced a new environment variable that Mono parses on startup, the MONO_ENV_OPTIONS variable.

    Mono will parse the contents of the MONO_ENV_OPTIONS variable as if the arguments had been passed in the command line, so you could do a full bootstrap of Mono's class libraries with both by doing:

    	$ export MONO_ENV_OPTIONS="--llvm --gc=sgen"
    	$ make
    	

    How to test LLVM and SGen

    Update: Both the --gc=sgen and --llvm options depend on your architecture and operating system being supported by SGen and LLVM and depend on you compiling your runtime with these features.

    SGen will be automatically enabled if your OS/architecture is supported when you run configure.

    LLVM requires the installation of the LLVM libraries. We strongly recommend that you use our modified version of LLVM that has been extended to support various constructs required by .NET.

    For more information on compiling LLVM and building your Mono with it, see our web page

    Posted on 14 Jul 2010 by Miguel de Icaza

    GZip your downloads

    Gonzalo yesterday pointed me to a feature in the HTTP client stack for .NET that I did not know about.

    If you want the server to gzip the response before sending it to you, set the AutomaticDecompression flag in your HttpWebRequest:

    	var request = (HttpWebRequest) WebRequest.Create (uri);
    	request.AutomaticDecompression = DecompressionMethods.GZip;
    	

    This will set the Accept-Encoding HTTP header to gzip when you make your connection and automatically decompress this for you when you get the response stream.

    Update: on the comments there is a suggestion that Deflate is another option you can use, and you can combine both GZip + Deflate on the flags above.

    Update2: Dennis Dietric emailed me to point out an important bit: if the server side does not support GZip or Deflate content, you will could get a 406 return code, so when dealing with third party web sites you need to be prepared to fall back and retry your request without compression in place. The relevant sections of rfc 2616 are 10.4.7, 14.1 and 14.3.

    Posted on 09 Jul 2010 by Miguel de Icaza

    Microsoft MS-PL code in Mono

    Over the past couple of years Microsoft has been open sourcing some key .NET libraries under the MS-PL or Apache 2 license.

    We are tremendously grateful to Microsoft for making these components open source. This has allowed us to distribute this in the past, and we are going to be bundling a lot more of it with Mono 2.8:

    In Mono 2.8, the following assemblies and code come from Microsoft:

    With Mono 2.8 we are going to default to the .NET 4.0 profile. So from the list above MEF, the DLR, OData and MVC2 become first class citizens in Mono-land, no longer third-party packages that you needed to install.

    Update: as of July 17th 2010, the DLR, IronPython and IronRuby changed their licenses from MS-PL to Apache2.

    Posted on 07 Jul 2010 by Miguel de Icaza

    First MonoTouch Book is out

    I am very excited to see the first MonoTouch book published.

    You could not ask for a better team of authors to explain the MonoTouch and the iPhone platform. Chris, Craig, Martin, Rory, and Wally.

    This book was a team effort by various active members of the MonoTouch community. They nurtured the community from the start by exploring MonoTouch, by reporting bugs and missing functionality in MonoTouch and by guiding .NET developers through the new world of building iPhone applications.

    Congratulations on the book release guys!

    You can find them here:

    Posted on 06 Jul 2010 by Miguel de Icaza

    Pinta 0.4 Released

    Jonathan Pobst has released a new version of his paint program, Pinta, a lightweight app that runs on Linux, OSX and Windows and is built entirely using Gtk#.

    In this version, Jonathan added the MonoDevelop docking library to allow users to reorder the editing tools to match their workflow:

    There are ready-to-run packages available for Windows, OSX, Ubuntu and OpenSUSE.

    Posted on 06 Jul 2010 by Miguel de Icaza

    TweetStation: Elevating the Discourse

    (See below for Updates).

    TweetStation is my first native iPhone app (as opposed to my award-winning HTML5-app iCoaster). More screenshots can be seen here

    Just like Rails, TweetStation is an opinionated Tweeting client, it contains my personal blend of features that I enjoy from other twitter clients, but also tries to do something about changing the world.

    TweetStation has been designed to elevate the level of discourse on Twitter.

    At a conceptual level, this is achieved by applying the cardinal rule of not taking anything too seriously, specially any interactions you might have online.

    At a practical level this is achieved with two features. The first feature plays back chicken noises whenever you request more Tweets (this is bound to the Tweetie-like "Pull to Refresh" feature). These chicken noises have been engineered to remind you that no matter how important an argument appears to be in Twitter, you should not take it too seriously.

    Additionally, the chicken-noise-on-refresh serves as a cue to other people talking to you that you rather see what @jacksonh, or @Mickey__Rourke have to say than hear them parrot back the physics of clouds wikipedia page that they just read twenty minutes ago.

    When you compose a message with TweetStation music starts playing back in the background. This music was specially selected to elicit in you the desire to write a witty and clever response as opposed to the usual "well, fuck you too" response seen too often on social media sites. The result will be the kind of tweet that your local newspaper would publish in the front page, or in their "Social Media Expert" column.

    But there is an elephant in the room, and I want to speak directly about it. Many Twitteristas are concerned about the Tweetpocalypse and Twitter's transition to use some bizarro world non-feature called OAuth.

    Tweetstation is feature packed and does not suffer from either problem. You can trust that Tweetstation was developed using the best engineering techniques available today, and that you will never be the victim of the Tweetpocalypse and be left incommunicado due to some silly programming mistake. Not in this 32-bit century, not in the next, and not under my watch. If my years of experience taught me one thing is and one thing only, it is when to use a 32-bit integer data type and when to use a 64-bit one. Do not fear dear user, I also master many other data types, but I digress.

    But you might be wondering, why another Twitter client, and why now? As a twitterista you know that there is a special bond, an intimate bond if you will, between the twitterista and his twitter client. This bond can exist as long as both the twitterista and the twitter client grow hand in hand, if they co-develop. And I found myself at odds with the design decisions and paths that other twitter clients were taking. In a metaphorical way, I felt uncomfortable, like a Woody Allen character under pressure. But a character that lacked Woody Allen's command of the language.

    And this is how TweetStation was born, it was a labor of love, but mostly of social awkwardness when my friends mocked my Twitter client for lacking a chicken noise, or when they suggested things at dinner like "would it not be cool if...". I decided to change all that, and make sure that other twitteristas in the future did not feel the social scorn that I had gone through, and this is why TweetStation's source code is on github.

    Getting TweetStation

    You can get TweetStation from iTunes.

    Activating the Chicken Noises

    By default, the chicken noises are off. To turn on this features, go to "Settings" and in the "Poultry" section set "Chicken Noises" to the "ON" position.

    TrollStation Pro vs TweetStation

    Since this is going to become a FAQ, I wanted to address this here.

    I have two sets of keys that I got from Twitter to access the service using OAuth. One set of keys is the regular set of keys that anyone can get, and I attached the name "TrollStation Pro" to that one. This set of keys is what I placed on the public code on GitHub, so anyone can try and anyone can use. I reserve the right to change that name on a day-by-day basis depending on what I consider to be funny that particular day.

    The second set of keys are labeled as "TweetStation" and that one is used for the actual application on the AppStore. These keys are special because Twitter was kind enough to give me access to their service using "xAuth" which improves the login experience (no web browser is involved).

    Retina Display

    TweetStation was submitted to Apple before I could get my hands on an iPhone4, so it is missing the high-resolution artwork. I just submitted a build that contains high-resolution icons for the iPhone4.

    Updates

    Login bug: There is a login bug if your password contains any special characters. I have submitted a bug fix to Apple (including the Retina display update). For now you can work around this issue by changing your password to use letters and numbers.

    Posted on 01 Jul 2010 by Miguel de Icaza

    Guadec this year.

    This year I will be skipping the Guadec conference. Like Ted Gould we are expecting our first baby this year around the same time that Guadec will take place.

    The good news is that next year any of you attending my talk at Guadec 2011 will get to enjoy a presentation packed with baby pictures.

    I wish a happy Guadec to all the Gnomers attending!

    Posted on 30 Jun 2010 by Miguel de Icaza

    What I would do if I was in charge of Windows 8

    Apple and its AppStore did for software programmers what Google's AdWord did for bloggers and writers: it provided a mechanism for people to make money while doing what they love.

    The AppStore takes a big weight from the shoulders of software developers by taking care of the distribution and billing system.

    If I was in charge of the Windows 8 future (or MacOS for that matter), I would try to reproduce that formula on my mainstream operating system. And it seems from the leaked presentations that this is where Microsoft's head is.

    The leaked mockups for the AppStore are creative, but the entire slide deck misses the fundamental point that people are scared of installing software on Windows.

    Everyone is scared of installing applications on Windows either because they break the system or because you might be accidentally installing malware. In either case, the end result is countless wasted hours backing data up, reinstalling the operating sytem and all the applications.

    An AppStore wont fix this.

    For a Windows appstore to work, they need to guarantee that installing software wont ever break the system.

    They need to produce an appliance that allows users to install and remove software in seconds, and yet, guarantee that installing and removing apps will never break the system. This is not a problem that can be solved by hiring an army of curators and people that just sit all day rejecting apps.

    To solve the problem, Microsoft needs to both alter their kernel to ensure the safety of the host OS and come up with a new way of distributing applications. They need:

    • A sandboxed execution system.
    • Self contained applications, fully embedded in a single directory that require no installation.
    • A set of supported APIs that will run in the Sandbox execution system.
    • A public contract for extension points.

    The Sandboxed Execution System: would prevent applications from touching the registry, installing any drivers, any hooks, any visualizers or any other deep integration features that applications typically use to integrate with the OS.

    The sandboxed execution system would prevent applications from looking at the file system, except for locations that have been predetermined for sharing.

    The kernel would have to enforce what files they get access to, what devices and what components they get access to. And should be set to a bare minimum.

    Self Contained Applications would be required to install software from the network, or from their appstore. These applications would get absolutely no rights to modify anything outside their directory. Any extension points that they could register with the system ("open with") would have to be registered with the public extension point contract.

    Public Contract for Extension Points Any extension points like "open with", or handlers for mime-types would be self contained in a manifest in the application directory.

    Instead of having every app poking at the system registry and dumping their junk everywhere, applications would list all of their requirements from the operating system on the manifest and the OS would rebuild its internal data from all of the application manifests available from a user.

    Limited APIs: File access APIs, display access APIs would have to be altered to give applications limited access to the host operating system, and to give them as little access to anything that most applications do not need.

    The above obviously does not apply to frameworks like the .NET framework, Java or Adobe's AIR. But beyond frameworks, there are very few cases where an application really should have legitimate access to all of the features in the OS. Video games certainly do not need it, and even applications like Visual Studio would not need it.

    Posted on 28 Jun 2010 by Miguel de Icaza

    Moonlight 3.0, Preview 7

    Chris Toshok has just announced our 7th preview of Moonlight 3.0. You can get it from our preview site.

    What is new in this release:

    • Roughly API complete to SL4.0 beta. Next preview will be API compatible with SL 4.0 RTW.
    • Video capture support, but support for pixel formats is sparse. right now the supported formats are YUYV and YV12/YUV420 (planar).
    • SSE2 fast paths for gradient fills in the embedded pixman/cairo, this improves performance significantly as some people seem to have discovered the use of gradients.
    • Fixes for chrome support and to our curl bridge.
    • Several html bridge fixes.
    • element to element binding.
    • Client HTTP stack
    • cascading (BasedOn) styles are now supported
    • new right-click dialog so we can (finally!) managed isostore usage.
    Posted on 18 Jun 2010 by Miguel de Icaza

    Infragistics Announces Support for Mono

    Today Infragistics announced that their NetAdvantage for ASP.NET will support Mono out of the box.

    We loved working with Infragistics on this project, and I am very proud of the work that the Mono team did to get these fabulous controls working with Mono.

    You can read more about Infragistics and Mono on Infragistics site where you can also try out some of their sample applications running on Linux with Mono.

    From the press release:

    "In recent years, our customers have indicated that their organizations are moving to mixed IT environments and require UI tools that enable them to deploy applications in either Windows or open source environments," said Dean Guida, CEO of Infragistics. "With Mono compatibility in our ASP.NET toolkit, we enable developers who have a need for open source development to create UIs that are the basis for Killer Applications and deliver the best user experiences possible."

    Infragistics ASP.NET toolset excels in top performance, flexibility and usability and enables developers to build rich Web applications for line of business. By providing full compatibility with the Mono runtime, Infragistics extends this functionality to the Mono community.

    Coinciding with today's NetAdvantage for .NET 2010 Volume 2 availability, Infragistics highlights the ASP.NET toolkit's Mono compatibility through Sample Showcase hosted on a live Linux Server running Mono: http://mono.infragistics.com/

    For us this is a very important milestone as developers building .NET applications need to complement the core framework with packaged components like the ones that Infragistics provides.

    It also shows the maturity of the project, as commercial ISVs start supporting more Mono on Linux.

    Posted on 16 Jun 2010 by Miguel de Icaza

    We have released MonoDevelop 2.4

    We have finally released MonoDevelop 2.4. You can read a high-level description of the changes or see screenshots with the details. I would go for the screenshots myself.

    We made packages for OpenSUSE, SLES, Windows and MacOS X. For other Linux distributions, you should consult with your favorite package provider or you can build it yourself from sources.

    Congratulations to the team. They not only improved the UI and the editing experience, but they support Gtk#, ASP.NET MVC, Silverlight, MonoMac and MonoTouch deployments from the same IDE. We have also added support for WCF references and T4 macro processing.

    Next Steps for MonoDevelop

    For the next release we have a couple of big goals in mind for MonoDevelop:

    • Git support, using GitSharp.
    • Mono on Android support (debugging, templates, deployment).
    • Templates and support for MVC2.

    Support for Foo is missing

    As you can see from our list of MonoDevelop Tasks there are plenty of tasks that currently have nobody assigned to. This includes even popular features like F#, IronPython, IronRuby or PHP support.

    We have limited resources and a huge wish-list. If you want to help us take on any of those tasks, please join us on IRC at irc.gnome.org on channel #monodevelop, or join our mailing lists.

    Posted on 16 Jun 2010 by Miguel de Icaza

    Road to MonoDevelop 2.4: Navigation

    Perhaps my favorite feature in MonoDevelop 2.4 is the "Navigate To" functionality that we added. This new feature is hooked to Control-comma on Linux and Windows and to Command-. on Mac.

    This feature lets you quickly jump to a file, a class or a method:

    I used to navigate between my files by opening then from the solution explorer, and then using Control-tab or the tabs. Needless to say, the old way just felt too clumsy for a fast typist like me.

    With Navigate-To, I can just hit the hotkey and then like I would in Emacs, type the filename, type or method and jump directly to the method. This is fabulous.

    This will also search substrings, so you can either start typing the name of a method or you can fully qualify the method (for example: "Vector.ToString").

    But it gets better, you can use abbreviations, so instead of typing "DialogViewController" you can just type "dvc":

    BREAKING UPDATE Michael just told me of a cute extra feature: if your match is for a filename, if you type ":NUMBER" it will jump to the selected file to the specified line number.

    The result:

    Posted on 14 Jun 2010 by Miguel de Icaza

    Conditional Attribute

    One cute feature of C# 1.0 was the introduction of the Conditional attribute. When you apply the conditional attribute to a method, calls to this method are only included in the resulting code if the appropriate define is set.

    For instance, consider:

    	[Conditional ("DEBUG")]
    	void Log (string format, params object [] args)
    	{
    		Console.WriteLine (String.Format (format, args));
    	}
    	

    Calls to Foo.Log become no-ops unless you pass the -define:DEBUG command line option to the compiler.

    What is interesting about this compiler-supported feature is that that the code inside the method Log is checked for errors during compilation as any other regular method. They are first class citizens.

    Posted on 12 Jun 2010 by Miguel de Icaza

    My first iPhone app

    I am proud to introduce my first iPhone App built entirely using standard HTML5 technologies.

    I felt that I had to go with HTML 5 as I did not want to write the app once for the iPhone and once for the Android. I am also open sourcing this application in its entirety, to help future generation of mobile HTML 5 developers learn from my experiences and hopefully help them write solid, cross platform mobile applications using HTML 5.

    I use this app every time we go to a pub, or when we are having lunch at the Cambridge Brewing Company.

    Before you check it out, my lawyer has advised me that I need to add the following disclaimer:

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    I give you: iCoaster.

    Stay tuned for my Cheese Table app, coming soon to the iPad.

    What People Are Saying about iCoaster!

    From my survey on iCoaster for iPad:

    "I am currently resorting to use my four iPhones to create one giant iCoaster; this is ridiculous. Need iCoaster HD!!!!"

    "Buying an iPad every time I want to put a drink down is expensive, though it is better than getting those little rings all over my shiny new table."

    "Four coasters per iPad would be ideal"

    "Please keep up the great work. Not sure what I would do without this app, would at least have a lot of ruined coffee tables."

    Sadly, we do have some bugs being reported, and I can assure everyone that I am working around the clock to fix these issues. Ensuring that iCoaster is reliable is my top priority:

    "If I put my drink on iCoaster, and then rotate my phone to the landscape orientation, my drink gets spilled onto my lap. Please fix this in the iPad version."

    Survey Results as of 14:50 EST

    Updates

    Update: We have confirmation that it works on WebOS and Blackberry as well. HTML5 FTW!

    Update 2: Due to popular demand, I am launching an effort to bring iCoaster to the iPad. If you want to participate in the beta for iCoasterHD, please fill in this survey, your feedback will help me prioritize features.

    Update 3: iCoaster works on walls too: http://yfrog.com/c9wlkogj.

    Update 4: For those of you complaining about the missing DOCTYPE Geoff Norton has done what any honorable open source contributor would have done: he forked iCoaster and made it HTML "compliant": icoaster-fork.

    Update 5: After today's brouhaha over Apple's HTML 5, Mike Shaver from Mozilla talks about the elephant in the room.

    Update 6: iCoaster's HTML 5 fork has been forked to support full-screen on WebKit and Opera browsers.

    Update 7: We have a Silverlight port! This enables iCoaster to run on the upcoming Windows Compact Edition Media 7 Series Phone Embedded Release Plus Pro Advanced.

    Update 8: We got a Unity port of iCoaster, and showing true open source spirit, sethillgard open sourced the code.

    Posted on 04 Jun 2010 by Miguel de Icaza

    First Beta of MonoTools 2 for VisualStudio

    Last week we released our first beta for the upcoming MonoTools2.

    There are four main features in MonoTools 2:

    • Soft debugger support.
    • Faster transfer of your program to the deployment system.
    • Support for Visual Studio 2010 in addition to 2008.
    • Polish, polish and more polish.

    Getting Started

    Download our betas from this page. On Windows, you would install our plugin for either 2008 or 2010 and you need to install Mono 2.6.5 on the target platform (Windows, Linux or MacOS).

    On Linux, run `monotools-gui-server' or `monotools-server', this will let Visual Studio connect to your machine. Then proceed from Windows.

    On MacOS, double click on the "MonoTools Server" application.

    Once you run those, MonoTools will automatically show you the servers on your network that you can deploy to or debug:

    ASP.NET debugging with this is a joy!

    Soft Debugger

    This release is the first one that uses our new soft debugger. With is a more portable engine to debug that will allow our users to debug targets other than Linux/x86 for example OSX and Windows.

    This is the engine that we use on MonoTouch and that we are using for Mono on Android.

    Our previous debugger, a hard debugger, worked on Linux/x86 systems but was very hard to port to new platforms and to other operating systems. With our new soft debugger we can debug Mono applications running on Windows, helping developers test before moving to Linux.

    Faster Transfers

    When you are developing large applications or web applications, you want your turn around time from the time that you run hit Run to the site running on Linux to be as short as possible.

    Cheap Shot Alert: When dealing with large web sites, we used to behave like J2EE: click run and wait for a month for your app to be loaded into the application server.

    This is no longer the case. Deployments that used to take 30 seconds now take 2 seconds.

    Support for Visual Studio 2010

    Our plugin now supports the Visual Studio 2010 new features for plugin developers.

    This means you get a single .vsix package to install, no system installs, no registry messing around, no dedicated installers, none of that.

    The full plugin installs in 3 seconds. And you can remove it just as easily.

    Then you can just from VS's Mono menu pick "Run In Mono" and pick whether you want to run locally or remotely.

    We now also support multiple profiles, so you can debug from Visual Studio your code running on Linux boxes, Mac boxes or your local system.

    Polish and more Polish

    MonoTools was our first Windows software and we learned a lot about what Windows developers expected.

    We polished hundreds of small usability problems that the community reported in our last few iterations. You can also check our release notes for the meaty details.

    Appliances

    And we integrate directly with SuseStudio to create your ready-to-run appliances directly from Visual Studio.

    Posted on 03 Jun 2010 by Miguel de Icaza

    Linux for Consumers: MeeGo Updates

    Excited to see the work happening on the Linux consumer space in the MeeGo Universe. There is now a MeeGo 1.0 download available for everyone to try out.

    At Novell we have been contributing code, design and artwork for this new consumer-focused Linux system and today both Michael Meeks and Aaron Bockover blog about the work that they have been doing on MeeGo.

    These screenshots are taken directly from Aaron's and Michael's blog posts. Aaron discusses the new UI for the music player Banshee and Michael discusses the new UI for the Email/Calendar program.

    Media Panel in MeeGo

    You can still get access to the full Banshee UI themed appropriately:

    Themed MeeGo UI for Banshee

    Check Aaron's blog for the details on the design process and the new features coming out for it.

    Then, on the Evolution side of things Michael discusses Evolution Express a renewed effort to make Evolution suitable for netbooks. The work done there is amazing, here are some screenshots:

    Evolution Express on MeeGo

    Just like Banshee, Evolution now integrates with MeeGo panels, like this:

    Summary of your tasks on the MeeGo Panel

    This is what the new preferences panel looks like:

    Themed MeeGo UI for Banshee

    And finally the calendar:

    Evolution Express Calendar on MeeGo

    Third Party Applications

    You can also run existing Mono applications on MeeGo. I give you the photo management application F-Spot:

    F-Spot on MeeGo

    And this is Jonathan's Pinta painting program built on Mono with Gtk#:

    The Mono-based paint program Pinta

    Pinta is fascinating as it shows how much punch can be packed by CIL code. Pinta and all of its effects use 328k of disk space and for distribution it only takes 108k of disk space.

    Development Tools

    And we are of course very happy to be supporting developers that want to target MeeGo using Windows, Mac or Linux with our MonoDevelop plugin for MeeGo.

    If you are more of a Visual Studio developer, our upcoming MonoTools for Visual Studio 2.0 will also support developing applications for MeeGo from Windows.

    MeeGo

    I am blown away by the way that everyone involved in MeeGo has been able to execute on the vision of bringing Linux to the consumer space by the way of the netbook.

    Kudos to everyone involved.

    Posted on 27 May 2010 by Miguel de Icaza

    MonoDroid - Mono for Android Beta Program

    We are hard at work on MonoDroid -- Mono for Android -- and we have created a survey that will help us prioritize our tooling story and our binding story.

    If you are interested in Monodroid and in participating on the beta program, please fill out our Monodroid survey.

    Here is what you can expect from Mono on Android:

    • C#-ified bindings to the Android APIs.
    • Full JIT compiler: this means full LINQ, dynamic, and support for the Dynamic Language Runtime (IronPython, IronRuby and others).
    • Linker tools to ship only the bits that you need from Mono.
    • Ahead-of-Time compilation on install: when you install a Monodroid application, you can have Mono precompile the code to avoid any startup performance hit from your application.

    We are still debating a few things like:

    • Shared Full Mono runtime vs embedded/linked runtime on each application.
    • Which IDE and OS to make our primary developer platform. Our options are VS2010, VS2008 and MonoDevelop and the platforms are Windows, OSX and Linux.

      We are currently leaning towards using VS2008/2010 for Windows during the beta and later MonoDevelop on Linux/Mac.

    Like we did with MonoTouch, we will bring developers into the preview in batches of 150 developers, please enter enough information on the "comments" section if you want to be in the early batches.

    Posted on 21 May 2010 by Miguel de Icaza

    Group Completion in MonoDevelop 2.4

    In our Beta for MonoDevelop 2.4 we introduced a new feature designed to help developers better explore a new API.

    Many developers use the IDE code-completion as a way of quickly navigate and explore an API. There is no need to flip through the documentation or Google for every possible issue, they start writing code and instantiating classes and the IDE offers completion for possible methods, properties and events to use as well as small text snippets describing what each completion does as well as parameter documentation:

    With MonoTouch, we were dealing with a new type hierarchy, with new methods. We found that our users wanted to explore the API through code completion, but they wanted more context than just the full list of possible options at some point.

    For example, the UIButton class has this hierarchy:

    Looking through the methods, properties and events of this class can be confusing, as for the UIButton class there were some 140 possible completions that came from the complete hierarchy. Sometimes the user knows that the method they want is a button-specific method, and as fascinating as UIResponder, UIView or UIControl might be, the method they are looking for is not going to be there.

    With MonoDevelop 2.4 we introduced a new shortcut during code completion that changes the completion order from alphabetic to grouped by type, with completions from the most derived type coming up first:

    To switch between the modes you use Control-space when the popup is visible. You can use shift-up and shift-down to quickly move between the groups as well.

    I have been using this feature extensively while exploring new APIs.

    Posted on 09 May 2010 by Miguel de Icaza

    MonoDevelop's New Search Bar

    MonoDevelop 2.4 was a release in which we focused on improving the ergonomics of the IDE. We did this in dozens of places and we did this by dogfooding the IDE and comparing it to other tools and environments that we have been using.

    With MonoDevelop 2.0 and earlier we used a dialog box like most other GUI applications from 2005. The dialog would remain on top of the text and the user would press next, and move the dialog box around as the matches were found.

    In the current MonoDevelop (2.2) we adopted a more Firefox-like UI, this is what the search bar looks like:

    We have a relatively big bar at the bottom of the screen, big labels, a drop down for picking previously searched items and an options menu that would let users pick manually case sensitivity, whole world matching or toggling regular expressions.

    This took too much space, in a prime location of screen real estate. Additionally, the features although present were hard to pick. You would start an incremental search with Control-f but if you wanted to change the settings, you would have to use the mouse to access the options menu. If you later changed your mind, you would have to change the defaults again.

    With the new release of MonoDevelop (2.4) we have changed this again, this time adopting the Google Chrome search bar and done a few other usability changes:

    The first thing to notice is that instead of taking valuable horizontal space in the form of a full row, we now only take a corner of the screen, and we take it on the top right corner which is less likely to contain the information you are looking for as you search forward.

    Case sensitivity searches now use the same model used by Emacs. If you start searching for a term and you type only lowercase letters, the search will be case insensitive.

    Searching for "thread" will match "thread", "Thread" or "THREAD". But if at any point during the search you type an uppercase letter, then the search for this particular activation will switch into case-sensitive search. Searching for "Thread" will only match the word "Thread" and not "thread" or "THREAD".

    And we also highlight matches like some Mac applications do, all matching words in the screen are highlighted, and the current match gets both a brighter color as well as a bubble that inflates and deflates on every match.

    The replace functionality is built into this new UI, and is accessed either with a hotkey (Control-H) or by clicking on the left-side icon:

    Just like Google Chrome, we use a watermark to show the number of matches in the document.

    MonoDevelop 2.4 is packed with new features, and I hope to blog about some of the design decisions of the new feature as time permits. In the meantime, check out the list of new features in the Beta for MonoDevelop 2.4.

    Posted on 06 May 2010 by Miguel de Icaza

    Pinta 0.3 is out

    Jonathan Pobst has announced the release of Pinta 0.3:

    Live Preview

    Pinta is a lightweight paint application for Linux, OSX and Windows written entirely in C# and using the Gtk# toolkit for its user interface. From the FAQ:

    Is Pinta a Port of Paint.NET?

    Not really, it's more of a clone. The interface is largely based off of Paint.NET, but most of the code is original. The only code directly used by Pinta is for the adjustments and effects, which is basically a straight copy from Paint.NET 3.0.

    Regardless, we are very grateful that Paint.NET 3.0 was open sourced under the MIT license so we could use some of their awesome code.

    Jonathan further adds that this release is very close to feature parity with the original Paint.NET.

    Posted on 03 May 2010 by Miguel de Icaza

    CLI on the Web

    In the last few days Joe Hewitt has been lamenting the state of client side web development technologies on twitter. TechCrunch covered the progress in their The State Of Web Development Ripped Apart In 25 Tweets By One Man.

    Today Joe followed up with a brilliant point:

    joehewitt: If CLI was the ECMA standard baked into browsers instead of ECMAScript we'd have a much more flexible web: http://bit.ly/sLILI

    ECMA CLI would have given the web both strongly typed and loosely typed programming languages. It would have given developers a choice between performance and scriptability. A programming language choice (use the right tool for the right job) and would have in general made web pages faster just by moving performance sensitive code to strongly typed languages.

    A wide variety of languages would have become first-class citizens on the web client. Today those languages can run, but they can run in plugin islands. They can run inside Flash or they can run inside Silverlight, but they are second class citizens: they run on separate VMs, and they are constrained on how they talk to the browser with very limited APIs (only some 20 or so entry points exist to integrate the browser with a plugin, and most advance interoperability scenarios require extensive hacks and knowing about a browser internal).

    Perhaps the time has come to experiment embedding the ECMA CLI inside the browser. Not as a separate plugin, and not as a plugin island, but as a first-class VM inside the browser. Running side-by-side to the Javascript engine.

    Such an effort would have two goals:

    • Access to new languages inside the browser, optionally statically typed for major performance boosts.
    • A new platform for innovating on the browser by providing a safe mechanism to extend the browser APIs.

    We could do this by linking Mono directly into the browser. This would allow developers to write code like this:

    <script language="csharp">
    from email in documents.ElementsByTag ("email")
    	email.Style.Font = "bold";
    </script>
    	

    Or pulling the source from the server:

    <script language="csharp" source="ImageGallery.cs"></script>
    

    We could replace `csharp' with any of the existing open sourced compilers (C#, IronPython, IronRuby and others).

    Or alternatively, if users did not want to distribute their source and instead ship a compact binary to the end users, they could embed the binary CIL directly:

    <script language="cil" source="MailApp.dll"></script>
    	

    Pre-emptive answer to the "view-source" crowd: you can use .NET Reflector to look at the source code of a compiled binary. If it is obfuscated, you will enjoy reading that as much as you would enjoy reading any Javascript in the real web.

    Embedding the CIL on the browser would create isolated execution environments for each page (AppDomain in ECMA parlance) and sandbox the execution system.

    The security model exposed by Silverlight exposes exactly what is needed to go beyond a language-neutral runtime. The security model distinguishes between untrusted code which is subject to verification, strict requirements on what it can do and limits what they can do from "platform" code that is trusted.

    Trusted platform code is granted special permissions that untrusted code is not given. The runtime enforces that no untrusted code can call into any security sensitive and protected areas.

    This would allow browser vendor to expose new APIs that get full access to the underlying operating system (for example getting direct access to special hardware on the system like microphones and camera) while enforcing that the user code accesses them only through safe gateways.

    This is very important to allow developers to try out new trusted APIs: new UI models, rendering systems and APIs built entirely on the same core.

    I am absolutely fascinated by the idea and I only regret not having come up with it. We have been too focused on the Moonlight-as-a-plugin to take a step back and think in more general terms: how can we use the ECMA CIL engine for *all* applications without a browser plugin.

    Joe like many of us is conflicted between the power of reach that the web has versus the polish and speed that native GUI toolkits deliver.

    Althought Silverlight provides a nice UI system inside the plugin, Joe's point is that we need a platform in which we can more quickly innovate new UI ideas, and probably completely different new ideas quickly. And with the ECMA sandbox model we can start testing new ideas without waiting for browser vendors to add the features themselves and we can make the integration between these plugins and the browser stronger than they have ever been.

    The plugin model does not provide the necessary tools to drive more innovation in the web. We need a new model, and I am ready to start prototyping Joe's idea.

    The only question is what browser to target first Firefox or Chrome.

    Gestalt

    Gestalt allows developers to use the CLI inside the browser and it shows what can be done with other languages in the browsers. It requires Silverlight to run and the interaction between the code and the browser is limited in the level of integration that can be achieved via the browser-plugin interface.

    This solves only the half the problem: multi-languages and does it in a limited way.

    Resources

    You can learn more about the security model in my previous blog post.

    Our open source Silverlight implementation.

    Posted on 03 May 2010 by Miguel de Icaza

    MonoTouch and Apple's Section 3.3.1: Two Theories

    Before April 8th, developers targeting the iPhone had to deal with this section:

    3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.

    The above is a pretty reasonable requirement as it gives Apple the chance to not have to maintain and support internal APIs, temporary APIs or APIs that have not fully matured.

    When iPhoneOS 4.0 was announced, the wording was changed to:

    3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

    This spelled disaster for many developers that had chosen to use other programming languages like C#, Delphi, Lua, Python, Javascript, Java, Scheme, ActionScript and a handful of others. It also put a stop to porting efforts for languages like Eiffel and other industrial languages that can be used on the iPhoneOS and the iPad.

    Much of the discussion for the rationale of these changes on the blogosphere has centered around personal language preferences. They amount to little more than the usual discussions of Mac vs PC or Emacs vs VI.

    When Greg from Tao Effect discussed this with Steve Jobs his reply shed light into the reason. There is a business reason, and possibly a UI reason. Here are my theories.

    Theory #1: The Business Case

    With the iPhone Apple revolutionized the phone market in a way that nobody had planned for. Microsoft, Nokia, RIM, HTC and everyone else was left to catch up with the user experience and the operating system. One year after the iPhone took the world by surprise, Apple opened up the developer stack, launched the AppStore and leapfrogged every competitor in the field.

    Apple had the first mover advantage in a space that they created: the high-end smart phone market.

    The problem that Apple faces is that now every competitor has a blueprint of what they need to aim for. Competitors now know what the minimum required user experience and features required are. And they all likely have plans on how they can differentiate themselves and add features that Apple does not have.

    And this is where Adobe enters the picture.

    Flash and Flex have a huge user base of developers that have been building web and desktop applications for the past few years.

    Although Flash applications on the iPhone do not look and act like native iPhone applications they are useful for a certain class of development. It would very likely attract Flash developers to the iPhone, but also Objective-C developers to Flash. Developers that probably are not interested in creating UITableViews or using the low-level APIs, but wanted to focus more on the interactive content creation or exploring new UI ideas or games.

    Flash's killer feature would be that the same code that ran on the iPhone would run on many devices with minimal changes. The applications do look alien on every platform, but not every application needs to use native controls. Games, storyboards, marketing tie-ins and a whole new class of ideas do not need a native UI.

    Flash would erode some of Apple's first mover advantage in the market they created. So section 3.3.1 was added to protect Apple's shareholder's interests.

    Apple being the #1 platform for mobile applications and being the largest distribution channel for those applications probably felt that it would be ok to do.

    Eventually, Android, Windows Mobile 7 and Nokia will catch up in terms of UI with Apple. It might take a few years before there is a marketplace as large as Apple's AppStore and a few years before these phones catch up to Apple's dominance in the space.

    My prediction is: When those platforms do catch up to Apple in terms of market share and applications Apple will lift the restrictions on section 3.3.1. Apple at that point will have nothing left to lose and everything to gain. Adobe will also bring Flash back to the iPhone as it will be a nice bump in revenues.

    Theory #2: The UI

    As I mentioned before, using cross-platform solutions like Flash or Silverlight would make every application look alien. But also like Steve Jobs alluded to, developers would not have access to new features on the iPhoneOS if they had chosen a technology that did not expose it.

    For example, when Apple introduced in iPhoneOS 3.2 the new split views that the iPad uses extensively when rotating your screen, that functionality would have taken too long to bring in a satisfactory way to say Silverlight on iPhone or Flash on iPhone. Or when Apple introduced the UIView that can be used to render maps, it would also have been challenging to embed this control. Or when Apple introduced GameKit, an API to connect iPhones and exchange messages between them.

    As a developer, I feel that I should be responsible for my technological choices. If I pick a cross-platform toolkit that looks horrible on the iPhone, it will just leave the space open for a competitor to do a better job. Or if my application does not take advantage of a new API in iPhoneOS, I am also leaving a flank open for a competitor to take over. Apple does not need to intervene with guidelines as the application quality, the AppStore, magazines, reviews and word of mouth are creating the conditions for an all-out darwinian survival of the fittest.

    Why MonoTouch has been misrepresented

    MonoTouch has been misrepresented, initially by Gruber and by most people covering the debate over section 3.3.1. Probably because few of them have actually used MonoTouch or because they are not familiar with .NET. Probably folks think that MonoTouch is .NET, and .NET is Microsoft's Java and draw their own conclusions.

    MonoTouch brings the C# language and the core of .NET to the iPhone, but does nothing to provide a cross-platform UI experience or for that matter any sort of mobile device cross-platform APIs.

    We bring the C# language, garbage collection, a type safe system that help reduce errors, make programmers happier and more productive on the iPhone while getting access to every single iPhoneOS API that they want to.

    We have also been able to expose new APIs that Apple has exposed in record time thanks to the fact that we are not really an abstraction layer over the iPhoneOS, but merely a compiler that talks to the native APIs.

    We released the iPad support 24 hours after Apple released the SDK. We released the iPhoneOS 4.0 support within days of the release (mostly because every one of us was pretty bummed out). Our APIs are a 1:1 mapping to the iPhone APIs.

    Just like C and C++, if developers want to reuse code between MonoTouch, Windows 7 or MonoDroid, they will have to split their UI and device-specific code from their business logic. MonoTouch does not provide such an abstraction layer.

    The "core of .NET" that I refer to previously means: garbage collection, type safety, the platform-invoke bridge, file and networked streaming APIs (contrast with the iPhone ones), XML and Json libraries, Language Integrated Query, access to web services and the ability to reuse hundreds of GUI-less libraries that have been created for .NET.

    We believe that MonoTouch does not erode Apple's first mover advange and nourishes the iPhone ecosystem by giving developers and users the native iPhoneOS experience.

    Posted on 28 Apr 2010 by Miguel de Icaza

    Mono's C# Compiler as a Service on Windows.

    The Mono team is proud to bring you a preview of C# 5.0 a few years before our friends in Building 41 do.

    A snapshot of the code is available in the demo-repl.zip file. This contains the csharp.exe C# REPL shell and the Mono.CSharp.dll compiler-as-a-service assembly.

    With Today's code drop all those scenarios now work:

    • Run Mono's C# compiler on .NET
    • Embed Mono's Evaluator in your C# app.
    • Use Mono's REPL with the .NET framework runtime.

    Update April 28th: I have now uploaded a new version that fixes the bug that people were getting when importing other libraries. Thanks to Marek for the rapid fix.

    Background

    Although we have had a compiler-as-a-service framework since September of 2008 it has been so far limited to Mono users, which effectively means only Linux and OSX users could use our C# REPL and the compiler as a service.

    The reason is that the Mono's C# compiler uses System.Reflection.Emit as its code generation backend. This API was fine for implementing C# 1.0 but required a few changes to support compiling its own core library (mscorlib, the equivalent of libc in C or rt in Java).

    When we started to work on our C# 2.0 support, we were working on our compiler as the language was being standardized at ECMA. Our compiler evolved faster than the underlying support for Reflection and Reflection.Emit did and this lead to more Mono-specific extensions being added to our Reflection and Reflection.Emit code. The more extensions that we depended on, the fewer chances we had of running with Microsoft's runtime.

    As time went by, Microsoft did improve their System.Reflection.Emit, but at that point, it was too late for us to go back to it.

    This had the unfortunate side effects that our compiler could not run on the Microsoft runtime. Now, this per se is not a major problem since Windows users likely use Microsoft's CSC compiler.

    But this also meant that our awesome compiler as a service could not be used by .NET developers and it also meant that our REPL shell could not be used with .NET and most importantly, neither one would run on Silverlight.

    Our compiler also relied heavily on our extended System.Reflection and System.Type as its own type system. And we could not just change our APIs for Microsoft's APIs to run on the Microsoft runtime.

    Today's commit at the coref replaces our dependency on System.Type and introduced our own Mono.CSharp.TypeSpec which lifts many of the restrictions that we had on System.Type. All of the hard computations that we had to do for inflating generics types are done here now and we can query the types without the backward Reflection limitations.

    With today's changes, not only we became more portable, but the move from System.Type to TypeSpec and MemberCache improved the compiler performance by 30% and fixes dozens of bugs that were very hard to fix with the previous compiler architecture.

    REPL Love

    We have a small guide on using the C# REPL on Linux.

    Caveat: both the Microsoft and the Mono C# compilers loads libraries from their "base directory", never from the Global Assembly Cache.

    In Mono, the csharp command happens to be in the same directory as the rest of Mono, so loading implicit libraries just works (Loading System.Core for example). But when running our csharp command on Windows, unless you put the binary in the same location as csc.exe the REPL wont be able to load libraries using their short names.

    This is particularly obnoxious because to use LINQ you need to use the full assembly name, or copy csharp.exe to the directory that contains System.Core so you can just do:

    	csharp> using System.Linq;
    	csharp> from x in "Foo" select x;
    	

    Future work

    Public API: There is still some work left to do: we need to turn 99% of the public API in that assembly into a private API, the only class you should care about is the Mono.CSharp.Evaluator class, the rest you should consider internal.

    The Evaluator API needs to evolve, right now it is a big singleton that exposes all of the variables defined as global variables. They really should be tied to some kind of context so we can support multiple and independent execution contexts on the same address space.

    Chances are that we want to expose some of the internals of the compiler to the world, but we first need to figure out what makes sense.

    Now that the code runs on .NET, hopefully those of you that wanted to embed it can provide us some feedback on how you would like to see this API change or even better, provide patches for it.

    C# as a DLR language: Someone had suggested to also provide a hook into the DLR, so you can instantiate C# eval engines with the same API that you instantiate IronPython and IronRuby eval engines.

    Silverlight support: in theory this works out of the box, but we have not tested it yet.

    Contributions: Yes, we are accepting contributions to this awesome compiler.

    Keybindings: Currently the csharp command line repl uses Emacs keybindings as part of my fabulous getline.cs command line editor. We are aware that developers of different faiths might find other keybindings more appropriate. We are taking patches.

    Add support for IKVM Reflection: Jeroen has written a drop-in replacement for System.Reflection[.Emit] that will allow us to decouple the compile from the profile that it compiles code for (Monoistas are familiar with dmcs, smcs, gmcs and mcs; We will be able to have a single compiler).

    Source Code and Hacking

    The source code for Mono's C# compiler, the Compiler as a Service and the interactive REPL are all available from SVN, do a checkout from our subversion repository for the module "mcs".

    Download from GitHub the "mono" module

    Then open the VS2008 solution in mcs/tools/csharp. This will build the Mono.CSharp compiler as a service library and the csharp tool.

    We do not typically provide VS Solution files for most of Mono, but we are making an exception for the compiler as a service to encourage .NET developers to play with it.

    Update: Our compiler is MIT X11 licensed, so even developers at Microsoft can download this code and look at it. It is all kosher guys!

    Posted on 27 Apr 2010 by Miguel de Icaza

    MonoMac Bindings: Blending Cocoa and .NET on OSX

    Today we released MonoMac, a new foundation for building Cocoa applications on OSX using Mono.

    MonoMac is the result of years of experimentation in blending .NET with Objective-C and is inspired by the same design principles that we used for MonoTouch.

    It is also the result of weekend hacking as our day to day work revolves around Mono's efforts on Linux servers, Linux desktops, Visual Studio integration and our mobile efforts. Luckily, it shares some components with MonoTouch.

    To get MonoMac, you need to get two modules from GitHub: monomac and maccore.

    Background

    Many years ago Geoff Norton produced CocoaSharp, the first set of .NET bindings to the Cocoa API. CocoaSharp was a fine first binding at the time and it was a good place to start learning about the challenges of binding Objective-C APIs to be consumed by .NET clients.

    Over the years three other frameworks were created to integrate the Objective-C world and the Objective-C APIs with C# and other .NET languages. Each one of these new frameworks had its pros and cons, and a year ago we made a call for all three competing frameworks to be merged, but sadly nothing came out of it.

    When we created MonoTouch, we wanted a binding for the Cocoa APIs that would fit the patterns and idioms used in the C# and .NET worlds, that would comply with the .NET Framework Design Guidelines and would allow give developers all the tools required to build full Cocoa applications.

    We had two main requirements: the binding should just work and the code should be MIT X11 licensed. For the binding to just work, we turned to the .NET Framework Design Guidelines book as it captures years of design decisions, programming idioms and advise that would help C# and .NET developers. By following the Design Guidelines we:

    • Avoid surprises
    • Blend with other C# and .NET libraries
    • Reduce the room for errors
    • Increase developer joy
    • Minimizes time for the developer to be productive
    • Every bit of existing .NET knowledge translates

    Luckily for us, .NET was designed from the start to be an interoperability framework. A framework that supports the most advanced requirements to make multiple runtimes and frameworks to communicate seamlessly with each other. We used these features to create our bindings.

    The above goals turned into the following technical requirements:

    • Developers should be able to consume Cocoa APIs as C# APIs
    • Allow developers to subclass Objective-C classes
      • Subclass should work with C# standard constructs
      • Derive from an existing class
      • Call base constructor
      • Overriding methods should be done with C#'s override system
      • Do not expose developers to Objective-C selectors
    • Provide a mechanism to call arbitrary Objective-C libraries
    • Make common Objective-C tasks easy, and hard Objective-C tasks possible
    • Expose Objective-C properties as C# properties
    • Expose a strongly typed API, for example instead of exposing the generic-container NSArray or individual NSObjects. This means that developers get a few benefits:
      • MonoDevelop can flag errors as you write the code
      • MonoDevelop can present documentation popups on types, methods, properties and parameters as you type them.
      • Minimize runtime errors by catching invalid casts at compile time.
      • Encourage in-IDE API exploration without rebuilding, and without having to look up the types in the documentation.
    • Turn int and uint parameters that should have been enums as C# enumerations and C# enumerations with [Flags] attributes
    • Expose the basic Foundation as C# native types:
      • NSString becomes string
      • NSArray becomes strongly-typed array
    • Events and notifications, give users a choice between:
      • Support the Objective-C delegate pattern:
        • Strongly typed version is the default
        • Weakly typed version for advance use cases
      • C# event system
    • Class libraries should be MIT X11 licensed, like the rest of Mono's class libraries.
    • Expose C# delegates (lambdas, anonymous methods and System.Delegate) to Objective-C APIs as "blocks".
    • Curated APIs: there is no point in binding every UNIX or CoreFoundation C API available, as those are not very useful in practice. Bind only those that are required to build applications or get access to mandatory functionality.

    More information about our API can be found here: http://monotouch.net/Documentation/API_Design

    Binding Cocoa

    Cocoa consists of two sets of APIs, one set is an object oriented C-callable API and another one is the Objective-C based API.

    C-based APIs were bound using a traditional P/Invoke approach where the C-based API is wrapped in a C# class. This includes APIs like AudioToolbx, CoreGraphics, CoreFoundation and CoreText. There is very little magic in these bindings, they are straight forward bindings, similar in spirit to what you would do if you wrapped those APIs for C++ use. I am in particular very proud of the much simpler AudioToolbox API.

    The Objective-C APIs is where the UI heavy lifting takes place and where most of the high-level functionality is found, and this includes APIs like Foundation and AppKit. The Objective-C APIs are bound using a new binding engine (MonoMac.ObjCRuntime) and the btouch binding generator.

    The btouch binding generator consumes an API contract in the form of a C# source file and generates a binding that matches the specified contract., for example, this is the API definition for the NSActionCell:

    	[BaseType (typeof (NSCell))]
    	interface NSActionCell {
    		[Export ("initTextCell:")]
    		IntPtr Constructor (string aString);
    	
    		[Export ("initImageCell:")]
    		IntPtr Constructor (NSImage  image);
    	
    		[Export ("target")]
    		NSObject Target  { get; set; }
    	
    		[Export ("action")]
    		Selector Action  { get; set; }
    	
    		[Export ("tag")]
    		int Tag  { get; set; }
    	
    	}
    	

    We produced a comprehensive guide to binding Objective-C APIs with MonoTouch that applies directly to MonoMac.

    Since a lot of the work of binding an Objective-C API is very repetitive, we have also included a header parser that does most of the heavy lifting in producing the above API from the Objective-C header file. The parser output then needs to be then massaged a bit to produce a binding that satisfies our design requirements. For example, NSArray arguments and return types must be looked up on the documentation and the proper strong typed inserted.

    Status

    Unlike MonoTouch, MonoMac is not a complete binding for all of the Cocoa APIs at this point. This has been a weekend effort for Geoff and myself but it has reached the point where it can be used for building applications and it has reached the point where we can start taking contributions to the effort.

    Currently MonoMac binds:

    • CoreFoundation (the parts that are needed, see the design principles)
    • CoreText (done)
    • CoreGraphics (done)
    • Foundation (the parts that are needed, and helper tools to support the rest)
    • AppKit (About 30% left to be done)

    If you are interested in advancing the state of MonoMac, we are currently looking for contributors to help us bind the other Objective-C frameworks and help us complete AppKit.

    Where we are going

    MonoMac is merely the library that gives C# developers access to the underlying APIs on OSX, it does not include the tooling necessary to create a full application bundle.

    Luckily, MonoDevelop has already most of the code needed in the form of the MonoTouch plugin. We will update this plugin to also support creating full application bundles for OSX.

    A new feature that developers will be interested in is the new "Mono bundler" tool that we are hoping we can include in Mono 2.8. This bundler examines your .NET application and generates an application bundle that contains both your application code and any dependencies that it needs from Mono in a self-contained package.

    This is the technology being used by Banshee on OSX today. The tool constructs a self-contained application based on your system installed Mono that you can distribute to your users, without requirement them to install Mono in the first place.

    But we need your help. There are many small and medium tasks that developers can help us with that will free our already busy weekends and will allow us to have a full MonoMac experience done in a shorter period of time.

    The more help we get, the sooner this will be done.

    We need contributors in the following areas:

    • API binding for the rest of the Frameworks
    • We need samples to be written
    • We need tutorials to be written (like the ones we did for MonoTouch)
    • We need to port existing Cocoa samples to C#:
      • To exercise the binding
      • To serve as reference for new developers
      • To identify missing frameworks
      • To prioritize bindings
    • We need to alter MonoDevelop's plugin to produce OSX Application bundles.

    Please join us on the mono-osx mailing list to discuss the future of MonoMac.

    Update Currently this requires a preview Mono to work from http://mono.ximian.com/monobuild/preview/download-preview/

    Posted on 19 Apr 2010 by Miguel de Icaza

    MonoTouch 3.0

    We have just released MonoTouch 3.0.0 with support for iPhoneOS 4.0's new APIs. To try it out, you need to have Apple's iPhone 4.0 SDK installed otherwise MonoTouch 2.0 wont let you download the new toolkit (since it is Apple confidential at this point).

    This release is a preview, the final release will be some sort of 3.0.XX number.

    This release includes API support for the features that Apple announced last week, in broad terms:

    • Background application support
    • iAd support
    • Local notifications
    • Game Center support
    • Support for enterprise data protection

    We also sneaked in some new work that is not bound to the iPhoneOS 4.0 API and can be used when building for iPhoneOS 3.1.x and 3.2.x:

    • Size reductions:
      • Linker updates to reduce executable size
      • More fat trimmed from the final executable.
      • "Hello world" is 500k slimmer now
    • Native support for Objective-C blocks on the binding generator:
      • Exposed as C# delegates
      • Both lambdas and anonymous methods can be used as blocks
      • Standard C# semantics for variable capturing
    Posted on 16 Apr 2010 by Miguel de Icaza

    Moonlight 3 Preview 6

    We have released a big update to Moonlight on Linux, our Moonlight 3, Preview 6.

    New in this release:

    • Chrome support and chrome packages
    • Many performance improvements
    • Most Silverlight 3 features are in now, including taking apps out-of-browser
    • Hundreds of bug fixes and improvements our Silverlight 3 compatibility story

    Remember to file bug reports. If you do not file a bug report, we have no way of knowing that something is not working.

    Posted on 16 Apr 2010 by Miguel de Icaza

    ECMA 2010 Common Language Infrastructure Public Draft

    The ECMA working group that drives the Common Language Infrastructure standard (ECMA 335) has published the working draft for the 2010 edition of the standard.

    These are the work-in-progress documents that the team is working on.

    In addition to the Novell mirror copy above, you can get the standard from the following sites:

    Posted on 09 Apr 2010 by Miguel de Icaza

    MonoTools for Visual Studio 1.1

    We just released our updated version of MonoTools for Visual Studio:

    A tool that helps Windows/.NET developers target Linux systems directly from Visual Studio, this release is still intended to be used with Visual Studio 2008 and includes some important improvements:

    • Smarter Remote File Copying
    • Automatically Detect Future Updates
    • Preview of Visual Studio 2010 Support
    • Easier Packaging of Precompiled Web Applications

    We are hard at work on our 2.0 release that will include soft-debugging support, MacOS support and will also run with Visual Studio 2010.

    Posted on 05 Apr 2010 by Miguel de Icaza

    C#, Mono and the Google Summer of Code

    This year, Michael Hutchinson is the administrator for Mono's involvement in the Google Summer of Code.

    We are looking for motivated students that would like to either work on one of the ideas that we listed in our Student Projects page like work on MonoDevelop's IDE, Mono's runtime, Mono's class libraries and in Mono-based applications.

    Additionally, if you are a student and you have been thinking "The Mono guys really should do...", do not hesitate and propose your idea. Perhaps you get to implement your idea, get paid to do so, and be mentored by our group of awesome C and C# hackers.

    If you are a student, you can apply here and Google has a convenient list of frequently asked questions about the program.

    Remember: There are only 3 days left.

    Posted on 05 Apr 2010 by Miguel de Icaza

    The Right Spirit

    From Steve Jobs 1997 presentation when he announced his partnership with Microsoft:

    Where we are right now is, we are shepherding some of the greatest assets in the computer industry.

    If we want to move forward, seeing Apple helping an prospering again.

    We have to let go of this notion that for Apple to win, Microsoft has to lose. We have to embrace the notion that for Apple to win, Apple has to do a really good job. And if others are going to help us, that's great. Because we need all the help we can get. And if we screw up and do not do a good job, it is not somebody else's fault, it is our fault.

    So I think that is a very important discussion.

    If we want Microsoft office on the Mac, we better treat the company that puts it out with a little bit of gratitude. We like their software.

    So the era of setting this up as a competition between Apple and Microsoft is over as far as I am concerned. This is about getting Apple healthy and this is about Apple being able to make incredibly great contributions to the industry and get healthy and prosper again.

    I feel exactly this way about open source. For open source to win, we do not need Microsoft, Apple or proprietary software to lose. The industry is not a zero-sum game, not only we enrich each other's platforms by exploring different ideas, but it is also incredibly healthy for the industry to have a blend of different approaches to computing.

    Open source software leads in some areas in the industry and we as a community are very proud of its success. But when it comes to the areas where open source has not delivered a full solution like our proprietary competitors have, we resort to finger pointing and blaming others.

    Some in the open source movement would like all the software in the industry to be open source/free software. Desktops, servers, games, embedded systems and everything that every human touches.

    Although it is a noble goal, it has set people up for suffering by making the goal unachievable. It has been 15 years since the rise of the first large open source companies and by now we should know that our dream of a pure open source stack ruling the world is not going to happen any decade now.

    Luckily, today, we have a much better understanding of where open source works and where it does not.

    It would do us good to ponder Steve's 1997 message:

    And if others are going to help us, that's great. Because we need all the help we can get. And if we screw up and do not do a good job, it is not somebody else's fault, it is our fault.

    Once again, I want to recommend Ben Zander's The Art of Possibility book, a book with various recipes on how to look at the world through new eyes.

    Posted on 03 Apr 2010 by Miguel de Icaza

    Microsoft and .NET

    It seems that David's article on Windows strategy tax on .NET lacked enough context for my actual quotes in there.

    When David contacted me, he was writing a piece on the evolution of .NET and since he was speaking to Microsoft, he wanted to get feedback from other people on what we thought Microsoft got right and what they got wrong. This is how my email to David started:

    Well, I am a bit of a fan of large portions of .NET, so I might not be entirely objective. You might want to also get some feedback from a sworn enemy of Microsoft, but you should get at least the statements from a sworn enemy that has tried .NET, as opposed to most people that have strong opinions but have never used it.
    David said:
    Given your familiarity with the framework, are there any iterative changes that you find questionable or you feel require some explanation?
    There are certain areas that I do not quite like about .NET, they are not major issues as they can be either worked around or ignored (to some extent), but here are some.

    And this is where the quote on Microsoft shooting the .NET ecosystem comes from, I reproduce from my email for the sake of completeness, none of this is a secret:

    The most important part is that Microsoft has shot the .NET ecosystem in the foot because of the constant thread of patent infringement that they have cast on the ecosystem. Unlike the Java world that is blossoming with dozens of vibrant Java virtual machine implementations, the .NET world has suffered by this meme spread by Ballmer that they would come after people that do not license patents from them.

    Sun on the other hand said from day one: we will not sue you over patent infringement if you implement your own Java. Google does something similar with their APIs and Google's Wave: they are giving everyone access to their stuff.

    As the only implementor of the ECMA standards outside of Microsoft, I sure would have hoped that they had given rights to everyone to implement. They would still be the #1 stack, but it would have encouraged an ecosystem that would have innovated extensively around their platform.

    Instead, people went and innovated on Java or other platforms that might not have been as advanced as .NET, but at least they were not under Microsoft threat.

    Google could have used .NET, Rails could have been built on .NET, the Wikipedia and Facebook could have been built using ASP.NET.

    All of those are failed opportunities. Even if the cross-language story was great, the web integration fantastic, the architecture was the right one to fit whatever flavor of a platform you wanted, people flocked elsewhere.

    This is their largest mistake, and it is perhaps too late to do anything about it.

    It took Microsoft eight years, a new management and a fresh set of eyes to change some of these mistakes. The veil of threats that existed over the runtime in 2001 was lifted with the Community Promise announcement but it took eight years, and those were eight years of lost opportunity and FUD directed at all things Microsoft.

    I still believe that Microsoft lost a great opportunity of having .NET become the universal runtime of the net, and they could still have the best implementation. I still believe that they should put the rest of .NET under the Community Promise or OSP and even with Mono as an open source implementation, they would retain their edge.

    On Innovation on other Runtimes

    David quotes Ted Neward (a speaker on the .NET and Java circuits, but not an open source guy by any stretch of the imagination). Ted tried to refute my point about Java and innovation but seemed to have missed the point.

    The article attributed this to Ted: "Microsoft has made an open-source CLI implementation codenamed 'Rotor' freely available, but it has had little or no uptake".

    There is a very simple reason for that. Rotor was not open source and it was doomed to failure the moment it came out. When Microsoft released Rotor in 2002 or 2003 they had no idea what they were doing and basically botched the whole effort by using a proprietary license for Rotor.

    Rotor's license was "look but do not touch" and prohibited commercial use of it. This is a non-starter for anyone that wants to call their software open source. Had Rotor been open source, we would have just used that instead of building Mono and we would have invested in it.

    The article also gets the facts on the interest on Java virtual machines wrong. Certainly only a handful are used for large server deployments, but minor Java VMs were part of the Java culture for years. Fine-tuned versions of the JavaVM are used for all sorts of embedded scenarios and it has also been used extensively in research.

    The Jikes RVM Java implementation is still an important playground for researchers where new garbage collectors, code generator technology, large memory problems, and optimization have been prototyped and tested. The open source Kaffe was the first open source JIT engine and it lead to way for many developers to explore the problems of cross platform JIT compilation, Japhar lead the way for a full open source class library stack (this became GNU class path). The Cacao open source VM explored new code generation optimizations techniques that were eventually used by other JIT engines.

    In the industrial world, variations on Java were used for embedded systems, the most popular one today is Dalvik, Google's runtime for a Java-like runtime.

    The list above is by no means comprehensive and the above is merely the innovation that happened in the JavaVM world. What is clear is that .NET/ECMA CLI fixed a lot of the design mistakes in Java, improved in many areas and built on the knowledge that had been gained from Java.

    But my point about the ecosystem goes beyond the JVM, it is about the Java ecosystem in general vs the .NET ecosystem. Java was able to capitalize on having implementations on Linux and Unix, which accounts for more than half the web today. The Apache Foundation is a big hub for Java-based development and it grew organically.

    Had Microsoft been an open company in 2001 and had embraced diversity we would live in a different world. The awesome Mono team would probably be bigger, and the existing team members would have longer vacations.

    But for everyone that missed the point, luckily, Microsoft has new management, new employees that know open source, fresh new ideas, is becoming more open and is working actively on interoperability with third parties. They even launched the CodePlex Foundation.

    As I told David on that interview, I am still a fan of .NET, and we are going to continue working to bring Mono everywhere where we think we could improve developer's experience. We are actively working on improving Mono on Linux, Mono for MeeGo, Mono for OSX, Mono for the PlayStation, Mono for Xbox360, Mono for the Wii, Mono for the iPhone, Mono for Android and Mono everywhere.

    Just like everyone that complains about Sun's tight control over the Java development process, I have my own regarding Microsoft's development process for .NET. But that is just business as usual.

    The best C# and .NET days are ahead of us.

    Posted on 25 Mar 2010 by Miguel de Icaza

    OData Client goes Open Source

    Microsoft is trying to succeed where web services failed before with their new Open Data Protocol (oData).

    A few years ago, I had an epiphany when listening to Don Box talk about data services and web services. Web services and web sites are merely public facades to your internal databases. Web sites expose your database rendered as HTML while web services expose them in some sort of data format, defined on a case-by-case basis.

    With Web Services, developers need to define what bits of information should be exposed and how it is exposed (this applies to both SOAP and REST-based services). The problem is that developers might not have the time to spend on exposing every possible bit of interesting information that you maintain in your databases. Most importantly, there are very few web services that provide server-side queries making the information harder to mine.

    oData is a little bit different, for a given oData endpoint (like http://odata.netflix.com/Catalog/CatalogTitles) you can request that the server do some work for you, for example, you can pass a query that will limit the results to only those that you are interested in, and you can also specify the information that you are interested in.

    For example:

    It seems like Microsoft is doing the right things to get oData to be adopted. It reused Atom as the exchange format, made the services REST-based, it made client libraries available for many developer platforms and placed the spec under the OSP.

    Consuming oData sources

    Microsoft is taking a very Google-y approach with oData. They have created client libraries for a wide range of platforms to encourage adoption of this new way of exposing data.

    In addition to the JavaScript, Java, PHP, .NET and Objective-C bindings, Microsoft has announced that they will be open sourcing the .NET client library under the Apache 2 license. I was pleasantly surprised to learn that they were open sourcing this code, as we can consume it right away on Mono.n

    So this is good news for everyone that wants to consume the information. The bindings for .NET are in particular great since you get strongly typed client-side code that you can use to invoke remote servers.

    Producing oData: the need to open source System.Data.Services

    This is trickier, and I believe that if Microsoft wants to bootstrap the oData universe they need to seed this space not only with some existing services but also with an open source OData server implementation for Unix.

    I should further add that they should not wait a single minute and open their server-side .NET implementation if they want to accelerate the oData adoption.

    Let me explain why.

    Although the client libraries are great step to drive the adoption of the protocol for clients, it will do very little to unlock the data that sits today out in the web behind Linux servers running PHP, Java, Ruby or Python-based applications.

    At the end of the day, the client side code is a relatively simple parser for an XML file format. The server side on the other hand is much more complicated to get right.

    The server side requires a complete implementation of the query syntax, selection as well as access control and transaction support required to expose the data safely.

    It is clearly possible to implement the oData server technology, IBM did it for WebSphere, but this is an unnecessary wait. Placing a standard under the OSP and documenting it is not enough to drive open source or even third party implementations.

    If Microsoft were to open source their server side implementation of oData, we could overnight allow Linux users to expose their data in a format that can be mined. Linux users would only need to run a Mono front-end to the System.Data.Services library to expose the data that currently lives in their servers and is being served by Joomla, Wordpress, Rails, Django front-ends to become available as data services.

    Witness what happened with the M modeling language: great idea, OSP-covered, and yet the steep work required to implement it means that not a single implementation has been created in the 18 months since the project went public.

    Update: I stand corrected, Douglas Purdy points out that there is an open source implementation of M built with Javascript here.

    Ok, so not the best example, risking another egg in my face, I want to say that chances are that jsmeta is not a complete implementation of M.

    More on oData

    A detailed overview is available on the oData site.

    The best intro to oData that I have seen is Douglas Pourdy tour-de-force during the second day keynote as he walks through all the pieces in a span of 20 minutes.

    The MIX sessions on oData are packed with great information. The transaction and access control requirements on the server-side support are discussed on the How to create a feed for that session.

    If you want to explore oData services, you can use this Silverlight application to build your queries.

    Posted on 22 Mar 2010 by Miguel de Icaza

    Baby on the Way

    Laura and myself will become parents sometime this summer. This will be our first baby.

    A friend told me that "Most kids turn ok, despite of their parents" which I interpreted as a green light for raising our daughter with a touch of Dali-like surrealism.

    Also, as much as I love the Summer conference circuit, I will be skipping on most travel from May to October and spend some quality time nesting.

    Posted on 22 Mar 2010 by Miguel de Icaza

    Big Day in MonoLand

    Mark Probst found and squashed one of the hardest bugs in our upcoming garbage collector. Pablo from Codice has been testing the new GC under stress and posted a nice message to the list.

    Plenty of great feedback on deprecating old libraries and tools from Mono. We will have a lighter distribution. As things are coming together so fast and we are now well into the features we had planned for 3.0, we might end up just calling the next version 3.0 instead o 2.8.

    Andreia got Moonlight running on Chrome.

    Posted on 03 Mar 2010 by Miguel de Icaza

    Simplified User Interfaces on the iPhone with MonoTouch.Dialog

    At the core of the iPhone UI lies the UITableView, a powerful table rendering widget that is used by pretty much every application on the iPhone. The UITableView is a powerful widget that can render its data in many different ways based on how you configure the widget, these are all variations of the UITableView:

    This is one powerful widget.

    The contents of the UITableView are rendered by calling into a developer supplied set of routines that provide the data on demand. The protocol includes queries like "How many sections?", "How many rows in section N?", "What is the title for section N?" as well as callbacks to provide the actual contents of a cell. Although the widget is pretty powerful, creating UIs with it is a chore and a pain to maintain. The pain to maintain and the repetitive nature of the process leads to developers either spending too much time customizing each view, bare minimum configuration and lack of polish on certain configurations. As I ported many of the Objective-C samples to C# I found myself repeating the same process over and over.

    My fingers developed calluses, and at night I kept thinking that there should be a better way. But at the time, I was just doing a line-by-line port, I was not really ready to build a new API on top of it.

    Recently, when my favorite twitter client on the iPhone butchered its UI I figured I would write my own Twitter client. The first step was to create the account configuration for my twitter account. As you can imagine, the configuration is done with a variation of the UITableView. And once again I found myself setting up the model, responding to view events, sprinkling switch and if statements liberally all through my source code and just plainly not having any fun writing the code. This is how MonoTouch.Dialog was born.

    I wanted to reflection to allow a class to be mapped to a dialog box, something that would allow me to write a C# class and have it mapped to a UITableView, something like this:

    class TwitterConfig {
        [Section ("Account")]
          [Entry] string Username;
          [Password] string Password;
    
       [Section ("Settings")]
          bool AutoRefresh;
          bool AutoLoad;
          bool UseTwitterRetweet;
    }

    Instead of starting with the Reflection code to deal with this, I first created an in memory representation of the entire dialog. The idea was that the Reflection code would then be a bridge that could use the engine code.

    The engine code is built on the idea that each row could be a specific kind of widget. It could contain text, a switch box, a text editing line, a slider control, a calendar picker or any other kind of user created control. I call these "Elements" and I created a bunch of these:

    • BooleanElement: rendered with a UISwitch
    • FloatElement: rendered with a slider.
    • HtmlElement: when tapped, starts the web browser on a url.
    • StringElement: used to render plain strings.
    • MultilineElement: A multi-line string element.
    • RadioElement: a radio-item, to select one of many choices.
    • CheckboxElement: like the BooleanElement, but uses a checkbox instead of a UISwitch.
    • ImageElement: Allows the user to pick an image or take a photo.
    • EntryElement: text entry element.
    • DateTimeElement, DateElement, TimeElement: pickers for dates and times, dates and times.

    The MonoTouch.Dialog follows the Apple HIG for the iPhone and implements as much of the UI policy allowing me to focus on the actual application instead of focusing on the administrivia.

    Although the UITableView is built on the powerful Model/View/Controller setup that would allow it to scale efficiently to large data sets, most configuration pages and data entry pages do not require this complexity.

    Another feature is that it takes care of all the bookkeeping required to do text entry without any work from the programmer: accepting keyboard input, automatically switching to the next entry line on return, aligning all entry lines in a section, dismissing the keyboard with the last input is reached.

    Here is a sample of the API in action:

    var root = new RootElement ("Settings") {
      new Section (){
        new BooleanElement ("Airplane Mode", false),
      new RootElement ("Notifications", 0, 0) { Notifications }
      new Section (){
        new RootElement ("Sound"), { Sound },
        new RootElement ("Brightness"){ Brightness },
        new RootElement ("Wallpaper"){ Wallpaper }
      },
      new Section () {
        new EntryElement ("Login", "Your login name", "miguel"),
        new EntryElement ("Password", "Your password", "password", true),
        new DateElement ("Select Date", DateTime.Now),
        new TimeElement ("Select Time", DateTime.Now),
      }
    }
    	

    Once the RootElement has been created, this can be passed to a DialogViewController to manage it:

    var dv = new DialogViewController (root);
    navigation.PushViewController (dv, true);
    

    Reflection API

    The reflection API inspects a class and looks for fields that have some special attributes on them.

    Here is a sample class and how it is rendered:

    class AccountInfo {
        [Section]
        public bool AirplaneMode;
    
        [Section ("Data Entry", "Your credentials")]
    
        [Entry ("Enter your login name")]
        public string Login;
    
        [Caption ("Password"), Password ("Enter your password")]
        public string passwd;
    
        [Section ("Travel options")]
        public SeatPreference preference;
    }
    	

    As you can see, enumerations (SeatPreference) are automatically turned into a radio selection that uses the UINavigationController to navigate and the captions are computed from the field names, a behavior that you can customize with the [Caption] attribute.

    The attributes that are attached to each instance variable control how things are rendered and can be used to specify a variety of attributes like captions, images and overriding the defaults from MonoTouch.Dialog.

    Some Samples

    Code:

    new RootElement ("Settings") {
      new Section (){
        new BooleanElement ("Airplane Mode", false),
        new RootElement ("Notifications", 0, 0) { Notifications }
      new Section (){
        new RootElement ("Sound"), { Sound },
        new RootElement ("Brightness"){ Brightness },
        new RootElement ("Wallpaper"){ Wallpaper }
      },
      new Section () {
        new EntryElement ("Login", "Your login name", "miguel"),
        new EntryElement ("Password", "Your password", "password", true),
        new DateElement ("Select Date", DateTime.Now),
        new TimeElement ("Select Time", DateTime.Now),
      }
    }
    	

    LINQ and MonoTouch.Dialog

    Craig has written a great Conference application for the Mix 2010 conference. I helped him reduce the code size of the application by removing all of the repetitive code required to set up UITableViews for various pieces of the application with MonoTouch.Dialog. Since the conference application deals with a database schedule, I extended MonoTouch.Dialog to work better with LINQ.

    In the same spirit of the System.Xml.Linq API that allows you to create XML documents with nested LINQ statements, you can use MonoTouch.Dialog to create your entire UIs.

    For Craig's application, I wrote a SessionElement that allows sessions to be "starred" and shows both the title of the session as well as the location of the session.

    This code constructs the entire UI for the "My Schedule" tab. The data is populated on demand (Apple recommends that all views are loaded lazily)

    public class FavoritesViewController : DialogViewController {
      public FavoritesViewController () : base (null) { }
    
      public override void ViewWillAppear (bool animated)
      {
        var favs = AppDelegate.UserData.GetFavoriteCodes();
        Root = new RootElement ("Favorites") {
          from s in AppDelegate.ConferenceData.Sessions
            where favs.Contains(s.Code)
            group s by s.Start into g
            orderby g.Key
            select new Section (MakeCaption ("", g.Key)) {
              from hs in g
                select (Element) new SessionElement (hs)
            }
        };
      }
    }
    	

    That is it. The entire source code.

    So use any of the two models that you enjoy the most: Reflection for quick one-offs and quick data-entry or the Element API for more advanced user interfaces but without having to spend your life writing boilerplate code.

    I hope that this helps guys spend more time improving their applications, and less time writing boilerplate code.

    MonoTouch.Dialog is not perfect and does not have every possible bell and whistle that you might want to add. Although I do welcome patches for certain features, feel free to fork the code and patch at will to suit your needs.

    Posted on 23 Feb 2010 by Miguel de Icaza

    MeeGo Support in MonoDevelop

    We just landed the support on MonoDevelop's trunk to support developing applications that target MeeGo powered devices.

    MeeGo is a Linux-based operating system designed to run on mobile computers, embedded systems, TVs and phones. Developers would not typically use a MeeGo device as a development platform, but as a deployment platform.

    So it made sense for us to leverage the work that we have done in MonoDevelop to support the iPhone to support MeeGo. Unlike MonoTouch, we are not limited to running on a Mac, you can use MonoDevelop on Windows, Linux and OSX to target Meego Devices.

    Developers would continue using their Linux Workstation, their Windows PC, or their Mac to develop and test and the resulting cross-platform binary can be deployed and debugged remotely over the wire using Mono's Soft Debugger.

    In this video, I interview Michael Hutchinson as he demostrates the developer experience:

    The MonoDevelop/Mono that we will be supporting is entirely Gtk# based, both during development as well as during deployment.

    Posted on 22 Feb 2010 by Miguel de Icaza

    Using MonoDevelop to Debug Executables with no Solution Files

    Every once in a while I need to debug some Mono program that does not come with a solution. Either a program that was compiled using a Makefile or an executable that I installed with RPM on my system.

    Sometimes I would end up cretaing MonoDevelop solution that contained every source file, command line option and resource that I meticulously copied from the Makefile. In other words, I was in for a world of pain just to be able to use MonoDevelop's awesome debugger.

    Lluis offered this solution, and I am blogging it hoping that it will help someone else in the future. Follow these steps to debug a Mono executable and set breakpoints on the source code or class libraries source code:

    1. Create a Generic Solution

    Select File/New Solution and select Generic Solution:

    2. Open the Project Properties

    Double click on your project, in my case I called the project "compiler":

    3. Add an Execute Custom Command

    In your project select Custom Commands:

    Add a custom Execute command by selecting it from the "Select a Project Operation" option and point to your Mono executable:

    4. Load source files

    Use File/Open to load the source file where you want to set a breakpoint (the executable source or some class library source) and set your breakpoints:

    Then use Run/Debug to start your program in debugging mode (Linux and Windows users can use F5, MacOS X users can use Command-Return).

    Posted on 20 Feb 2010 by Miguel de Icaza

    What have we been up to?

    Every once in a while I would run into someone that will ask me what exactly we are up to in Mono. As Mono becomes larger, and various big projects "land" into the trunk, we can no longer do releases on a monthly basis. Some of the work that we do is inherently very attractive, things like new features, new libraries, new UIs and new frameworks. But probably more important are the efforts to turn our code into programming system products: fixing bugs, testing it, packaging it, supporting it, writing documentation, test suites, improving error handling, scaling the software, making it faster, slimmer and backporting bug fixes.

    I wanted to give my readers a little bit of an insight of the various things that we are doing at Novell in my team. This is just focused on the work that we do at Novell, and not on the work of the larger Mono community which is helping us fill in the blanks in many areas of Mono.

    MonoDevelop work

    We just released MonoDevelop 2.2, a major upgraded to our IDE story, and the backbone that allows developers on Linux to debug various kinds of Mono-based applications. With support for the new Soft debugging engine, it has allowed us to support debugging ASP.NET web sites, ASP.NET web services, Silverlight applications, Gtk# and Console applications with minimal effort. Since the soft debugger leverages Mono's JIT engine, porting the soft debugger to a new architecture is very simple.

    MonoDevelop 2.2 major goal was to create a truly cross platform IDE for .NET applications. We are off to a solid start with Linux, Windows and OSX support as well as solid support for C#, VB, Vala and Python.

    We are now turning our attention to MonoDevelop 2.4. This new release will incorporate many new UI touch ups which I will blog about separately.

    MeeGo/Moblin Support

    We have been working closely with the MeeGo (previously Moblin) team at Novell to offer a streamlined developer experience for developers on Windows, Mac and Linux to target MeeGo devices.

    Developers will be able to develop, test and deploy from their favorite platform software for MeeGo devices.

    Mono Service Pack

    A service pack release of Mono's enterprise supported ASP.NET release is ahead of us and we will be upgrading Mono from release 2.4 to release 2.6.

    This will bring to our customers support for all of the new features in Mono 2.6 with the added benefit that it has gone through four months of extra testing and polish.

    As part of this effort we are also upgrading the MonoTools for Visual Studio to support the new Mono Soft Debugger.

    Runtime Infrastructure

    Mono's runtime is being upgraded in various ways: we continue to work on integrating LLVM [1], productize our new copying garbage collector that can compact the heap, and make Mono scale better on multi-core systems with the integration of ParallelFX into Mono as well as re-architecting thread management and thread pools in Mono.

    A big upgrade for Mono 2.8 will be the support for obfuscated assemblies that insert junk in dead blocks. This is a feature that we never had, but with many Silverlight applications being deployed with these options we started work on this.

    We are working to improve our support for F# and together with various groups at Microsoft we are working to improve Mono's compatibility with the CLR to run IronPython, IronRuby and F# flawlessly in Mono. Supporting F# will require some upgrades to the way that Mono works to effectively support tail call optimizations. [1] LLVM: better use LLVM to produce better code, use it in more places where the old JIT was still required and expand its use to be used for AOT code.

    Mono for Mobile Devices

    We recently shipped Mono for the iPhone and we continue to develop and improve that platform. Our goal is to provide developers with a great experience, so we are doing everything in our power to make sure that every wish and whim of the iPhone developer community is satisfied. We are working to expand our API coverage, write helper libraries to assist developers, tune existing .NET libraries to run on Mobile devices, reduce startup time, and reduce executable sizes.

    But we have also just started an effort to ship MonoDroid: Mono for the Android platform. This will include a comprehensive binding to the Java APIs, but accessible through the JIT-compiled, 335-powered runtime engine.

    Our vision is to allow developers to reuse their engine and business logic code across all mobile platforms and swapping out the user interface code for a platform-specific API. MonoTouch for iPhone devices and the Monodroid APIs for Android devices.

    Head-less Tasks

    A big part of Mono's effort is in the development kit: the compiler, the tools and the server side components.

    Mono has now a complete C# 4.0 implementation that will be ready to ship with the next version of Mono. Anyone can try it today by building Mono from SVN. We are also porting our C# compiler to work with Microsoft's Reflection.Emit to enable us to run our C# Interactive Shell in Silverlight applications and to allow .NET developers to embed our compiler in their applications to support C# Eval.

    Our MSBuild implementation is very robust these days, and it will be fully supported in Mono 2.8 (and we will be backporting it to Mono 2.6 as well).

    On the ASP.NET front, we are working with third party vendors to certify that their controls work with Mono's ASP.NET (we will have some tasty announcements soon) and we are also catching up to the new features that are coming with .NET 4.0.

    WCF has turned out to be one of the most requested features. We had historically only paid attention to WCF for its Silverlight/Moonlight use cases, but as time goes by, more and more users are moving to WCF. We are working on completing our WCF support.

    On the ADO.NET front our major focus has been to complete the support for LINQ to SQL as part of the DbLinq project that we are contributing to. At this point we have no plans to implement Entity Frameworks due to the large scope of that project.

    Moonlight 3

    I do not need to say much about Moonlight 3. Moonlight 3 is one of our most visible projects right now due to the adoption of Silverlight and Smooth Streaming.

    By the first week of Feburary there had been 610,000 downloads of Moonlight 2.0 for Linux. This is only counting the downloads since the official release on December.

    Policy Changes

    Mono 2.6 was the last release of Mono to support the .NET 1.0 API profile. With Mono 2.8 we are going to drop the class library support for 1.0 and ship both 3.5 and 4.0 assemblies.

    With Mono 2.8 we are also switching the default tools and compiler to be 4.0-based as opposed to be based on the 3.5 profile. We will be doing a release of Mono 2.8 a couple of months after .NET 4.0 ships.

    Ciao!

    The above probably reflects the main focus of the team in the past three months. There are many community driven efforts that are very cool and that deserve their own space and a future blog post. Things like the amazing work that was done on Qyoto and the Synapse IM client come to mind.

    We look forward to a great year ahead of us.

    Posted on 17 Feb 2010 by Miguel de Icaza

    Valentine's Day Call to Action

    Everyone knows that in this day an age a software product is not complete until it offers a Desktop UI, a Web UI, and a front-end on the Appstore.

    We access beautiful web sites, we purchase 0.99 apps on our phones and install gorgeous native software on our desktops.

    The sysadmin community, once the backbone of Linux adoption, keeps asking "but what about me?". Indeed. What about them?

    What are we doing about these heroes? The heroes that ssh in the middle of the night to a remote server to fix a database; The heroes that remove a chubby log file clogging the web server arteries; The very same heroes that restore a backup after we drag and dropped the /bin directory into the trashcan?

    They are a rare breed in danger of extinction, unable to transition into a GUI/web world. Trapped in a vt100 where they are forced to by conditions to a small 80x24 window (or 474 by 188 with 6 pixel fonts on a 21 inch flat screen display).

    These fragile creatures need our attention.

    Today I am doing my part, my 25 cents to help improve their lives.

    I am releasing Mono Curses 0.4 a toolkit to create text-based applications using C# or your favorite CLR language.

    The combination of C#'s high-level features, Mono's libraries, Mono/.NET third party library ecosystem and the beautifully designed gui.cs, we can bring both hope and change to this community. Hope and change in the form of innovative text-based applications that run comfortably in 80x24 columns.

    What is gui.cs

    We know that hardcore sysadmins will want full control over what gets placed on the screen, so at the core of mono-curses we expose a C# curses binding.

    On top of this, we provide a widget set called "gui.cs". gui.cs was introduced in 2007 enjoying unprecedented public acclaim among a circle of five friends of mine. Eight months after its introduction, it experienced an outstanding 100% growth when a second application was written using it.

    Today, gui.cs is the cornerstone of great work-in-progress applications that any decade now will see the light of day. Including a new and riveting version of the Midnight Commander:

    With only 3% of features implemented progress is clearly unstoppable!

    I believe in dogfooding my own software before I unleash it to the world:

    On a typical 21" sysadmin setup: 474x188 with the "Sysadmin Choice" award winning 6 pixel font.

    Valentine's Day

    So in this Valentine's Day, after you are tired of spending quality time with your grandmother, making out with your significant other or a stranger you just met at the checkout line in Costco, consider donating. Donate some of your time towards building some nice applications for your favorite sysadmin. God knows that he spent the whole day monitoring the dmesg output, looking for a SATA controller failure and keeping an eye on /var/log/secure, waiting for your ex to deface your wordpress installation.

    And you have a choice, you can use Boo, IronRuby, IronPython, F# for building your app. VB.NET is also available if you want to teach your sysadmin a lesson in humility.

    Get inspired today with some of the old screenshots.

    Posted on 14 Feb 2010 by Miguel de Icaza

    Winter Olympics on Linux

    The amazing Moonlight Team lead by Chris Toshok just released Preview 2 of Moonlight 3 just in time for the Winter Olympics' broadcast:

    The player has some nice features like live streaming, Tivo-like "jump-back", accelerated playback and slow motion and it does this using Smooth Streaming which adjusts the quality of your video feed based on your bandwidth availability.

    Thanks to Tom Taylor, Brian Goldfarb and the rest of the team at Microsoft for assisting us with test suites and early access to some of the technologies in use at NBC Olympics. With their help we were able to make sure that Moonlight 3 would work on time for the event (with full 24 hours and 14 minutes still to burn!).

    As usual, the team did a great job, considering that we had to implement in record time plenty of Silverlight 3 features for Moonlight.

  • Release notes for Preview 2
  • List of Known Issues with the Olympics Player.

    Firefox 3.7 runs this code better than 3.5, and you can improve the performance by disabling the pixel shaders in Moonlight, like this:

    	MOONLIGHT_OVERRIDES=effects=no firefox
    	
  • Posted on 11 Feb 2010 by Miguel de Icaza

    Moonlight 3.0 Preview 1

    We have just released our first preview of Moonlight 3.0.

    This release contains many updates to our 3.0 support, mostly on the infrastructure level necessary to support the rest of the features.

    In the release:

    • MP4 demuxer support. The demuxer is in place but there are no codecs for it yet (unless you build from source code and configure Moonlight to pick up the codecs from ffmpeg).
    • Initial work on UI Virtualization.
    • Platform Abstraction Layer: the Moonlight core is now separated from the windowing system engine. This should make it possible for developers to port Moonligh to other windowing/graphics systems that are not X11/Gtk+ centric.
    • The new 3.0 Binding/BindingExpression support is in.
    • Many updates to the 3.0 APIs

    The above is in addition to some of the Silverlight 3.0 features that we shipped with Moonlight 2.0.

    For the adventurous among you, our SVN version of Moonlight contains David Reveman's pixel shader support:

    From Silverlight Parametric Pixel Shader.

    Posted on 03 Feb 2010 by Miguel de Icaza

    Mono at FOSDEM

    I will be arriving in Brussels on Saturday Morning for the FOSDEM conference. We have an activity-packed day on Sunday of all-things-mono.

    This is the current schedule, pretty awesome!

    Feedback requested: My plan is to do a state-of-the-union kind of presentation on Mono, but if you have a specific topic that you would like me to present on, please leave a comment, I will try to prepare for that.

    See you in Brussels!

    Posted on 02 Feb 2010 by Miguel de Icaza

    iPad - Inspirational Hardware

    iPad - Inspirational Hardware

    As a software developer, I find the iPad inspirational.

    Apple's iPad is not a new idea. They are not the first ones to think of a tablet and as many blogs have pointed out the Apple iPad is not everyone's dream machine, the hardware is lacking gadgets and the software is not that amazing.

    Five elements come together to revolutionize software:

    1. Price
    2. Multi-touch centric development
    3. Standard hardware available for consumers
    4. Apple's AppStore
    5. Large form factor.

    The iPhoneOS is a multi-touch centric operating system. For years application developers have been subjected to the tyranny of the mouse and keyboard. This has been the only input technology that developers could reliably depend on and expect to be available on the user's system. Any software that requires different input mechanism sees its potential market reduced.

    The mouse is a great device for certain class of desktop applications. But it has also led to applications that are incredibly frustrating to use. Software for editing music and audio is cumbersome. Find the target, drag it, move it, find the other button, click it, scroll, drag, click. Anyone that has used Garage Band to try to play along knows this. The same applies to software to paint or draw. The mouse and keyboard are poor substitutes for using your hands.

    On the iPhone, and now the iPad, the situation is reversed. Multi-touch is the only input mechanism that developers can depend on. Apple's iPhone helped create a community of developers that think in terms of taps, pinches and twirls instead of clicks, double-clicks and right-clicks. It is no longer an after thought. It is no longer a feature that is added if there is enough time in the schedule or enough budget. It is the only option available.

    Taps, pinches and twirls allow us to use the full expression of our hands to drive an application. And it is not just any multi-touch, it is multi-touch over the same surface where the application is providing feedback to the user. Software that respond to user input in the same way that a physical object responds to our physical contact is the key to create new user experiences.

    This is a whole new space in which we can research, a new space that we can explore and where we can create a whole new class of computer/user interactions. With the new form factor, we can now create applications that just made no sense on the iPhone.

    It is fascinating.

    The standardized hardware means that software developers do not have face testing their software with dozens of combinatorial options. There are only a handful types of systems. If the software works on the core systems, they will work on all consumer devices. Standardized hardware is at the core of the success of the console gaming market, developers test and develop against a uniform platform. Price is the cherry on top of the cake, this device will be mass produced and the affordable price means that it will have a deep reach.

    The possibilities for new computer/user interactions are no longer dampened by this market reality. As developers, a new door to invention and innovation has been opened for us. No longer will software developers have to cripple their user experiences based on the mouse and keyboard.

    For the past couple of years I have had some ideas for some software that I wanted to build on a touch-based computer, but the specter of having a small user base for my experiments always discouraged me. Ever since I heard the rumors about Apple producing a tablet computer I have not cared about what the device looked like, or what the software stack for it was going to be. I wanted to try new touch-based UI ideas, I have dozens of ideas that I want to try out. And with Mono, I get to do it in my favorite language.

    Posted on 29 Jan 2010 by Miguel de Icaza

    iPad Support for MonoTouch!

    We did it!   MonoTouch for iPad!

    24 hours after we got the iPad SDK we completed the support for the iPad for MonoTouch!

    To get started with iPad development, go to http://monotouch.net/iPad and follow the instructions.

    Let the iPad# hacking begin!

    Posted on 28 Jan 2010 by Miguel de Icaza

    Release-o-Rama

    Nice new releases of software that I use in the last few days.

    Banshee 1.5

    A new Banshee release, now supports new device syncing options, audiobooks, eMusic and GIO for non-local files. Gabriel has more details as well.

    Now with a fully self-contained Mono and Gtk+ stacks on OSX. On the OSX note, I recommend Michael Hutchinson's blog entries on how to package your Gtk# app for use in OSX as well as his article on how to make your Gtk# app integrate with OSX. Both based on the lessons of bringing MonoDevelop and MonoDoc to OSX.

    Jeroen Frijters released his IKVM.Reflection API. His API could be very useful for Reflection-Emit compiler writers, perhaps we could even use it in Mono's C# compiler to solve our long standing issues with Reflection. More research is needed on this area.

    Maurits Rijk has published a new version of GIMP# his Mono-based plugin engine that lets you write plugins in any Mono supported language. There are samples in C# 3, F#, Boo, Nemerle, Oxygene, IronPython, Java/IKVM and Visual Basic.

    Sandy released a new version of Tomboy, now supports exporting data in HTML format to the clipboard and jump Lists on Windows 7.

    Posted on 28 Jan 2010 by Miguel de Icaza

    24 hour race

    Another Mono-race, in 24 hours we are aiming to:

    • Support the iPad SDK from Apple (freshly baked and published).
    • Add MonoDevelop support for it.
    Posted on 27 Jan 2010 by Miguel de Icaza

    Preordering the Apple Tablet

    Posted on 25 Jan 2010 by Miguel de Icaza

    MVP Award

    Thanks to everyone that participated in the campaign to nominate me for a C# MVP award, when I got back to Boston I found on my piles of email that I am now part of the program.

    This is Pretty Sweet(tm). This will be a great opportunity to build more bridges with Windows developers and show them that there is an ECMA CLI life in the other side of the OS spectrum.

    Looking forward to the group picture!

    Posted on 11 Jan 2010 by Miguel de Icaza

    Mono at FOSDEM

    This year we will have a Mono Room at the FOSDEM Conference in Brussels. The FOSDEM conference is held on the weekend on February 6th and 7th.

    Ruben and Stephane organized the room and the speakers for the it. has posted the finalized schedule for the Mono activities at FOSDEM on Sunday.

    Here is the schedule, there are some pretty interesting talks:
    09:00 - 09:15Opening (Ruben Vermeersch, Stéphane Delcroix)
    09:15 - 10:00MonoDevelop (Lluis Sanchez Gual)
    10:00 - 11:00The Ruby and .NET love child (Ivan Porto Carrero)
    11:00 - 12:00Mono Edge (Miguel de Icaza)
    Lunch Break
    12:45 - 13:15The evolution of MonoTorrent (Alan McGovern)
    13:15 - 13:45Image processing with Mono.Simd (Stéphane Delcroix)
    13:45 - 14:15ParallelFx, bringing Mono applications in the multicore era (Jérémie Laval)
    Coffee Break
    14:30 - 15:30Building The Virtual Babel: Mono In Second Life (Jim Purbrick)
    15:30 - 16:00Moonlight and you (Andreia Gaita)
    16:00 - 16:30OSCTool - learning C# and Mono by doing (Jo Shields)
    16:30 - 16:45Smuxi - IRC in a modern environment (Mirco Bauer)
    16:45 - 17:00Closing (Ruben Vermeersch, Stéphane Delcroix)

    Posted on 11 Jan 2010 by Miguel de Icaza

    Pixel Shaders for Moonlight

    David Reveman has just posted a fascinating patch that debuts the support of pixel shaders in Moonlight.

    David's patch uses Gallium, and he says:

    The current implementation uses gallium's softpipe driver but hooking up the llvm driver as well should be a minor task and give significantly better software performance.

    [...]

    My current approach is to focus on getting all these things working in software first. By using a OpenVG backend for cairo we can incrementally move to using gallium and hardware for all rendering.

    Posted on 07 Jan 2010 by Miguel de Icaza

    Moonlight: Platform Abstraction Layer Lands

    Chris Toshok has landed the changes necessary to abstract Moonlight's engine from the platform.

    The platform abstraction layer lives in moon/src/pal and the Gtk+ interface lives in moon/src/pal/gtk.

    This is a necessary step to bring Moonlight to non-X11 powered GUI systems.

    Posted on 06 Jan 2010 by Miguel de Icaza

    C# Support for Tuples

    More Mono proof of concept extensions to C#.

    As part of the list of things I would like to see in C# is support for tuples in the language. They would show up in a few places, for example, to return multiple values from a function and assign the results to multiple values at once.

    In recent versions of the framework there is a new datatype called Tuple, it is used to hold N values, the Tuple for N=2 looks like this:

    	public class Tuple<T1, T2> {
    		public Tuple (T1 v1, T2 v2);
    		T1 Item1 { get; set; }
    		T2 Item2 {get; set; }
    	}
    	

    The tuple patch extends the C# language to allow multiple variables to be assigned from any Tuple, like this:

    	(user, password, host, port, path) = ParseUri (url);
    	

    The above would assign the four values to user, password, host, port and path from the call to ParseUri. ParseUri would be declared like this:

    	Tuple<string, string, string, int, string> ParseUri (string url);
    	

    Future Work and Ideas

    In addition to handling Tuples, I would like to extend this to support collections and IEnumerables as well, for example:

    	(section, header) = my_array;
    	

    The above would store my_array [0] in section, and my_array [1] in header.

    If the last element of a tuple is a collection, it could store the rest of the values from the collection or enumerable in the last element:

    	(query, page, other_options) = Request.QueryString;
    	

    The above would store the first item in the QueryString into query, the second into page, and the rest into the other_options array.

    Tuple creation syntax:I would like to add nicer support for creating Tuples as return values, it could just mirror the assignment syntax.

    	ParseUri ()
    	{
    		...
    		return (user, password, host, port, path);
    	}
    	

    Handling well-known types: In addition to Tuple, ICollections and IEnumerables, perhaps the compiler should know about older versions of Tuple like DictionaryEntry.

    Using statements: Today the using statement is limited to a single resource, with multi-valued return types, it could handle multiple resources at once, like this:

    	using (var (image, audio, badge) = iphoneApp.GetNotifications ()){
    	    // use IDisposable image
    	    // use IDisposable audio
    	    // use trivial int badge
    	}
    	
    Posted on 23 Dec 2009 by Miguel de Icaza

    New Moonlight Covenant has been posted

    As I mentioned a few days ago, there is a new covenant form Microsoft for Moonlight, it has been posted.

    Posted on 22 Dec 2009 by Miguel de Icaza

    Cena Linuxera en el DF, hoy

    Cena Linuxera/Monera hoy (Diciembre 22) en el bar/restaurante del Covadonga a las 7pm. Para todo p�blico (incluso talibanes).

    Direcci�n: Puebla 121 cerca de el Metro Insurgentes.

    Posted on 22 Dec 2009 by Miguel de Icaza

    C# String Interpolation

    We have discussed in the past adding support to C# to support string interpolation. I have cooked a patch that allows C# developers to embed expressions inside strings, like this:

    	var a = 'Hello {name} how are you?';
    	

    Single quotes are used for strings that will have expressions interpolated between the braces. The above sample is equivalent to:

    	var a = String.Format ("Hello {0} how are you?", name);
    	

    Currently the patch supports arbitrary expressions in the braces, it is not limited to referencing variables:

    	var a = 'There are {list.Count} elements';
    	

    This notation can be abused, this shows a LINQ expression embedded in the string:

    	var a = 'The {(from x in args where x.StartsWith ("a") select x).FirstOrDefault ()} arguments';
    	

    I am not familiar with what are the best practices for this sort of thing in Python, Ruby and other languages. Curious to find out.

    Update: after the discussion on the comments the syntax was changed to use $" instead of the single quote to denote a string that will be interpolated. Now you will write:

    	var a = $"There are {list.Count} elements";
    	var greeting = $"Hello {name} how are you?";
    	

    The updated patch is here.

    Posted on 20 Dec 2009 by Miguel de Icaza

    Debugging Silverlight/Moonlight Apps on Linux

    A little hidden feature from our release of MonoDevelop 2.2 and Mono 2.6 earlier this week was MonoDevelop's support for debugging Moonlight applications:

    Moonlight debugging is a feature that came together very recently, but we delayed Mono and MonoDevelop's release to make sure that we shipped with it.

    To debug, merely open your Moonlight/Silverlight project, set some breakpoints, and run your program (F5). Your app will be debugged.

    I did a quick screencast and annotated it:

    Posted on 17 Dec 2009 by Miguel de Icaza

    Releasing Moonlight 2, Roadmap to Moonlight 3 and 4

    Today we are making a few of announcements:

    • Moonlight 2 is complete: Moonlight 2, our open source implementation of Silverlight 2 is done.
    • An updated collaboration agreement between Microsoft and Novell to bring Silverlight 3 and 4 to open source Unix.
    • Microsoft has an updated patent covenant that will covers third party distributions.

    Update: Sean Michael Kerner covers the announcement and talks to Brian Goldfarb from Microsoft.

    Update 2: New covenant from Microsoft has been posted.

    2.5 API

    Moonlight 2 is a superset of Silverlight 2. It contains everything that is part of Silverlight 2 but already ships with various features from Silverlight 3:

    • Silverlight 3 Pluggable Pipeline, this allows developers to hook into the media decoding pipeline at various points:
    • Easing animation functions
    • Partial out-of-browser support
    • Writable bitmaps
    • Some of the new databinding features of XAML in Silverlight 3

    We are moving quickly to complete our 3 support. Microsoft is not only providing us with test suites for Moonlight but also assisting us in making sure that flagship Silvelright applications work with Moonlight.

    When it comes to prioritization of Silverlight 3 features, we are going to focus on getting the major applications that users want to use first. Sunday Night Football, the Winter Olympics and Bing's Photosynth support.

    Smooth streaming works really well. Visit the site and test the immediate seek, and play with the bandwidth limiter to see how Silverlight/Moonlight can adapt the video quality based ont he bandwidth available:

    Moonlight 2

    Moonlight 2 is the result of love and passion to bring the Silverlight runtime to Linux.

    Moonlight 2 engine consists of 142,000 lines of C/C++ code and 320,000 lines of C# code (125,000 lines of code came from Microsoft's open source Silverlight Controls).

    Moonlight is built on top of Mono 2.6 runtime, Cairo and Gtk+ and today supports Firefox on Linux. We are hard at work to support Google Chrome on Linux as well.

    Updated Patent Covenant

    We worked with Microsoft to make sure that Moonlight was available to everyone on Linux and BSD.

    Culturally, we started on two opposite ends of the software licensing spectrum. The covenant that was issued for Moonlight 1 and 2 covered every user that used Moonlight, but only as long as the user obtained Moonlight from Novell. This is a model similar to how Flash is distributed: there is a well-known location where you get your plugin.

    The open source world does not work that way though. In the open source world, the idea is to release source code and have distributions play the role of editors and curators and distribute their own versions of the software.

    Microsoft's intention was to expand the reach of Silverlight, but the original covenant was not a good cultural fit. We worked with the team at Microsoft (Brian Goldfarb and Bob Muglia's teams) to make sure that the covenant would cover the other Linux distributions.

    The new patent covenant ensures that other third party distributions can distribute Moonlight without their users fearing of getting sued over patent infringement by Microsoft.

    There is one important difference between the version of Moonlight that will be available from Novell and the version that you will get from your distribution: the version obtained from Novell will have access to licensed media codecs.

    Third party distributions of Moonlight will be able to play unencumbered media using Vorbis, Theora and Ogg inside Moonlight (and Silverlight), but for playing back other formats, they will have a few options:

    • Negotiating directly with the media codec owners a license (MPEG-LA, Fraunhofer).
    • Negotiate access to Microsoft's Media Pack with Microsoft.
    • Plug-in GStreamer or another commercial codec license into their Moonlight implementations.
    • Update: Use a hardware provided decoder like VDPau.

    Moonlight 3 and Moonlight 4 Collaboration Agreement

    As readers of my blog know, the Silverlight 4 feature set is something that is very interesting to me.

    If our experience with the positive feedback that we have gotten from MonoDevelop is of any indication Silverlight 4 will enable a whole new class of cross-platform .NET application development to take place. Like nothing we have seen before.

    We are thrilled to be working with Microsoft to make sure that we can improve, fix and fine tune Moonlight to meet those requirements and to do so in a purely open source fashion.

    Update: Team Silverlight blogs.

    Posted on 17 Dec 2009 by Miguel de Icaza

    Nine Months Later: Mono 2.6 and MonoDevelop 2.2

    About nine months ago we released MonoDevelop 2.0 and Mono 2.4. Today we are releasing the much anticipated upgrades to both. Mono 2.6 and MonoDevelop 2.2.

    For those in a hurry, binaries and source are available from:

    And if you want a quick mnemonic to remember this release, just think debugger! and cross platform.

    The Mono team and contributors worked on this release like we have never worked before. Thanks to everyone that reported bugs, filed feature requests, contributed code and helped newcomers with Mono.

    Mono 2.6 highlights:

    • WCF client and server, the subset exposed by Silverlight 2.0.
    • LLVM support, to improve performance on server/computational loads.
    • Continuations/Co-routine framework Mono.Tasklets (background info)
    • LINQ to SQL using DbLinq.
    • New Soft Debugger, integrated with MonoDevelop on Unix and OSX (background).
    • System.IO.Packaging.
    • csharp shell now supports auto-completion (press tab to complete)
    • xbuild can now build most msbuild projects.
    • Mono debuts a verifier and security sandbox (used by Moonlight).
    • More complete 3.5 API coverage.
    • This release includes Microsoft's open sourced ASP.NET MVC, ASP.NET AJAX and Microsoft's Dynamic Language Runtime.
    • Faster and slimmer.

    MonoDevelop 2.2 highlights (screenshots here and here):

    • MonoDevelop code is now LGPLv2 and MIT X11 licensed. We have removed all of the GPL code, allowing addins to use Apache, MS-PL code as well as allowing proprietary add-ins to be used with MonoDevelop (like RemObject's Oxygene).
    • User interface improvements: the first thing that MonoDevelop users will notice is that we have upgraded the UI to fit modern ideas. We borrowed ideas from Chrome, Firefox, Visual Studio, Eclipse and XCode.
    • ASP.NET MVC support, you can now develop, debug and build ASP.NET MVC applications from MonoDevelop.
    • New T4 Macro processor (Text Template Transformation Toolkit) integrated directly into the IDE (Mono's T4 is also available as a reusable library for use and abuse in your own programs).
    • Moonlight Project Support: you can now build, debug and run Moonlight applications using MonoDevelop.
    • New MacOS and Windows support. Check our feature matrix for details.
    • New Debugger support allows debugging Console, Gtk#, ASP.NET, iPhone and Moonlight applications.
    • Extensive text editor improvements:
      • Dynamic abbrev (Just like Emacs' Alt-/)
      • Code generator (Alt-Insert)
      • Acronym matching
      • Code templates
      • Block selection
      • C# Formatter
    • New refactoring commands:
      • Inline Rename (see screenshot).
      • Resolve Namespace
      • Rename Refactoring with Preview
      • Extract Method
      • Declare Local Variable
      • Integrate Temporary Variable
      • Introduce Constant
      • Move Type to Own File
      • Remove Unused Usings
      • Sort Usings
      • Create/Remove Backing Store
      • Keybindable Commands
    • Python add-in has graduated to be a supported plugin, includes code completion, syntax checking, method and class locator and code folding.
    • iPhone development plugin.

    The team is on #mono, #monodev and #monodevelop on irc.gnome.org fielding any questions you might have.

    Update: the diffstat results for Mono 2.4 to 2.6 on a 2 million line patch:

     7208 files changed, 1392400 insertions(+), 440016 deletions(-)
    

    About a million lines of new code in Mono.

    For MonoDevelop the patch is 750,000 lines and:

     2427 files changed, 464284 insertions(+), 120124 deletions(-)
    

    Roughly 300k lines of new code.

    Posted on 15 Dec 2009 by Miguel de Icaza

    Apple's Reply to Nokia

    I felt like an archaeologist trying to formulate a theory of what had happened there. I loved the feeling of trying to put together the story from a partial puzzle.

    The patent infringement lawsuit against Apple was a list of accusations and patent lists that Nokia claims that Apple infringes with their iPhone. But behind the background information provided in the legal document and the list of ways in which Nokia felt Apple had wronged them, it was difficult to put together a narrative. Scanning the discussion forums for clues did not lead to anything significant beyond the superficial analysis.

    As a software developer, and in particular a Linux software developer, I have mixed feelings about this lawsuit. Apple has not been exactly a model citizen when it comes to interoperability between Apple and Linux products while Nokia has embraced Linux, embraced open source development and contributed to the universal pool of software. But I also found myself enjoying using my iPhone and building software for the iPhone.

    I wanted to give both companies the benefit of the doubt. What had happened between these two companies that had forced Nokia to sue Apple?

    There were various possibilities.

    The lack of immediate response from Apple suggested that they were caught unprepared, but that was just a small chance. Probably the companies had been on negotiations and these negotiations broke off when they could not reach an agreement. The iPhone had taken the world by surprise, nobody had seen it coming and nobody had envisioned that Apple would not merely do an incrementally better phone, but it would be many times better than anything available at the time.

    When Apple launched the iPhone, Steve Jobs wanted everyone to know that iPhone's innovations were patented and that Apple planned to prevent others from copying those ideas.

    Apple's response to Nokia is a very educational document. It reads as a crash course on patent litigation when it lays out Apple's strategy for their defense. It is also a crash course on the patent system and how corporation work with international bodies to develop technology. But most importantly for me, it fills some the gaps of what happened behind the scenes.

    We do not know yet which company approached the other first about patent infringement. It could have been someone on Nokia's board that decided to extract some revenue from their patents to compensate for their business losses or it could have been initiated by Apple's team notifying Nokia that their new phones used some idea from their phones.

    What does emerge from Apple's reply is that Nokia tried to use the patents that they had pledged to license under reasonable terms to get themselves rights to Apple's juicier iPhone innovations. Nokia's pledged patents might be formidable patents and key to the implementation of certain cellular and WiFi communications, but by being pledged under F/RAND terms to various industry consortia they lost a significant amount of value. But what they lost in value, they made up in volume. This is in stark contrast with Apple's un-pledged, pristine, fully proprietary patents that Nokia and everyone but China are trying to get rights to.

    Posted on 12 Dec 2009 by Miguel de Icaza

    Marek Announces Mono's C# 4.0 has been completed

    Marek has just announced that Mono's C# compiler 4.0 is complete.

    To try it out, get the modules mono and mcs from our Anonymous Subversion Repository and build Mono like this:

    	$ mkdir $HOME/mono4
    	$ ./autogen.sh --prefix=$HOME/mono4 --with-profile4=yes
    	$ make && make install
    	
    Posted on 09 Dec 2009 by Miguel de Icaza

    Mexico 2009

    Voy a Mexiquito lindo estas vacaciones de Diciembre.

    Si quieren que nos reunamos para hablar de software libre, Mono, Linux, Moonlight, Silverlight, C# o para discutir por que La Mancha ya no escribe o el ultimo blog del Jetas mándenme un correo para ponernos de acuerdo.

    Posted on 03 Dec 2009 by Miguel de Icaza

    First MonoTouch Book is out!

    This was fast! Wallace B. McClure has written the first e-book on getting started with Mono on the iPhone with MonoTouch.

    This is a short e-book, 42-pages in size, but it is also very cheap, it is only 6.99 USD and will help you get started in no time with MonoTouch.

    Here is the table of contents:

    Table of Contents

    iPhone Requirements 2

    Development Strategies 3

    Web Development with ASP.NET 3

    MonoDevelop and MonoTouch 4

    Visual Studio .NET ➪MonoDevelop 4

    Classes in MonoTouch 4

    What Is MonoTouch? 4

    Namespaces and Classes 5

    Introduction to Development on the Mac with MonoDevelop 6

    Interface Builder 8

    Outlets 10

    Actions 14

    Deploying to an iPhone 15

    Mapping 17

    MKMapView 17

    The Application 18

    Annotating the Map 20

    Debugging 21

    Interacting with Other Applications 22

    UIPicker 22

    NSUrl 24

    UIAlertView 26

    UITableView 26

    DataSource 27

    Binding Data to a UITableView 29

    Customizing UITableView 30

    Accelerometer 33

    Settings 34

    Things to Watch Out For 37

    Resources Used 38

    Posted on 03 Dec 2009 by Miguel de Icaza

    Mono Developer Room at FOSDEM

    Stephane and Ruben are chairing the first Mono-developer room at the upcoming FOSDEM 2010.

    Ruben writes:

    As of now, you can submit your talk proposals! We want to make this a fun room and we want to accomodate all kinds of talks. For that reason, one thing we're experimenting with is having dynamic timeslots. Only want 15 minutes? That's okay! Need an hour? We'll see if we can squeeze it in! The most important factor is that it's interesting and fun.

    So send in your proposals, be it large earth-shaking projects, or little hackery experiments that make you giggle with hacker joy, we want to hear it. We have the complete Sunday to schedule. Still have questions? Email me: ruben @ savanne be.

    The submission form is here, go fill it in now! (Send in your proposals before December 20)

    See you there!

    Posted on 02 Dec 2009 by Miguel de Icaza

    Silverlight: Universal GUI toolkit

    The most important piece of news from last week's PDC was Microsoft's decision to turn Silverlight into the universal platform for building cross platform applications.

    The upcoming version of Silverlight will no longer be a Web-only technology. It will now be possible to build full desktop applications with Silverlight.

    Desktop Silverlight applications differ from the standard Silverlight in a few ways:

    • Full access to the host file system, like any other .NET application would have.
    • None of the socket connectivity limitations that are present on the sandboxed versioned of Silverlight. Full network access (we should build a MonoTorrent UI for it!)
    • Built-in Notifications API to show up bubbles to the user when they need to interact with the application.

    Although Moonlight has supported this mode of operation since day one, turning this into a standard way to develop applications was going to take a long time. We would have needed to port Moonlight to Windows and OSX and then we would have to bootstrap the ecosystem of "Silverlight+" applications.

    But having Microsoft stand behind this new model will open the gates to a whole new class of desktop applications for the desktop. The ones that I was dreaming about just two weeks ago.

    This was a big surprise for everyone. For years folks have been asking Microsoft to give Silverlight this capability to build desktop apps and to compete with Air and it is now finally here. This is a case of doing the right thing for users and developers.

    Desktop Tools in Silverlight?

    Now that this technology is available, perhaps it is a good time to start a movement to create a suite of Silverlight-based desktop applications.

    The benefits to me are many:

    • .NET applications that actually look good. In the past your choices were basically of Gtk# or Winforms, neither one really designed for this graphic-designer driven world.
    • We can join forces with Windows/MacOS developers to create the next generation of desktop applications.
    • Developers can tap into the large ecosystem of third-party controls that exists for Silverlight.

    For the Moonlight team, this means that there is a lot of work ahead of us to bring every Silverlight 3 and 4 feature. I think I speak for the whole Mono team when I say that this is exciting, fascinating, challenging and feels like we just drank a huge energy boost drink.

    If you want to help, come join us in the #moonlight or #mono channels on the IRC server at irc.gnome.org.

    Silverlight 4

    There are many other great features in Silverlight 4, but none as important as Silverlight becoming a universal runtime for the CLR. This is a revolution.

    If you are curious about all the new tactical features of the revolution, check Tim's Complete Guide to the new Silverlight Features.

    If you have the time, watch Scott's keynote's presentation where he introduced the new features (he starts at 1:02). I loved the use of HTML as a Silverlight brush (paint with HTML and even Flash). If you have time, these are some great sessions on Silverlight:

    Droolingly yours,
    Miguel de Icaza.

    Posted on 23 Nov 2009 by Miguel de Icaza

    Concurrency with DREAM

    Arne's presentation on concurrent programming at Monospace ago has been published.

    Posted on 12 Nov 2009 by Miguel de Icaza

    Apps

    Although making changes to Moonlight might be a very fun thing to do, for the longest time I have had this entry in my TODO list: "Blog about writing a video editor in Moonlight".

    As much as I love Gtk+ and the Gnome desktop, our contributions for our desktop applications and for Gtk+ come mostly from from folks developing on Linux for Linux (with a handful of exceptions). And we are a small fraction of desktop developers.

    In my mind what is interesting to me about building applications with Silverlight is that we can create an ecosystem of free software applications that run on all three major platforms: Windows, Linux and MacOS.

    A few years ago, as part of the Google Summer of Code for Mono we created a project that could have had a great future, the Diva project (by MDK). Sadly, Michael moved on to other things, but in the back of my mind, I always wanted to have a nice video editing application for Linux.

    I like to think that with Silverlight we have a new opportunity: we can create a community of open source developers that goes beyond the Linux-desktop community, but will pull developers interested about such a project from the Windows and MacOS worlds. I know that various members of the Moonlight team are passionate about Moonlight because it is this next generation API for building GUI applications.

    Which applications do you think are needed nad could be built with Moonlight?

    I say video editing, and I have some ideas of how it should work.

    Posted on 12 Nov 2009 by Miguel de Icaza

    The future of Moonlight

    With Moonlight quickly approaching its first official 2.0 release (which has feature parity with Silverlight 2.0 and has a handful of 3.0 features in place) we have been thinking about the work ahead of us, 3.0 and beyond.

    Although there is much work left to do to achieve full parity with Silverlight 3.0, a solid 2.0 core means that we can start thinking about new innovative ideas.

    Here are some ideas of things that Moonlight could prototype:

    • Video camera and audio support (Chris has a working prototype).
    • Native menu support for out-of-browser: we feel strongly that out-of-browser apps should get native menus and not be done with XAML. To allow proper MacOS, Windows and Linux integration.
    • Right-click support for taking screenshots of Moonlight apps, record a screencast of a video, support for saving individual images, XAML and video from the plugin.
    • Print the current canvas.
    • User opt-in for full network access and full file system access (This is possible with Moonlight if compiled for the desktop APIs, but perhaps we should extend this to the browser version).
    • Make the "Moonlight" widget ubiquitous. Allow any existing Gtk+, Win32, OSX, iPhone and Android to create content from a XAML file:
      		var splash = Moonlight.LoadFrom ("splash.xaml");
      		container.Add (sphash);
      		[...]
      
      		var mainMenu = Moonlight.LoadFrom ("mainMenu.xaml");
      		mainMenu.FindObject ("Start").Clicked += {
      			StartGame ();
      		};
      		window.Add (mainMenu);
      		

    We could use Silverlight to build the next wave of cross-platform desktop applications.

    I think of the Moonlight relationship to Silverlight as the Firefox relationship to IE four years ago. It is a chance to try out new ideas in the Silverlight-o-sphere, we can try those ideas out, and if the ideas have merit, they could become part of the official Silverlight.

    This echoes to some extent what Bob Muglia said on an interview a few days ago: "[it] will allow for Silverlight to move into all sorts of places where we can't - we can't see."

    For example, we are hard at work to make Silverlight run on the native PlayStation 3 and the Wii.

    In any case, we have been working on Moonlight for a long time. With our security system in place, and both our smooth streaming media engine and GUI engine in place I feel that open source innovation can begin.

    Posted on 12 Nov 2009 by Miguel de Icaza

    BitTorrent in Silverlight

    A few years ago, thanks to the Google Summer of Code, I got to meet a brilliant programmer that wrote an entire BitTorrent implementation as a reusable library called bitsharp. Today, I am lucky enough to work with Alan in the team team at Novell.

    Alan wrote a Gtk+ UI on top of his library called Monsoon:

    With Mono running in the browser as part of Silverlight, I have always felt that we needed to build a UI for bitsharp.

    The most important advantage is that every web browser can be turned into a BitTorrent client without having to install extra software.

    Some other advantages: you could connect to a web page that contains the BitTorrent client, it would turn your machine into a seeding/downloading host, it could be shut down with minimal fuzz and it would be trivial to spice up the UI and add all kinds of visualizations for the download.

    Silverlight 2 now provides direct socket/network access and supports storing files in your local file system. Most of the pieces are already in place to make this happen.

    There are a few challenges though. Silverlight does not allow a client to listen on a port, and for security reasons it has a limited set of ports it can connect to.

    The first problem could be addressed by having the client initiate connections to third parties requesting and providing data. This might require a protocol extension.

    The second problem is easy to solve, but would require other Bittorrent clients to listen in a new port to explicitly grant access to Silverlight clients by exposing a clientaccesspolicy.xml file.

    Finally, at least for Moonlight's case, we could start doing some changes to the core and grant the out-of-browser plugin to have full network access.

    Posted on 12 Nov 2009 by Miguel de Icaza

    Moonlight Branches

    Chris posted the new rules for the moonlight-2-0 branch and how to start working on 3.0 stuff.

    Another intesting post is David's initial take on bringing pixel shaders, perspective transforms and hardware acceleration to Moonlight.

    Posted on 11 Nov 2009 by Miguel de Icaza

    Mono Tools for Visual Studio

    Today is a big day for the Mono team, we just released the Mono Tools for Visual Studio. The goal of this release is to make it simpler for Visual Studio developers to deploy their applications on Linux. ASP.NET, Windows.Forms, server and console applications are supported. These are the major features in the release:

    Deploy to Linux: You can deploy from Visual Studio to a Linux machine running Mono your software. We are using Universal Plug and Play to detect Linux machines on your local network, or you can enter the IP address of your favorite hosting provider.

    Debug Linux system remotely from Visual Studio: Developers complained that our debugging story left much to be desired, that deploying to Linux was possible, but debugging cumbersome. We now allow you to debug your application running on Linux without ever having to leave Visual Studio.

    You can continue to edit, build and debug the way you have always done it, but the software will be running on a Linux machine:

    We hooked the Mono debugging engine to Visual Studio, so all the regular debugging tasks are available (watches, locals, breakpoints, stepping) that you come to expect from Visual Studio debugging are available.

    Review your code for portability: We have integrated Mono's Migration Analysis (MOMA) tool into Visual Studio so you can check your software for Windows/Linux differences right from your IDE and work around APIs that do not exist in Linux or Mono and refactor your code accordingly.

    Package your software for Linux: Right from Visual Studio you can package your .NET application in Linux native installation format. Just create a packaging project in your solution, configure your package and produce an RPM that you can distribute:

    And finally, one of the most exciting features in this tool: go from shipping applications into shipping appliances in minutes:

    You use our wizard to prepare your appliance, select a base operating system template (Server, Client, and base operating system) and off you go.

    Once your appliance is built, you can test it and apply the finishing touches over the web (using a Flash applet that connects to our virtual machines in our data center) and when you are happy with the results, you can download and redistribute your appliance to your users.

    Appliances

    Earlier this year I wrote about Novell's SUSE Studio our hosted service that helps developers create ready-to-run appliances.

    Today, as a .NET developer, when you distribute your software to your users and customers, you probably have a list of requirements that goes like this:

    • Install Windows XXX, Reboot.
    • Install security updates A through Z, reboot as many times as needed.
    • Install .NET runtime, reboot as needed.
    • Install SQL server, reboot as needed.
    • Populate database, reboot as needed.
    • Install third party tool, reboot as needed.
    • Just to be sure, reboot.

    Then your users can start installing your software. At that point, you initiate a series of support calls that go like this:

    • Did you make sure that .NET xxx.yy was installed? Ah, so do that and resume the steps.
    • Wrong databases, uninstall, reboot, reinstall database, reboot.

    And repeat the above process for every single one of your users.

    Basically, every user has to repeat the same steps. Everyone has to assemble the solutions made up of the operating system, various pieces of dependencies that you have and your software, like this:

    The experience today is like trying to buy a car by buying the individual parts:

    We believe that for a class of developers there is a better way.

    We believe that we can help you put together the full car, and deliver the car in a single piece.

    With appliances you can ship a pre-configured operating system, pre-configured database and every service pre-configured and installed together with your software to deliver a full package, so you prepare your software for distribution once, you configure the database once, and then you give your users a ready-to-run virtual machine, CD-ROM or USB stick:

    SUSE Studio has been used to build Linux based appliances (over four thousand per week), and now we are making it easy for .NET developers to take advantage of one of Linux's strengths: it is free, it is open source, you can shrink it, you can grow it and you can ship your own version (and yes, we do provide the updates for all of the core components that you pick).

    Getting Started

    Check out our getting started document.

    Cool use of MonoVS

    This is a cool use of Mono for Visual Studio debugging the Axiom 3D engine from the amazing Michael Cummings:

    Visual Studio remotely debugging Axiom on an Ubuntu virtual machine hosted in Sun's VirtualBox.

    Update: How to get it to work with Ubuntu

    Posted on 10 Nov 2009 by Miguel de Icaza

    Third Party MonoTouch controls

    This is pretty sweet in a couple of levels.

    A couple of hackers at RemObjects have released some reusable controls for use with MonoTouch that simplify some common tasks with UITableViews, they are part of their "Project Plateau":

    Not only this is sweet in that these are the first set of 3rd party controls for MonoTouch, they are also sweet because the authors built these controls using Oxygene, their Object Pascal compiler.

    Update: Some documentation can be found here: introducing Plateau for MonoTouch.

    Posted on 09 Nov 2009 by Miguel de Icaza

    Mono's new Compacting GC

    I missed this post from Friday.

    Mark Probst has posted a call for testers for Mono's new garbage collector:

    Our new garbage collector, SGen, is now at the point where it's ready
    for early testing.  It's still a long way from being ready for
    production use - it's still slow and consumes too much memory,
    especially for long-running processes - but if you'd like to help us
    find bugs, please consider giving it a try.  I'm especially interested
    in cases where Mono crashes or hangs with SGen (other than for memory
    exhaustion).  The simpler the test cases the better.
    
    To use SGen instead of Boehm, configure mono with the switch
    "--with-gc=sgen".  At this point it's only known to run on x86 and
    AMD64 Linux.
    

    This collector is a precise-heap, conservative stack, moving, copying collector and will return unused memory back to the operating system. The details of this collector are available in our Compacting GC page.

    I am rebuilding my own Mono with Compacting GC now as we speak.

    Posted on 09 Nov 2009 by Miguel de Icaza

    MonoTouch application for the PDC

    Craig Dunn has turned his Monospace application for the iPhone into a Microsoft PDC application that conference attendees can use at the upcoming conference.

    Mandatory screenshot:

    Since this app is not on the AppStore, you need to compile it and use Ad-Hoc deployment to run it into your phone.

    Update: If you do not have a Mac, come to our booth at the Microsoft PDC, and we will ad-hoc deploy the app for you.

    Posted on 09 Nov 2009 by Miguel de Icaza

    Alleviating Memory Fragmentation in Mono

    Currently, Mono's Garbage Collector does not compact the heap and one of the problems that users have is that certain allocation patterns might result in a heap fragmentation that is hard to recover from. The observable side effect is that your process memory usage grows, but the memory is mostly unused:

    You can read more about this in the Compacting GC page at the Mono web site.

    Although a new GC is being developed to address this, the code is still not switched on by default in Mono as we do not consider it ready for production use (you must compiled Mono with --with-gc=sgen).

    Avoid allocating very large buffers, instead allocate smaller buffers, and if you need to provide the illusion of a large buffer, hide this behind an interface.

    If you must use large buffers, you might want to consider using MindTouch's ChunkedMemoryStream which exposes the same interface as MemoryStream, except that it uses 16k chunks instead of a very large buffer.

    This will avoid the fragmentation for a very common use case.

    Posted on 09 Nov 2009 by Miguel de Icaza

    Pig Farm Tour Oaxaca 09

    April IM logs:

    Posted on 04 Nov 2009 by Miguel de Icaza

    Introducing Debugging for MonoTouch

    Today we released MonoTouch 1.2.

    Perhaps the most important new feature in MonoTouch 1.2 is that it now has a debugger that supports debugging on both the iPhone simulator and on the iPhone/iPod Touch.

    The debugger is integrated directly into MonoDevelop/OSX. All you have to do is select one of the debugging configurations (either Debug|iPhone or Debug|iPhoneSimulator):

    and run your application:

    To set breakpoints, you use the usual MonoDevelop UI, just click on the left-hand side of the editor, or use Command-/:

    The debugger offers the usual watch windows, and also allows you to navigate object state by hovering over the value in the IDE:

    The Technology

    Although this was developed for the iPhone, I should probably have said that this is Mono's new soft debugger engine.

    The iPhone is once again a challenging platform to get debugging working on. Since Apple has not published the information necessary to implement something like GDB or Mono's own MDB and we are not going to reverse engineer the protocol, instead we created a new way of debugging Mono applications.

    The Mono Debugger for the iPhone platform uses a soft-debugger. Unlike traditional debuggers that act like a fully controlling entity over the Mono process, the soft-debugger is actually a debugger that is built into the Mono process itself. MonoDevelop communicates with this debugger over a compact protocol, similar to what has been done in the past with Java debuggers:

    We are providing a new library, the Mono.Debugger.Soft.dll that encapsulates the protocol and offers an API that developers can use to debug a remote Mono process.

    On systems where we have access to breakpoints the soft debugging engine will use the standard operating system facilities to single step and set breakpoints.

    But on systems like the iPhone and some video game consoles where there is no way to modify memory without special privileges we had to resort to a different technique. The Mono static compiler inserts special code at every sequence point that checks for single stepping or breakpoints. The code generated during these debug builds is larger, but it allows us to support the iPhone without having to resort to undocumented APIs in any form or shape.

    MonoDevelop and the iPhone

    When the user selects an application for debugging, MonoDevelop configures the application to contact MonoDevelop on startup and link the debugger to it, starts listening on a couple of ports (one for the debugging protocol, and one for redirecting standard output/standard error) and waits for the application on either the iPhone simulator or the iPhone to contact it.

    Upon contact, the debugger handshake takes place and operation continues. For the simulator, this takes place with a local socket; for the device, this happens over a TCP/IP socket over WiFi.

    One of the nice side effects of this approach to debugging is that it is possible to distribute binaries to testers (using the Ad-Hoc distribution model) and debug problems on a user's iPhone over the network.

    To support this scenario, when you build applications with the "Debug|iPhone" configuration, MonoDevelop will modify your application's Settings file on the iPhone.

    This allows your beta-testers to enable debugging and connect to your debugger for inspection. This is what the settings looks like:

    The first port is the port where MonoDevelop will be listening to. The second port is the port where the standard output and standard error will be redirected to.

    All of the Console.Output and Console.Error output will be sent to this port when debugging is enabled on the application.

    Pros and Cons

    There are pros and cons to the soft debugger approach.

    Soft debuggers are unable to do low-level debugging or debug Mono itself (mixed-mode debugging) and they are unable to stop applications at will, all it can do is request politely that the application stops, and when the Mono runtime decides that it is a good time to stop, it will stop.

    On the pro side, the soft debugger is easier to port and is more robust as it eliminates some dead-lock situations. These can happen when the runtime has been forcefully stopped by the debugger, and then the debugger invokes methods on the target. These methods in turn might require an internal lock that is currently held by a different thread.

    The Protocol

    The protocol used between the debugging agent running inside the Mono process and a debugger is implemented in the debugger-agent.c file.

    Availability

    MonoTouch customers will be offered the update the next time they start MonoDevelop or if they manually "Check for Updates" on the MonoDevelop IDE.

    Users of MonoTouch for the iPhone simulator can get the it from the trial page.

    The source code for the soft-debugger is available on SVN. The API to communicate with the Mono runtime is available in the Mono.Debugger.Soft assembly and the debugger itself has already been integrated into the Mono 2.6 branch and Mono trunk on SVN.

    This should prove useful to other users of Mono that might benefit from a soft debugger like Unity3D or Second Life.

    Screenshots

    Brent has a nice gallery of screenshots of the debugger in action on his MonoTouch 1.2 with debugging released! post.

    Posted on 04 Nov 2009 by Miguel de Icaza

    10 years of Ximian

    Today is the ten year anniversary of the incorporation of Ximian, Inc. A company founded by Nat Friedman and myself whose goal was to advance the state of the Linux desktop. It was also an excuse for Nat and myself to hang out as we had become best friends forever in the previous two years.

    Our conversations over the years have always been a little surreal. I have megabytes worth of logs that look like this:

    Ximian was made up of friends that shared this vision, and its founders had no startup, business or management experience when we launched the company. We learned on the job and we were advised by friends that believed in our goals, and by people that cared about our mission.

    From the archive: Ettore Perazzoli, Raph Levien, Nat and myself in Summer of Linux.

    Ximian hired 90% of its employees from open source contributors in the community and folks that we had met over mailing lists or IRC channels.

    Nat was a Computer Science and Math graduate; I was a math drop out and we had no management experience. This means that we made every possible management mistake in the book, but all of our friends and employees stuck with us as we learned and as we worked to get the company off the ground.

    This is an interesting time to reflect on 10 years of hacking adventures. Writing, funding and advancing the state of the art of open source. In the next few weeks, Nat and myself will be publishing some short stories from Ximian.

    Today Ximian has been incorporated into Novell. Our goals have been expanded, but we still continue to work to advance the state of the art in Linux.

    Looking forward to another 10 years of joy and hacking.

    Posted on 19 Oct 2009 by Miguel de Icaza

    iPhone application for MonoSpace Conference

    I woke up this morning and found that the amazing Craig Dunn put together an iPhone app for the Monospace Conference using MonoTouch!

    The app provides the schedule, access to the twitter feeds for the speakers and the conference, access to the MonoSpace blog, speaker profiles and access to their blogs and twitter feeds and a map to find the event.

    You can learn more, see larger screenshots and download the code to run on your iPhone from Craig's Post.

    Posted on 17 Oct 2009 by Miguel de Icaza

    MonoSpace Conference in Austin - October 27 through 30

    Over the past few weeks, the final details of the program for the Monospace Conference have been announced, and now the event is just less than two weeks away. Some key details you may have missed:

    • The Monspace conference features 2 days of workshops and 2 days of Open Space sessions.
    • The full conference agenda has been posted, and now includes a full day of MonoTouch training (Mono for the iPhone).
    • The two-day open space sessions will be kicked off on Thursday with an Open Source Panel featuring Sam Ramji (CodePlex Foundation), Ayende Rahien (NHibernate and Castle Contributor), and Glenn Block (Managed Extensibility Framework) and moderated by Rod Paddock, Editor of CoDe Magazine.
    • The famous, prolific and thorough Ayende Rahien will be speaking on NHibernate.
    • Microsoft's own Glenn will be talking about the Managed Extesibility Framework.
    • M David Peterson will be discussing Mono on Amazon EC2.
    • The ThoughtWorks crew will be talking about F# on Mono.
    • Eric Hexter from Headsprings will be covering ASP.NET MVC.

    From the Mono team, various engineers will be presenting on special topics:

    • Larry Ewing will talk about the Moonlight, the open source implementation from
    • Aaron Bockover will talk about cross platform GUI development with Gtk#.
    • Geoff Norton will discuss development with MonoTouch on the iPhone.
    • Jackson Harper will talk about ASP.NET MVC development with Mono and Joseph Hill will discuss Mono Tools for Visual Studio.
    • Rodrigo Kumpera from our JIT team will do a low-level talk on Mono's Virtual Machine covering some of the innovations on the VM that are Mono-specific.
    • And I will focus on the schmoozing.

    The Monospace conference will be held in Austin, TX on Tuesday, October 27 through Friday, October 30. To register for the event, visit the Monospace Conference Registration Page.

    Check the program for more information.

    Registered Monospace attendees will receive a $150 discount on MonoTouch, if they purchase in the month of October.

    Posted on 16 Oct 2009 by Miguel de Icaza

    Event mapping in MonoTouch

    When we were designing the MonoTouch APIs we had to map some of the constructs used by CocoaTouch and Objective-C to what C# developer expect.

    Like other modern toolkits, the behavior of a control can be customized by the programmer by hooking up to events and the responses to those events.

    This is a common pattern used in other toolkits. In Gtk+ objects emit signals, and the programmer can connect event handlers to individual signals, for example this is how you would connect

    void pause_player ()
    {
    	// pause the player.
    }
    
    void configure_pause ()
    {
    	button = gtk_button_new_with_label ("pause");
    	gtk_signal_connect (button, "clicked", pause_player, NULL);
    }
    	

    In the ECMA CLI world developers hook up to events by connecting to events directly in the object, it is similar in spirit:

    void configure_pause ()
    {
    	button = new Button ("Pause");
    	button.Clicked += delegate {
    		// Pause the player here.
    	};
    }
    

    In both the Gtk+ and the ECMA CLI worlds there can be multiple subscribers to the event.

    In CocoaTouch, instead of having an event per action they use a pattern where the components emits all of its messages to an instance of an object. If a button were to emit messages like "clicked", "clicked_violently" and "caption_changed" all of those messages will be sent to an object that implemented the required interface.

    I am going to give myself a literary license and use some terms loosely and write a little bit of imaginary C#.

    A button implementation would look like this:

    interface ButtonDelegate {
    	optional void clicked ();
    	optional void clicked_violently ();
    	optional void caption_changed ();
    }
    
    class Button {
    	public ButtonDelegate Delegate { get; set; }
    
    	public Button (string text) { ... }
    
    	public string Text {
    		get { return text; }
    		set {
    			text = value;
    			DoSomeRepainting ();
    			Delegate.caption_changed ();
    		}
    	}
    
    	public EventHandler ()
    	{
    		...
    		if (event_this_is_the_user_clicking){
    			// Send the message to the Delegate
    			Delegate.clicked ();
    		}
    		
    

    The user of the Button class then needs to implement the interface ButtonDelegate to respond to messages. This in Objective-C is made simple by allowing this interface to have optional methods.

    This would not work with C# interfaces as those require that all the methods on the interface are implemented.

    So we came up with a design that would blend those worlds together.

    Supporting the Objective-C approach

    We can support the Objective-C model where a class can satisfy the contract by just registering methods to respond to the actions. A user could respond to some events like this:

    class Foo : NSObject { 
    	void ConfigureButton ()
    	{
    		button = new Button ("pause");
    		button.WeakDelegate = this;
    	}
    	
    	[Export ("clicked")]
    	void pause_clicked ()
    	{
    		// Pause the button.
    	}
    }
    

    In MonoTouch we expose the "WeakDelegate" property as the weakly-typed version of the delegate, that means that you can assign to it anything that derives from the NSObject class, and respond to messages by just annotating your method with the [Export ("name")] attribute.

    But weakly typing could introduce errors. What if the parameters of the method or the return value do not match the actual signature of the selector. If the developer introduce a typo, the compiler would not be able to point this out, and you would get a nice crash or some corrupt memory.

    So we introduced strongly typed delegates, these require the programmer to implement a class and override methods that have a very specific signature. The code would then look like this:

    class Foo : ButtonDelegate {
    	void ConfigureButton ()
    	{
    		button = new Button ("pause");
    		button.Delegate = this;
    	}
    
    	// strongly typed: override ensures that this method exists in
    	// the base class, or the contract is not satisfied. 
    	public override void pause_clicked ()
    	{
    		// Pause the button.
    	}
    }
    

    The ButtonDelegate class is flagged with a special attribute, the [Model] attribute which informs the MonoTouch runtime that only methods that are overwritten from this class will be dispatched, any other methods will be considered optional and treated like optional methods.

    The problem of course is that if you wanted to respond to multiple buttons, you would have to actually distinguish them somewhere in your pause_clicked with some sort of closure value, or use helper classes, one for each button that you want to respond to. But that is a minor detail.

    So Objective-C developers that like the separation between model, view and controller can continue to use those patterns.

    That being said, although there is a lot of literature and discussion about the clean separation of Models, Views and Controllers, most samples I run across are a hodgepodge of Controller code for all sorts of things. At least the production code and the samples I have seen make it obvious that the separation of concerns is mostly academic, and in practice an instance object becomes a general purpose responder to all events, very much like you see in Gtk+, Qt, or Winforms.

    Our approach also has a limitation: the hodgepodge approach does not really work with the strongly-typed signatures as you can only derive from one class at a time. The solution is to use separate classes for each controller. Although that cleans things up and has some aesthetics associated with it in terms of clean separation of concerns, in my opinion, it is not very practical.

    Supporting the C# style

    With MonoTouch we wanted to preserve the C# style of programming where you could attach code to these notifications one-by-one.

    With C# you can use anonymous methods or lambda functions. These are incredibly powerful as they are able to capture the environment in which they were created. This means that you can trivially pass information and share information between multiple handlers.

    Additionally, you more than one method can "subscribe" to the same event, you are not limited to a single method being the receiving of the events.

    This means that in MonoTouch you configure buttons like this:

    void configure_button ()
    {
    	button = new UIButton (dims) { Text = "Pause" };
    	button.Clicked += delegate {
    		// Pause the video
    	};
    }
    

    What MonoTouch does internally is that the first time that you attach to a C#-like event, it create an instance of the ButtonDelegate that merely raises the event in the C# style.

    This means that you only pay for the memory usage if you use the feature. But when you do, you can subscribe to individual events and you can have more than one listener attached to the event.

    The Pattern

    Although we brought the pattern to most places in MonoTouch where a delegate was used, it is notably missing from the UITableView as we felt that the number of methods that had to be overwritten were too big for the model to make sense.

    In a few instances like UITableView, we suggest that developers just use the strongly typed version of the delegate classes and override the methods accordingly.

    One of the things that I would like to see is a UITableView derived class that can present the data and style the data entirely based on properties discovered at runtime with System.Reflection.

    Another thing that I want to see is support for System.Data data binding style versions of the UITableView and other UI controls in a single page.

    More details on the low-level implementation are available on the API design document on the web site.

    Posted on 15 Oct 2009 by Miguel de Icaza

    Git# - First Public Release

    Meinrad Recheis has lead the effort to bring a full managed GIT implementation to the .NET and Mono worlds and he just announced the release of GitSharp 0.1.3, the first public release of Git#.

    The code is based on the original work from Kevin Thompson who ported the JGit Eclipse plugin to C#. Meinrad has put together a great community of contributors that integrated every JGit improvement, the credits for the first release are as follows:

    • Dave Cameron: for fixing bugs
    • Björn Carlson: for killing bugs that crept into the core
    • caytchen: for porting huge parts of the transport layer, and hunting down nasty bugs. btw, what's your real name?
    • Emeric Fermas: for eliminating some of the hardest to find bugs and for verifying the complete test suite against jgit
    • Martinho Fernandes: for fixing bugs
    • Andriano Machado: for porting massive amounts of code and tests, also fixing many bugs
    • Jim Radford: for the continuous integration server account and the support
    • Gil Ran: for porting and fixing lots of tests and initial efforts on Mono
    • Dan Rigby: for porting and fixing tests
    • rolenun: for the command line interface framework. hey, what is your real name?
    • Mauricio Scheffer: for the testing and build server expertise and CI server trouble shooting
    • Neil Stalker: for holding up the flag for git# on Mono compatibility and squashing bugs
    • Kevin Thompson: for initially porting large amounts of code and letting me rise the baby

    An easy to use API is being developed on top of the GIT core, check out some of the examples.

    Posted on 12 Oct 2009 by Miguel de Icaza

    Your anthropological tidbit of the day

    In 1991 or 1992, I wrote a curses-based file manager for Unix, a clone of the DOS Norton Commander.

    Unlike the Norton Commander, curses, xterms and Linux did not support the mouse. So I called my file manager "The MouseLess Commander".

    Linux at that time was a cauldron of hot ideas. And Alessandro Rubini created a library for console applications to get mouse support on Linux. We worked to add mouse support to the MouseLess Commander and by the end of this exercise we renamed the file manager to "The MouseLess Commander With Mouse Support".

    Somehow I was talked into changing the name of the Mouseless Commander with Mouse Support. Since I was pretty bad at naming, we organized a vote on the mailing list and eventually the current name "Midnight Commander" was picked.

    I miss the previous name.

    Posted on 06 Oct 2009 by Miguel de Icaza

    World Views

    Richard Stallman does not seem to have anything better to do than launch personal attacks against me. In his last piece he has decided to call me a Microsoft apologist because I do not participate in his witch hunt.

    I merely happen to have a different perspective on Microsoft than he has. I know that there are great people working for the company, and I know many people inside Microsoft that are steering the company towards being a community citizen. I have blogged about this for the last few years.

    At the end of the day, we both want to see free software succeed. But Richard, instead of opening new fronts to promote his causes, attacks his own allies for not being replicas of himself. To him, ridiculous statements like Linus "does not believe in Freedom" are somewhat normal [1].

    A Matter of Perspective

    A few years ago, I had the chance to listen to Benjamin Zander in person talk about his world of possibilities. His book "The Art of Possibility" had a profound effect on me.

    Benjamin tells this story in the book:

    Two shoe salesmen were sent to Africa in the early 1900's to scout the territory.

    One telegraphed back: "Situation hopeless. Stop. No one wears shoes."

    The other telegraphed: "Business opportunity. Stop. They have no shoes."

    Since we only have a limited time on earth, I have decided to spend my time on earth as much as I can trying to be like the second salesman. Looking at opportunities where others see hopelessness.

    This is why I love my work, because I work with friends that have consistently beat the odds and we have consistently proved our critics wrong. Because everyone that I work with wants to change the world and nobody I work with is dominated by fear.

    Far too many times, fear has prevented people from coming up with creative solutions. I rather work on constructive solutions to problems than moan and complain.

    Fear mongering is a vibrant industry, it is the easy way out for those that can not lead with the example. Create a bogeyman, make things up, lie, or tell half-truths, and demonize and you got a recipe to energize your base.

    Richard's Fear Mongering

    The documentary "The Power of Nightmares" is a fascinating view at the industry of selling "safety" to the scared population and how leaders like to scare people to push their own agendas. Richard's fear mongering is no different.

    Richard Stallman frequently conjures bogeymen to rally his base. Sometimes it is Microsoft, sometimes he makes up facts and sometimes he even attacks his own community [2]. His language is filled with simple, George W Bush-eque terms like Good vs Evil, Us vs Them.

    The creation of the CodePlex foundation was an internal effort of people that believe in open source at Microsoft. They have been working from within the company to change it. Working at CodePlex is a great way of helping steer Microsoft in the right direction.

    But to Richard, this simply does not compute.

    To Richard, the state of the world is hopeless. I on the other hand see possibility and opportunity.

    Not only you attract more bees with honey than with vinegar, there are lots of shoes to sell.

    [1] Plenty of attacks on other open source/free sofftware advocates/developers are readily googable.

    [2] the "open source" vs "free software" non-issue and the "Linux" vs "GNU/Linux" wars of the 90's that haunt us to this day.

    Comments

    I am now closing the comments for this post. Feel free to move this to the Slashdot forum.

    Posted on 05 Oct 2009 by Miguel de Icaza

    Feedback wanted: StackOverflow DevDays in Boston

    I will be presenting at StackOverflow DevDays in Boston, on October 7th at 4.20pm.

    As usual, I will be talking about Mono. But since Mono is an giant universe, I would like to know what the audience would like to hear about.

    Please fill in my small survey to provide feedback.

    See you there!

    Posted on 30 Sep 2009 by Miguel de Icaza

    Pictures: ECMA 334/335 January 2003

    At the ECMA meeting in January of 2003 Anders was presenting C# 2.0:

    Todd Proebsting had just developed iterators for C# and was presenting, it was inspired by his previous work on Icon's iterators. Sam Ruby (from IBM), Thomas Plum (from Plum Hall) and Todd:

    Anonymous methods, the foundation for lambdas in C#, used a beautiful code generation technique. Anders who has a beautiful hand writing was explaining the design to the committee:

    Jim Hogg presented the design for generics in the ECMA CIL. Here he is discussing with Arch (at the time with Intel, and the guy behind ECMA's System.Parallelization), Jon Jagger and Emmanuel Stapf (ISE Eiffel):

    Joel Marcey, then at Intel and Jim Miller:

    Todd and Chris Fraser. I was fanboying them. Mono's original JIT design was based on a lot of his work. At dinner Chris recommened Csikszentmihalyi's book on Flow, which I loved:

    Posted on 26 Sep 2009 by Miguel de Icaza

    Comment Policy on my Blog

    Here is a rough draft of the comment policy for my blog.

    When you come to my blog to comment, you are a guest in my blog and your opinions are hosted there in the same way that you would be hosted if you showed up at my place to chat.

    So standard rules of social engagement are required. If you are unable to operate under regular social situations and you feel the need to insult others or myself in my blog, not only you are not welcome, but your comment will not show up and will be promptly deleted.

    Constructive criticism is always welcome on my blog, now

    If you feel the need to be rude, offensive, lie or you are intentionaly trying to start a fight, I encourage to do that in your blog.

    If you can not articulate your thoughts without attacking and you can not keep your temper in check, I encourage to do that on your own blog.

    Trolling will be removed.

    Posted on 25 Sep 2009 by Miguel de Icaza

    Branching for Mono 2.6

    Today Andrew branched Mono trunk for the Mono 2.6 release.

    Mono 2.6 is the last release that will support the mscorlib 1.1 profile and the C# 1.0 compiler. We are now moving to a pure generics world with Mono.

    Update: Specifically, we will be removing the 1.0 assemblies from the build, the mcs.exe command will now point to gmcs.exe, all of the xxx1 command versions will be eliminated and all of the conditional code in the Mono class libraires that depended on NET_1_0 and NET_1_1 will be removed.

    As for the Mono 2.6 release notes: we will put those together in the next few days. Please be patient.

    Posted on 25 Sep 2009 by Miguel de Icaza

    On Richard Stallman

    I want to say that God loves all creatures. From the formidable elephant to the tiniest ant. And that includes Richard Stallman.

    As for me, I think that there is a world of possibility, and if Richard wants to discuss how we can improve the pool of open source/free software in the world he has my email address.

    Love, Miguel.

    Posted on 23 Sep 2009 by Miguel de Icaza

    MonoTouch 1.0 goes live.

    MonoTouch is a commercial product based on Mono and is made up of the following components:

    • MonoTouch.dll The C# binding to the iPhone native APIs (the foundation classes, Quartz, CoreAnimation, CoreLocation, MapKit, Addressbook, AudioToolbox, AVFoundation, StoreKit and OpenGL/OpenAL).
    • Command Line SDK to compile C# code and other CIL language code to run on the iPhone simulator or an iPhone/iPod Touch device.
    • Commercial license of Mono's runtime (to allow static linking of Mono's runtime engine with your code).
    • MonoDevelop Add-in that streamlines the iPhone development and integrates with Interface Builder to create GUI applications.

    The MonoTouch API is documented on the Mono site. The MonoTouch API is a combination of the core of .NET 3.5 and the iPhone APIs.

    We have created some tutorials on how to use MonoTouch and you can read the design documentation on the MonoTouch framework.

    Some History

    Almost a year ago when we released Mono 2.0 for OSX, I asked the readers of this blog to fill a survey to help us understand where we should take Mono.

    Many developers asked us to provide Mono for the iPhone.

    A year ago, it was possible to use Mono's static compiler to compile ECMA 1.0 CIL bytecode for the iPhone. This is the technology that powered Unity3D's engine for the iPhone.

    Users of Unity3D have published more than 200 applications on the AppStore.

    We debated internally what exactly Mono for the iPhone would be. We considered doing a Windows.Forms port, to bring Compact Framework apps to the iPhone, but that would have required a complete new backend for Windows.Forms and would have required also a "theme" engine to make it look like the iPhone. We discarded this idea early on.

    We decided instead to go with a native binding the iPhone APIs. It would not be a cross platform API and it would tie developers to the iPhone platform, but it would also mean that applications would look and feel native, and developers would get closer to the iPhone.

    Creating a binding for the Objective-C APIs with .NET in the past has relied extensively on dynamic code generation, and this feature is not available on the iPhone (the kernel prevents JIT compilation from taking place). As we started doing the work to bind the low-level C APIs, Geoff started prototyping a new Objective-C/C# bridge that was specifically designed to work within the iPhone requirements.

    By the time we had sorted out the foundation and the Objective-C bridge we had gained some fresh experience from binding the C++ PhyreEngine to .NET and we decided to create a new binding generator to simplify our life (I will blog about this new approach to binding creation in another post).

    At this point, we started investing into supporting not only the device, but support the simulator. This would prove to be incredibly useful for quickly testing the code, without having to wait a long time to compile and deploy on the device.

    The Developer Experience

    At this point, we had enough to create mix-mode GUI applications (they were mostly Objective-C apps hosting Mono) and the pipeline was horrible: it involved using some 3 compilers, having 3 Mono checkouts and applying individual patches to all trees.

    We were aware of how easy Unity had made things for their users, they had set the bar pretty high in terms of usability for us. Unity had some advantages, they could "debug" without deploying the code to the device, something that we could not really do ourselves.

    We were still far from this.

    We introduced a command that would isolate all of the complexities of creating simulator and ARM executables, the mtouch command.

    With the mtouch command and the bindings complete, we started trying out the API by porting the Apple iPhone samples from Objective-C to C#. And in the process finding two things: C# 3.0 constructor initializers are a thing of beauty:

    UIControl SliderControl ()
    {
    	var slider = new UISlider (new RectangleF (174f, 12f, 120f, 7f)){
    		BackgroundColor = UIColor.Clear,
    		MinValue = 0f,
    		MaxValue = 100f,
    		Continuous = true,
    		Value = 50f,
    		Tag = kViewTag
    	};
    	slider.ValueChanged += delegate {
    		Console.WriteLine ("New value {0}", slider.Value);
    	};
    	return slider;
    }
    	

    And also that the samples ported were half the size of the equivalent Objective-C programs.

    As we were doing this work to iron out the kinks in the API design, Michael got started on designing the MonoDevelop support for the iPhone. This included the regular bits that you would expect like templates, building, running and deploying, but most importantly the Interface Builder integration.

    Interface Builder produces an XML file that describes your UI, and it is able to generate some header files for you, but in general developers that want to refer to components in the UI and implement their backing store have to repeat the same stuff over and over. For example, controlling the contents of a label on the screen requires the developer to declare the same variable three times: 2 in the header file, and one in the Objective-C file (if you are lucky).

    We took a different approach. We made it so that MonoDevelop would automatically generate a code-behind partial C# class for each Interface Builder file. This meant that to users the entire process would be transparent.

    They would define outlets or messages, and those would just become part of their class. Intellisense and code completion would become available to them without any extra coding.

    Posted on 14 Sep 2009 by Miguel de Icaza

    CodePlex Foundation

    Microsoft today launched the CodePlex Foundation a non-profit organization to promote the open source collaboration between companies and open source communties, projects and individuals.

    This is another step in the right direction for Microsoft. I have been working on open source software since 1992, and back then a world where open source played a major role was a dream to many of us. Microsoft adopting open source licenses, releasing some of their code under open source licenses and being a better community member was the stuff of fiction.

    There are still many things that I would like to see Microsoft do, and many things that I believe Microsoft has to change to become a full member of the open source community, but it is encouraging to me to see Microsoft evolve. I hope that the CodePlex foundation will help us continue to build bridges between our communities.

    I am glad that I was asked to be part of the board of directors of the foundation. And to work together with some great advisory board.

    I hope that I can last more on this foundation than I lasted at the FSF, where I was removed by RMS after refusing to be an active part of the campaign to rename Linux as GNU/Linux.

    Posted on 10 Sep 2009 by Miguel de Icaza

    MonoDevelop 2.2 Beta 1: We go cross platform.

    MonoDevelop goes cross platform.

    Since the beginning of time, man has yearned to get a cross platform .NET IDE. Homer's Odyssey described one man's effort to achieve such a thing. And it was not until today, September 9th of 2009 that the world can test out such a tool.

    With this release MonoDevelop leaves its cozy Linux nest and embarks on a wild adventure into the hearth of MacOS and Windows. The MonoDevelop team made this one of their major goals for this release: to turn our loved IDE into a cross platform IDE.

    If you are curious about the details, check out the What is new in MonoDevelop 2.2 page.

    MonoDevelop on Windows

    We are not only bringing MonoDevelop to OSX and Windows as a plain GUI port, but we are also providing installers, deep operating system integration and support for native debugging on each platform.

    MonoDevelop on MacOS X

    In addition to becoming a cross platform IDE, there are many new features in MonoDevelop.

    For instance, MonoDevelop can be used to develop ASP.NET MVC applications on OSX and Linux and Silverlight applications on OSX and Linux.

    Debugger

    MonoDevelop now has integrated debugger support. Not only it is able to debug Mono applications, it also can work as a frontend to GDB to debug native applications.

    In addition, on Linux it is possible to debug ASP.NET pages.

    New Add-ins

    New exciting add-ins: ASP.NET MVC, Silverlight and iPhone (for use with MonoTouch).

    Policies

    A common problem that we face as open source developers is that not every project uses the same coding style. Different teams use different coding conventions. MonoDevelop now supports policies to describe how files should be edited and what defaults should be used in each:

    Editor Improvements

    My favorite new feature is Dynamic Abbrev (Alt-/) a feature that we brought from Emacs and that fills me with joy. That being said, for the non-Emacs lovers there are plenty of features that you asked for, and that we implemented:

    • Extensive refactoring support. And I mean, it is extensive.
    • Code templates.
    • On the fly formatting.
    • Acronym Matching in Code Completion
    • XML Documentation Shown in Code Completion
    • VI mode for those users hooked up on VI commands, they can now use those within MonoDevelop.

    Another pretty cool feature is the code generation support that is triggered with Alt-Insert. When you press Alt-insert it will popup a context sensitive dialog box that offers a few options of code that could be generated at this point: ToString methods, Equals/GetHashCode methods all based on existing fields and properties.

    Why go Cross Platform?

    Going cross platform means that developers will have the same tool across all of the operating systems they use: Windows, Mac and Linux.

    .NET developers that have been enchanted by OSX will be able to continue developing software with their favorite programming languages while enjoying OSX and will be able to go back and forth between Windows, OSX and Linux as needed. This also means that they can work with developers in other platforms, regardless of the personal choices of other team members.

    As many of you know, the number of contributors to a project is linked to the number of users of that project. By expanding our market presence from Linux, we expect to get contributions, fixes, improvements, bug reports, code and add-ins from developers in other platforms.

    We intend to make MonoDevelop the Eclipse of the .NET community. Just like Eclipse became the foundation for Java development, we hope that MonoDevelop will become the foundation for .NET development, and hopefully for much more than that.

    A multi-system IDE

    We are not religious when it comes to supporting other programming languages [1]. We want to embrace not only .NET-based projects like Gtk#, Silverlight, ASP.NET, Boo, C#, F#, Visual Basic and Windows.Forms. We are also embracing other developer platforms like Python, C/C++, Vala, and we want to expand our presence to work with the Flash, PHP, Ruby, Rails, Flex and any other communities that need a cross platform IDE.

    [1] we are just religious about the fact that C# is a better programming language to build an IDE than Java is.

    Thanks!

    This release could not have been possible without the endless nights and the collaborations of our contributors and all of the end users that reported bugs and gave us feedback.

    Posted on 09 Sep 2009 by Miguel de Icaza

    Mono Survey Time!

    Is it that time of the year when I unleash Google Docs' Survey platform on the users of my blog.

    Every once in a while people ask us "When will you support Mono on..." and our answer is usually "thanks for your feedback, we will carefully consider it".

    The reality is that all we have at this point is a lot of anecdotal data. Since my previous surveys on Mono, Mono for OSX, Mono for the iPhone and Mono for Visual Studio turned out to be great tools to understand what people actually want, I have created a new survey.

    In this survey, I want to know how much people are willing to pay for (or not pay) for Mono commercial support on a variety of platforms: Red Hat Enterprise Linux, HP-UX, AIX, Solaris on a variety of architectures.

    Go to my survey

    Posted on 08 Sep 2009 by Miguel de Icaza

    Mono/.NET CodeCamp in Catalonia, Spain

    The .NET and Mono user communities are working together in Spain to organize a joint .NET/Mono Code Camp. This Code Camp is going to be interesting because it is putting together two communities with very different points of view, but between which there is a lot of synergy. It will be a good chance to talk about Mono, Moonlight, MonoDevelop, MonoTouch and all the stuff we are working on.

    Lluis just announced that the call for papers is ending this Friday, so not much time is left if you want to participate with a talk. There are more details in his blog post

    Posted on 08 Sep 2009 by Miguel de Icaza

    GitSharp making progress

    Meinrad Recheis emailed me to inform me that he has forked the Gitty project (a project that was doing a line-by-line port of a Java version of GIT) and that the project is making progress on having a full C# based GIT implementation.

    GitSharp source code can be downloaded from github and they are making sure that GitSharp works on both .NET and Mono.

    I can not wait for a MonoDevelop UI for it!

    Posted on 01 Sep 2009 by Miguel de Icaza

    MonoTouch Resources

    While I was gone, a pretty nice site called MonoTouch.infowas created that is aggregating all kinds of MonoTouch samples, posts, and discussions.

    From the MonoTouch Bill Splitter page.

    It is aggregating many of the samples being discussed in the tweetosphere and from the MonoTouch mailing list.

    The samples are particularly useful as MonoTouch merges two worlds: .NET development and Objective-C programming on the iPhone/iTouch.

    MonoTouch supports the Objective-C like setup where classes can respond to messages and you have to structure your code with MVC patterns. But it also supports the C# event-style programming mode, where developers can use lambda functions to hook up to interesting events.

    You can also follow @monotouchinfo on twitter.

    Posted on 01 Sep 2009 by Miguel de Icaza

    Silverlight/C#, Flash/ActionScript 3 and Canvas/Javascript

    Been following some of the discussion around Action Script 3 on the tweetosphere. Here are three implementations of the same model from Joa Ebert (he works on a fabulous Flash product for doing music that I absolutely love).

    From his Flirting with Silverlight post:

    Lately a lot of discussion had the ActionScript language as its focus. People start complaining about complex language features but I think they are great because the end user will benefit from that. Yesterday evening I had my very first test with Silverlight — and I am really impressed.

    It took me a short amount of time to port the strange attractor to Silverlight. I agree that this is may be not a fair comparison because I know C# already but have a look at the source code. I make heavy use of type inference and the Matrix4x4 class has the plus, multiply and array-index operator overloaded. The code is more readable. And besides: it executes really fast. Faster than my heavily optimized ActionScript version. Imagine I would write var bleh = 1.0 in ActionScript. Framerate would drop to something like zero. But this is sad since there is no reason for me to write var bleh: Number = 1.0. A modern compiler should be able to figure this out. haXe can do it, C# can do it, OCaml can do it and lots of others as well.

    Remember: This was my first time using Silverlight. To achieve the same result with Flash you have to be kind of an expert in strange player and language “features”. Now tell me again that the end user will not benefit.

    Here are the three implementations:

    Posted on 12 Aug 2009 by Miguel de Icaza

    C# 4's Dynamic in Mono

    C# 4.0 introduces the dynamic type into the language. The language will ship in Visual Studio 2010.

    Once a variable is declared as having type dynamic, operations on these value are not done or verified at compile time, but instead happen entirely at runtime.

    Marek has been working on Mono's C# 4 implementation and it is coming along nicely. Zoltan wrote a small "PInvoke" dynamic class using Mono's C# compiler that allows you to call C library methods like this:

    	dynamic d = new PInvoke ("libc");
    	d.printf ("I have been clicked %d times", times);
    	

    In this case "printf" is resolved at runtime to be a method in the "libc" library. This is similar to Python's ctype library in about 70 lines of C# leveraging LINQ Expression, the Dynamic Language Runtime and C#'s dynamic:

    The code is:

    using System;
    using System.Dynamic;
    using System.Reflection;
    using System.Reflection.Emit;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Linq.Expressions;
    
    class PInvokeMetaObject : DynamicMetaObject {
    
        public PInvokeMetaObject (Expression parameter, object o) :
            base (parameter, BindingRestrictions.Empty, o) { }
    
        public override DynamicMetaObject BindInvokeMember (InvokeMemberBinder binder, DynamicMetaObject[] args) {
    
            var self = this.Expression;
            var pinvoke = (PInvoke)base.Value;
    
            var arg_types = new Type [args.Length];
            var arg_exps = new Expression [args.Length];
    
            for (int i = 0; i < args.Length; ++i) {
                arg_types [i] = args [i].LimitType;
                arg_exps [i] = args [i].Expression;
            }
    
            var m = pinvoke.GetInvoke (binder.Name, arg_types);
            var target = Expression.Block (
    			    Expression.Call (m, arg_exps),
    			    Expression.Default (typeof (object)));
            var restrictions = BindingRestrictions.GetTypeRestriction (self, typeof (PInvoke));
    
            return new DynamicMetaObject (target, restrictions);
        }
    }
    
    public class PInvoke : DynamicObject {
        string dll;
    
        AssemblyBuilder ab;
        ModuleBuilder moduleb;
        int id_gen;
    
        public PInvoke (string dll) {
            this.dll = dll;
        }
    
        public override DynamicMetaObject GetMetaObject (Expression parameter) {
            return new PInvokeMetaObject (parameter, this);
        }
    
        public MethodInfo GetInvoke (string entry_point, Type[] arg_types) {
            if (ab == null) {
                AssemblyName aname = new AssemblyName ("ctype");
                ab = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.Run);
                moduleb = ab.DefineDynamicModule ("ctype");
            }
    
            // Can't use DynamicMethod as they don't support custom attributes
            var tb = moduleb.DefineType ("ctype_" + Interlocked.Increment (ref id_gen) + "_" + entry_point);
    
            tb.DefinePInvokeMethod ("Invoke", dll, entry_point,
    			    MethodAttributes.Static|MethodAttributes.PinvokeImpl,
    			    CallingConventions.Standard, typeof
    			    (void), arg_types,
    			    CallingConvention.StdCall, CharSet.Auto);
    
            var t = tb.CreateType ();
            var m = t.GetMethod ("Invoke", BindingFlags.Static|BindingFlags.NonPublic);
    
            return m;
        }
    }
    
    public class Tests
    {
        public static void Main (String[] args) {
            dynamic d = new PInvoke ("libc");
    
            for (int i = 0; i < 100; ++i)
                d.printf ("Hello, World %d\n", i);
        }
    }    
    	

    You can download the C# 4.0 Future document for details.

    Mono's C# 4 compiler so far implements optional parameters, named parameters, has support for the new covariant and contravariant specifiers and the dynamic keyword is evolving very quickly (as shown by the example above).

    If you want to test drive Mono's C# 4.0 compiler, you need Mono from Git and you must pass the "--enable-profile4=yes" argument. Once you do this, the new compiler will be installed as dmcs on your system.

    Nikhil has a nice sample that shows JSon integrated directly into C#.

    Posted on 11 Aug 2009 by Miguel de Icaza

    C# Sqlite

    Noah Hart did a line-by-line port of Sqlite to C# and has uploaded the code to code.google.com/p/csharp-sqlite.

    The frequently asked questions on the web site talks about performance (it is about 5 times slower than native code, but still, it can do 1.5 million selects per second, 300k inserts per second).

    Still, not bad for a line-by-line port; Folks on the #mono channel on irc.gnome.org a couple of days ago were commenting on the possible ways of tuning it up by not forcing the C way where the C# way would work just fine.

    The potential for this library is huge. It could be used for ASP.NET servers running in medium trust mode, or it could be used by Silverlight applications.

    It seems like Tim Anderson is attempting to remove all the P/Invokes from it to make it run on Silverlight (the P/Invokes are mostly used for doing file-level locking; Again part of the line-by-line history of it).

    Posted on 06 Aug 2009 by Miguel de Icaza

    MonoTouch: Mono on iPhone closed preview

    We have reached feature completion status for our MonoTouch project and we are looking for some adventurous iPhone developers that might be interested in trying out Mono for the iPhone and the MonoTouch APIs (A C# API for building Cocoa applications).

    We are doing a closed preview to gather feedback on MonoTouch, if you would like to be part of this preview/beta, please fill out the signup form.

    You can browse the source code for the sample widget catalog built using the MonoTouch.UIKit .NET binding to Cocoa's UIKit.

    Posted on 03 Aug 2009 by Miguel de Icaza

    MonoTouch: Mono on iPhone closed preview

    We have reached feature completion status for our MonoTouch project and we are looking for some adventurous iPhone developers that might be interested in trying out Mono for the iPhone and the MonoTouch APIs (A C# API for building Cocoa applications).

    We are doing a closed preview to gather feedback on MonoTouch, if you would like to be part of this preview/beta, please fill out the signup form.

    You can browse the source code for the sample widget catalog built using the MonoTouch.UIKit .NET binding to Cocoa's UIKit.

    Posted on 03 Aug 2009 by Miguel de Icaza

    Bridging C# and C++ on Unix

    Unlike Microsoft's .NET, Mono lacks a C++ compiler that can generate CIL code or mixed CIL/native code. This makes it harder for C++ codebases to integrate with C# code.

    One solution to the problem is to write C wrappers for every C++ method and then use P/Invoke to call into each wrapper. Dealing with virtual methods then becomes challenging.

    Andreia Gaita explains on Binding C++ APIs a technique that can be used to bridge the C++ and C# worlds using Mono's built-in support for COM objects.

    Posted on 03 Aug 2009 by Miguel de Icaza

    IronRuby Progres

    Antonio Cangiano from IBM compares the performance of the recently released IronRuby with Ruby 1.8 and 1.9 on Windows.

    On his blog post he looks at both the micro benchmarks and overall benchmarks. The summarized results:

    Antonio comment:

    IronRuby went from being much slower than Ruby MRI to considerably faster across nearly all the tests. That’s major progress for sure, and the team behind the project deserves mad props for it.

    One final warning before we get too excited here. IronRuby is not faster than Ruby 1.9.1 at this stage. Don’t let that first chart mislead you. While it’s faster in certain tests, it’s also slower is many others. Currently, it’s situated between Ruby 1.8.6 and Ruby 1.9.1, but much closer to the latter. The reason why this chart is misleading is that it doesn’t take into account any tests that timed out, and several of such timeouts were caused by IronRuby (more than those caused by Ruby 1.9.1). If you were to add, say, 300 seconds to the total, for each timeout for the two implementations, you’d quickly see that Ruby 1.9.1 still has the edge. The second chart that compares macro-benchmarks does a better job at realistically showing how IronRuby sits between Ruby 1.8.6 and Ruby 1.9.1 from a performance standpoint. If you were to plot every single benchmark on a chart, you’d find a similar outcomes for a large percentage of the tests.

    Whether it’s faster than Ruby 1.9 or not, now that good performances are staring to show up, it’s easier to see IronRuby delivering on it’s goal of becoming the main implementation choice for those who both develop and deploy on Windows. This, paired with the .NET and possible Visual Studio integration, the great tools available to .NET developers, and the ability to execute Ruby code in the browser client-side thanks to projects like Silverlight/Moonlight and Gestalt, make the project all the more interesting.

    Posted on 03 Aug 2009 by Miguel de Icaza

    SUSE Studio is out - The Linux Appliance Builder

    Update: Nat Friedman has written two great blog posts on SUSE Studio, check them out here:

    Today Novell announced the release of Nat's latest project: SUSE Studio. Nat has been working on this for a very long time.

    Studio is a tool that allows anyone with a web browser to create Linux-based systems and appliances. We believe that this is one of Linux' major strengths and we wanted to turn this potential into a reality.

    In addition to custom Linux builds, Nat's team has put a strong focus on Linux-based appliances.

    The goal of an appliance is:

    • Perform a single task well.
    • Requires minimal assembly and setup.
    • It comes as a standalone unit.

    The idea is that software developers can combine into a single deployable unit (a) the operating system; (b) your software plus any dependencies requires; (c) the proper configuration and data files required to operate.

    When you build your appliance with Studio, you can select the kind of system you want, the packages you want to install, you can preconfigure the system and you can even test-drive the result over the web (it uses a Flash applet) and even fine tune or do some last minute touches over the web (inside the Flash applet) before producing your final version:

    Test your Linux over the web.

    The resulting Linux distribution can be downloaded as an ISO image, you can update it, you can create a bootable USB Linux system with your software, generate a VMWare image or VPC image and next week you should be able to deploy them in Amazon EC2.

    We have been using Studio for building the Mono downloaded VMware/VPC images for a while. We bundle the latest Mono, MonoDevelop and various ASP.NET and Windows.Forms samples for developers to try out.

    As a software developer, you can move from a world where you let the end users assemble the solution themselves:

    Into a setup where you deliver the entire package to your end user:

    The above scenario is common in the Linux world, non-existent in the OSX world, and only large OEMs are able to do the same on the Windows world.

    What we wanted to do was enable anyone, with little Linux expertise to setup their own operating systems. You do not have to be an expert on kernels, boot loading, dependencies or anything else to produce your own operating system.

    In addition to Unix software, we are going to make it very easy for Windows developers to bring their applications to Linux. Our Mono for Visual Studio project will now allow developers to go straight from Visual Studio into a Linux powered appliance:

    Mono Visual Studio Plugin allows .NET to Appliance compilation.

    Posted on 28 Jul 2009 by Miguel de Icaza

    Proposed C# extensions

    Scott Peterson has written a proposal to extend C# to support parameterless anonymous methods.

    Scott's proposal includes a patch for Mono's C# compiler that implements the suggestion.

    The short story is that with this patch allows constructor initializers to also initialize events in an object. So you can now write code like this:

    var button = new Button () {
        Label = "Push Me",
        Relief = ReliefStyle.None,
        Clicked +=> Console.WriteLine ("ouch!")
    };
    	

    Both Bockover and myself love the 3.0 initializer syntax for objects and the only place where the awesomeness broke was the event initialization.

    Posted on 27 Jul 2009 by Miguel de Icaza

    Improving Mono's compatibility with .NET CLR

    For as long as we remember, most new versions of IronPython, IronRuby or the Dynamic Language Runtime exposed new missing functionality in Mono.

    After a major release of any of these tools that deeply exercise the internal Reflection.Emit support and the runtime we would implement the missing features and ship a new Mono version.

    As part of the Microsoft/Novell collaboration on Silverlight for Linux, a couple of months ago, we received from Microsoft the test suite for the Silverlight class libraries.

    We have been working on fixing all of the issues exposed by the test suite. The test suite exposed bugs in Mono and missing features that are necessary for Silverlight in general, as well as the DLR and the DLR-based languages like IronRuby and IronPython.

    We are pretty excited about the progress and the increased compatibility of Mono with Microsoft's .NET.

    Posted on 27 Jul 2009 by Miguel de Icaza

    MonoDevelop Refactoring

    The other day I did a quick tweet-vey asking folks what they wanted to see in MonoDevelop the most. It turned out that what they wanted the most matched pretty much what we had been working on.

    About 50% of the features requested will be in our upcoming MonoDevelop 2.2. One cool refactoring tool is bound to the F2 key. You press F2 in a parameter or local variable, and as you edit the local/variable, all the references in your method are updated accordingly live.

    ObScreenshot:

    There are many more features on the pipeline, but they deserve more than a quick post-and-run.

    Posted on 24 Jul 2009 by Miguel de Icaza

    Using Ruby and Python on Web Clients

    Project Gestalt allows developers to use Ruby and Python to script their web UIs.

    The project is powered by Silverlight's Dynamic Language Runtime and the IronPython and IronRuby. This means that they run under a sandboxed JIT engine.

    Using it in your web pages is very simple. All you need to do is include in your web page the "gestalt.js" javascript. Once you do that, you can then embed Python or Ruby source code using <script> language="python"<script> or <script> language="ruby"<script>

    <body>
    
    <button id="say_hello">Say, Hello!</button>
    
    <script language="python">
    def OnClick(s,e):
      document.say_hello.innerHTML = "Hello, World!"
        
    document.say_hello.AttachEvent("onclick", 
                       EventHandler[HtmlEventArgs](OnClick))
    </script>
    </body>
    </html>
    	

    This addresses a part of Silverlight's story that I always felt was less than ideal. Without the Gestalt script, developers using Ruby or Python had to package their software on a ZIP file before sending down to the client.

    Jimmy covers in more detail this important development. We both disliked the ZIP-file deployment model that Silverlight comes out of the box with.

    With Gestalt developers can treat Python and Ruby on the client in the same way they have been treating HTML and Javascript. Write code, hit save, refresh page.

    Check the samples.

    All four pieces (Gestalt, the Dynamic Language Runtime, IronRuby and IronPython) are open source technologies that run on either Microsoft's Silverlight or our own open source Moonlight.

    Posted on 22 Jul 2009 by Miguel de Icaza

    Popular Topics on ServerOverflow

    In the comments from my previous post someone pointed out ServerFault's question clouds:

    The StackOverflow tags are:

    I love to be working, contributing and participating with fabulous people that are advancing the hottest topics of discussion at Stack/Server/Overflow.

    Posted on 22 Jul 2009 by Miguel de Icaza

    Popular Topics on StackOverflow

    I am probably the last person to find about this, but I find the number of questions/tagged on StackOverflow fascinating:

    Posted on 21 Jul 2009 by Miguel de Icaza

    TreemapViewer: Building Silverlight Applications on Unix

    A few months ago, to get an idea of what contributed to the size of Mono libraries I wrote a small Treemap visualizer using Moonlight:

    Moonlight's assemblies; area represents the codesize.

    You can browser the code or get a copy from our AnonSVN repository.

    There are a couple of tools here:

    My Treemap is not very ambitious, and it is nowhere as complete as the new Treemap control that is part of the open source Silverlight Toolkit. But it was a fun learning experience for me.

    Reusable Engine

    I did not really know where we would use this control, on the web or on the desktop when I started. So I split the actual engine that does the heavy lifting from the actual chrome for the application.

    This is why I ended up with a Silverlight user interface and a Gtk# user interface. This idea in general might be useful for other developers as well.

    The Custom Control

    The custom control is very simple, it is called TreemapRenderer and derives from UserControl. The code overwrites two methods: MeasureOverride and ArrangeOverride. These methods are used to allow the control to participate in the Silverlight layout system (for example, the control can be embedded in a table that can auto-stretch). Silverlight invokes your MeasureOverride to find out the desired size that you control would like to consume:

    public class TreemapRenderer : UserControl {
    	protected override Size MeasureOverride(Size availableSize)
    	[...]
    
    	protected override Size ArrangeOverride(Size finalSize)
    	[...]
    }
    	

    Silverlight will invoke your control's ArrangeOverride to layout its contents once it has determined the size that the control will use.

    This is where my TreemapRenderer lays out its contents.

    This code renders an actual region on the treemap, I like the C# 3.0 initializer syntax for the text created:

    public void SetRegion (Rect newRegion)
    {
            region = newRegion;
            content.Children.Clear ();
            content.Width = region.Width;
            content.Height = region.Height;
            
            if (caption != ""){
                    int max;
                    string formatted = MakeCaption (caption, out max);
                    double w = region.Width * 1.60;
                    double s = w / max;
    
                    var text = new TextBlock () {
                            FontSize = s,
                            Text = formatted,
                            Foreground = new SolidColorBrush (Color.FromArgb (255, 0x5c, 0x5c, 0x5c))
                    };
    
                    Canvas.SetTop (text, (region.Height-text.ActualHeight)/2);
                    Canvas.SetLeft (text, (region.Width-text.ActualWidth)/2);
                    content.Children.Add (text);
            }
     
            Rect emptyArea = region;
            Squarify (emptyArea, root.Children);
     
            Plot (root.Children);
    }
    	

    To provide feedback to the user, I change the background color of the treemap on enter/leave. I use anonymous two anonymous methods, one for MouseEnter, one for MouseLeave.

    Notice that state is shared by these two blocks of code using C# variable capturing. A key feature of the language:

    	bool inside = false;
    	host.MouseEnter += delegate {
    	        host.Background = new SolidColorBrush (Colors.Yellow);
    	        if (text != null)
    	                text.Foreground = new SolidColorBrush (Colors.Black);
    	        inside = true;
    	};
    	
    	host.MouseLeave += delegate {
    	        host.Background = transparentBrush;
    	        if (text != null)
    	                text.Foreground = borderBrush;
    	        inside = false;
    	};
    	

    One thing that proved very useful was the ability to zoom-into an area. If you click on an assembly, you will get a rendering of the code size used by a type; If you click on that, you get a method breakdown on a class:

    drill-down into mscorlib's sizes.

    To transition, I added a cute animation where I render the new image and animate it from the area occupied in the larger view into the final size. This is the code that queues the animation:

            // Render a child
            void Clicked (Node n)
            {
    		// This is the child rendered, configure it to its final size
                    TreemapRenderer c = new TreemapRenderer (n, n.Name);
    
                    Size ns = new Size(region.Width, region.Height);
                    c.Measure (ns);
                    c.Arrange(region);
    
    		//
    		// Scale it and position on the spot that it currently
    		// occupies on the screen
    		//
                    var xlate = new TranslateTransform () {
                            X = n.Rect.X,
                            Y = n.Rect.Y };
    
                    var scale = new ScaleTransform () {
                            ScaleX = n.Rect.Width / region.Width,
                            ScaleY = n.Rect.Height / region.Height };
    
                    c.RenderTransform = new TransformGroup { Children = { scale, xlate } };
                    c.Opacity = 0.5;
                    content.Children.Add (c);
                    activeChild = c;
    
                    //
    		// Animate this to its final location
    		//
                    TimeSpan time = TimeSpan.FromSeconds (0.3);
    
                    var s = new Storyboard () {
                            Children = {
                                    Animate (time, xlate, "X", 0),
                                    Animate (time, xlate, "Y", 0),
                                    Animate (time, scale, "ScaleX", 1.0),
                                    Animate (time, scale, "ScaleY", 1.0),
                                    Animate (time, c, "Opacity", 1.0),
                            }};
    
                    s.Begin ();
    	}
    
    	// Helper method;   
            static Timeline Animate (TimeSpan time, DependencyObject target, string path, double to)
            {
                    var animation = new DoubleAnimation () {
                            Duration = time,
                            To = to
                    };
    
                    Storyboard.SetTarget (animation, target);
                    Storyboard.SetTargetProperty (animation, new PropertyPath (path));
    
                    return animation;
            }
    	

    The Silverlight Application

    Using the control is fairly simple, but since it loads a large XML files (feel free to change this to use a web service) I use the downloader and a callback to render the control.

            private void Application_Startup(object sender, StartupEventArgs e)
            {
    	    [...]
                var webclient = new WebClient();
                webclient.DownloadStringCompleted += delegate (object sender2, DownloadStringCompletedEventArgs ee){
                    try {
                        RootVisual.Dispatcher.BeginInvoke(() => LoadNodesFromString(ee.Result));
                    }
                    catch (Exception ex) {
                        main.BackButton.Content = ex.ToString();
                    }
                };
    
                webclient.DownloadStringAsync(new Uri("../mscorlib.xml", UriKind.Relative));
            }
    	

    The actual creation of the control happens in LoadNodesFromString:

            void LoadNodesFromString(String s)
            {
    	    // Use Size for the area.
                Node n = LoadNodes(s, "Size", "Extra");
                while (n.Children.Count == 1)
                    n = n.Children[0];
                
                treemap = new TreemapRenderer(n, "");
                Grid.SetColumn(treemap, 0);
                Grid.SetRow(treemap, 1);
                main.grid.Children.Add(treemap);
            }
    

    Building a Gtk# Out-of-Browser Client

    The above works great for Silverlight, but I like my application on the desktop, so I created a Gtk# version of it.

    Moonlight provides a Gtk# widget that can be embedded into C# desktop applications. This is what it looks like when running on the desktop. I know this screenshot is not too exciting as I did not do much with the Gtk+ side of things:

    Gtk# is rendering, seriously.

    The core of embedding Moonlight as a Gtk# widget is very simple, here it is:

    using Moonlight.Gtk;
    using Moonlight;
    
            public static void Main(string[] args)
            {
                    n = LoadNodes (args [0], "Size", "Foo");
    
                    Gtk.Application.Init ();
                    MoonlightRuntime.Init ();
    
    		// My container window.
                    Gtk.Window w = new Gtk.Window ("Foo");
                    w.DeleteEvent += delegate {
                            Gtk.Application.Quit ();
                    };
                    w.SetSizeRequest (width, height);
    
    		// The Moonlight widget that will host my UI.
                    MoonlightHost h = new MoonlightHost ();
    
    		// Add Moonlight widget, show window.
                    w.Add (h);
                    w.ShowAll ();
    
                    // Make it pretty, skip all levels that are just 1 element
                    while (n.Children.Count == 1)
                            n = n.Children [0];
    
                    // Render
                    TreemapRenderer r = new TreemapRenderer (n, "");
                    Size available = new Size (width, height);
                    r.Measure (available);
                    r.Arrange (new Rect (0, 0, width, height));
    
    		// This informs the widget which widget is the root
                    h.Application.RootVisual = r;
                    Gtk.Application.Run ();
            }
    
    

    There are Visual Studio and MonoDevelop solutions on the SVN for folks to try out.

    You can also try a sample live on the web.

    Posted on 20 Jul 2009 by Miguel de Icaza

    MiggyTour 2009

    In the third and fourth weeks of August, Laura and I will be spending a couple of days in Madrid visiting friends.

    Then a couple of days hanging out with Nat, Stephanie and a bunch of awesome friends and family friends in Florence.

    And then we are spending a week in Morocco, most likely in Marrakesh.

    If you live in Madrid or Marrakesh and would like to get together to meet and talk, send me an email.

    Posted on 17 Jul 2009 by Miguel de Icaza

    StackOverflow DevDays in Boston

    Joel Spolsky and Jeff Atwood have invited me to participate on StackOverflow's DevDays in Boston on October 7th.

    I will be talking about Mono, Mono and Visual Studio and Mono on iPhone. Come equipped with questions.

    Shocking, I know.

    Posted on 17 Jul 2009 by Miguel de Icaza

    LLVM powered Mono

    Mono from SVN is now able to use LLVM as a backend for code generation in addition to Mono's built-in JIT compiler.

    This allows Mono to benefit from all of the compiler optimizations done in LLVM. For example the SciMark score goes from 482 to 610.

    This extra performance comes at a cost: it consumes more time and more memory to JIT compile using LLVM than using Mono's built-in JIT, so it is not a solution for everyone.

    Long running desktop applications like Banshee and Gnome-Do want to keep memory usage low and also would most likely not benefit from better code generation. Our own tests show that ASP.NET applications do not seem to benefit very much (but web apps are inherently IO-bound).

    But computationally intensive applications will definitely benefit from this. Financial and scientific users will surely appreciate this performance boosthttp://www.mono-project.com/.

    Taking it out for a spin

    Note: the notes here are no longer relevant, these applied to Mono back in 2009. LLVM has now been integrated into Mono, follow the steps in http://www.mono-project.com/Mono_LLVM instead

    You need to install both LLVM and Mono from SVN.

    Get and install LLVM like this:

    $ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    $ cd llvm
    $ ./configure --prefix=/mono --enable-optimized
    $ make && make install
    

    Then get Mono, and you need to apply a tiny patch to configure.in.

    $ wget http://tirania.org/tmp/m7a9da378.txt
    $ svn co svn://anonsvn.mono-project.com/source/trunk/mcs 
    $ svn co svn://anonsvn.mono-project.com/source/trunk/mono 
    $ cd mono
    $ patch -p1 < m7a9da378.txt
    $ ./autogen.sh --prefix=/mono --enable-llvm=yes
    $ make && make install
    

    Now you have an LLVM-powered Mono.

    LLVM is not able to support some of the features that Mono needs, so in those cases the JIT compiler will still fall back to Mono's JIT engine (methods that contain try/catch clauses or methods that do interface calls).

    This backend was written by Zoltan.

    Posted on 16 Jul 2009 by Miguel de Icaza

    Banshee as a Platform?

    Aaron Bockover recently discussed Banshee's modular architecture. Aaron discusses using Banshee as a foundation for managing not only music, and videos but merging with F-Spot to manage photos as well:

    The slides from his talk go into a bit more detail.

    Jonathan Pobst takes the platform idea one step further and suggests that Banshee's core could also be used to replace YAST's Software Installer UI:

    Jonathan says:

    Every time I use YaST's Software Manager, I wonder if it would be better implemented using Banshee. Banshee's interface has been tuned for usability, both on its own, and what it borrows from iTunes. Software management is a naturally scary operation, and using an interface that the user is already familiar with could help reduce user fear.

    Of course, it would just be the interface pieces of Banshee in a new app, you wouldn't actually start Banshee for software installation.

    Another feature I would like to see taken from iTunes/Banshee is downloading/installing in the background. Once I hit Install, go ahead and download the application in the background, and install it in the background. I can click on the "Downloading/Installing.." menu item if I want to see what's going on. Most of the time, I'd rather be looking at other things to download.

    I think this is a brilliant idea.

    Posted on 15 Jul 2009 by Miguel de Icaza

    From Microsoft: C# and CLI under the Community Promise

    First the big news: Microsoft will be applying the Community Promise patent licensing to both C# and the CLI.

    The announcement was done by Peter Galli at Microsoft over at Port25 and it states (emphasis is mine):

    I have some good news to announce: Microsoft will be applying the Community Promise to the ECMA 334 and ECMA 335 specs.

    ECMA 334 specifies the form and establishes the interpretation of programs written in the C# programming language, while the ECMA 335 standard defines the Common Language Infrastructure (CLI) in which applications written in multiple high-level languages can be executed in different system environments without the need to rewrite those applications to take into consideration the unique characteristics of those environments.

    "The Community Promise is an excellent vehicle and, in this situation, ensures the best balance of interoperability and flexibility for developers," Scott Guthrie, the Corporate Vice President for the .Net Developer Platform, told me July 6.

    It is important to note that, under the Community Promise, anyone can freely implement these specifications with their technology, code, and solutions.

    You do not need to sign a license agreement, or otherwise communicate to Microsoft how you will implement the specifications.

    The Promise applies to developers, distributors, and users of Covered Implementations without regard to the development model that created the implementations, the type of copyright licenses under which it is distributed, or the associated business model.

    Under the Community Promise, Microsoft provides assurance that it will not assert its Necessary Claims against anyone who makes, uses, sells, offers for sale, imports, or distributes any Covered Implementation under any type of development or distribution model, including open-source licensing models such as the LGPL or GPL.

    You can find the terms of the Microsoft Community Promise here.

    I told you this was good news!

    A few months ago we approached Bob Muglia and Brian Goldfarb (@bgoldy) at Microsoft with a request to clarify the licensing situation for the ECMA standards covering C# and the CLI (also ISO standards, for the ISO loving among you).

    Previously Microsoft had detailed the patent license plans and today they have delivered on those plans.

    Astute readers will point out that Mono contains much more than the ECMA standards, and they will be correct.

    In the next few months we will be working towards splitting the jumbo Mono source code that includes ECMA + A lot more into two separate source code distributions. One will be ECMA, the other will contain our implementation of ASP.NET, ADO.NET, Winforms and others.

    Depending on how you get Mono today, you might already have the this split in house or not.

    Thanks to everyone at Microsoft that worked to get this approved and released. We appreciate that they made this a priority when we approached them, and we know that everyone in the .NET team was also incredibly busy with various betas: .NET 4, Visual Studio 2010, Silverlight, MVC, MEF and much more.

    I am overflowing with joy right now. Cheers!

    Update: Send your thanks to @bgoldy on tweeter, who crossed all the t's and dotted all the i's to make this happen.

    Update: Moderation of comments is taking place. Off topic messages will be removed immediatly. Trolling, as mild as it might be will be deleted. If you want to argue what language is the best one take the debate to a newsgroup.

    Posted on 06 Jul 2009 by Miguel de Icaza

    PhyreSharp runs on the PS3

    Mono on the PS3 has been making some nice progress. Supporting the PS3 requires some special features in Mono, for instance, a static compiler for .NET code for the PowerPC/Cell processor.

    PhyreSharp, our .NET binding to Sony's PhyreEngine game engine ran on Thursday for the first time.

    Posted on 03 Jul 2009 by Miguel de Icaza

    MonoSpace Conference Announced

    Scott Bellware has announced the MonoSpace Conference in Austin Texas on October 27-30th.

    Scott has made a Call for Speakers:

    The Monospace Conference is looking for teachers to give tutorials on the Mono framework, tools, languages, and platforms supported by Mono.

    Some tutorials are aimed at .NET developers with little experience with operating systems other than Windows, and others are geared to experienced Mono developers with exposure to the various Mono platforms.

    The tutorials are two hour to three hour interactive sessions that can be any combination of follow-along examples, labs, and lecture.

    We're looking for tutorials on subjects such as Linux, Mac, Windows, web, desktop, servers, message queues, databases, iPhone, Android, Amazon's EC2, among others.

    You can track the progress of the conference at the MonoSpace Conf Blog.

    You can also follow the progress on twitter.

    Scott was one of the founders of the Alt.Net series of conferences.

    Posted on 30 Jun 2009 by Miguel de Icaza

    Some Cool Mono Announcements

    Yesterday we shipped Mono 2.4.2, our long-term supported version of Mono. It ships Microsoft's opensourced ASP.NET MVC stack for the first time (you could get it before on your own, but now it is integrated) and fixes over 150 reported bugs.

    Chris Toshok announced M/Invoke a tool to port applications that use P/Invokes on Win32 to Linux and MacOS.

    What Chris does not talk about on his post is that he was trying to use some .NET software that interfaces via USB to his glucose meter and was trying to get this to run on Linux. The tool is mostly .NET with the usual handful of P/Invokes to Win32. And this is how M/Invoke was born: a tool to retarget P/Invoke happy applications into becoming pure managed applications.

    This opens new doors to forcefully port more apps to Linux.

    Alan McGovern released a new version of Mono.Nat one of the libraries used by MonoTorrent.

    Jordi Mas released a new version of Mistelix a DVD authoring tool for Linux:

    Jordi's GBrainy brain teaser game was picked up by MoLinux, a regional Linux distribution, and shipped it translated to Spanish:

    Joe Audette's mojoPortal was being installed four times as much when it got included in in Microsoft's Web Platform Installer site (more stats here).

    For years I have loved the Joel on Software rules for software engineering. And one of those rules is "Build in one step". We have not always succeeded, but we have always tried. Lluis delivers the one step to build and run for MonoDevelop on Windows: Load solution, Hit F5, up and running.

    Google Chrome really lead the way here, and I want very badly to have all of Mono building in Visual Studio with one keystroke, but we are not there yet.

    Stephane reports on some nice startup performance improvements for F-Spot. Loading time for 10 images from Stephane's own image collection went from 1.2 seconds to .5 seconds.

    MonoDevelop got some enhanced support for autoconf integration.

    Jeremy Laval released another version of ZenComic a desktop Comic reader:

    David Siegel announced a new release of Gnome Do on behalf of the Gnome Do team. In particular, it is now easier to write "Docklets" for the Gnome Do panel and for those of us that like the Emacs keybindings, it is now possible to use C-N and C-P for navigation

    And of course the Google Summer of Code is in full swing:

    And we have various very exciting projects brewing.

    Jonathan Pobst has been exploring integration points for Mono and Visual Studio 2010:

    Guadec: I will sadly not be attending the Guadec/Akademy conference in Canaria next week. This is going to be a busy summer for us as we are shipping a lot of code in the next few months: Moonlight 2.0, Mono for Visual Studio, MonoTouch 1.0 and Mono 2.6.

    Posted on 30 Jun 2009 by Miguel de Icaza

    Mono

    Posted on 29 Jun 2009 by Miguel de Icaza

    PhyreEngine, Mono, cool Mono uses in Gaming, and more.

    Last week there was a little Mono surprise. It can be found on this Novell-hosted web page web page (scroll a little bit).

    It has been a few very busy weeks at Novell's Eastern Research and Development Facility (Novell NERD Facility) here in Cambridge and we have been incredibly busy polishing some nice toys.

    A few weeks ago we learned about Sony's developer event in the West Coast. Michael, Zoltan and myself worked very hard to put together a demo to show the virtues of C# and the CIL to developers. So we cranked on some record time some code:

    • PhyreEngine#
    • Static compiler for PowerPC for Mono on PS3
    • A yield-based co-routine framework.

    We picked Sony's PhyreEngine to demostrate how to use Mono to write the high-level code for a game using Sony's finely tuned engine. We figured this was better than showing a for loop printing the numbers 1 to 10 on the screen.

    PhyreEngine# wraps PhyreEngine using the same techniques that we used in Gtk# and Moonlight. The resulting API is glorious and by letting PhyreEngine do all the heavy lifting while driving all the high-level from C# there is no way of telling that the driving force is not C++. All you get is pure unadultered productivity.

    To make our demos a little more interesting, Michael wrote a minimalistic yield-based co-routine framework inspired by some of the ideas that our friend Lucas gave us. It is a tiny toy, but we used it to illustrate the concept of using C# iterators as the foundation for game logic development and how a cooperative scheduler would work (Unity game logic works just like this).

    We were also working on completing Mono's port to the PlayStation 3's native operating system (this is different than running Mono on Linux on the PS3: that already works, and it was used for developing CellDotNet, a JIT for the PS3's SPUs). Zoltan developed the static compiler for PowerPC and I did the platform support.

    Mono can now run "Hello World" on the PS3 native OS. There are still lots of ins, lots of outs and lots of whathaveyous that need to be tied up before this fully works and before we are able to run PhyreEngine# on the PS3.

    Posted on 08 Jun 2009 by Miguel de Icaza

    Developing Cross Platform application with MonoDevelop

    Yesterday Lluis announced the last missing piece from our strategy to make MonoDevelop a full cross-platform IDE: MonoDevelop now runs on Windows as well:

    When we started the planning for MonoDevelop 2.2, the major goal of that release was to get feature parity on Linux, MacOS and Windows.

    We want to grow the community of developers that contribute to MonoDevelop and we wanted to attract add-in developers that wanted to bring their IDE extensions to all three platforms.

    MonoDevelop has recently been getting some nice community contributed plugins like Flash/Flex development support, Vala language support, Mono debugger for OSX (thanks to the nice folks at Unity for this!), VI editing mode and of course our own Silverlight and ASP.NET MVC add-ins.

    My theory is that supporting MonoDevelop on all the three major operating systems will have a multiplication effect in terms of contributions to MonoDevelop: it will help both users and will enable developers that extend MonoDevelop with add-ins to reach more users.

    I secretly want Unity to adopt MonoDevelop as the code editor for Unity; for the FlashDevelop guys on Windows to adopt MonoDevelop as their cross-platform foundation (their users want a cross platform Flashdevelop); for Flashbang to bring their UnityScript framework to MonoDevelop

    Developing an add-in for MonoDevelop now brings your enhancements to a much larger community.

    Look and Feel

    Although the IDE is built using Gtk#, but we are aware that developers want to get things integrated with their operating system as much as possible. This is why we have invested in properly integrating MonoDevelop with the Mac and Windows.

    The Look of MonoDevelop still has a heavy feel of the Linux Gtk+, but we are bluring the lines by making the theme and style match the operating system. Development in Gtk native themes will also continue to improve things.

    Feel wise, we make MonoDevelop follow the conventions of the host platform. For example, on the Mac, MonoDevelop uses the Mac system menu, it uses an entirely different keybinding style that follows what every Mac developer expects (Command-KEY operations that match X-Code for example) and even text selection in the editor behaves differently:

    More work will come, because we want MonoDevelop to feel native on each platform.

    On Windows for example, MonoDevelop runs on top of the .NET Framework and uses the .NET managed debugger instead of using Mono's runtime and Mono's debugger, so there is no dependency on Mono to be installed on the system.

    Posted on 04 Jun 2009 by Miguel de Icaza

    Moonlight 2 Preview 3

    Another week of excellent work on the Moonlight universe and we bring you our Preview 3 release of Moonlight. Alan McGovern said it best though.

    This week stats:

    This is what the Silverlight Toolkit Sample page looked with Preview 2:

    Moonlight 2 Preview 2

    This is what the Silverlight Toolkit page looks with Preview 3:

    Moonlight 2 Preview 3

    You should be able to update directly from Firefox, or if you are trying it for the first time, go to our http://go-mono.com/moonlight-preview/ page.

    Now, although Preview 2 was able to run the IronPython mini-Web IDE I am still going to try to pass that as a new feature.

    And now you can try the IronPython mini-Web IDE!

    Posted on 18 May 2009 by Miguel de Icaza

    Three Melon's Quest for R2-D2

    I had the honor to meet the Three Melon developers at Unity's party this year at the Game Developer Conference. Three Melons is an Argentinian-based company that builds online games, and most recently they have been using Unity to build their new online games.

    Today they just announced that their latest online game powered by Unity and Mono. "Quest for R2-D2" is now live at Lego.com:

    Pato Jutard, co-founder of Three Meleons announced the launch and posted the Making of Lego Star Wars game by Three Melons:

    Congratulations to the Three Melon developers for their launch!

    You can follow them on twitter.

    Posted on 16 May 2009 by Miguel de Icaza

    Moonlight 2 Preview 2

    As we promised last week (threatened?) now that the foundation for Moonlight 2 is in place, we will be doing weekly releases for folks to try out, and to increase the feedback that we have received.

    Thanks to everyone that provided bug reports and contacted us about the problems with last week's preview. In particular the issue affecting Ubuntu and SLED 10 users has been fixed and the plugin should work.

    If you installed Moonlight already, you can update either by restarting Firefox or by following these steps:

  • Click Tools/Addons
  • Click on the "Extensions" toolbar icon.
  • Click "Find Updates":
  • This will check for updates, and take you to the updates tab. Then clikc "Install Updates".

    If you have not installed Moonlight yet and want to try it out, go to http://www.go-mono.com/moonlight-preview.

    This release fixes various rendering problems, more sites should be working and the performance was increased in multiple hot spots.

  • Posted on 12 May 2009 by Miguel de Icaza

    Micro Focus Video

    My friend Stephen sent me an interesting video they just cooked up at Micro Focus giving some hints as to what is coming up on the keynote of Micro Focus Live.

    They recently bought Borland.

    Video: Micro Focus Live Developers Keynote.

    Posted on 11 May 2009 by Miguel de Icaza

    Developing Silverlight Apps on Linux and MacOS with Moonlight

    Earlier this week I promised I would blog about how to build Silverlight apps in Linux. Michael beat me to this and did a couple of screencasts.

    In Moonlight Development in Linux with MonoDevelop he walks us through the steps necessary to install the Moonlight SDK on top of Mono 2.4 and using MonoDevelop to create your app. Once you get these installed, here is how you get started with development:

    To render this content, you need Silverlight or Moonlight Preview or Silverlight

    MonoDevelop will provide auto-complete for the Silverlight APIs and also provide auto-complete in XAML files.

    In addition to Linux, you can also use MonoDevelop on OSX to do the same thing. We shipped Moonlight's SDK as part of the MonoDevelop/OSX release, the result runs with Microsoft's Silverlight.

    Michael again talks about it and produced a nice screencast:

    Screencast

    Posted on 08 May 2009 by Miguel de Icaza

    I, for one, welcome our new SH4 embedded overlords.

    ST Microelectronics, the maintainers of GCC-CIL (the GCC code generator backend that produces ECMA CIL bytecodes for Mono/.NET) have announced their port of Mono to the SH4 platform.

    The code is currently available from http://code.google.com/p/mono-sh4/.

    In addition to the MIPS64 port that I mentioned last week from SiCortex/nIX is now being merged into Mono's repository.

    MIPS apparently is not only used in super computers, but apparently is also powering $169 dollar netbooks.

    Posted on 07 May 2009 by Miguel de Icaza

    Mono talk at the Beantown.NET Users Group

    Tomorrow, Joseph, Michael, Gonzalo and myself will be talking at the Beantown.NET Users Group about Mono, Moonlight and MonoDevelop at 6pm.

    If you are in the Boston area, come join us for these open source festivities at Microsoft NERD center in Cambridge.

    Posted on 06 May 2009 by Miguel de Icaza

    Innovation

    Dana Blankenhorn comments on the the Moonlight 2.0 release and says:

    It's the kind of open source success story Microsoft wants publicized. Microsoft innovates, open source copies.

    It's not the kind of open source story open source needs, however.

    What open source needs is real innovation, created by teams who may or may not represent Microsoft's fierce competitors. This can be hard to deliver, and Microsoft would like us all to know resistance in this case is futile.

    A few points.

    First: Moonlight's core is designed to ensure that Linux users get access to content that is produced for Silverlight on the web.

    This is about making sure that Linux (and for that matter any other system where Moonlight can be compiled) does not become a second class citizen on the web.

    Folks will argue all day whether the Silverlight model is the right one; whether it is gaining adoption; whether it is necessary; whether it is part of the open web.

    But none of that matters when trying to access content on Linux: it is either possible to use it, or not. And having a working relationship with Microsoft allows us to bring it to Linux.

    Second: Dana is looking in all the wrong places for innovation. If he wants to see my team's work that deviates from the set of APIs that Microsoft has created, he could look at our work on SIMD; our interactive C#; Static compilation technology to support things like the iPhone; our cross platform MonoDevelop (Linux, OSX, Windows); Our Gtk# API for building the above; He could look at all of our Mono.* classes, or all of the libraries and APIs produced by our community (Mono.Addins, Mono.Nat, Mono.ZeroConf, BitSharp, Cecil, CocoaSharp, MonoObjc, Crimson, and some forty others; I just got tired of going through the list here and here).

    All of these created to solve a particular problem with the tools that we had on the platform we used.

    Or for that matter, even reading the announcements on my blog.

    Or he could look elsewhere in the vast universe of open source projects for ideas that match his definition of innovation. Not everything that is built in the open source world has to be about innovating in a completely new direction.

    Third, and most important one: The definition of Innovation.

    Innovation

    Most people that discuss innovation have not even bothered to actually think about what this means in the first place. And I am particularly bothered when people claim that open source does not innovate, but can only copy.

    Google's define:innovation is a good starting point.

    Are Ideas Innovations? Everyone has ideas, even great ideas. Every day you go to lunch, every day you are taking a shower, every day you are walking alone and thinking you are having new ideas.

    You can have a million ideas, and these might be innovative, but if they do not reach the world, did they matter?

    For an idea or an innovation to have a practical effect, they need to go beyond the discussion at the lunch table with your friends and become a reality.

    Bringing an Idea to Life Once I sit down and turn my idea into an actual tangible result there are a number of hurdles in my path.

    The idea must be good enough for people to try out, I must get it distributed, and I must get people to use it.

    Being first versus being to market first: It does not matter that many great ideas originate in the open source world or at the lunch table with your friends. You must bring the ideas to the public and the public must be in a position to adopt it.

    For instance, Compaq/Digital were showing portable MP3 players based on Linux years before the iPod took the world by storm. Yet, nobody remembers these devices anymore and Apple gets the credit for bringing digital audio to the masses.

    Or tagging and searching your email. GMail uses it today, but few people remember that the idea had been implemented before in Digital's Pachyderm.

    Many ideas might originate as personal prototypes or even open source prototypes, but without a distribution channel and an ecosystem that would sustain the innovation many of those ideas exist merely to be replaced by folks in a better position to market/distribute it.

    Claiming "I had the idea first" or "we were the first ones" is of little consolation if someone out-executes and out-markets you.

    Definitions of Innovation: Wikipedia (as of 10 seconds ago) defines Innovation as:

    The term innovation means a new way of doing something. It may refer to incremental, radical, and revolutionary changes in thinking, products, processes, or organizations. A distinction is typically made between invention, an idea made manifest, and innovation, ideas applied successfully.

    I also like this one (from Google's define: too):

    Innovation is the process that translates knowledge into economic growth and social well-being. It encompasses a series of scientific, technological, organizational, financial and commercial activities.

    I think that Moonlight fits this definition perfectly well in that case.

    Moonlight and Innovation

    Sure, we do follow the APIs that Microsoft set for Silverlight.

    But we have innovated in a number of ways:

    • We innovate in the development process: we are an open source project, taking contributions and consuming other open source components.

      We dogfood other FOSS components, and we iterate to improve them.

      In 1999, the MIT Technology Review magazine named me the innovator of the year. In the award ceremony, Bob Metcalfe said that I was receiving the award for the work on Gnome, not because Gnome was a ground-breaking system, but because the goals and processes of Gnome were.

    • We innovate in our cross-platform stance: Moonlight runs on more platforms (although admittedly, with a smaller market share than Windows and MacOS).
    • We had out-of-browser support before Silverlight did: Sure it was trivial, but we had it before (see above note on futility of claiming "we were here first").
    • Working with Microsoft: Ok, this is a bit of a stretch to claim as innovation, but here it goes: I am very proud that we are finding ways of working with a company that for many years resisted Linux and open source as well as helping Microsoft with all of its inertia become more open source friendly.
    • Update: Mats on the comments points out something that I wish I had thought of when I wrote this: "Innovation is also, and I'd say mostly if history teaches us anything, about building and improving upon ideas - not just making new ones from scratch."

    We (the Mono/Moonlight team) are not Dana's beacon of revolutionary change. But it is no secret that we are fans of the CLI virtual machine, and we believe that giving developers this platform will help them turn their ideas into innovations by giving them the best technologies available.

    Users of Mono and Moonlight have already demonstrated that they have way better ideas than I have ever had. And they already have used Mono in brilliant ways. Dana might want to check my blog more periodically to take note of those innovations.

    Posted on 06 May 2009 by Miguel de Icaza

    MonoDevelop on MacOS X

    Good news for all OSX users, a build of MonoDevelop that integrates with OSX is now available:

    MonoDevelop OSX-ified.

    For the impatient among you, click and run MonoDevelop.app.zip.

    It requires Mono 2.4 for OSX, on the upside, you can use this to develop ASP.NET MVC apps on the Mac.

    Some Background

    Back in February I showed a screenshot of MonoDevelop 2.0 for the Mac, it looked like this:

    Super-Alpha-Preview of MonoDevelop on OSX.

    It was basically the Gtk# based MonoDevelop IDE binary executing on the Mac. There was no porting involved, just the same executable running under Mono/OSX. The code works, but it did not feel like a Mac app:

    • The Menu bar was embedded in the window.
    • The keyboard accelerators were the Linux ones. They felt unnatural for OSX users, and also did not take advantage of the spare key (Command) to liberate the control key for other uses.
    • The editor behaved like a Linux editor.

    There is a vibrant Mono on OSX community out there, and it will only grow larger. We wanted to make sure that all of the work that is going into creating a great IDE is available for folks on the Mac in a way that is actually comfortable to use.

    So working with folks in the Mac Community and with folks at Unity Michael has been working on tuning up MonoDevelop on the Mac to become an editor that does not get in the way of Mac users and developers and integrates better from the "feel" perspective with other tools in the OS.

    For instance, not only does the new MonoDevelop for MacOS use the Mac menu bar, and the Mac accelerators (a combination of XCode and Textmate accelerators), but even the text editor has been altered to support the way selection and navigation works on the Mac.

    I figured that for every 100 users of MonoDevelop one of them will contribute patches back to the effort. If you happen to be that 1% hacker that will contribute back, you might want to look at a list of ideas to improve MonoDevelop on the Mac.

    MonoDevelop on Windows.

    MonoDevelop on Windows is on a similar boat: the 2.0 release works "out of the box" on Windows, but again, it is a GNOME IDE in a Windows land.

    Stay tuned for news from the MonoDevelop community as to what will happen there.

    Update: Lluis posted an update on the progress of MonoDevelop on Windows.

    Posted on 05 May 2009 by Miguel de Icaza

    Smooth Streaming with Moonlight

    I never tested Smooth Streaming before, just the more basic media tests, but the Smooth Streaming stack is running with our Moonlight preview:

    You can see a few rendering glitches for the controls on the screen. But this is really good news for our new media pipeline.

    Posted on 05 May 2009 by Miguel de Icaza

    First Moonlight 2.0 Preview is Out

    After a loving incubation period, the Moonlight 2.0 preview, an open source implementation of Microsoft's Silverlight for Linux has been released:

    This is really the release I have been looking for since Microsoft first introduced Silverlight 1.1 and ever since our 21-day hack-a-thon to bring Silverlight to Linux.

    This is the ECMA VM running inside the browser and powering C# and any other CIL-compatible languages like Ruby, Python and Boo. You can use Moonlight/Silverlight as a GUI (this is what most folks do) or you can use it as the engine to power your Python/Ruby scripting in the browser.

    Installing Moonlight 1.9

    Go to our preview page, select the platform and hit the download icon.

    That will download and install the plugin in your Firefox installation. You can then restart the browser, and you should see this:

    Then you can try out some of the test web sites we have been working on. This is CNN's The Moment that uses Silverlight/Photosynth:

    If instead of binaries you want to build Moonlight in the comfort of your own living room while sipping margaritas, fetch the source code for mono, mcs, mono-basic and moon from the branch and build them in this order: mono, mono-basic and moon.

    While one hand holds your margarita, use the other one to follow the instructions on how to compile Mono from SVN.

    Some Notes on this Release

    Now some qualifications to this release:

    This is a preview release. By this we mean that we are not yet feature complete with Silverlight 2.0 feature-to-feature but we are relatively close. For example, we do not yet pass the entire Silverlight GUI 2.0 test suite that was provided to us by Microsoft and you can spot glitches in various web sites.

    Security Sandbox: One of the reasons we delayed the first preview of Moonlight for public consumption was that we did not want to release Moonlight without the security sandbox. In the pre-Moonlight days there was no reason for Mono to implement a security sandbox, so we never had it. With Moonlight a security sandbox is mandatory so we implemented it.

    Moonlight 2.0 ships with the new CoreCLR Sandbox that was introduced in Silverlight 2.0. This security system is very easy to understand, it is pretty straightforward and is a lot easier to secure and audit than something like CAS. I will blog about the security stack in another post.

    But even if we now have a security sandbox , we have not completed the security audit.

    Weekly Releases: Our current plan is to update the plugin once a week during this preview/alpha period hoping that we can get good bug reports and to ensure that we work in as many Linux distributions as possible.

    Debug Builds: During the preview/alpha cycle we are shipping our code with debugging symbols hoping that this will improve the quality of the bug reports that we receive. This means that the plugin size instead of being 3.9 megs is 8.8 megs on average. This will change when we do the final release.

    The Cool Toys

    There are a number of cool toys on this release, the foundation for many things to come. Here are some:

    Silverlight Unix SDK: If you install Mono 2.4 and Moonlight SDK (not the browser plugin, but the -devel package) you can now develop Silverlight applications entirely in Unix.

    In fact when you install Eclipse4SL (a Microsoft sponsored project) you need Mono 2.4 to build Silverlight apps. With the Moonlight SDK you can skip an entire step by having the SDK assemblies present at installation time.

    I will do another blog on how to build Silverlight apps from the ground up on Unix using the Moonlight SDK.

    Microsoft MS-PL Controls: Instead of reimplementing the high-level controls (buttons, Checkboxes, listboxes, containers, calendars, datepickers, sliders) or the very advanced controls (like a full database bound datagrid) Moonlight reuses Microsoft's open sourced Silverlight controls.

    Iron* Languages: In addition to C# you can run code written in a variety of programming languages that target the ECMA CLI. In particular dynamic languages.

    IronRuby and IronPython are open source implementations of Ruby and Python done by Microsoft that can be used in Silverlight but you can also use a variety of other languages in the browser like Visual Basic or PHP (Phalanger).

    Visual Basic Runtime: This is just a plug for the work that Mainsoft did a few years ago. One of the things that Silverlight ships with is a Visual Basic class library for all the VB helper functions.

    Mainsoft contributed a few years ago a VB runtime written entirely in VB

    We ship a "tuned" version of their assemblies as part of the Moonlight release.

    Adaptive Streaming: This also deserves a blog entry of its own. In addition to the support for HTTP-Streaming (to support seeking and stream quality selection) Silverlight allows developers to create their own transports to fetch media and not be limited by HTTP.

    For instance, a developer could write a transport that fetches different bits of the media from different servers. Or use bittorrent to fetch the media instead of depending on a single server. More in an upcoming blog entry.

    DeepZoom: with all of the bells and whistles that you expect.

    Hard Rock Memorabilia on Moonlight/Linux.

    Silverlight 3.0 APIs: As we were implementing the 2.0 APIs a handful of features from 3.0 fit naturally into our design. So instead of going the extra mile to limit things in 2.0, we just expose the 3.0 APIs in a forward-compatible fashion.

    This Moonlight preview includes a few 3.0 features:

    • Out-of-browser support (although this is currently a manual process, not yet automated, and without a GUI).
    • WritableBitmap class.
    • 3.0 pluggable media pipeline.
    • SaveDialog support.

    There are more details see Chris Toshok's blog entry.

    The pluggable media framework is very exciting to us, because it means that developers can author their own codecs without waiting for Silverlight or Moonlight to add support for it.

    We have developed a handful of open source codecs for Dirac, Vorbis and ADPCM that can be used with Silverlight 3/Moonlight Preview based on existing C# and Java implementations. Hopefully someone will help us fill in the blanks with more codecs (like Theora).

    For up-to-date news check out our README file.

    In the words of Paris Jobs, this release is nothing short of hawt.

    Moonlight Twitteristas

    If you want to follow the progress of various Moonlight activities on Twitter, you can follow these folks:

    • moonproject: the twitter account for project news.
    • kumpera: in charge of the Mono metadata and IL verifier and creator of Mono.SIMD.
    • spouliot: Mono's security and cryptography Czar and graphics hacker.
    • lewing: Moonlight core hacker, in charge of Moonlight's layout and performance and also the creator of the Linux logo and co-developer of F-Spot.
    • toshok: Moonlight team leader and maintainer of the core of Moonlight. ex-Winforms team lead.
    • jbevain: In charge of the Silverlight 2.1 API, Mono's Linker and Cecil.
    • kangamono: Codec hacker, hard-problem solver, iPhone support, Mono on Mac.
    • atsushi_eno: XML, LINQ to XML, WCF and pluggable codec author.
    • sh4na: Recovering winformista, in charge of the new toggle ref implementation and the Moonlight/Javascript bridge.
    • rolfkvinge: media pipeline, visual basic runtime, vbnc compiler (Mono's VB compiler written in VB).
    • jstedfast: text layout engine, and ex-Evolution hacker.
    • jacksonh: All things XAML, a recovering Winformista/Ilasm-ista. A must-follow twitterista, considering that even Aimee_b_loved follows him.
    • rustyhowell: release engineering.

    Some of the team members are not twitteristas yet.

    Alternatively, if you are not really into twitter, you can always check our aggregated blogs at monologue.

    Posted on 04 May 2009 by Miguel de Icaza

    Interactive C# Code Completion

    Last month I introduced code completion in Mono's Interactive C# shell. You can use the TAB key to auto-complete at the current cursor position. Pressing the TAB key twice will list all possible completions.

    This should make the csharp more pleasurable to use and for bash junkies like me a more natural fit.

    This is particularly useful to explore an API like Gtk#:

    	csharp> LoadPackage ("gtk-sharp-2.0");
    	csharp> using Gtk;
    	csharp> Application.Init ();
    	csharp> var w = new Window ("Hello");
    	csharp> w.SetF[tab]
    	SetFlag SetFocus SetFrameDimensions
    	csharp> w.SetFo[tab]
    	csharp> w.SetFocus ();
    	

    This comes in quite handy for completing namespaces, types and valid methods. It works with the C# 3.0 initializer syntax as well, that one is useful in Silverlight for those of us that can not stand to type XAML instead of C#:

    	csharp> new TextBlock () { Bac[tab]
    	

    Does the nice:

    	csharp> new TextBlock () { Background
    	

    Bonus points: another tab at that point inserts the equal sign to assign the value.

    This was done by extending the Mono.CSharp.Evaluator API to provide code completion.

    The API is fairly simple:

    public static string [] GetCompletions (string input, out string prefix)
    	

    This will provide possible completions (methods, properties, fields) that are valid at that point in the string.

    A discussion that details the implementation of how the compiler supports code completion is in the mailing list and our compiler documentation has been updated to include a tutorial on expanding code completion.

    The next step is to implement this for the interactive GUI shell.

    Posted on 28 Apr 2009 by Miguel de Icaza

    Gtk# 2.12.8 Installer for Windows

    Mike Kestner yesterday announced the availability of the new Gtk# installer for Windows.

    A few good news: the entire stack (Gtk+, Cairo and Gtk#) comes in a nice 8 meg download, it is packaged as an MSI and it is now signed by Novell's certificate, so you no longer get a scary "Unknown Publisher" dingus on the screen.

    This is the equivalent of the greek god Prometheus giving fire to humans.

    We are giving Windows developers a nice cross-platform toolkit that is nicely integrated into Visual Studio. To try a sample application using it, you can download Tomboy, load the Tomboy.sln solution, hit F5 and enjoy.

    Posted on 22 Apr 2009 by Miguel de Icaza

    PseudoTerminal class

    As a follow up to yesterday's post I did the "hard work" of cut-and-pasting the VTE pseudo-terminal support+gnome-pty-helper into an independent module and wrote a managed binding for the code, autoconf-ified it and put it on SVN.

    Code lives in the pty-sharp module, or you can get a tarball.

    Now someone needs to do the trivial hack of writing the Mono terminal emulator.

    Posted on 21 Apr 2009 by Miguel de Icaza

    Pseudo Terminals and Terminal Emulators

    There was a discussion about how to host REPLs in applications like MonoDevelop recently and some of the discussion was centered around how to host something like a shell into a program like MD.

    Since I have been thinking about building a Silverlight-based version of the Midnight Commander (OH NOES!) I figured I should share some thoughts that I had on this matter.

    Widgets like ZVT and VTE today bundle a number of things in a single widget:

    • A Unix Pseudo terminal with login/logout support (Unix flavor-specific).
    • A terminal emulator that turns escape sequences generated by a stream into rendering commands.
    • A binding to the Gtk+ toolkit to send input events to the child process and render the terminal results.

    I would like to see some nice C# libraries for doing each one of those tasks independently of each other. Think of it as the MVC of terminal widgets. Like this:

    Reusable Blocks for Terminal Emulation.

    Pseudo-terminal support: the functionality to create pseudo terminals is very OS-specific, it is hard to get right and getting the more advanced features like registering your session is even harder. Very few applications get this right (mc, zvt and vte all use the same code that took me years to fine tune but has never been made reusable for other applications).

    This can be used beyond terminal emulators, it can be used to script or control programs expect a real terminal to run. These are typically interactive Unix console applications.

    Those applications either break or refuse to run when their standard input or standard output are redirected. Expect is a system built on top of this functionality

    Terminal Emulation: A terminal emulator class that supports the vt100/xterm command set and render it into some internal buffer; can take high-level keystrokes and encode them as byte streams (for example turning Alt-X into ESC-x) and supports terminal resizing.

    This terminal emulator should not be bound to Gtk+ it should merely render into a text buffer.

    Gtk#, Silverlight and Curses Bindings: Once the underlying terminal emulator exists we will need to write a handful of bindings to the terminal emulator.

    The Gtk# is an obvious choice for embedding terminal emulators inside things like MonoDevelop.

    The Silverlight binding would allow people to create full fledged SSH clients on the web.

    The curses binding could be used to implement an application like GNU Screen or it could be used in an application like the Midnight Commander (the Midnight Commander plays some Unix tricks to avoid having to emulate a terminal, and this has been a small weakness).

    Posted on 20 Apr 2009 by Miguel de Icaza

    Banshee and Tomboy over the weekend

    Over the weekend a couple of interesting post were made:

    In "Fitting the Kitchen Sink into a CD" Jo from the the Debian/Ubuntu Mono developers and describes how the way they have split Mono on Debian/Ubuntu makes it so that replacing Rhytmbox with Banshee Media Player ends up consuming less space on Ubuntu's LiveCD (6 megs) and brings more features.

    Nice to see that using managed code consumes less space and delivers more features. There is a heated debate on the comments as well.

    Sandy Armstrong also posted an update on the desktop note-taking application Tomboy that now runs on Windows and MacOS X.

    Sandy was just saying a few weeks ago that porting Tomboy to Windows brought new developers to the project. Although some people have historically been against the idea of making Linux software available on other platforms, it is nice to see day-to-day validation that by expanding the scope of our open source software to other platforms it directly improves the software in our own platform (as many predicted).

    Posted on 20 Apr 2009 by Miguel de Icaza

    Common Compiler Infrastructure and Cecil.

    Last week at Lang.NET 2009 conference the Common Compiler Infrastructure was open sourced under the terms of the MS-PL license.

    This library was developed used internally at Microsoft some years ago to support some internal projects. This provides a set of services similar to our own Cecil library. Despite this, it is nice to see Microsoft open source more code.

    Cecil, in addition to the low-level APIs for reading and writing ECMA CIL files has a few niceties layered on top of it like a Flowanalysis engine (it is used to decompile byte codes into ASTs) and a full fledged decompiler.

    Additionally, Marek is currently replacing the backend in our C# compiler to move away from System.Reflection.Emit into using Cecil so that we can bring our C# REPL to Windows developers.

    Mono's C# REPL currently works in a very limited mode in .NET (no generics, no LINQ) because .NET's System.Reflection has several limitations for building full-fleged compilers. To work around this issue Mono has over the years extended the Reflection stack to provide the features that were missing. We were never quite happy with this and we are now dropping it in exchange for Cecil.

    JB, the creator of Cecil shares with us his take on Cecil and the CCI.

    Posted on 20 Apr 2009 by Miguel de Icaza

    Job Posting: Mono Hacker Looking for a Job

    A good friend of mine that has extensive experience with C# and has written significant portions of the Banshee media player, has contributed to our C# 3.0 and C# 4.0 support and to our runtime is looking for a programming job.

    If you want to hire him, drop me an email and I will get you in touch with him.

    Posted on 10 Apr 2009 by Miguel de Icaza

    Continuations in Mono: Embrace and Extending.NET, Part 3

    Update: I accidentally published an incomplete version of this blog entry the other day before the actual content and samples were ready.

    As part of our ongoing Embrace and Extend.NET series (SIMD, supercomputing), today I wanted to talk about the Mono.Tasklets library that has just landed on Mono's repository.

    This library will become part of the Mono 2.6 release.

    Mono.Tasklets is the Mono-team supported mechanism for doing continuations, microthreading and coroutines in the ISO CLI. It is based on Tomi Valkeinen's excellent work on co-routines for Mono.

    Unlike the work that we typically do in Mono which is pure C# and will work out of the box in .NET (even our Mono.SIMD code will work on .NET, it will just run a lot slower) Mono.Tasklets requires changes to the VM that are not portable to other ISO CLI implementations.

    History

    Unity Early Experiments

    Back in 2004 when Unity first started to explore Mono, Joachim Ante brought up the topic of coroutines in Mono. On an email posted to the mono-devel-list he stated:

    I want to be able to write scripts like this:
    	void Update ()
    	{
    	    Console.WriteLine ("Starting up");
    	    //Yields for 20 seconds, then continues
    	    WaitFor (20.F);
    	    Console.WriteLine ("20 seconds later");
    	}
    	

    The WaitFor function would yield back to unmanaged code. The unmanaged code would then simply go on, possibly calling other C# methods in the same class/instance. After 20 seconds, the engine would resume the Update method.

    The idea here is to have multiple execution paths running on a single thread using a sort of cooperative multitasking. GUI programmers are already used to this sort of work by using callbacks: event callbacks, timer callbacks and idle callbacks. In Gnome using C or C# 1.0 you use something like:

    	void do_work ()
    	{
    		printf ("Starting up\n");
    		g_timeout_add (20 * msec, do_work_2, NULL);
    	}
    
    	void do_work_2 ()
    	{
    		printf ("20 seconds later\n");
    	}
    	

    Although lambdas help a little bit in C# 2.0 if the core of your application needs to chain many of these operations the style becomes annoying:

    	DoWork ()
    	{
    		Console.WriteLine ("starting up");
    		Timeout.Add (20 * msesc, delegate {
    			Console.WriteLine ("20 seconds later");
    		});
    	}
    	

    In event-based programming everything becomes a callback that is invoked by the main loop. The developer registers functions to be called back later in response to a timeout or an event.

    Another alternative is to build a state machine into the callbacks to put all of the code in a single method. The resulting code looks like this:

    	void do_work (void *state)
    	{
    		MyState *ms = (MyState *) state;
    	
    		switch (ms->state){
    		case 0:
    			printf ("starting up\n");
    			ms->state = 1;
    			g_timeout_add (20 * msec, do_work, state);
    			break;
    		case 1:
    			printf ("20 seconds later");
    		}
    	}
    	

    It is worth pointing out that Joachim and in general the gaming world were ahead of our time when they requested these features. This style of threading is commonly referred as microthreading or coroutines.

    At the time, without runtime support, Rodrigo suggested that a framework based on a compiler-supported generator-based system using the yield instruction would satisfy Joe's needs for coroutines in the gaming space.

    This is what Unity uses to this day.

    C# Yield Statement in Mono

    The yield statement in C# works by building a state machine into your method. When you write code like this:

    	IEnumerable DoWork ()
    	{
    		Console.WriteLine ("Starting up");
    		yield return new WaitFor (20 * msec);
    		Console.WriteLine ("After resuming execution");
    	}
    	

    The compiler generates a state machine for you. In the above example there are two states: the initial state that starts execution at the beginning of the function and the second state that resumes execution after the yield statement.

    A year later we used a variation of the above by employing nested yield statements in C# to implement Mono's HttpRuntime pipeline stack.

    Cute screenshot from my blog at the time:

    Yield statements can be used to solve this class of problems, but they become annoying to use when every method participating in suspending execution needs to become an iterator. If any part of the pipeline is not built with explicit support for yield, the system stops working. Consider this:

    void Attack()
    {
    	 DoTenThings ();
    }
    
    void DoTenThings()
    {
    	  for (int i=0; i < 10; i++){
    	      C();
    	  }
    }
    
    IEnumerable C()
    {
    	   yield WaitForIncomingMessageFromNetwork();
    }
    	

    Here, even if the WaitForIncomingMessageFromNetwork uses yield the callers (DoTenThings and Attack) are not participating, they merely discard the return from yield, so the execution does not return to the main loop.

    Using a yield-based framework is not much of a problem if you only need to use this every once in a while. For example we use this in our ASP.NET engine but it is only used in a handful of places.

    Unity used an approach built on top of the yield framework to suspend and resume execution. For example this is invoked by the Update() function on an enemy script:

    function Patrol() {
    	while(true) {
    		if (LowHealth ())
    			RunAway();
    		else if (EnemyNear ())
    			Attack();
    		else
    			MoveSomewhere();
    		yield; // done for this update loop!
    	}
    }
    
    function Attack () {
    	while (!LowHealth () && EnemyNear ()) {
    		DoTheAttack ();
    		// done with this update, and wait a bit
    		yield WaitForSeconds (attackRate);
    	}
    	// return to whatever invoked us
    }
    	

    The same can be done in Unity with C#, but your functions should be declared as returning an IEnumerable.

    Microthreading in SecondLife

    In 2006, Jim from LindenLabs introduced the work that they had done in SecondLife to support microthreading.

    Jim's work was a lot more ambitious than what both Joe had requested. SecondLife required that code be suspended at any point in time and that its entire state be serializable into a format suitable for storage into a database. Serialized state could then be restored at a different point in time or on a different computer (for example while moving from node to node).

    For this to work, they needed a system that would track precisely the entire call stack chain, local variables and parameters as well as being able to suspend the code at any point.

    Jim did this by using a CIL rewriting engine that injected the state serialization and reincarnation into an existing CIL instructions stream. He covered the technology in detail in his Lang.NET talk in 2006.

    The technology went in production in 2008 and today this continuation framework powers 10 million Mono scripts on SecondLife.

    Tomi's Microthreading Library

    That same year Tomi posted a prototype of coroutines for Mono called MonoCo, inspired by the use of Stackless Python for EVE Online.

    The Stackless Python on EVE presentation goes through the concepts that Tomi adopted for his Mono.Microthread library.

    Tomi's approach was to modify the Mono runtime to support a basic construct called a Continuation. The continuation is able to capture the current stack contents (call stack, local variables and paramters) and later restore this state.

    This extension to the runtime allowed athe entire range of operations described in the Stackless Python on Eve presentation to be implemented. It also addresses the needs of developers like Joachim, but is not able to support the SecondLife scenarios.

    Mono.Tasklet.Continuation

    The Mono.Tasklet.Continuation is based on Tomi's Microthreading library, but it only provides the core primitive: the continuation. None of the high-level features from Tomi's library are included.

    This is the API:

    	public class Continuation {
    		public Continuation ();
    		public void Mark ();
    		public int Store (int state);
    		public void Restore (int state);
    	}
    	

    When you call Store the current state of execution is recorded and it is possible to go back to this state by invoking Restore. The caller to Store tells whether it is the initial store or a restore point based on the result from Store:

    
    	var c = new Continuation ();
    	...
    
    	switch (c.Store (0)){
    	case 0:
    		// First invocation
    	case 1:
    		// Restored from the point ahead.
    	}
    	...
    	// Jump back to the switch statement.
    	c.Restore (1); 
    	

    Tomi implemented a Microthreading library on top of this abstraction. I ported Tomi's Microthreading library to Mono.Tasklet framework to test things out and I am happy to report that it works very nicely.

    Tomi's patch and library were adopted by various people, in particular in the gaming space and we have heard from many people that they were happy with it. Not only they were happy with it but also Paolo, Mono's VM curator, liked the approach.

    Frameworks

    Speaking with Lucas, one of the advocates of Tomi's VM extensions, at the Unite conference it became clear that although the Mono.Microthreads work from Tomi was very useful, it was designed with the EVE scenario in mind.

    Lucas was actually not using Mono.Tasklets on the client code but on the server side. And when used in his game the Stackless-like primitives were getting on his way. So he used the basic Continuation framework to create a model that suited his game. He uses this on his server-side software to have his server micro-threads wait for network events from multiple players. The Tomi framework was getting in Lucas' way so he created a framework on top of the Continuations framework that suited his needs. He says:

    I found however, that what system you build on top of the core continuations tech, really depends on what kind of application you're building. For instance, I have a system where I send serialized "class ProtocolMessage" 's over the network. they have a questionID and an answerID, which are guids.

    in my code I can say:

    	// automatically gets questionID guid set.
    	var msg = new RequestLevelDescriptionMessage();         
    	someConnection.SendMessageAndWaitForAnswer (msg);
    	

    the last call will block, and return once a message with the expected type, and matching answerID has been received. This is made to work because the SendMessageAndWaitForAnswer<T>() call adds itself to a dictionary<GUID,MicroThread> that keeps track of what microthreads are waiting for which answer. A separate microthread reads messages of the socket, and reads their answerID. it then looks to see if we have any "microthreads in the fridge" that are waiting for this message, by comparing the guid of the message, to the guid that the microthread said it was waiting for. If this is it, it reschedules the microthreads, and provides the message as the return type for when the microthread wakes up.

    This is very specific to my use case, others will have things specific to their use cases.

    Going back to the Joachim sample from 2004, using Tomi's code ported to Mono.Tasklets, the code then becomes:

    	void Update ()
    	{
    	    Console.WriteLine ("Starting up");
    	    //Yields for 20 seconds, then continues
    	    Microthread.WaitFor (20.F);
    	    Console.WriteLine ("20 seconds later");
    	}
    	

    The MicroThread.WaitFor will suspend execution, save the current stack state --which could be arbitrarily nested-- and transfer control to the scheduler which will pick something else to do, run some other routine or sleep until some event happens. Then, when the scheduler is ready to restart this routine, it will restore the execution just after the WaitFor call.

    A sample from the game world could go like this:

    	prince.WaitForObjectVisible (princess);
    	prince.WalkTo (princess);
    	prince.Kiss (princess);
    	

    The code is written in a linear style, not in a callback or state machine style. Each one of those methods WaitForObjectVisible, WalkTo and Kiss might take an arbitrary amount of time to execute. For example the prince character might not kick into gear until the princess is visible and that can take forever. In the meantime, other parts of the game will continue execution on the same thread.

    The Continuation framework will allow folks to try out different models. From the Microthread/coroutine approach from Tomi, to Lucas' setup to other systems that we have not envisioned.

    Hopefully we will see different scheduling systems for different workloads and we will see libraries that work well with this style of programming, from socket libraries to web libraries to file IO libraries. This is one of the features that Lucas would like to see: Networking, File and other IO classes that take advantage of a Microthreading platform in Mono.

    Posted on 09 Apr 2009 by Miguel de Icaza

    Boston .NET Users Group Presentation

    Today both Joseph and myself are doing a presentation on Mono, Moonlight at the Boston .NET Users Group meeting in Waltham.

    We will be demoing the Visual Studio integration and remote debugging capabilities of Mono as well as SuseStudio to go from an ASP.NET application into an appliance with a handful of clicks.

    Posted on 08 Apr 2009 by Miguel de Icaza

    Update

    The actual post on Mono continuations and coroutines is available here.

    Posted on 07 Apr 2009 by Miguel de Icaza

    Monday Mystery: Poetry Showing up on my Surveys.

    Yesterday I was pondering whether I should go to Lang.NET 2009 and unable to make a decision, I ran an online poll and asked people to vote on twitter:

    In my survey I listed the pros and cons to give people a feeling of what I was up against.

    The first couple of votes were not very helpful, I got 2 votes, one said yes, one said no.

    Then another twenty or so votes came and the balance started to shift towards "go". Here is the final result:

    And then something very strange happened, the comment section for the online poll started getting people's opinion in the form of poems or Haikus.

    I copy pasted some of the poems below:

    In my heart you will always be now in heaven i cant wait again to see

    When I decided not to roam
    I just stayed home
    Got a lot done
    Enjoyed some time in the sun


    Listen to good talks with your friends
    Before all the fun ends!

    Catch up and learn about Google's V8
    --Maybe you'll even get a date!

    You should go because it will be a blast
    Life is short, so make it last!


    a haiku for miguel:

    Improve your cv
    Boston is lovely right now
    Drink with nerdy folks


    I can’t make up my mind.
    I really am in a bind.
    I can go to Lang dot net,
    And my day will be set.
    Or stay at home and work,
    Like a common store clerk.
    This choice will be easy.
    Lang is where I will be.

    Should I stay,
    or should I go?
    For every con,
    there is a pro.

    I could see old friends,
    and make some new.
    Or stay at home,
    and get work done too.

    I could learn about Second Life,
    and Google's V-8.
    And actually accruing miles
    would really be great.

    It would take a whole week.
    And delay my work,
    But learning something new
    Is definitely a perk.

    A programmer I am,
    and a programmer I will be.
    I think this great poem
    made my mind up for me.


    New friends
    Old friends
    Learning new things
    And when you get back to Boston
    You can have some baked beans


    destroyer of days seven
    bringer of travel expenses
    Lang.NET

    provider of lectures
    connector of colleagues
    Lang.NET

    delayer of projects
    impeder of family time
    Lang.NET

    programmer of dynamic C#
    granter of Second Life
    Lang.NET

    Why go across the country to have a v8?
    Because that's what .NET is 4.
    Lang.NET


    Kill time
    or make new friends?
    Lose a little time from work
    or catch up with those you've fallen out of touch with?
    Work can always wait Miguel
    opportunity cannnot.


    Another dollar for yet another day,
    That is what they all used to say.
    For Lang.NET 2009 I pine away
    The cost to do it makes me say “Hey!”
    Give me Second Life with which to play
    If only I could go to the conference that way
    I’d program it if C was their programming thang’


    Let me help Miguel on what to do.
    He's undecided...can't decide between the two.
    If he goes to Lang. NET, work at home will pile high.
    If he stays home to work, perhaps he'd cry.
    He'd miss the chance to learn Second Life,
    Or make new friends, maybe even find a wife!

    So it costs a few bucks to get to there.
    He'd blow it on something else other than air fare!
    Make the reservations today and don't delay.
    You'll have a good time....that's what I say!


    Divided I stand
    The opportunity to advance ahead
    A week of talks and new friends await me
    On my way to Lang.NET 2009.

    One week gone,
    Trekking across the country.
    Putting all tasks aside,
    I delay work
    On my way to Lang.NET 2009.

    In the end,
    The journey made
    Is better than the journey dreamed.


    Oh the choice, to go or to stay
    that is Miguel's question of the day!

    Should he go, he would have a great time
    Should he stay...he might save a dime!

    Going he will learn about new things out there
    Staying he might...get more work done fair.

    The choice looks easy to someone like me
    but then again I'm not Miguel....I'm Susie


    Once when Miguel was feeling weak,
    A conference looked to kill his week.
    But opportunity there it seemed was rife:
    A chance to master Second Life!


    Miguel's Dilemma
    Should I stay or should I go
    The trip could be for not
    But my gut says I should go
    Money,work,time and home
    Oh, well bye bye I go.....


    knowledge is calling me to fill him up
    my friends are quite expecting
    there are also some guys I don't know that i have to spy on

    who cares about work!
    who cares if I hitchhike to Lang.Net!

    home will always wait
    across the country I will enlighten myself


    To Lang.NET or not to Lang.NET ... that is the question.
    Whether 'tis nobler to learn about great stuff
    Like Second Life and dynamic C#,
    Or consider it the death of
    An entire week away from home,
    Thereby missing out on the catching up with old friends.
    What value, then, shall be given
    This knowledge and friendship?
    Is it greater than the cost of transport and per diem?
    Only Miguel can truly tell.

    Lang.NET
    Lang.NET
    Oh this decision should not make you fret

    Think about the things that are great
    Second Life! .NET 4 and Google V8!

    These things are worth the week away
    your delay in work, and your hit in pay

    Think about the old friends you'll greet
    And all the new ones that you will meet

    The knowledge base you'll gain and learn
    will help you back help you back home and what you earn

    Lang.NET
    Lang.NET
    Looks like going is really your best bet.


    Haiku:

    While traveling sucks
    Experience should be worthwhile
    Go enjoy Lang.NET


    There are times we can't resist
    Pondering the things we've missed.
    We vow, "Next time I won't be slow.
    I'll just pick up myself and go.".
    And when we're back, our money spent,
    We often think, "I'm glad I went".


    Lang.Net
    Not a bad gig to get
    Sure it's a road trip
    And a work skip
    A budget breaker
    But 'cmon,
    Ain't it grand to be a taker?


    Lang.Net
    Not a bad gig to get
    Sure it's a road trip
    And a work skip
    A budget breaker
    But 'cmon,
    Ain't it grand to be a taker?


    Miguel should fly cross country,
    And not worry about the money.
    The trip will be great,
    You must learn about Google V8.

    Leaving home for a week,
    Does sound rather bleak,
    But you'll chat with old pals,
    And may meet some gals.


    There is much to learn,
    but conferences return.
    If you stick to your guns,
    keep your money in your pocket,

    you'll have more in store
    when next year rolls around.
    So stand on solid ground!,
    and in 2010 launch rocket.


    Not quite sure why I got so many replies in the form of poems, and Google surveys do not track the IP address of the submissions, so I have no idea if these were all submitted by the same person or not.

    Need to get to the bottom of this mystery.

    Posted on 06 Apr 2009 by Miguel de Icaza

    Supercomputing Mono

    Last year we did some work in Mono together with Luis Ortiz to support 64-bit arrays in the VM.

    What was interesting about this work is that even though the ECMA standard allows the index of arrays to be a long .NET on Windows64 does not support this and Java would require modifications to the bytecode format. Altering Mono became the natural choice for those looking to host very large arrays in an advanced and managed VM.

    This means that you can continue to use your existing tools to build applications, but when running under Mono you will get to use those arrays without that pesky 2,147,483,648 upper boundary.

    Today Ian Dichkovsky (from N-iX)announced on the mailing list their work to bring Mono to the MIPS64 from SiCortex. This is based on the excellent work from Mark Mason that did the MIPS32 port.

    SiCortex has an entry-level desktop computer with 72 MIPS processors and if you have the budget you can get modules with 5,832 processors. The MIPS processors helps them stay eco-friendly.

    Posted on 06 Apr 2009 by Miguel de Icaza

    Telerik Announces Support for their ASP.NET controls on Mono!

    Telerik is one of the most famous provider of controls for .NET. We have been working for the past few months with Telerik to make sure that their RadControls for ASP.NET AJAX product worked out of the box with Mono:

    Today Telerik announced the availability of their product officially for Mono-based customers on Linux systems. From their press release:

    Telerik, the leading vendor of development tools and components for the Microsoft .NET platform announced that RadControls for ASP.NET AJAX fully supports the Mono runtime environment, an open source .NET framework sponsored by Novell, tailored for development of Linux applications. The Telerik AJAX UI components is the first major commercial user interface (UI) suite to go cross-platform and allows developers to build rich .NET applications in a Linux environment. “This has been a long-awaited feature, which we have been quietly working on for quite some time. Over the past few months, we have been actively testing the compatibility of our RadControls for ASP.NET AJAX offering with Mono", said Hristo Kosev, Telerik CTO. "We are extremely happy that our joint work with Novell will allow customers to build compelling high-performance ASP.NET AJAX-based applications and run them on Linux using Mono 2.4.” The decision to work with Novell to extend the capabilities of RadControls over other platforms is in direct response to customer feedback and interest in Mono. Telerik and Novell are optimistic about the effect their partnership will have on the industry and the benefits it will bring to .NET developers.

    Telerik is a major player in the control space in the .NET world and many developers turn to them for ready to use controls for their applications. Developers that were previously using Telerik products can now host their products on Linux servers.

    Special thanks go to Marek Habersack in the Mono team who worked tirelessly to fix Mono's ASP.NET stack. Working with the Telerik folks was a pleasure. Telerik helped us by providing us access to their source code, their test suite and their QA team that made sure that their thousands of tests ran equally well on Mono as they did on Microsoft's .NET.

    You can try the Telerik controls running on Mono at http://mono.telerik.com/.

    Posted on 03 Apr 2009 by Miguel de Icaza

    MonoDevelop Support for ASP.NET MVC

    Michael Hutchinson blogs about how to use the recently open sourced ASP.NET MVC framework with MonoDevelop. Go from installing MonoDevelop 2.0 to your first ASP.NET MVC application 3 minutes:

    There are a few very simple steps:

    • Go to Tools/Add-in Manager.
    • Click "Install Add-ins".
    • In ASP.NET select "ASP.NET MVC".
    • Install.
    • Select File/New Solution
    • Select ASP.NET MVC project.
    • Hit F5 (run) to run your first app:

    This will give you basic templates and dialog boxes for solutions, views, controllers and master pages. The code uses Michael's recent implementation of the T4 engine.

    Check Michael's Blog for a complete step-by-step setup.

    The Add-in bundles Microsoft's recently open sourced ASP.NET MVC engine to run on top of Mono 2.4.

    Kudos to Michael that created this add-in in his copious spare time. And kudos to the MonoDevelop team that created such a pleasant platform to extend.

    Posted on 02 Apr 2009 by Miguel de Icaza

    Microsoft releases ASP.NET MVC under the MS-PL License

    Microsoft's ASP.NET MVC is an extension built on the core of ASP.NET that brings some of the popular practices and ease of development that were popularized by Ruby on Rails and Django to the .NET developers.

    Scott Guthrie ---the inventor of ASP.NET--- just announced that Microsoft is open sourcing the ASP.NET MVC stack under the MS-PL license:

    I’m excited today to announce that we are also releasing the ASP.NET MVC source code under the Microsoft Public License (MS-PL). MS-PL is an OSI-approved open source license. The MS-PL contains no platform restrictions and provides broad rights to modify and redistribute the source code. You can read the text of the MS-PL at: http://www.opensource.org/licenses/ms-pl.html

    These are incredibly good news. Worth dancing for!

    I know that a lot of developers inside Microsoft worked to get this important piece of code released under the MS-PL to ensure that the users of ASP.NET could benefit from the code being open source. I know that at least Phil Haack, Scott Guthrie, Scott Hanselman, Dimitry Robsman, Rob Conery and Brian Goldfarb pushed for this.

    I am psyched, not only because ASP.NET MVC is usable in Mono and the code is licensed under open source terms, but also because I strongly believe that the same innovation, rapid adoption and experimentation that has happened with the new wave of web stacks will come to ASP.NET MVC across all platforms.

    The source code is available for download and we are hoping to integrate this into Mono shortly. Scott Hanselman has a nice blog entry on how ASP.NET MVC went from price-free to open-source free.

    In Scott's PDF tutorial he discussed how to build applications with ASP.NET MVC using Visual Studio and how the Rails practices of not repeating yourself and convention over configuration are used by ASP.NET MVC.

    We have developed a MonoDevelop add-in that provides a set of templates, dialog boxes and the tooling necessary to take advantage of ASP.NET MVC on Linux and MacOS X as well. Hopefully the experience will be very similar to Visual Studio.

    It was only two weeks ago that we were sipping virgin pina coladas at Mix09:

    Posted on 02 Apr 2009 by Miguel de Icaza

    CoreCLR Security Model

    Mono is quickly approaching having a complete implementation of the CoreCLR security model for Mono. This is being developed primarily for use in Moonlight.

    This new and simplified security model allows Moonlight to download and execute untrusted code and run it inside a sandbox. A full implementation requires Mono to have an executable image verifier (making sure the binary that we download follows all of the rules and does not try some funny business), an IL verifier that ensures that the code does not contain any unsafe operations and the sandbox system that ensures that the downloaded code only calls methods that it has permission to call.

    Click for passable illustration of how the sandbox works.

    MSDN has a short introduction to the sandbox and I blogged a long list of links to the original blog entries that documented it.

    CoreCLR security can be customized using a handful of attributes. Instead of sprinkling our source code with the attributes and a gazillions #ifdefs we are using our Mono Linker and a few tools and configuration files to reshape our libraries to contain the necessary attributes required to secure the sandbox. We use a number of tools to automate this process and a manual auditing process to audit the results.

    This is cool because this is a much simpler sandbox system than CAS ever was and our tools make it very simple for third parties embedding Mono into their applications to create their own sandboxes and reshape what is allowed or not allowed by the sandbox based on their specific needs.

    The bad news: this sandbox is only available from trunk right now and will not be easily available until Mono 2.6.

    Posted on 31 Mar 2009 by Miguel de Icaza

    Mono 2.4 and MonoDevelop 2.0 released

    We just released two big projects we have been working on for quite a while.

    Mono 2.4 is a much faster, scalable and tuned version of Mono, like you have never seen before. Major highlights from the previous release are documented in our release notes.

    And MonoDevelop 2.0

    And a brand new web site

    I previously blogged about the list of all the new MonoDevelop 2.0 features. The most visible one is the integrated debugger both for Mono applications and for C-based applications (using GDB).

    Dogfooding: In addition to all the nice features in MonoDevelop 2.0, Lluis migrated the web site for MonoDevelop from MediaWiki to the Mono-powered MindTouch Deki content management system.

    Posted on 30 Mar 2009 by Miguel de Icaza

    Game Developers Conference

    I am heading out to the Game Developers Conference in San Francisco as an attendee after some strong endorsments from some friends on tweeter.

    If you are at the GDC or in San Francisco and would like to get together at some point drop me an email (miguel at gnome dot org). Or if there are any great hacker get-togethers for game developers, I would love to hang out with them.

    I would not want to dissapoint, and as a one trick pony kind of person, I will likely be talking about Mono, Moonlight and the virtues of managed code to anyone willing to listen.

    Looking forward to see what my friends have been up to. I can not wait to see the C# repl in a Unity/Web app.

    Posted on 24 Mar 2009 by Miguel de Icaza

    Moonlight 1.9 and Ogg

    As I mentioned on a previous post Silverlight 3 opens the doors for developers to plug their own Codecs into the Silverlight media pipeline.

    Only a few hours later I read on twitter that Atsushi and Rolf has implemented not only the Ogg/Vorbis Codec for Silverlight 3, but also implemented the Silverlight 3 API in Moonlight:

    This means that you can now use your Silverlight-based players to playback Ogg/Vorbis content. Theora and Dirac are still missing, but with the sample code that we now have, it is going to be merely a weekend hack to get it done. Fluendo has a nice implementation of both already in Java.

    Update on May 6th, 2009: open source implementations of Dirac, Vorbis and adpcm now live in the mooncodecs module.

    Update: link fixed.

    You can see the sample in action in Atsushi's test page.

    Like Jo said on IRC:

    it also works on SL3 though. that's the bit that excites me, since it means we have proper cross-platform playback with Free codecs *today* working in most browsers that matter

    In the words of Annie Hall: La de da.

    Go Moonlight Go!

    Posted on 24 Mar 2009 by Miguel de Icaza

    Hot Hot Hot: Silverlight 3 Pluggable Codec Architecture (OGG, Theora, Vorbis and Dirac).

    Burried in the list of what is new in Silverlight 3 there is this gem:

    Extensible media format support: With the new Raw AV pipeline, Silverlight can easily support a wide variety of third-party codecs. Audio and video can be decoded outside the runtime and rendered in Silverlight, extending format support beyond the native codecs.

    What the above means is that with Silverlight 3 in addition to the built-in codecs for VC-1 and H.264 and the built-in containers (ASF and MOV) developers can plug an arbitrary audio or video codec and containers into the pipeline to support other formats like Dirac, vorbis, theora and the OGG container.

    Both the codecs and the container parsers are authored using C# (or any other .NET supported language).

    It would be nice to use Mono.SIMD where appropriate for these codecs. Mono.SIMD works out of the box on .NET, but it is hardware accelerated in Mono.

    Atsushi at Novell has done some of the work to get an old C#-based Vorbis codec working with Silverlight 3. We will post more details when we have more information (the fix is on SVN).

    Posted on 23 Mar 2009 by Miguel de Icaza

    Mono and the Google Summer of Code 2009

    Once again, the Mono project will be participating in the fabulous Google Summer of Code.

    This is a great opportunity for students that want to get involved with open source to contribute, learn and get paid for their work during the summer.

    We have been very lucky in recruiting some great students in the past years and these students have taken on some very sophisticated tasks over the years. MonoTorrent, ParallelFX, FastCGI for mod_mono, WinForms designer and theming, Gendarme development, Gtk# widgets and much more.

    We have posted some ideas for students to get started, but students that are passionate about Mono should feel free to pitch their own ideas.

    We tend to pick students for advanced projects over the milder, simpler tasks.

    This year, I am excited about a few special projects:

    • Making the Mono VM use LLVM as a code generation backend.
    • Porting Mono.SIMD to new architectures.
    • ParallelFX updates.
    • Using NVidia's VDPAU library to provide a new codec implementation in Moonlight to support VC-1/H.264.
    • Managed (C#) implementations of Dirac and Vorbis as Silverlight 3 codecs.
    • A Database designer Add-in for MonoDevelop to support DBML editing.

    There are many more of course, but the above are the ones that are making me drool.

    Posted on 23 Mar 2009 by Miguel de Icaza

    BareFTP

    Christian just pointed me to BareFTP a graphical file transfer client that supports FTP, FTPS, SSH and SFTP protocols to transfer files.

    I am a command line kind of person, but many of my friends like to use GUI clients for this.

    Posted on 22 Mar 2009 by Miguel de Icaza

    Moonlight brings Playboy archives to Linux

    Since yesterday's announcement that the Playboy archives would be hosted using Silverlight's DeepZoom folks have been hard at work getting the remaining Silverlight 2 features implemented in Moonlight.

    Click for screenshot.

    Posted on 19 Mar 2009 by Miguel de Icaza

    Hot Off the Presses: Unity Goes to Windows

    Unity has announced that their Unity 2.5 IDE is now cross platform and now works Windows in addition to MacOS.

    Unity rebuilt the entire Cocoa-based UI that they had previously with a Unity-powered UI. The entire UI is now built in C# using the Unity built-in APIs (all the controls, views, widgets).

    This is a little bit like a compiler compiling itself. This time it is an IDE built using the IDE itself

    Posted on 19 Mar 2009 by Miguel de Icaza

    Lucas integrates csharp REPL into Unity

    Lucas Meijer has integrated Mono's C# REPL into Unity.

    Visit his post and check out the flash demo of the C# REPL in action.

    Posted on 18 Mar 2009 by Miguel de Icaza

    Voices from Post-Saddam Iraq

    My friend Victoria Fontan who works at the UN's University for Peace in Costa Rica just published the book from her research work on Iraq.

    The book is Voices from Post-Saddam Iraq: Living with Terrorism, Insurgency, and New Forms of Tyranny. From the editorial reviews:

    Even today, most Americans can not understand just why the fighting continues in Iraq, whether our nation should be involved there now, and how we could change our tactics to help establish a lasting peace in the face of what many fear will become a full-fledged civil war. In the book at hand, Victoria Fontan - a professor of peace and conflict studies who lived, worked and researched in Iraq - shares pointed insights into the emotions of Iraq's people, and specifically how democratization has in that country come to be associated with humiliation. Including interviews with common people in Iraq this work makes clear how laudable intentions do not always bring the desired result when it comes to international conflict and cross-cultural psychology. For example, Fontan explains, one might consider the comment of a young Shiite: "The greatest humiliation of all was to see foreigners topple Saddam, not because we loved him, but because we could not do it ourselves." This gripping text is focused on a new and growing area of human psychology - humiliation studies.

    Please vote to have the book available on Kindle. I got a hardcopy, but I would love to travel with it instead.

    Posted on 16 Mar 2009 by Miguel de Icaza

    Mono and Qt

    The KDE folks have created some brilliant bindings for Mono and .NET called Qyoto.

    But there is nothing like a polished application to really test the bindings. This week Eric Butler announced Synapse: an advanced Instant Messaging platform.

    This is the first large application built with Qt/Qyoto/Mono and it is a beautiful application:

    I had a chance to see Synapse live a couple of weeks ago in Seattle when we met Eric for dinner. Eric has written a very polished application. This is what love does to software.

    Congratulations to Eric for the release of his app, to the Qymono crowd for creating these polished applications and Nokia/Trolltech for releasing Qt under the LGPL license.

    Developers interested in doing Qyoto development with MonoDevelop can take advantage of the QyotoDevelop add-in that Eric created as well. This add-in generates code from the Qt Designers UI files (click for a screenshot).

    Posted on 16 Mar 2009 by Miguel de Icaza

    Mono's Text Template Transformation Toolkit (T4)

    At the ALT.NET Seattle conference I was introduced for the first time to the Text Template Transformation Toolkit. Also known as T4. T4 is built into Visual Studio and developers use TT to generate code from all kinds of data sources. This tutorial covers the basics.

    T4 Support in MonoDevelop, with error reporting and document outline.

    T4 is very much like ASP.NET in that code is mixed with output code. Additionally TT has access to data on its "host". This allows for some creative data extraction from the environments before it generates output.

    To my surprise T4 thing is wildly used by lots of people. Daniel Cazzulino's company has a product just to improve Visual Studio's support for editing .tt files.

    What really got me interested in T4 were the templates that Damien wrote to convert from DBML files into C# code that is suitable for use with Linq. A nice replacement for the SQLMetal tool.

    I mentioned this -in passing- to Michael Hutchinson as he had been working on ASP.NET MVC support for MonoDevelop and there are some nice ASP.NET MVC T4 files out there.

    In a week he implemented: the T4 command line tool, the MonoDevelop host (to support ASP.NET MVC) and he even added syntax highlighting to it (see the above screenshot).

    We have also started using it to migrate the code that previously used assorted WriteLines to generate RPM files from Visual Studio/MonoDevelop projects into a nice T4 template:

    Packaging Template

    Posted on 10 Mar 2009 by Miguel de Icaza

    Gnome Do

    Gnome Do got a new and shiny web site.

    Posted on 24 Feb 2009 by Miguel de Icaza

    ALT.NET this weekend

    My friend تلة جوزيف (Youssef) and myself will be heading out to Redmond for the ALT.NET Seattle event this weekend.

    This will be my first ALT.NET conference and I do not know quite what to expect. Youssef keeps telling me "You should not prepare for this", but I feel like I should at least prepare something exciting to get the juices flowing for discussion.

    Thoughts?

    Posted on 24 Feb 2009 by Miguel de Icaza

    CoyoteLinux uses Mono for syadmin tools

    Interesting find: Coyote Linux -a firewall in a box- configuration of Linux is using Mono and ASP.NET for its admin tools.

    Web Admin

    Here is the rationale for the switch to C#:

    One of the biggest changes to this release of Coyote Linux is the use of C# as the primary development language used for most of the administration, configuration, and maintenance utilities. Previous implementations of Coyote Linux made heavy use of C, Pascal (namely Delphi), and Bash shell scripting for this purpose. The change is being made to C# after nearly 2 years of working with the language in a cross-platform setting which involved the use of both Red Hat Linux and Windows 2003/2008 servers. The ability to use a single development environment (in my case, Visual Studio 2008) and produce executables that will execute in unmodified form on both Linux and Windows has seriously put the “R” in RAD programming. I am still actively involved in projects that require the development of cross-platform utilities and am already paying for all of the necessary licenses to provide my company with a full array of software and hardware to develop applications that work in a mixed server OS environment.

    I have spent a great deal of time testing C# applications under Linux using Mono as the executing environment. While this is not necessarily the best choice for small, embedded hardware (486 / ARM class processing power) it works very well for anything using i686 or better technology. Another wonderful advantage of using this technology is the ability to run the same set of executables on both 32 and 64 bit hardware without the need for compatibility libraries to be installed. The installation of Mono dictates the 32/64 bit execution environment, preventing the need to recompile the full Coyote Linux software package.

    Traffic

    Posted on 22 Feb 2009 by Miguel de Icaza

    System.Shell.CommandLine does not belong in System.Core

    Update: Justin Van Patten at Microsoft clarifies that the System.Shell.CommandLine API that was on the CTP for VS2010 will not be part of the final .NET 4.0. Instead better versions (similar in spirit to Mono.Options) will be made available in CodePlex in the future. Relief.

    Update 2: Justin gave me permission to quote from his private email, which I include:

    We are not shipping System.Shell.CommandLine in .NET 4. This was based on an intern project from a couple of years back that was mistakenly public in the .NET Framework 4.0 CTP. It wasn't a design that we were happy with and has been removed and will not be present in the next preview release.

    We have a *much better* command line parsing API, along the lines of Mono.Options, that we're planning to release on CodePlex later this year.

    Today I was alarmed by a new API being introduced into .NET 4.0, the System.Shell.CommandLine which is being dumped into System.Core.

    An introductory blog post shows a bloated, over-engineered, too rich in the OO, too poor in the taste look at the API. Not only it is a terrible API, it is being dumped right in the core of the framework on the System.Core assembly.

    This is the kind of API that you get when the work is commissioned as opposed to be created as an act of love. This is what you get from a culture of process. Some PM figured out "We need command line parsing". And since it does not look like rocket science they assigned this to someone that had absolutely no interest in this task. And clearly nobody involved (the PM, the developer and the tester) fought back. They were forced to do this, and they came up with this aberration, hoping that the sooner they were done with this, the sooner they could move on with their lives.

    Compare this with the labor of love from Jonathan Pryor and his Mono.Options library. This API was discussed publicly, it was adopted in a few applications and tried out, it was morphed to support Windows, Unix and GNU style command line options and the result shows what passion and love deliver when it comes to APIs.

    Compare and contrast. This is the sample posted for on the blog above:

    	using System;
    	using System.Shell.CommandLine;
    
    	class Program
    	{
    	static void Main()
    	        {
    	            Console.WriteLine("Checks a disk and displays a status report.\n");
    
    	            CommandLineParser cmd = new CommandLineParser();
    	            cmd.AddParameter(CommandLineParameterType.String, "volume", ParameterRequirement.Required,
    	            ParameterNameRequirement.NotRequired, "Specifies the drive letter.");
    	            cmd.AddParameter(CommandLineParameterType.Boolean, "F",      ParameterRequirement.NotRequired,
    	            ParameterNameRequirement.Required,    "Fixes errors on the disk.");
    	            cmd.AddParameter(CommandLineParameterType.Int32, "L",      ParameterRequirement.NotRequired,
    	            ParameterNameRequirement.Required,    "Changes the log file size to the specified number of kilobytes.");
    
    	            try
    	            {
    	                cmd.Parse();
    	            }
    	            catch (ParameterParsingException ex)
    	            {
    	                Console.WriteLine(cmd.GetHelp());
    	                Console.WriteLine(ex.Message);
    	                return;
    	            }
    
    	            string volume = cmd.GetStringParameterValue ("volume");
    	            bool fix      = cmd.GetBooleanParameterValue("F");
    	            int? logSize  = cmd.GetInt32ParameterValue  ("L");
    
    	            Console.WriteLine("Checking volume {0}...", volume);
    
    	            if (fix)
    	                Console.WriteLine("Fixing errors...");
    
    	            if (logSize != null)
    	                Console.WriteLine("Changing log size to {0}...", logSize);
    	            else
    	                Console.WriteLine("Current log size: {0}", 1024);
    	        }
    	    }
    	

    This is the equivalent in Mono.Options. With Mono.Options you can take advantage of C# 3 features and make the code more succinct. An important style difference is that the policy is not limited by what can be poorly expressed by an enumeration but can be anything that can be expressed with a real language.

    What is the point for "ParameterNameRequirement.Required" for example? This is essentially a bool option with a long name. The fundamental problem is not that it looks like someone left a turd on my source code or the fact that it is a glorified bool value. The problem is that enumerations and an OO structure will not give you the flexibility that is required for command line handling. This API would not be able to cope magically with conflicting options (either -a or -b can be used) or with options that are required if another option is set (if -v set, then -log is needed) or with custom parsing required after the basic command line options are parsed (consider a C compiler, -I and -L and -l options can be specified multiple times).

    This is the equivalent code in Mono.Options. Notice that the policy can be enforced either outside of the parameter parsing (after the basic parsing has been done) or as each one of the delegates for the options:

    	using System;
    	using Mono.Options;
    
    	class Program {
    	    static void ShowHelp (string msg, OptionSet p)
    	    {
    	        p.WriteOptionDescriptions (Console.Error);
    	        Console.Error.WriteLine (msg);
    	    }
    
    	    static void Main (string [] args)
    	    {
    	        Console.WriteLine("Checks a disk and displays a status report.\n");
    
    	        bool fix = false;
    	        int logSize = 1024;
    	        string volume = null;
    
    	        OptionSet p = new OptionSet ()
    	            .Add ("volume=", "Specifies the drive letter.", v => volume = v)
    	            .Add ("f|F",  "Fixes error on the disk", v => fix = true)
    	            .Add ("l=", "Changes the log file size to the specified number of kilobytes",
    	                  v => logSize = int.Parse (v));
    
    	        try {
    	            p.Parse (args);
    	        }
    	        catch (OptionException)
    	        {
    	            ShowHelp ("Error, usage is:", p);
    	        }
    	        if (volume == null)
    	            ShowHelp ("Error: must specify volume", p);
    
    	        Console.WriteLine("Checking volume {0}...", volume);
    
    	        if (fix)
    	            Console.WriteLine("Fixing errors...");
    
    	        if (logSize != null)
    	            Console.WriteLine("Changing log size to {0}...", logSize);
    	        else
    	            Console.WriteLine("Current log size: {0}", 1024);
    	    }
    	}
    	

    The number of lines is roughly the same, but one is an eye sore and limited. The other is both beautiful and extensible.

    Both APIs are capable of more. But System.Shell.CommandLine will merely give you more enumerations with limited functions and you will end up rolling out your own if you want to do anything remotely interesting.

    Mono.Options is more of an open ended, future-proof and extensible API. It is implemented as a single C# source file (1,112 lines of code) that you can use in your own projects (and even tune/modify), you can start using today and will work on .NET 2.0 and up, it is nicely documented. More examples: here, here and here.

    System.Shell.CommandLine does not belong in System.Core. System.Core is a fundamental assembly that will be everywhere .NET is, and it will soon enough run into the same upgrade and maintenance restrictions that mscorlib has.

    This API needs to be moved into CodePlex or be available as an unsupported "PowerOverEngineeredPack.dll".

    Posted on 21 Feb 2009 by Miguel de Icaza

    MonoDevelop 2.0 Beta 1

    Earlier this week we released the first beta of MonoDevelop 2.0.

    MonoDevelop 2.0 is a very ambitious release in terms of the new functionality available since the MonoDevelop 1.0 release back in March 2008. It is ambitious, but also very stable, we have had hundreds of people dogfood this new release of MonoDevelop during the entire development cycle.

    There are a number of new features since MonoDevelop 2.0 that are worth calling out:

    Built-in Debugger

    MonoDevelop now has a built-in debugger. The debugger supports both debugging Mono-based applications as well as native applications using GDB.

    While hovering over variables, you can explore the values of complex data structures:

    Breakpoints and Tooltips

    You can debug both at the source code level, or the generated assembly code:

    Debugging the Mono Runtime

    Auto-complete on the watch window:

    Auto-complete in the watch window.

    You can also attach to running processes, both native or Mono processes and debug them:

    Process selector

    For more information see our list of supported features.

    Improved ASP.NET support

    Our ASP.NET story is getting better. web projects are now compatible with Visual Studio 2008 and Visual Web Developer 2008 SP1.

    Our ASP.NET text editor now offers code completion of tag, attributes, attribute values and event handlers is now supported for ASP.NET and various HTML DTDs. For example:

    We also now have DOM breadcrumbs in the editor as you edit your file, and a nice DOM/Document outline for navigating your HTML and DOM documents.

    The beta does not contain this feature, but we will be publishing an Add-in that will help you get your ASP.NET MVC projects up and running with minimum hassle by the time ASP.NET MVC ships.

    New Text Editor

    A new text editor, this text editor is written entirely in C# and replaces the GtkSourceView widget. This has allowed us to more easily add features to the editor and bring MonoDevelop to the 21st century. Some of the features in the new text editor include:

    • Flagging errors with underlines on the fly.
    • Change bars (track what changes are in your buffers).
    • Incremental search.
    • Code folding: Support for collapsing regions of text (#region), methods, classes.
    • Themes for the editor.
    • Source code split views.
    • Transparent popups. Holding down the Control key when a completion popup is shown will make the popup transparent to make it easier to see the text that is underneath the popup.
    • VI-mode support. We understand that some of our users would rather use VI keybindings than Emacs keybindings. VI support is here.

    Source Code Editing

    Intellisense now works for pretty much every piece of the C# 3 language. I am not supposed to use the word "Intellisense", but I just did.

    Also, sagacious readers will have noticed that I sneaked in "3.0" in the above statement. MonoDevelop now understands the C# 3.0 syntax. A great companion to our award-winning C# 3.0 compiler.

    Now, technically speaking we have not received any awards for our C# 3.0 compiler, but we should have, because we are awesome. And in fact, I will be arranging a dinner at my place this coming weekend where we will award prizes to the best pieces of technologies and our C# compiler is a nominee.

    Notice how it also supports nice automatic generations of methods when you declare an event:

    MonoDevelop is also aware of types, so for example, if you type "override" when entering a method, it will offer a list of methods that can be overwritten. O-M-G.

    There are other cute features like MonoDevelop can stub out interface methods for you. O-M-G.

    There are also a few features that we liked from editors like TextMate that should make it more suitable for managing web projects like the revamped "Go to File" dialog (invoke it with control-alt-o). It is now able to do acronym searches.

    New XML Editor

    The XML Editor from SharpDevelop has been fully integrated into MonoDevelop and improved. It supports code completion of tags, attributes and attribute values (available for registered XSD schemas). A range of schemas are supplied with MonoDevelop.

    XML files can be validated using the built in schemas, and can have XSL transforms applied. in addition, XSD schemas can be generated from XML files.

    For instance, it is currently used to allow editing of Silverlight XAML files and have auto-completion of XAML tags that are valid for Silverlight/Moonlight.

    Project Improvements

    We have switched to msbuild-style project files to increase interoperability with Visual Studio.

    Support for opening multiple solutions at once, and support for Workspaces.

    We now have cascading project policies. This is useful for example to use different coding styles depending on the project that you are working on.

    Cascading Project Policies

    Gtk# GUI Designer

    You can now make your custom widgets available on the toolbox, by just adding the [ToolboxItem] to your widget.

    My favorite one is that now constructed dialogs and windows expose the Gtk.UIManager as a field. It was previously hidden, and not possible to adjust the UI dynamically without much work.

    Assembly Browser

    There is no better way of learning an API than browsing the data types exposed and their relationships. A new Assembly Browser has now been included.

    Assembly Browser

    Switching

    A cute little window pops-up when you press Control-Tab these days:

    Vala Support

    Support for the Vala programming language has been integrated:

    Vala Support

    The Future: MonoDevelop, the Cross Platform IDE.

    We are very excited about this release, and there are a few areas in which we would like to improve MonoDevelop for future releases.

    We want to bring MonoDevelop to Windows to be able to reach into more users and to help developers doing Gtk# development on Windows.

    MonoDevelop on Vista.

    We are also currently shipping a preview of MonoDevelop for the Mac, it is not yet ready as there are a few kinks that need to be sorted out on that platform, but we are working to resolve those issues. For example, we want to integrate with the Mac menu system, and to provide bindings that are familiar for Mac users. Here is a preview:

    Super-Alpha-Preview of MonoDevelop on OSX.

    Unity has stated that they will be making MonoDevelop the standard editor for Unity3D on MacOS.

    Posted on 19 Feb 2009 by Miguel de Icaza

    Mono Runtime Debugging

    We now have better integration of GDB with Mono. Information on how to use this is in Debugging with GDB in XDEBUG mode in our wiki.

    This will be useful if you are debugging the Mono runtime, or debugging Mono embedded into an application new versions of Mono (for example debugging Moonlight).

    This will give you symbols for managed code in stack traces, for example the bold text in this example are the managed frames. These would previously just be rendered as "????????" by gdb.

    (gdb) xdb
    (gdb) bt
    #0  0x0000000040cd707e in Tests:pass_floats_doubles (a=100, b=101, c=102, d=103, e=104, f=105, g=106)
    #1  0x0000000040cd6fd8 in Tests:test_721_sparc_float_argument_passing ()
    #2  0x0000000040a6228a in (wrapper runtime-invoke) Tests:runtime_invoke_int (param0=0x0, param1=0x7fc05e5b0e00,
        param2=0x0, param3=0x40cd6f80)
    #3  0x00000000004219f7 in mono_jit_runtime_invoke (method=0x9daa70, obj=0x0, params=0x0, exc=0x0) at mini.c:4253
    #4  0x00000000005c1d2c in mono_runtime_invoke (method=0x9daa70, obj=0x0, params=0x0, exc=0x0) at object.c:2399
    #5  0x00000000005c39d7 in mono_runtime_invoke_array (method=0x9daa70, obj=0x0, params=0x0, exc=0x0) at object.c:3488
    #6  0x00000000005cdc31 in ves_icall_InternalInvoke (method=0x7fc05c371be0, this=0x0, params=0x0, exc=0x7fff66729368)
        at icall.c:3038
    #7  0x0000000040cd6bee in (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (
        this=0x7fc05c371be0, param0=0x0, param1=0x0, param2=0x7fff66729368)
    #8  0x0000000040cd690c in System.Reflection.MonoMethod:Invoke (this=0x7fc05c371be0, obj=0x0, invokeAttr=0x0,
        binder=0x0, parameters=0x0, culture=0x0)
    #9  0x0000000040cd683b in System.Reflection.MethodBase:Invoke (this=0x7fc05c371be0, obj=0x0, parameters=0x0)
    #10 0x0000000040a6275c in TestDriver:RunTests (type=0x7fc05e5b6dc8, args=0x0)
    #11 0x0000000040a62380 in TestDriver:RunTests (type=0x7fc05e5b6dc8)
    #12 0x0000000040a62354 in Tests:Main ()
    #13 0x0000000040a6228a in (wrapper runtime-invoke) Tests:runtime_invoke_int (param0=0x0, param1=0x7fc05e5b0e00,
        param2=0x0, param3=0x40a62340)
    #14 0x00000000004219f7 in mono_jit_runtime_invoke (method=0x9576f0, obj=0x0, params=0x7fff66729600, exc=0x0)
        at mini.c:4253
    	

    For people running the archer branch of gdb, there is a "mono mode" implemented in python for gdb, which offers additional features: http://anonsvn.mono-project.com/viewvc/trunk/mono/data/gdb/

    Posted on 19 Feb 2009 by Miguel de Icaza

    Mono on Android, update

    Koushik Dutta has posted two great updates on his blog about Mono running on the Android powered G1 phone. The code necessary to build Mono on Android is available at the androidmono page.

    The first bit is his work to allow Mono code to call Dalvik code as well as the bridge to allow Dalvik/Java to call into .NET code. This is necessary to allow Mono-based applications to call into the phone API and integrate with the existing stack.

    The second bit is a cute show of DLR-based IronPython running on the phone.

    This of course means that with the bridge in place, any CLR or DLR-based language can access the functionality exposed in Dalvik.

    Posted on 16 Feb 2009 by Miguel de Icaza

    Mono 2.0 - .NET Tool/Add-in of the Year

    Jeff just pointed out to me that Mono 2.0 won the ".NET Tool/Add-in of the Year" award from the guys at developer.com.

    Sweetness!

    Posted on 13 Feb 2009 by Miguel de Icaza

    Linus does 25 things

    Linus Torvalds does 25 things about me.

    Posted on 12 Feb 2009 by Miguel de Icaza

    Moonshine

    Now that Moonlight 1.0 is out, I should talk a little bit about Aaron Bockover's amazing Moonshine plugin.

    Moonshine's About Box while playing HBO.com

    Moonshine is a tiny plugin that registers itself with Firefox to render Windows Media streams and emulates the Windows Media Javascript API by redirecting it to Moonlight.

    So when you visit a page that in the past used to embed the Windows Media Player (for example at HBO.com or at C-SPAN), instead you get a Moonlight-based rendering engine and uses Microsoft's Media Pack for doing the video and audio playback.

    It is trivial to install it, just go to this page and click on the moonshine that is right for your platform.

    Internally we referred to this project as "Pornilus" a homage to the Roman senator and patron of the arts from the 3rd century. And like Pornilus, we want to bring the arts to the people.

    Cute fact: Pornilus/Moonshine will pick-up your Gnome theme and theme itself accordingly.

    Oddly enough, there is no Wikipedia page for Pornilus yet. Someone needs to correct this.

    Posted on 12 Feb 2009 by Miguel de Icaza

    Moonlight 1.0 goes live

    Moonlight, the open source implementation of Silverlight for Unix systems has officially reached its 1.0 level. We are feature complete, we pass all the Microsoft regression test suites and we shipped support for Microsoft's Media Pack for x86 and x86-64 architectures.

    Moonlight is available as a Firefox plugin that can be installed with a single click from the moonlight download page.

    What is in Moonlight 1.0

    Moonlight 1.0 contains our plugin that can be used in Firefox 2 and 3 on Unix systems using the X11 windowing system.

    Moonlight 1.0 (and Silverlight 1.0) both come with a graphics pipeline, video and audio frameworks and a javascript bridge and neither one of them contains an actual execution environment. The execution environment is the browser's own Javascript engine. When developers build 1.0-based plugins they script all of the functionality using the browser's own Javascript engine.

    The browser Javascript engine communicates with Silverlight (or Moonlight) through the Javascript API exposed by the plugin.

    With Silverlight 2.0 and Moonlight 2.0 in addition to this model where the browser's Javascript drives the interaction a new model is available: the ECMA CLI execution system powers the actual execution of the code and will deliver performance anywhere between 20 to 300 times faster execution speed than even the most modern Javascript implementation if you use a strongly typed language like C# or Boo.

    CNN's The Moment on Moonlight.

    It is worth pointing out that Moonlight is provided both for 32 bit systems and 64 bit systems on the launch date.

    We are also hoping to expand our reach to other Unix variants that use X11 like the various BSD systems and Solaris and make codecs available for those.

    How we got here

    The development of Moonlight has been a fascinating adventure. It all started at the Mix conference in May 2007 when Scott Guthrie introduced Silverlight 1.1. It was a bold move for Microsoft to embed the ECMA CLI into their Silverlight 1.0 plugin.

    In my blog post called "Mix 07, Silverlight, Dynamic Languages Runtime and OpenSource". From that post you can see that I was already excited about the technology, and I could not wait to get this technology to Linux. The talk on the DLR at Mix 07 was also fascinating and got me interested in bringing this to Linux.

    A few weeks after the DLR had been announced and open sourced, our team had it working on Linux with Mono and by the end of May I had cooked up enough to render a spinning video on the screen.

    IronPython 3D visualization on Moonlight

    It was during the dynamic language workshop at Microsoft that I had a chance to have dinner with Jason Zander and Scott Guthrie in an Indian restaurant in downtown Redmond. In this dinner they discussed some of the design tradeoffs in Silverlight and these would become part of our own implementation a few days later.

    At Mix 2007 I had the chance to meet Marc Jalabert from Microsoft France. Marc invited me to the Remix event in Paris but did not take the invitation seriously until he offered us to demo Moonlight on Jun 21st.

    Other than a spinning video and the DLR we did not really have much code so on May 31st I sent an email to the team and asked them to work on an intense 21-day hackaton to bring Silverlight 1.1 to life on Linux. By Jun 21st we had a demo working and we showed Silverlight 1.1 applications (with the CLR) running on Linux.

    A few weeks passed by, and Jeff Jaffe from Novell asked me to present our Moonlight to Bob Muglia as part of the regular Microsoft/Novell interoperability meetings. After struggling with the video projector for what seemed like an eternity the Silverlight Chess and the Silverlight Airlines demo came up on the screen on Linux.

    In the meantime, we were in love with our Moonlight engine, and we used to build desktop applications in addition to web applications.

    After this meeting, I do not remember exactly how things happened as too much happened too quickly, but Microsoft and Novell agreed to collaborate on bringing Silverlight to Linux. We announced the collaboration on September 5th.

    It was early on, at that dinner with Jason and Scott that the issue of how to properly license codecs for MP3, WMV and VC-1 had been discussed. We knew that we could implement the engine, but the question remained: how to get codecs to end-users in a fully licensed way. This and other problems had been already discussed and agreed on the collaboration agreement. Microsoft would develop, distribute and maintain their own Media Pack for Linux users and other Unix operating systems.

    The entire media work involved hard work at every level, but it was worth the effort. We now have one of the best open source media pipelines implemented. And it will only get better with all the new features in Silverlight 2 for adaptive streaming.

    The Immediate Future

    We are now hard at work on Moonlight 2, and those of you interested in trying it out can do so by following the build instructions on our web site.

    Silverlight 2.0 was a major upgrade from its original announcement Silverlight 1.1. It is more complete, more polished and has been future-proofed.

    Microsoft has continued to help us all along in creating an open source implementation of Silverlight. They have open sourced the Microsoft DLR, the Microsoft MEF framework and the crown jewels: the Microsoft Silverlight Control Library and the Control Toolkit under the OSI-approved MS-PL licenses. Without this it would have taken years for us to catch up.

    Jimmy Schementi's IronRuby + DOM + Flickr sample.

    Up until two weeks ago we could not see much in the screen as a lot of Moonlight had inter-dependencies between various subsystems. But once Larry Ewing's layout system landed in our tree, magically many things started to come together.

    You can try out yourself Moonlight with some very hot demos including CNN's The Moment, the Photosynth-based 3D browsing engine for Obama's Inauguration and of course the always amazing DLR demostrations.

    Silverlight 3

    Silverlight 2 is incredibly exciting, it is delicious and mindblowing. There is a lot of excitement about it, my favorite three sites on Silverlight 2 include:

    Microsoft will be announcing the details about Silverlight 3 at their Mix conference in March in Las Vegas.

    My wish list

    I love Silverlight and the use of the CLR for building web applications. That is just how I am wired up.

    I still personally wish that Silverlight 2.0 had a JSon interface to XAML, like the prototype that Chris Toshok did, or that Silverlight had a more fluent model for application deployment. I would like the XAP model to be entirely optional or non-existent for IronRuby or IronPython.

    Posted on 11 Feb 2009 by Miguel de Icaza

    It is that time of the Quarter! Traveling to Microsoft.

    When Joseph and myself head out to Redmond to meet with some folks at Microsoft about Moonlight.

    This is a call for all cool cats at Microsoft that would like to get together and talk shop to drop me an email (miguel at gnome dot org) and we can schedule something.

    Posted on 05 Feb 2009 by Miguel de Icaza

    XBox Division at Microsoft

    For about a year I have been trying to find someone in the XBox360 division at Microsoft that we can talk to about bringing Mono to the XBox360 to allow C/C++ developers to script their applications with the high performing C#, Boo or the Iron* languages as opposed to interpreters.

    A year ago Mono could not target the XBox360 as apparently this platform, like the iPhone, does not support JITing. Mono now supports full static compilation of .NET code into native code before deployment and we would very much like to bring this to the XBox360.

    If you are a Microsofty and you know how to get a hold of someone on the XBox360 group in the Middleware division and you could hook us up, I would love if you could arrange an introduction.

    Posted on 03 Feb 2009 by Miguel de Icaza

    Linux Outlaws Podcast

    Last week the folks at Linux Outlaws interviewed me about Mono.

    The idea was that someone on a previous episode apparently did not quite like Mono and they wanted to hear my take. In the end I am not sure that we even talked about their concerns, but it was a fun interview.

    Posted on 03 Feb 2009 by Miguel de Icaza

    IronClad

    The guys at Resolver Systems have released IronClad. IronClad is a library that allows IronPython to use any existing compiled CPython extension.

    The new version has matured to the point that it is able to use CPython's numpy and pass its test suite.

    It is lovely to see third parties start to test their code with Mono in addition to .NET as part of the release process. The code has been tested with Mono, and comes with Unix makefiles.

    Posted on 30 Jan 2009 by Miguel de Icaza

    One Month of Email Gone

    If you sent me an email in the last month, and you are waiting for me to reply, please resend your email.

    I accidentally deleted all email since December 18th, 2008.

    Posted on 27 Jan 2009 by Miguel de Icaza

    DekiWiki powers WhoRunsGov.Com

    Aaron Fulkerson and his team at Mindtouch have done it again. This time they landed the Washington Post new http://whorunsgov.com project:

    WhoRunsGov.com provides a unique look at the world of Washington through its key players and personalities. The site features concise profiles of influential political officials who shape government policy, including members of the new presidential administration, Pentagon officials, lawmakers, senior congressional aides and committee staff. The first several hundred profiles are being crafted by a newly created editorial team at the Washington Post Company, as well as a group of experienced outside contributors. Each profile provides in-depth information on an official’s policy experience, involvement in government decision-making, major policy positions, key associates, political affiliations, voting records, campaign and personal finance information, plus relevant news articles from around the Web.

    Their Deki project has gone from the cutest Wiki system to a full collaboration platform.

    Their press release has the details.

    And as my readers have come to expect, yes, this is also built on top of Mono. Deki is not built with ASP.NET --Microsoft's web platform-- instead the engine is built on top of Mindtouch's Dream framework and the presentation layer is built on top of PHP.

    Congraulations to Mindtouch on this important launch!

    Posted on 23 Jan 2009 by Miguel de Icaza

    Cartoon Network's Kid's MMO and Mono.

    The amazing Joachim Ante from Unity3D wrote me to tell me that Cartoon Network's new browser-based MMO for kids FusionFall has finally launched to the public.

    Fusion Fall takes advantage of many new features in Unity3D for creating large worlds. I live blogged some of the details as Joachim presented them at the Unite Conference.

    Unity uses the Mono runtime on both Windows and MacOS and it might become one of the largest deployment vehicles for the Mono VM.

    There is an air of coolness in the fact that Mono is being used on Windows instead of .NET. And part of it has to do with the fact that Mono's open source engine allowed Unity to modify it to suit their very specific needs.

    As I mentioned at my PDC talk, the .NET engine is fantastic, but up until Mono only Microsoft was in a position to reshape .NET into different forms (Silverlight and Mesh both use a special trimmed-down .NET called CoreCLR). I would love to see a world where people take Mono (or chunks of Mono) tune it and shape it to suit their needs.

    Congratulations to the team at Unity for a job well done, and to the team that produced FusionFall. You can see the introduction video:

    One thing that stands out in FusionFall is that it shows what a big creative budget can do with Unity.

    Go Mono gaming, Go!

    Posted on 22 Jan 2009 by Miguel de Icaza

    Linux and the Inauguration

    Not only was the inauguration transmitted using Silverlight, but also on each window for everyone watching the inauguration from pic2009.org the following caption was at the bottom of every page:

    Every viewer could see "Linux-compatible Silverlight Player".

    Posted on 21 Jan 2009 by Miguel de Icaza

    Watching the Obama Official Inauguration on Linux with Moonlight.

    I just wanted to confirm that you can watch today's Barack Obama Official Inauguration video stream using Moonlight on Linux/x86 and Linux/x86-64 systems.

    All you need to do is to go to the Moonlight Download page, install Moonlight and restart your browser. Then you can visit www.pic2009.org in a few hours and watch the event from Linux.

    Microsoft worked late last night to get us access to the code that will be used during the inauguration so we could test it with Moonlight.

    Thanks to: Joseph, Larry, Geoff, Rusty and specially Aaron who all worked tirelessly to implement and get everything tested tonight and ready to go on the Novell side. To Brian, Eric, Ben at Microsoft and Mio at IStreamPlanet to make sure that Linux users will be able to watch Obama's inauguration.

    Ben Waggoner has posted an update on the Microsoft side..

    Aaron's code will also be powering MacOS/PPC streaming.

    Now everyone say at once: O-ba-ma! O-ba-ma! O-ba-ma!

    Posted on 20 Jan 2009 by Miguel de Icaza

    Mono's New Code Generation Engine

    Three years ago, in November of 2005 we started a project to upgrade Mono's code generation engine as the engine started to age and it became increasingly difficult to improve code generation and extend the JIT engine in meaningful ways.

    The new code generation engine is based on a linear intermediate representation as opposed to the tree-based intermediate representation that we had used up to Mono 2.0.

    Switching the code generation engine is a pretty significant effort and we did not want to switch it shortly before we had to ship Mono 2.0, so we decided to ship 2.0 with the engine that had been in wide use.

    Shortly after we branched Mono's tree for the 2.0 release Zoltan merged his work from the linear branch into the main tree.

    We have now shipped all of this as part of Mono 2.2, you can get it here.

    Some Benchmarks

    Mono's new engine generates much better code than the version found in Mono 2.0.

    Speed: The engine will mostly benefit computationally intensive code, usually between 10% and 30% performance increase, with some cases going up as high as being 50% faster.

    Code size: the new engine generates slimmer code, typically 12% to 20% smaller code generated.

    Check out some of the benchmark results.

    Debugging the Transition

    Although we had our test suite, and we regularly tested the code against most apps, we were still afraid that something might go wrong. The new code could miss-compile something, and it would be hard in a large project to pin point exactly what went wrong.

    For example, the problem might not appear while compiling a small test program like `hello world', but could appear when running a web site under heavy load or when running MonoDevelop.

    Zoltan came up with a very interesting solution: for a period of time Mono had two JIT engines built into it, the new and the old one. Here is where the clever trick comes in: an environment variable contained the number of methods that should be compiled with the new JIT engine. After the Nth method had been compiled, the engine would switch code generators.

    This was used to bisect regressions and failures.

    A couple of months after we had done the switch and both our unit tests and our system tests passed the old JIT engine was eliminated from Mono.

    SIMD

    Using SIMD for accelerating certain floating point operations had been in the back of our minds for a while. We looked into implementing that in our old engine, but that turned out to be very difficult.

    With the new engine, Rodrigo was able to put together a prototype in a weekend (the legend goes that Rodrigo's wife was busy that weekend).

    This prototype was later turned into Mono.SIMD an API for accelerating vector operations.

    Mono 2.2 is the first release to officially support and distribute it. To learn more about Mono.SIMD support, you can see this blog entry.

    Full Generics Sharing

    With this release, the generics code sharing engine has been completely debugged and is now enabled not only for code that lives in mscorlib, but for all generics code written by the user.

    The Technical Details

    We have provided A complete description of Mono's new engine design and the the various code generation stages.

    Posted on 20 Jan 2009 by Miguel de Icaza

    More Mono-based games on the iPhone

    Update: as of September there are at least 258 games on the AppStore build with Unity3D according to this interview. And 5 out of the Top100 applications are Unity based.

    Randy Edmonds pointed out in my previous post that FlashBang Studios's RaptorCopter is not the first or the only Unity3D/Mono-based game on the Apple AppStore.

    I counted almost 40 apps on the AppStore based on Mono, from the thread here.

    These are a few other games available today from the AppStore that are powered by Mono:

    • Downhill Bowling (5 stars), (screenshots and video).
    • Billiards.
    • SpacePig.
    • Age of Curling.
    • Dusktreaders.
    • X-Razer.
    • Tapball (video).
    • InvinciBall (video).
    • SlidePop.
    • FuguMaze.
    • Monkey Diving (video).
    • Ball-X (with the dash in the middle, or you wont find it).
    • FuguTilt.
    • Pizza Dash (you deliver pizzas in a car).
    • Debris (you do controlled demolitions).
    • Trash it!
    • Rotunda.
    • Asteroid Strike.
    • Crazy Snowboard (and 2.0).
    • Bubble Bang (video).
    • iStronaut Willy.
    • Bounce Pop.
    • Labyrinth 3D.
    • FuguBall.
    • SpaceRace (video).
    • iDrone.
    • Mars Explorer.

    Word games:

    • Christmas spell.
    • Alpha Blocks: Brain Freeze.

    Not really games, but cool hacks:

    • Moobox 3D, cute!
    • Widget Monkey.
    • Butterflies.
    • Dice 3D.
    • Night Divine.
    • Rainbow Day.
    • Zen of Snow and Zen of Snow 2.
    • Jingle Bells.
    • ArtiFISHal Life (3D Aquarium).
    • Leaves.
    • iFeathers.
    • Bobblehead Santa.

    Update:

    • Cricket (from SpinFast).
    • Rock'em Blocks (video).
    • Pelagic Tones.
    Posted on 07 Jan 2009 by Miguel de Icaza

    First Mono-game hits the Apple AppStore

    Blurst's Raptor Copter game built using Unity3D and Mono just hit the Apple AppStore.

    From the announcement:

    Raptor Copter has become our first Unity-made iPhone game to hit the App Store! We’re making it available for a limited-time price of $0.99. The game is a loose follow-up to Off-Road Velociraptor Safari. Instead of a jeep, you have a Chinook helicopter, but the basic game loop is the same: Capture raptors, drop them into factories, and teleport their sweet meats to the future.

    You can get it for your iPod Touch or iPhone from this Raptor Copter iTunes Link.

    Cute video:

    Unity3D is using Mono's full static compilation to allow the game to run JIT-less and interpreter-less on the iPhone.

    Posted on 06 Jan 2009 by Miguel de Icaza

    First Mono-based Wii Game on the Shelves

    Christian Lassmann from Weltenbauer Software Entwicklung GmbH, who I had the pleasure of meeting at the Unite Conference in Denmark in October, just wrote to tell me that "My Animal Center", a game built with Unity3D's Wii Edition and Mono hit the shelves on December 20th in Germany.

    The game uses C# extensively. It was a joy to hear Christian explain how the various effects were created, I wish he blogged about it.

    Cute trailer (text is in German):

    The game is coming to a Wii near you in the US soon.

    Posted on 06 Jan 2009 by Miguel de Icaza

    Mono goes Accessible!

    Brad Taylor has announced the first release of the Mono Accessibility stack:

    UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.

    Mono's Accessibility Framework is an implementation of UI Automation. The same API that is available for WPF and the framework is used by Silverlight and Windows.Forms.

    Client Code: The initial launch of Mono Accessibility adds accessibility support to applications built with Windows.Forms to be accessible.

    Backend Code: The code has a bridge that talks to the existing ATK framework on Linux.

    In the future the Mono Accessibility framework will be used in our own Moonlight 2.0.

    Check the release notes, install from source or use OpenSUSE's 1-click install.

    Posted on 05 Jan 2009 by Miguel de Icaza

    Mono Goes to Android

    Koushik Dutta got Mono running on the Android-based G1 phone.

    He posted a video of the phone compiling "Hello World" (he points out that it is slower due to Mono running from the SD card):

    He also posted some performance and memory usage comparisons between Dalvik, Mono and Java/ARM. Short story: Mono does great!

    There are some caveats on running Mono on the G1, see the comments on this post. Still, these are encouraging news.

    Posted on 05 Jan 2009 by Miguel de Icaza

    F-Spot Extensions

    Today I upgraded my F-Spot, I had not upgraded it since before the PDC.

    It is now has a Picassa-like toolbar on the left:

    And third-party extensions are starting to come out:

    Posted on 19 Dec 2008 by Miguel de Icaza

    Mono brings Plastic's Windows.Forms UI to Linux and MacOS

    Pablo has sent me these two screencasts of their Plastic SCM product running on Linux and MacOS using Mono 2.0's Windows.Forms support:


    Plastic on Linux, the GUI toolkit is Windows.Forms with custom widgets and a nice color scheme.

    Plastic has a nice graphical diff tool:


    A preview of Plastic on MacOS X.


    Cute graphs

    More screenshots here.

    Plastic is one of the finalists for this year's Jolt Awards.

    Posted on 18 Dec 2008 by Miguel de Icaza

    Evolution wish-list: IMAP server built into the client

    For a while I wanted to be able to get programmatic access to my email store in Evolution, just like it is possible to have programmatic access to the contacts and calendar through the Evolution Data Server.

    The advantages of using IMAP as the protocol to talk to Evolution are simple: I can use any existing IMAP client library, or any other IMAP client to connect to my Evolution store. The protocol is well known, documented and the large ecosystem of IMAP clients makes it a natural feature.

    There is also an application that I have in mind for it. I keep all of my email in Evolution, I download all of my email into my local hard disk so I can have all my information with me even when I am disconnected from the net. This means I can always check patches, review comments, discussions even when I am disconnected or with poor network connectivity.

    But when I go on vacation, I do not want to bring my laptop or Evolution with me. Instead I end up using internet cafes to read my gmail and all of the other email addresses end up in Novell's server. Novell provides a convenient Web UI that I can use to read my email.

    But the problem is that I end up reading emails twice: once in the road with the web UIs, and another time when I get back home and import all my email into Evolution.

    By having Evolution expose an IMAP interface, I could use any IMAP client on the road, or ssh into my box and use mutt to read from the same email store that Evolution is keeping track of.

    Posted on 17 Dec 2008 by Miguel de Icaza

    Visiting Microsoft

    Joseph, Chris and myself are visiting Microsoft this week to learn more about Silverlight 3.0

    If you are in town and have some time to meet to discuss open source, Mono, .NET, the CLI, the DLR or and whatever else you think we might have a fun conversation about, please drop me an email.

    Posted on 09 Dec 2008 by Miguel de Icaza

    Moonlight goes 3D

    Argiris Kirtzidi (one of the developers behind Managed OGRE) modified Moonlight to run inside the Ogre3D engine. You can render Moonlight applications or XAML files inside Ogre3D.


    The Moonlight Calculator Example.

    Your standard XAML tiger.

    We are merging his patches to make it simpler for Moonlight to be compiled by Windows users.

    Update:For more details about how this was done, and how he modified Cairo to be hardware accelerated check Argiris's post.

    Posted on 08 Dec 2008 by Miguel de Icaza

    Groupwise Calendar to Google Calendar Exporter

    I wrote a small tool that exports my Groupwise Calendar to Google Calendar.

    This tool only runs on Windows as it is using the Groupwise COM APIs to fetch the calendar data. I would love to have this work on Linux if someone knows how to get to these from Unix.

    You will need the Google Calendar assemblies (Google.GData.AccessControl, Google.GData.Calendar, Google.GData.Extenions) and the Groupwise Assemblies (GroupwiseTypeLibrary, GroupWiseCommander) and a text file that contains your passwords (called `passwords').

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using Google.GData.Calendar;
    using Google.GData.Client;
    using Google.GData.Extensions;
    using Google.Accounts;
    using System.Threading;
    using System.IO;
    
    namespace CalendarExporter
    {
        class Program
        {
    	const string google_email = "YOUR_EMAIL@gmail.com";
    	const string groupwise_login = "YOURNAME";
    	
            static void Main(string[] args)
            {
                var f = File.OpenRead("passwords");
                var reader = new StreamReader(f);
                var google_passowrd = reader.ReadLine();
                var groupwise_password = reader.ReadLine();
    
                new Thread(delegate() {
                    Thread.Sleep(1000 * 120);
                    Console.Error.WriteLine("Timing out");
                    Environment.Exit(1);
                }).Start();
    
                ClientLoginRequest login = new ClientLoginRequest();
                login.AccountType = "GOOGLE";
                login.Email = google_email;
                login.Password = google_password;
                login.Service = "cl";
                login.Source = "YOURNAMECo-CalendarPush-1";
    
                var token = login.Login();
    
                CalendarService cs = new CalendarService("YOURNAMECo-CalendarPush-1");
                cs.SetAuthenticationToken(token.Auth);
    
    
                CalendarQuery cq = new CalendarQuery();
                cq.Uri = new Uri("http://www.google.com/calendar/feeds/default/owncalendars/full");
                CalendarFeed resultFeed = cs.Query(cq);
                CalendarEntry gw_at_google = null;
                foreach (CalendarEntry entry in resultFeed.Entries) {
                    if (entry.Title.Text == "Groupwise Calendar") {
                        entry.Delete();
                        break;
                    }
                    
                }
                gw_at_google = new CalendarEntry();
                gw_at_google.Title.Text = "Groupwise Calendar";
                gw_at_google.Summary.Text = "This is the syncrhonized calendar at Novell's Groupwise server";
                gw_at_google.TimeZone = "America/New_York";
                gw_at_google.Hidden = false;
                gw_at_google.Color = "#2952a3";
                gw_at_google.Location = new Where("", "", "Boston");
                gw_at_google.Selected = true;
                Uri postUri = new Uri("http://www.google.com/calendar/feeds/default/owncalendars/full");
                CalendarEntry cal = (CalendarEntry)cs.Insert(postUri, gw_at_google);
    
                string calurl = cal.EditUri.Content;
                int p = calurl.LastIndexOf ('/');
                string code = calurl.Substring (p);
    
                
                Uri edit_uri = new Uri ("http://www.google.com/calendar/feeds" + code + "/private/full");
                GroupwareTypeLibrary.GWSession2Class gsc = null;
                try
                {
                    gsc = new GroupwareTypeLibrary.GWSession2Class();
                }
                catch
                {
                    Console.WriteLine("Did not regsvr the file c:\novell\groupwise\gwcma1.dll and is this program x86-only?");
                    return;
                }
                var account = gsc.Login(groupwise_login, "", groupwise_password, null, null);
                var path_to_host = account.PathToHost;
    
                //alendar calendar = new iCalendar();
    
                
                int count = 0, skipped =0;
                foreach (GroupwareTypeLibrary.Message m in account.Calendar.Messages)
                {
                    if (!m.ClassName.StartsWith ("GW.MESSAGE.APPOINTMENT"))
                        continue;
    
                    GroupwareTypeLibrary.Appointment2 app = (GroupwareTypeLibrary.Appointment2) m;
    
                    // Ignore appointments that are older than 15 days.
                    if (app.EndDate < DateTime.Now - TimeSpan.FromDays(7)) {
                        skipped++;
                        continue;
                    }
    
                    var ee = new EventEntry();
                    ee.Title.Text = app.Subject.PlainText;
                    ee.Content.Content = app.BodyText.PlainText;
                    ee.Locations.Add (new Where () { ValueString = app.Place });
                    ee.Times.Add(new When(app.StartDate, app.EndDate));
                    ee.EventVisibility = app.Private ?
                        EventEntry.Visibility.PRIVATE : EventEntry.Visibility.PUBLIC;
    
                    cs.Insert (edit_uri, ee);
                }
                
                Console.WriteLine("Done2");
                Environment.Exit(0);
            }
        }
    }
    	

    You will also need the Login.cs which is some sample code that I found on the tubes for doing Google Account authentication.

    Posted on 02 Dec 2008 by Miguel de Icaza

    Moonlight's Media Stack

    As part of the Moonlight Beta release, I wanted to devote a few blog posts to exploring the features in Moonlight and how we implemented those Silverlight features in Moonlight.

    Before I get started on today's topic, we would like to get some feedback from our users to find out which platforms they would like us to support with packages and media codecs. Please fill out our completely platform and media codec survey.

    Moonlight 1.0 is an implementation of the Silverlight 1.0 API. It is an entirely self-contained plugin written in C++ and does not really provide any built-in scripting capabilities. All the scripting of an embedded Silverlight component is driven by the browser's Javascript engine. This changes with the 2.0 implementation, but that is a topic of a future post.

    The Silverlight/Moonlight Developer View.

    One of the most important features of the Silverlight/Moonlight web plugin is to support audio and video playback.

    Silverlight takes an interesting approach to video and audio playback. In Silverlight the video can be treated like any other visual component (like rectangles, lines) this means that you can apply a number of affine transformations to the video (flip, rotate, scale, skew), have the video be composed with other elements, add a transparency layer to it or add a clipping path to it.

    This is the simplest incarnation of a video player in XAML:

    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <MediaElement x:Name="ExampleVideo"
    		  Source="TDS.wmv"
    		  Width="320" Height="240"
    		  AutoPlay="true"/>
    </Canvas>
    	

    The result looks like this when invoked with when embedded in a web page (or when using the mopen1 command that I am using to take the screenshots):

    The MediaElement has a RenderTransform property that we can use to apply a transformation to it, in this case, we are going to skew the video by 45 degrees:

    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    	<MediaElement x:Name="ExampleVideo" AutoPlay="true" Source="TDS.wmv" Width="320" Height="240">
    	   <MediaElement.RenderTransform>
    	     <SkewTransform CenterX="0" CenterY="0" AngleX="45" AngleY="0" />
    	   </MediaElement.RenderTransform>
    	</MediaElement>
    </Canvas>
    	

    The result looks like this:

    But in addition to the above samples, MediaElements can be used as brushes to either fill or stroke other objects.

    This means that you can "paint" text with video, or use the same video source to render the information in multiple places on the screen at the same time. You do this by referencing the MediaElement by name as a brush when you paint your text.

    This shows how we can fill an ellipse with the video brush:

    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    	<MediaElement x:Name="ExampleVideo" AutoPlay="true" Opacity="0.0" Source="TDS.wmv" Width="320" Height="240"/>
    
    	<Ellipse Width="320" Height="240" >
    	   <Ellipse.Fill>
     	      <VideoBrush SourceName="ExampleVideo"/>
    	   </Ellipse.Fill>
    	</Ellipse>
    </Canvas>
    

    This looks like this:

    You can also set the stroke for an ellipse. In the following example we use one video for the stroke, and one video for the fill. I set the stroke width to be 30 to make the video more obvious.

    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    	<MediaElement x:Name="ExampleVideo" AutoPlay="true" Opacity="0.0" Source="TDS.wmv" Width="320" Height="240"/>
    	<MediaElement x:Name="launch" AutoPlay="true" Opacity="0.0" Source="launch.wmv" Width="320" Height="240"/>
    
    	<Ellipse Width="320" Height="240" StrokeThickness="30">
    	   <Ellipse.Fill>
     	      <VideoBrush SourceName="ExampleVideo"/>
    	   </Ellipse.Fill>
    	   <Ellipse.Stroke>
     	      <VideoBrush SourceName="launch"/>
    	   </Ellipse.Stroke>
    	</Ellipse>
    </Canvas>
    	

    Notice that in the examples above I have been using AutoPlay="true". Silverlight provides fine control over how the media is played as well as a number of events that you can listen to from Javascript for various events (for example, you get events for buffering, for the media being opened, closed, paused, or when you hit a "marker" on your video stream).

    Streaming, Seeking and Playback

    Depending on the source that you provide in the MediaElement, Moonlight will determine the way the video will be played back.

    The simplest way of hosting a video or audio file is to place the audio or video file in a web server, and then have Moonlight fetch the file by specifying the Source attribute in the MediaElement. You do not need anything else to start serving videos.

    Seeking on the standard Web server scenario: When the programmer requests the media to be played (either by calling the Play method on the MediaElement, or because the MediaElement has AutoPlay set to true) Moonlight will start buffering and play the video back.

    If the user wants to seek backwards, or forward, Moonlight will automatically take care of this. In the case where the user fast-forwards to a place in the file that has yet to be downloaded, playback will pause until then.

    Seeking with an enhanced media server: If your server implements the Windows Media Streaming HTTP extension if the user seeks to a point in the file beyond the data that has been downloaded, it will send a special message to the server to seek. The server will start sending video from the new position. The user will get the playback started immediately without having to wait. The details of the protocol are documented in the MS-WMSP specification. This is enabled by using the "mms://" prefix for your media files instead of using the "http://" prefix.

    Notice that even if it says "mms", Silverlight and Moonlight do not actually speak to an MMS server, they merely replace that with "http" and speak http/streaming to the server.

    The extension is pretty simple, it is basically a "Pragma" header on the HTTP requests that contains the stream-time=POSITION value. Our client-side implementation is available here.

    You can use IIS, or use the mod_streaming to enhance the video experience for your end users.

    This basically means that you can stream videos on the cheap, all you need is a Linux box, two wires, and a 2HB pencil.

    Adaptive Streaming

    Another cool feature of the Adaptive Streaming support in Moonlight is that the server can detect the client throughput, and depending on the bandwidth available, it can send a high bitrate video, or a low bitrate video. This is a server side feature.

    This feature was demoed earlier this year at Mix 08:

    I am not aware of an adaptive streaming module for Apache.

    Supported Media Formats in Moonlight 1.0

    Although Moonlight 1.0 exposes the Silverlight 1.0, Moonlight 1.0 ships a 2.0 media stack (minus the DRM pieces). This means that Moonlight ships with support for the media codecs that are part of Silverlight 2.0 and supports adaptive streaming. This is what we are shipping:

    Video:

    • WMV1: Windows Media Video 7
    • WMV2: Windows Media Video 8
    • WMV3: Windows Media Video 9
    • WMVA: Windows Media Video Advanced Profile, non-VC-1
    • WMVC1: Windows Media Video Advanced Profile, VC-1

    Audio:

    • WMA 7: Windows Media Audio 7
    • WMA 8: Windows Media Audio 8
    • WMA 9: Windows Media Audio 9
    • WMA 10: Windows Media Audio 10
    • MP3: ISO/MPEG Layer-3
      • Input: ISO/MPEG Layer-3 data stream
      • Channel configurations: mono, stereo
      • Sampling frequencies: 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, and 48 kHz
      • Bit rates: 8-320 kbps, variable bit rate
      • Limitations: "free format mode" (see ISO/IEC 11172-3, sub clause 2.4.2.3) is not supported.

    We also support server-side playlists.

    For more information see the Silverlight Audio and Video Overview document on MSDN.

    Media Pipeline

    When we first prototyped Moonlight we used the ffmpeg media pipeline. A media pipeline looks like this:

    Charts by the taste-impaired.

    Originally ffmpeg handled everything for us: fetching media, demultiplexing it, decoding it and scaling it.

    Since we needed much more control over the entire pipeline, we had to write our own, one that was tightly integrated with Moonlight.

    Today if you download Moonlight's source code you can build it with either the ffmpeg codecs or you can let Moonlight fetch the binary Microsoft Media Pack and use Microsoft's codecs on Linux.

    Microsoft Media Pack

    The Microsoft Media Pack is a binary component that contains the same code that Microsoft is using on their Silverlight product.

    The Moonlight packages that we distribute do not actually have any media codecs built into them.

    The first time that Moonlight hits a page that contains media, it will ask you whether you want to install the Microsoft Media Pack which contains the codecs for all of the formats listed before.

    Today Microsoft offers the media codecs for Linux on x86 and Linux x86-64 platforms. We are looking for your feedback to find out for which other platforms we should ship binary codecs.

    Tests

    No animals were harmed in the development of the Moonlight Video Stack. To ensure that our pipeline supported all of the features that Microsoft's Silverlight implementation supports we used a number of video compliance test that Microsoft provided us with as part of the joint Microsoft-Novell collaboration.

    In addition to Microsoft's own tests, we created our own set of open source tests. All of these tests are available from the moon/test/media module. This includes the videos that are specially encoded with all the possible combinations and features used as well as XAML files and associated javascript.

    Posted on 02 Dec 2008 by Miguel de Icaza

    Moonlight 1.0 Beta 1

    We have released the first beta of Moonlight 1.0.

    This release supports the Microsoft Media Pack for playing back video and audio files. These are the same video and audio decoders that Microsoft uses in Silverlight 2.0.

    Check our Moonlight roadmap for details on upcoming versions.

    You can try some of the sites tests that we used to test Moonlight.

    Here are some Silverlight 1.0 materials:

    You can also read the Silvelright's XAML vocabulary description and its XAML Foundation Specification.

    Posted on 02 Dec 2008 by Miguel de Icaza

    Mono on PowerPC 64

    As part of SUSE 11, Mono needs to run on the PowerPC in 64 bit mode. The effort was bootstrapped with some early work from Andreas Faerber.

    It was fun to watch Mark's daily commits progress of the port, the tests referenced here are the basic runtime tests that we use to check for regressions and to get a port up and running, it is a good roadmap for how a port comes to life:

    	* mini-ppc64.c, cpu-ppc64.md: Fixed some opcodes.  PPC64
    	passes basic.exe now.
    
    	---
    
    	* cpu-ppc64.md: Fixed a few instruction lengths.
    
    	* mini-ppc64.c: Don't emit SETLRET.  Now PPC64 passes
    	basic-float.exe.
    
    	---
    
    
    	* decompose.c: Decompose carry and overflow add on PPC64 like
    	on other 64 bit archs.  Don't decompose sub at all on PPC64.
    
    	* mini-ppc64.c, exceptions-ppc64.c, tramp-ppc64.c,
    	cpu-ppc64.md: 	Several fixes and new opcodes.  Now PPC64 runs (but doesn't
    	pass) basic-long.exe.
    
    	---
    	
    	* ppc/ppc-codegen.h: Use ppc_load_reg instead of ppc_ld in
    	ppc_load_func to fix the 2 bit shift.
    
    	---
    
    	* mini-ppc64.c, mini-ppc64.h, cpu-ppc64.md: Several fixes.
    	Now PPC64 passes basic-long.exe.
    
    	---
    
    	* ppc/ppc-codegen.h: Make ppc_is_[u]imm16() work with 64 bit
    	values.
    
    	---
    
    	* mini-ppc64.h, cpu-ppc64.md: Fixed caller/callee saved
    	floating point regs.  Now PPC64 passes basic-calls.exe.
    
    	---
    
    	* mini-ppc64.c, mini-ppc64.h, exceptions-ppc64.c,
    	tramp-ppc64.c, cpu-ppc64.md: Several fixes.  PPC64 now runs objects.exe.
    
    	---
    
    	* mini-ppc64.c, tramp-ppc64.c: Small fixes.  PPC64 now runs
    	arrays.exe and basic-math.exe.
    
    	---
    
    	* mini-ppc64.c, mini-ppc64.h, exceptions-ppc64.c,
    	cpu-ppc64.md: Several fixes.  PPC64 now runs exceptions.exe and
    	devirtualization.exe.
    
    	---
    
    	* mini-ppc64.c: Several fixes.  PPC64 now runs iltests.exe.
    
    	---
    
    	* mini-ppc64.c, mini-ppc64.h, tramp-ppc64.c: Disable generic
    	code sharing.  PPC64 now passes generics.exe.
    
    	---
    
    	* basic-long.cs: New test case.
    
    	---
    
    	* mini-ppc64.c, mini-ppc64.h, tramp-ppc64.c, cpu-ppc64.md:
    	Several	fixes.  PPC64 now passes most of the runtime regressions.
    	
    	

    Followed by today's tweet:

    The bootstrap means that the Mono JIT is actually doing a full build of Mono's compilers and class libraries and can be built on the target platform.

    Update: Mark has posted a great picture of Jim Purbrick from Second Life, the man behind Mono running on Second Life.

    Posted on 25 Nov 2008 by Miguel de Icaza

    Unity on Linux, First Screenshots

    The first Unity3D on Linux screenshot:

    The above program was built on MacOS, the result copied to Linux and then executed using the LinuxPlayer. This is still very basic, the port is yet far from done.

    I followed Joachim's advise and added a tiny script to update the cube on the screen. See the video of the cubes in action: ogg and wmv.

    Posted on 14 Nov 2008 by Miguel de Icaza

    Framework Design Guidelines, 2nd Edition

    A couple of years ago I wrote an enthusiastic review of Brad Abrams and Krzysztof Cwalina's Framework Design Guidelines, a book that I absolutely love.

    The book is a great compendium of best-practices for building software, traps and pitfalls to avoid.

    But most importantly, it is the best source to learn the idioms and patterns used in the .NET Frameworks. Learning these idioms will have you writing code like the native C# speakers in no time.

    I was incredibly honored when Brad asked me earlier this year to write the foreword for the second edition of the Framework Design Guidelines.

    The second edition tracks the evolution of .NET and they apply as well to Mono. For instance, it now contains LINQ design patterns, extension methods patterns and DependencyProperties (used in WPF and Silverlight).

    Posted on 13 Nov 2008 by Miguel de Icaza

    Silverlight Toolkit, now MS-PL

    Update: Fixed some links, corrected some text.

    Shawn Burke announced the Silverlight Toolkit and it is licensed under the open source MS-PL. The code is available here complete with unit tests (check Ning's blog on the unit testing framework).

    With the Silverlight Toolkit they are taking a new approach to shipping new controls in an effort to move swiftly and deliver the controls to people at the right time. Their previous approach was to ship the Toolkit when every component was ready, and completely fleshed out.

    Now they will be shipping the Toolkit with controls that might have different levels of quality (and they are clearly flagged in the documentation). Shawn explains the new "Quality Bands" model that they are using in his post.

    You can try the components on the web. The charting control can be tried out with the ChartBuilder (check David's blog for details on the ChartBuilder):

    The source code for the Toolkit and the Controls is great to learn how to use Silverlight and it is great for people that need to tweak them for their own applications. When it comes to these controls, you no longer need Microsoft to make small changes for you or the small bug fixes that impact your application.

    Themes: An interesting control container in Silverlight is the theming control. You wrap your code around this, and it will let you skin your control with XAML and define the animations and interactions with XAML and the Visual State Manager:

    Some of these themes reminded me of the Gtk+ themes from 1998. Back in the days of Enlightenment and the "Cheese Pixmap" theme were hot. Mehdi explains how the themes work and Jafar explains the ImplicitStyleManager, the foundation for themes.

    Shawn's Talk

    Shawn's talk at the PDC was very interesting. I did not get to see it during the conference, but I watched it in the comfort of home (wmv, mp4 and slide deck).

    Posted on 10 Nov 2008 by Miguel de Icaza

    Moonlight Updates

    Last week we branched Moonlight for the 1.0 release, full with the licensed Microsoft Codecs and started our release process for Moonlight Beta 1 to be available in the next few days. This release is not yet published on our web site, watch this space.

    The Moonlight engine team has now resumed our work on Moonlight 2.0, the version that will track Silverlight 2.0.

    In the meantime, while the GUI team was busy completing 1.0, the Mono core team has been working on the security framework for Moonlight, the networking stack (Silverlight allows Socket connections using policy files) and web services (System.ServiceModel, a subset of WCF).

    The security system is the trickier and is the one that has received the most attention. We started early on last year in to implementing this, as we knew it would end up burning a lot of cycles to get it right.

    Our hero has posted the initial work partition for the upcoming GUI work on Moonlight 2.0.

    Moonlight is a blast, and who knows, maybe with our static compilation engine we might be able to deliver Silverlight on the iPhone.

    Posted on 10 Nov 2008 by Miguel de Icaza

    Change.Gov

    I wanted to thank everyone that helped get Barack Obama elected. Those that endorsed Obama passionately, those that videocasted, blogged, improved Obama's web site, donated to his campaign, wrote, discussed and voted on Tuesday to get him elected.

    Barack does not only represent a change of direction for public policy, he is a truly brilliant candidate.

    Some cool links on Barack:

    I was surprised that the Obama campaign already launched their Change.Gov (thanks Nat) web site. You can now see how the team operates in real life, and you can share your story and you can share your vision of where America should go. The blog is here.

    The above starts to deliver on the promise he had made during the campaign.

    Got a cool collection of pictures about Obama or the reaction to the results? Please post it in the comments.

    Inflamatory or misinformed comments will be deleted pronto.

    Posted on 06 Nov 2008 by Miguel de Icaza

    Static Compilation in Mono

    Another nice piece of technology that we showed at the PDC was static compilation, the feature behind allowing Mono to run on the iPhone in a fully legit way (no jail-breaking):

    Screenshot from the Unity IDE.

    Although Mono has supported batch compilation from CIL into native code in the past there was a small amount of code that was still generated dynamically. The intention originally was to help reduce startup and increase code sharing across multiple processes.

    Code sharing is important once you have a handful of Mono processes running on the system. Instead of having to JIT the same code once per Mono instance for say "System.Console.WriteLine", the code laid out in essentially a shared object.

    Our generated code uses many of the concepts found on the ELF file format to ensure that we can share code and that the code pages are read-only and not written to. This means that methods are invoked through a program linkage table instead of directly (to cope with the shared libraries being loaded at different addresses).

    The Extra Mile

    Although we are not certified XBox360 developers yet (we have yet to find the right person at Microsoft to talk to) we know from some of our users that have ported Mono to the XBox360 that JITing is not an option on that platform.

    The XBox360 seems to have the same security-imposed limitations that the iPhone has, it is not possible for a Just-in-Time compiler to run in the platform as either the license terms or the kernel do not allow writable pages to become executable pages.

    During the last few months we developed a static compilation mode for Mono. First we did this for the 1.0 profile, and now we are working on the 2.0 profile (so that we can support static compilation of generics). The work to support the 2.0 profile is reusing Mark's work on generic code sharing, which I found out to be a very nice synergy of efforts internally.

    This means that it is now possible compile code from CIL to native code and not even ship the JIT compiler in your final program (saving some precious kilobytes from the final executable).

    To do this, you must:

    • Use Mono 2.0.1 at least.
    • Request that Mono performs a full AOT compilation by using: mono --aot=full program.exe. That will generate your static executable. This executable still needs the runtime for things like garbage collection, threading and other runtime services.
    • You then run your executable with Mono: mono --full-aot program.exe
    • Optionally: build a new Mono on a separate location that removes the JIT engine by configuring Mono like this: configure --enable-minimal=jit. This will reduce your deployment by a few hundred Ks as the code generation and JIT engines are stripped out.
    • Optionally: build a smaller set of libraries by using the Mono Linker (this is the tool that we use for turning Mono's 3.5 APIs into the Silverlight 2.0 APIs).
    • Optionally: strip out the CIL code from the assemblies. We still require the assemblies for their rich metadata, but the actual CIL instructions can be safely removed. The new cil-strip tool built on top of Mono.Cecil can further shrink your deployed executables.

    Developers interested in trimming down Mono can look into our documentation for more features that can be removed by using the --enable-minimal option.

    Of course, once you remove the JIT you will not be able to use any dynamically generated code. This means no Reflection.Emit dynamically and at least for the time being or no IronPython/IronRuby.

    John Lam told me at the PDC that they are looking into bringing static compilation for IronPython/IronRuby/DLR back, so this might just be a short-lived limitation.

    For those interested in using Mono on the iPhone today the situation is a bit painful right now. You must run Mono on the target system to do the batch compilation and send the data back to assembly it on the host before you send the code back to the iPhone to run.

    If you are wondering how did the demo go so smoothly at the PDC, the reason is that I was using Unity. Unity modified their local copy of Mono to be hardwired to do cross compilation to that exact platform. A more general purpose solution is needed to allow arbitrary platform-to-platform cross compilation, and we hope that this will be available in the future.

    If you must quench your thirst for C# on the iPhone today your best choice is to use Unity's product and start building games instead of the enterprise application you always dreamed of.

    From the Unity's Video Sample

    If your boss demands that line of application running on the iPhone, you have a perfect excuse to learn the Unity gaming APIs and deliver the most glorious multi-touch, 3D-transformed line of business application to ever grace this world full with spinning AI for your "Sort By Customer Last Name" button.

    Posted on 05 Nov 2008 by Miguel de Icaza

    C# 4.0: var, object and dynamic

    Anders presentation on C# 4 was as usual great to listen to. He continues to evolve the language with solid steps, and the presentation was quite fun.

    You can watch his presentation or just read the slide deck.

    With C# 4 the new "dynamic" keyword has been introduced to flag a variable as a dynamic variable.

    This is slightly different than var and object, the differences are as follows:

    • "object x" is a shorthand for "System.Object x". This declares the variable x to have the type System.Object, this is strongly typed. And since C# provides autoboxing, you can assign anything you want to this variable.
    • "var x = E" declares a variable x to be of the type of the expression E. The E is required, not optional. This is a strongly typed declaration, and you can only assign values whose type is typeof(E) to it.
    • "dynamic x" declares the variable x to have dynamic semantics. This means that the C# compiler will generate code that will allow dynamic invocations on x. The actual meaning of "x.M" is deferred until runtime and will depend on the semantics of the IDynamicObject implementation.
    Posted on 03 Nov 2008 by Miguel de Icaza

    Mono's SIMD Support: Making Mono safe for Gaming

    This week at the Microsoft PDC we introduced a new feature in the Mono virtual machine that we have been working on quietly and will appear in our upcoming Mono 2.2 release (due in early December).

    I believe we are the first VM for managed code that provides an object-oriented API to the underlying CPU SIMD instructions.

    In short, this means that developers will be able to use the types in the Mono.Simd library and have those mapped directly to efficient vector operations on the hardware that supports it.

    With Mono.Simd, the core of a vector operations like updating the coordinates on an existing vector like the following example will go from 40-60 CPU instructions into 4 or so SSE instructions.

    Vector4f Move (Vector4f [] pos, ref Vector4f delta)
    {
    	for (int i = 0; i < pos.Length; i++)
    		pos [i] += delta;
    }
    	

    Which in C# turns out to be a call into the method Vector4f.operator + (Vector4f a, Vector4f b) that is implemented like this:

    Vector4f static operator + (Vector3f a, Vector3f b)
    {
    	return new Vector4f (a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);
    }
    	

    The core of the operation is inlined in the `Move' method and it looks like this:

    movups (%eax),%xmm0
    movups (%edi),%xmm1
    addps  %xmm1,%xmm0
    movups %xmm0,(%eax)
    	

    You can see the details on the slides that I used at the PDC and look at the changes in the generated assembly, they are very large.

    Ideally, once we tune the API based on our user feedback and contributions, it should be brought to ECMA for standardization. Hopefully we can get Microsoft to implement the SIMD support as well so all .NET developers have access to this.

    Making Managed Code Viable for Gaming

    Many developers have to resort to C++ or assembly language because managed languages did not provide the performance they needed. We believe that we can bring the productivity gains of managed languages to developers that seek high performance applications:

    But even if you want to keep using your hand-tuned C++ game engine, the SIMD extensions will improve the performance of your scripting code. You can accelerate your ray casting operations by doing all the work in the managed world instead of paying for a costly managed to unmanaged transition and back.

    You can avoid moving plenty of code from C# into C++ with this new functionality.

    Some SIMD Background

    Most modern CPUs contain special instructions that are able to perform arithmetic operations on multiple values at once. For example it is possible to add two 4-float vectors in one pass, or perform these arithmetic operations on 16-bytes at a time.

    These are usually referred to as SIMD instructions and started showing up a few years ago in CPUs. On x86-class machines these new instructions were part of MMX, 3DNow or the SSEx extensions, on PowerPC these are called Altivec.

    CPU manufacturers have been evolving the extensions, and newer versions always include more functionality and expand on the previous generations.

    On x86 processors these instructions use a new register bank (the XMM registers) and can be configured to work on 16 bytes at a time using a number of possible combinations:

    • byte-level operations on 16 elements.
    • short-level operations on 8 elements.
    • single precision or integer-level operations on 4 elements.
    • double precision or long-integer operations on 2 elements.

    The byte level operations are useful for example when doing image composition, scaling or format conversions. The floating point operations are useful for 3D math or physics simulations (useful for example when building video games).

    Typically developers write the code in assembly language to take advantage of this feature, or they use compiler-specific intrinsic operations that map to these underlying instructions.

    The Idea

    Unlike native code generated by a compiler, Common Intermediate Language (CIL) or Java class files contain enough semantic information from the original language that it is very easy to build tools to compute code metrics (with tools like NDepend), find bugs in the code (with tools like Gendarme or FxCop, recreate the original program flow-analysis with libraries like Cecil.FlowAnalysis or even decompile the code and get back something relatively close to the original source code.

    With this rich information, virtual machines can tune code when it is just-in-time compiled on a target system by tuning the code to best run on a particular system or recompiling the code on demand.

    We had proposed in the past mechanisms to improve code performance of specific code patterns or languages like Lisp by creating special helper classes that are intimately linked with the runtime.

    As Mono continues to be used as a high-performance scripting engine for games we were wondering how we could better serve our gaming users.

    During the Game Developer Conference early this year, we had a chance to meet with Realtime Worlds which is using the Mono as their foundation for their new work and we wanted to understand how we could help them be more effective.

    One of the issues that came up was the performance of Vector operations and how this could be optimized. We discussed with them the possibility of providing an object-oriented API that would map directly to the SIMD hardware available on modern computers. Realtime Worlds shared with us their needs in this space, and we promised that we would look into this.

    The Development

    Our initial discussion with Realtime Worlds was in May, and at the time we were working both towards Mono 2.0 and also on a new code generation engine that would improve Mono's performance.

    The JIT engine that shipped with Mono 2.0 was not a great place to start adding SIMD support, so we decided to postpone this work until we switched Mono to the Linear IL engine.

    Rodrigo started work on a proof-of-concept implementation for SIMD and after a weekend he managed to get the basics in place and got a simple demo working.

    Beyond the proof of concept, there was a lingering question: were the benefits of Vector operations going to be noticeably faster than the regular code? We were afraid that the register spill/reload would eclipse the benefits of using the SIMD instructions or that our assumptions had been wrong.

    Over the next few weeks the rest of the team worked with Rodrigo to turn the prototype into something that could be both integrated into Mono and would execute efficiently (Zoltan, Paolo and Mark).

    For example, with Mono 2.2 we will now align the stack conveniently to a 16-byte boundary to improve performance for stack-allocated Mono.SIMD structures.

    So far the reception from developers building games has been very positive.

    Although today we only support x86 up to SSE3 and some SSE4, we will be expanding both the API and the reach of of our SIMD mapping based on our users feedback. For example, on other architectures we will map the operations to their own SIMD instructions.

    The API

    The API lives in the Mono.Simd assembly and is available today from our SVN Repository (browse the API or get a tarball). You can also check our Mono.Simd documentation.

    This assembly can be used in Mono or .NET and contains the following hardware accelerated types (as of today):

    Mono.Simd.Vector16b  - 16 unsigned bytes
    Mono.Simd.Vector16sb - 16 signed bytes
    Mono.Simd.Vector2d   - 2 doubles
    Mono.Simd.Vector2l   - 2 signed 64-bit longs
    Mono.Simd.Vector2ul  - 2 unsigned 64-bit longs
    Mono.Simd.Vector4f   - 4 floats
    Mono.Simd.Vector4i   - 4 signed 32-bit ints
    Mono.Simd.Vector4ui  - 4 unsigned 32-bit ints
    Mono.Simd.Vector8s   - 8 signed 16-bit shorts
    Mono.Simd.Vector8us  - 8 unsigned 16-bit shorts
    	

    The above are structs that occupy 16 bytes each, very similar to equivalent types found on libraries like OpenTK.

    Our library provides C# fallbacks for all of the accelerated instructions. This means that if your code runs on a machine that does not provide any SIMD support, or one of the operations that you are using is not supported in your machine, the code will continue to work correctly.

    This also means that you can use the Mono.Simd API with Microsoft's .NET on Windows to prototype and develop your code, and then run it at full speed using Mono.

    With every new generation of SIMD instructions, new features are supported. To provide a seamless experience, you can always use the same API and Mono will automatically fallback to software implementations if the target processor does not support the instructions.

    For the sake of documentation and to allow developers to detect at runtime if a particular method is hardware accelerated developers can use the Mono.Simd.SimdRuntime.IsMethodAccelerated method or look at the [Acceleration] atribute on the methods to identify if a specific method is hardware accelerated.

    The Speed Tests

    When we were measuring the performance improvement of the SIMD extensions we wrote our own home-grown tests and they showed some nice improvements. But I wanted to implement a real game workload and compare it to the non-accelerated case.

    I picked a C++ implementation and did a straight-forward port to Mono.Simd without optimizing anything to compare Simd vs Simd. The result was surprising, as it was even faster than the C++ version:

    Based on the C++ code from F# for Game Development

    The source code for the above tests is available here.

    I use the C++ version just because it peeked my curiosity. If you use compiler-specific features in C++ to use SIMD instructions you will likely improve the C++ performance (please post the updated version and numbers if you do).

    I would love to see whether Johann Deneux from the F# for Game Development Blog could evaluate the performance of Mono.Simd in his scenarios.

    If you are curious and want to look at the assembly code generated with or without the SIMD optimizations, you want to call Mono's runtime with the -v -v flags (yes, twice) and use -O=simd and -O=-simd to enable or disable it.

    Presentation

    You can watch the presentation to get some color into the above discussion or check it in the Silverlight player, Get it as PDF, or PPTX.

    Posted on 03 Nov 2008 by Miguel de Icaza

    Mono and .NET talk at PDC video.

    The PDC 2008 was a blast. It was a privilege to be able to present Mono to all of these developers.

    Joseph Hill helped me prepare my presentation for the PDC. Our goal was to explore how Mono could help .NET developers, but we did not want to go down a laundry list of features, or a list of APIs, or rehash what the advanced audience at the PDC already knew.

    player, pdf, pptx

    The idea was to pick a couple of interesting innovations from Mono and try stitch a story together. I discussed our embeddable C# compiler (which we need to start calling "Compiler Service"), some applications of Mono in gaming, our recent SIMD extensions and using Mono on the iPhone.

    As for me, I am catching up on all the sessions I missed this weekend. All of the videos and slide decks are available for free from the Microsoft PDC site, and republished in Channel9.

    In the next few days I will blog in more detail about each topic.

    Posted on 02 Nov 2008 by Miguel de Icaza

    Interactive GUI Shell

    This week at the Microsoft PDC I showed gsharp, our GUI repl for the C# 3.0 language, a tool that I had previously talked about.

    Before the PDC we copied an idea from Owen's great reinteract shell where we provide our REPL with a mechanism to turn objects into Gtk.Widgets which we then insert.

    Out of the box we support System.Drawing.Bitmap images, we turn those into Gtk Widgets that then we render:

    I also added a toy Plot command that can take a number of lambdas that return floats to do some cute plots. The plots are just rendered into a System.Drawing.Bitmap so they get painted on the screen automatically:

    But you can add your own handlers for any data types you want, all you have to do is call RegisterTransformHandler with a function that can return a Gtk.Widget based on an input object, or null if it does not know how to render it.

    The implementation to render images is very simple, this is the implementation:

    using System;
    
    public class MyRenderHelpers {
    	public static object RenderBitmaps (object o)
    	{
    		System.Drawing.Bitmap bitmap = o as System.Drawing.Bitmap;
    		if (bitmap == null)
    			return null;
    
    		return new BitmapWidget (bitmap);
    	}
    }
    	

    You can put your own library of helper methods in a compiled assembly in ~/.config/gsharp, and then register all of your types from a file ending with the extension .cs in ~/.config/gsharp:

    RegisterTransformHandler (MyRenderHelpers.RenderBitmaps);
    	

    And you are done.

    The above could be used for example to create all kinds of information visualizers for the GUI REPL. I would love to see a LINQ query navigator, similar to the one in LinqPad.

    Update: A one line change that brings gsharp into the new millenium by rendering `true' and `false' with icons instead of text:

    Posted on 02 Nov 2008 by Miguel de Icaza

    In LA for the Microsoft PDC

    After a great week in Copenhagen with the Unity community I spent 14 hours on a high-tech tin can flying to LA for the Microsoft PDC conference.

    Mono Talk

    I am doing a talk on Wednesday at 4:45 in room 515B.

    Unlike previous talks that I have done about Mono, this is an advanced talk and will skip over all the generalities and go straight to Mono CLI/C# features and innovations.

    I decided against talking about Moonlight or APIs, as information about can be better learned elsewhere.

    Speculation

    There has been enough leaked information that we know some bits about C# 4. Some guess it includes dynamic support, other that it will be more F#-like and add immutability, others that it will introduce some Alef-like threading capabilities.

    Then there is talk about .NET 4, and I just have no clue what they will announce.

    So what do you think they are announcing this week?

    Speculate away in the comments.

    Posted on 25 Oct 2008 by Miguel de Icaza

    Live Blogging from Unite

    I am live blogging from Unite, the Unity3D conference, one of the most fun users of Mono.

    Announcements

    Next UnityEditor will run on Windows, and its rewritten in C# (it originated on MacOS, and is now moving to Windows).

    Unity as of today ships for building games on the iPhone. These are fully legit binaries, no need to crack your iPhone, they are using Mono's batch compilation to generate static binaries with no JITing involved (per Apple licensing requirements).

    Side Note

    Since I am a Linuxista, you might be wondering why I am so excited about Unity. Of course I am excited because they use Mono, but I am also excited because Novell is working with Unity to bring this to Linux:

    erandi$ uname -a
    Linux erandi 2.6.25.16-0.1-pae #1 SMP 2008-08-21 00:34:25 +0200 i686 i686 i386 GNU/Linux
    erandi$ ls -l unity-linux/build/LinuxPlayer 
    -rwxr-xr-x 1 miguel users 45735629 2008-10-12 00:37 unity-linux/build/LinuxPlayer*
    	

    We do not have a timeline yet, please do not spam the Unity guys with requests, stay tuned to this blog for updates.

    FusionFall pre-mortem

    12:17am Joachim explains their strategy with the web plugin and how they will cope with multiple versions of it as time goes by.

    12:06am Cartoon Network will drive a lot of the plugin penetration.

    11:50am Joachim is showing profiling information (particle, physics, the top scripts, time taken per frame).

    The game went from 2gigs to 300megs by using some interesting compressions fo meshes and animations.

    All of the features that were added for FusionFall are being folded back into the future Unity 2.5.

    Pics: I wish I had brought my USB cable to post pictures from the camera. I will try to spice up this post tonight with the photos.

    11:45am Runtime World Streaming: scenes are dynamically loaded and unloaded base on the player position in the world, the world is made up of a 16x16 grid. Scene loading happens when a player approaches a boundary in the world.

    11:40am The Unity guys are talkng about the challenge of converting the assets from Gamebryo to Unity, the volume was large (25k files of Gamebryo data, which was constantly changing and growing).

    They added support to Unity to interoperate with the Gamebryo and Cartoon Network data and wrote plenty of C# importing scripts and tools.

    11:30am FusionFall talk by Joachim Ante.. FusionFall is a project that was done for the Cartoon Network.

    It is an MMO with platform game elements.

    It has a huge streaming world, so there are no pauses as you navigate the world. The game is targetted at kids (8-14).

    The game was produced by Cartoon Network and developed by Grigon Entertainment, a team of 40 developers, 10 of them programmers, and has been under development for 3 years. Originally this was Windows-only standalone executable, developed with Gamebryo.

    The cycle at some point included the prototyping done in Unity, shipping the executable to engineering, and engineering reimplementing in Gamebryo. They realized that they could turn the prototype as the actual client and that they could just communicate to their backend server. This allowed them to switch the entire game from Gamebryo to Unity.

    Originally the standalone game was 2gb in size (lots of music, voice overs, terrains). This was a problem for kids, since they are not going to wait for 2 gigs to download, this was a big barrier to entry.

    Unity's web based distribution and the strong world-streaming features were a good match for this project. This allowed Cartoon Network to give a great experience.

    The entire MMO was ported in four months by a team Grigon developers and four Unity engineers working with them. They were on a very tight schedule. Four developers at Grigo ported the game client from C++ to C#.

    Keynote

    10:52am Interesting overview of the challenges of the game industry. Where does the game industry go next? A discussion on integrarting games with the web and delivering games as services.

    On one end there is the flashy stuff, on the other end lots of talk about the enterprise components of gaming. I had no idea.

    Between the low-barrier to entry and the high-barrier to entry markets, there is a large space for gaming and where 3D games on the browser will make a difference.

    Phil sees Unity as an agent that will help transform the game industry.

    10:31am Phil Harrison president of Atari is now on stage, "First time I have done a presentation in a Planetarium". Atari has no commercial relationship with Unity or investing-wise. He is here because "I wanted to be here, what David and his team are doing is transformational for the industry. I had an Eureka moment early this year, I had just joined Atari, and someone told me `check out Unity3d.com', I had heard about it, but never used it. Using the Web player demo was eye opening for me. [...] This is something similar to what I saw at Sony in 1993, when we first got the dinosaur demo on the PS1 [...] The island demo I believe is a game changer in this industry".

    "I have become an unpaid evangelist of Unity".

    Phil is now going to talk about the game industry, wont blog that.

    10:29am Introspection, why we want to do this? Goals: we want people to build games for the web, the iPhone, the Wii, and for everything else.

    10:29am Announcing Indie version, 199 dollars, but has some watermark/splashscreen at the beginning.

    10:26am Windows Vista logo on screen.

    "This is true, I have to admit it", they are demostrating the new Unity3D IDE on Unix. The same Unity3D tool but now running on Windows.

    "We are going completely cross platform", every script that you write will run on both platforms (Woohoo! Go CIL! Go!).

    10:21am Nicholas is going to talk about "Secret Labs". He talks about "Jus t Press Play", "Buliding for multiple targets" and the script property editor.

    They wanted to improved upon th eUnity editor.

    They rewrote the Unity editor from zero. Created entirely on top of the Unity APIs themselves - EditorWindows, unityGUI, GameObjects and Components. Unity is built on Unity now. "It is way faster than cocoa".

    He is showing Unity 2.5, looks like Unity 2.1; They now use tabs and the various windows can be dragged around, very much like MonoDevelop. He is showing the editor by dragging a lightpost into a paradise island and showing the new GUI tools like snapping, rotation and UIs that are closer to Maya's tools.

    He shows "Snap to surface" so you can easily position stuff on the 3D terrain. People like it.

    The UI is a lot easier to use. "We have been focused on the tiny details, but we are not shipping this yet". Everything in the IDE can now be scripted.

    He shows how a few lines of code a developer can attach a camera view when clicking on a property.

    130 new API entry points, Unity developers can now do everything that the Unity3D GUI can do.

    10:20am David talks about the pricing; Two pricing: cheap and expensive.

    10:13am Joachim Ante is introducing Unity for the iPhone. "With Unity we have always focused on iteration time". He goes into some of the technical details, "With all the new input mechanisms for theiphone, how do we provide a quick feedback system, we wanted to keep the experience of develop, hit run under a second".

    They provide a "Unity remote" that runs on the iPhone, you use the iPhone to control the game, but the debugging actually happes on the PC. So you hit "run" and there is no wait at all.

    Joachim is explaining how they are using AOT to run native code on the iPhone without having any JIT on the iPhone.

    Joachim shows "Build and Run" that does the cross compiler and sends the code to the iPhone. It takes about 10 seconds and he now has the game running on the iPhone and shows how both Javascript and C# code running on the system.

    10:10am Some stats: sold out event; 180 attendees; community doubled in the last year (2x employees, 2x posts, 2x users);

    Last year they released Unity 2.0.

    Unity 2.1 was released, should have been 3.0, but they did not charge more.

    They announced Unity for Wii.

    Big games using Unity: Sony, Disney. Virtual worlds like Hangout.Net is out (very pretty!) A new online community was created (Blurst). SeriousGames released a new title "Global Conflicts" Latin America.

    Hard to keep up with the list of users.

    10:04am The Unity founders Joachim, David and Nicholas are on stage to start Unite'08.

    They moved us from the room downstairs to the iMax auditorium whihc is packed with game guys. During the moments of panic that ensued after they moved us from the downstairs room into the switched rooms, I ended up in the front row, which in retrospect was a big mistake, you cant take pictures with the standard lens of this massive screen.

    Registration

    9:48am Waiting for the keynote at the Unite conference. There are about two hundred people packed in the Tycho Planetarium. The Blurst guys are all wearing matching shirts and have taken over the first line of the auditorium, From here I can see a them debugging a Sonic-like game that he is prototyping. Then he switched to some game that has an angry minotaur breaking dishes in a museum.

    The minotaur looks angry and just scored 3,000 points of some kind.

    Everyone in this conference seems to be using a Mac, and I could swear this computer is the only Linux machine in the audience.

    Pre-Conference

    Last night I had dinner at the Unity headquarters and got a chance to meet some of the Unity hackers and users before the conference started.

    Gained a deeper insight into what we can do to improve Mono's VM for games. Lots of good ideas.

    Phil Harrison brought up "the debugger" issue ;-).

    Hopefully Rasmus from CellDotNet will show up for the Unity Mingle tonight.

    Posted on 22 Oct 2008 by Miguel de Icaza

    Mono 2.0 OSX Installer Ready

    We released an updated installer for Mono 2.0 on MacOS X.

    This release got delayed because we wanted to upgrade our bundled Gtk# stack to contain the latest release of Imendio's Gtk+ for MacOS X.

    Banshee coming to an OSX near you this week.

    Mono OSX Survey!

    We are trying to understand how we can improve Mono on the OSX space. Help us figure this out by filling out our Mono on OSX Survey.

    Relocatable Applications

    If you have followed our Guidelines for Application Deployment your software should be easy to be packaged and distributed for MacOS X as a relocatable application.

    Eoin Hennessy worked on integrating Banshee into the OS, and packaging it into a bundle that runs out of the box on MacOS. The following are some screenshots from Aaron's box:

    The Banshee open source media player.

    Sandy has ported Tomboy and Tasque to MacOS and Windows and provided installers for both.

    Tomboy integrates into the dock and menus.

    Aaron Bockover from the Novell Desktop Team has promised that Eoin's work will be part of Friday's Banshee release. From this point on, Banshee will be released both for Linux and MacOS X at the same time.

    Maybe F-Spot is not too far behind?

    The Small Print

    • We downgraded the bundled Gtk+ from 2.15 to 2.14.3, as 2.15 was a development version and 2.14 is the officially supported Gtk+.
      This means that applications that linked directly against Gtk+ 2.15 from Mono 1.9 will fail to run. Please re-link those binaries.
    • We removed MonoDevelop from this distribution, so our package only contains the Mono SDK and Mono runtime.
      A MonoDevelop installation package will come later, we apologize for this delay.
      On the upside: now that the distribution is split, we will be doing MonoDevelop Beta 2 previews as DMGs after the PDC.

    Help us improve Mono on OSX by completing the Mono on OSX Survey and providing comments at the end.

    Posted on 20 Oct 2008 by Miguel de Icaza

    Parallel Programming

    As much as I personally dislike the use of threads for user code, multi-cores systems are here to stay. They are becoming increasingly popular (most laptops now ship with dual core systems, home computers ship with 3 cpus and gaming consoles ship with multiple general purpose cpus as well).

    Developers will need new frameworks for developing software that is ready to take advantage of multiple CPUs. But most importantly they will need to learn the traps and pitfalls of writing parallel/threaded code.

    Here are two fantastic articles on MSDN that cover these topics:

    J�r�mie Laval worked on an ParallelFX implementation for Mono over the summer as part of the Google Summer of Code.

    The implementation currently lives on the student repository at code.google.com. I can not wait for the API to be stabilized so we can move it into the main Mono distribution.

    Posted on 19 Oct 2008 by Miguel de Icaza

    Going to Copenhagen

    Next week I will be in Copenhagen for Unity3D's Unite conference.

    Unity3D is one of the most fun users of Mono as they create IDEs for Game Developers and they are driving the adoption of Mono, C#, Boo and their own UnityScript in the gaming space.

    As a newcomer into this industry, there are various sessions from actual Unity user on how they have built their games from start to finish. Other sessions include details on publishing, production (ArtPlant), Physics (Flashbang), Shader Programming (Unity), developing on the iPhone (Unity), a post-morterm on FusionFall's work for Cartoon Network and the hands-on lab.

    Some cool stuff from the agenda includes a keynote participation from Atari's President.

    If you want to meet up, drop me an email. I will likely be going to the Unity Mingle events at night and departing early on Friday to fly to the Microsoft PDC in LA.

    Posted on 17 Oct 2008 by Miguel de Icaza

    Alan "BitSharp" McGovern Joins Novell

    Alan McGovern, who created BitSharp during a Google Summer of Code for Mono has joined the Moonlight team at Novell.

    Imagine the possibilities! Bittorrent clients, servers, trackers all running from Silverlight 2.0 Web Applets!

    Discuss.

    Posted on 14 Oct 2008 by Miguel de Icaza

    Mono 2.2 Feature: Mono.Options

    In the upcoming Mono 2.2 release we will be distributing Jonathan Pryor's most excellent Mono.Options library.

    Mono.Options is a beautiful command line parsing library. It is small, succinct, a joy to use, easy and powerful, all in one.

    It is one of those libraries that does more with less. Something that every programmer aspires to write, but that we seldom achieve.

    It has also struck a good balance for Unix and Windows developers as options can be used on both systems, and map well to practices on both systems. It took a long time to get the right "blend" of parsing, but I think Jonathan has achieved it.

    Consider this example:

    
    using System;
    using System.Collections.Generic;
    using NDesk.Options;
    
    class Test {
        static int verbosity;
    
        public static void Main (string[] args)
        {
            bool show_help = false;
            List names = new List ();
            int repeat = 1;
    
            var p = new OptionSet () {
                { "n|name=", "the name of someone to greet.",
                  v => names.Add (v) },
                { "r|repeat=", "the number of times to repeat the greeting.",
                  (int v) => repeat = v },
                { "v", "increase debug message verbosity",
                  v => { if (v != null) ++verbosity; } },
                { "h|help",  "show this message and exit", 
                  v => show_help = v != null },
            };
    
            List extra;
            try {
                extra = p.Parse (args);
            }
            catch (OptionException e) {
                Console.Write ("greet: ");
                Console.WriteLine (e.Message);
                Console.WriteLine ("Try `greet --help' for more information.");
                return;
            }
    
            if (show_help) {
                ShowHelp (p);
                return;
            }
    
            string message;
            if (extra.Count > 0) {
                message = string.Join (" ", extra.ToArray ());
                Debug ("Using new message: {0}", message);
            }
            else {
                message = "Hello {0}!";
                Debug ("Using default message: {0}", message);
            }
    
            foreach (string name in names) {
                for (int i = 0; i < repeat; ++i)
                    Console.WriteLine (message, name);
            }
        }
    
        static void ShowHelp (OptionSet p)
        {
            Console.WriteLine ("Usage: greet [OPTIONS]+ message");
            Console.WriteLine ("Greet a list of individuals with an optional message.");
            Console.WriteLine ("If no message is specified, a generic greeting is used.");
            Console.WriteLine ();
            Console.WriteLine ("Options:");
            p.WriteOptionDescriptions (Console.Out);
        }
    
        static void Debug (string format, params object[] args)
        {
            if (verbosity > 0) {
                Console.Write ("# ");
                Console.WriteLine (format, args);
            }
        }
    }
    	

    And here is an example of its use:

    $ mono greet.exe --help
    Usage: greet [OPTIONS]+ message
    Greet a list of individuals with an optional message.
    If no message is specified, a generic greeting is used.
    
    Options:
      -n, --name=VALUE           the name of someone to greet.
      -r, --repeat=VALUE         the number of times to repeat the greeting.
      -v                         increase debug message verbosity
      -h, --help                 show this message and exit
    
    $ mono greet.exe -v- -n A -name=B --name=C /name D -nE
    Hello A!
    Hello B!
    Hello C!
    Hello D!
    Hello E!
    
    $ mono greet.exe -v -n E custom greeting for: {0}
    # Using new message: custom greeting for: {0}
    custom greeting for: E
    
    $ mono greet.exe -r 3 -n A
    Hello A!
    Hello A!
    Hello A!
    
    $ mono greet.exe -r not-an-int
    greet: Could not convert string `not-an-int' to type Int32 for option `-r'.
    Try `greet --help' for more information.
    
    	

    He has also documented it thoroughly.

    Where possible (new tools being written, or tools that have a similar command line structure that is compatible) we will be switching to this command line parsing library.

    The library is small, so developers should include a copy of the source code in their application, this is how you should include it in your makefiles:

    
    Options.cs:
    	cp `pkg-config --variable=Sources mono-options` .
    
    	

    Then your code can just include a reference to it.

    Posted on 14 Oct 2008 by Miguel de Icaza

    MonoDevelop gets VI bindings

    I grew up mostly with Turbo Pascal as my development environment. When I started to write C code in DOS, I used Turbo C briefly but for some reason I switched to the BRIEF text editor for a while.

    Around 1989 my friend Max Mendizabal who used nothing but Epsilon told me "Unix is the future, if you learn Epsilon, you will be ready to switch to Emacs when the time comes".

    Prophetic words.

    When I eventually switched to Unix in 1992, having learned Epsilon was useful, but Emacs was too slow for quick edits. I still used Emacs for programming, but for quickly making changes to a file, I ended up learning vi.

    When computers got faster, I tried to switch to Emacs for all my editing tasks, but my brain had been hardwired. I even added "alias vi=emacs" to by shell, and I would find myself typing subconsciously "/usr/bin/vi".

    To this day, I use both editors interchangeably.

    In any case, the above story was just an excuse to introduce VI Mode for MonoDevelop.

    Posted on 14 Oct 2008 by Miguel de Icaza

    Mono 2.0 is out!

    Today we released Mono 2.0 to the world. You can download sources and binaries from our download page. And our official release notes are up as well. This of course would not be possible without the open source contributors that worked tirelessly on Mono sending patches, fixing bugs, helping the community, answering questions, creating test cases and supporting us all these years.

    Mono 2.0 is both a runtime for application and a kit for developers for writing applications with C# and other ECMA CLI languages for a wide spectrum of uses.

    Big thanks go to the fantastic Mono team at Novell that has kept the excitement and the pace over all these years (we started in 2001), the large contributions from Mainsoft, Unity3D and our users that pushed us to fix bugs, implement new features and tune Mono. Also, we very much appreciate the work of the ECMA 334 and 335 committee members that worked on the CLI and C# specifications and everyone at Microsoft that answered our questions over the years and specially those that licensed code under open source licenses.

    We originally started to work on Mono, because we wanted to make developers happier and more productive on Linux. We liked C#, we liked the CIL and we wanted to have those technologies available on our platform.

    Since we have been active in the Linux Desktop world, it is not a surprise that the early use of Mono was mostly on Linux desktop applications, and Mono continues to shine there. Server-side use of Mono was a natural evolution and we soon were powering ASP.NET sites on Linux.

    There is one area where we under-delivered in the past, and it has been a constant source of pain. Up until now, we did not have a working debugger. This has finally changed, and Mono 2.0 includes for the first time a debugger, the time for WriteLine() debugging is now behind us.

    As the project matured, developers started taking advantage of Mono's open source nature: essentially .NET on their own terms. A platform that could be adapted, morphed, ported and modified to suit many different uses. Today Mono is embedded in portable mp3 players and powers Unity3D's game engine on the Apple iPhone, the Nintendo Wii, MacOS X and Windows (Some folks at Novell are working with Unity on bringing Unity3d to Linux!).

    It has also been deployed to run code on large clusters of servers for SecondLife, powers our open source Silverlight implementation (Moonlight) and powers the popular DekiWiki: a Social Collaboration Tool.

    Mono is a large project and it is hard to pick one feature to talk about as there are so many, so instead I put together a quick table of the major features that are part of this release:
    Compiler Support .NET APIs Mono APIs
    Mono's Open Source Compilers: Open Source Compilers: Commercial Compilers:
    • ISE's Eiffel.
    • Microsoft's C#.
    • Microsoft's F#.
    • Microsoft's VB.NET.
    • RemObject's Oxygene (Object Pascal).
    And many more.
    Core API:
    • 2.0 core APIs.
    • System, System.Xml.
    • 3.5 System.Core.
    • System.Drawing.
    • System.DirectoryServices.
    • System.Web.Services.
    Windows.Forms 2.0:
    • Win32 driver.
    • Quartz/OSX driver.
    • Cairo/X11 Unix driver.
    ASP.NET 2.0:
    • Core ASP.NET.
    • ASP.NET AJAX.
    • Apache and FastCGI integration.
    ADO.NET 2.0 plus providers for:
    • Managed drivers: Postgresql, MS SQL Server, Sybase.
    • Semi-managed drivers: Firebird, IBM DB2, Oracle, Sqlite.
    • MySQL provides their own drivers.
    GUI APIs:
    • Gtk# (Unix, Windows, MacOS X).
    • Cocoa# (MacOS X).
    Mono Core:
    • Mono.Addins - Extensibility Framework.
    • Mono.Cairo - Cairo Graphics Binding.
    • Mono.Cecil - ECMA CIL Manipulation.
    • Xml.Relaxng.
    • Novell.Directory.Ldap
    • C5 - Generics Library.
    Linux Specific: Other Ecosystem Libraries:
    • Bit# - Bittorrent client/server library.
    • Mono.Fuse - User-space file systems.
    • Mono.ZeroConf - Bonjour stack.
    • Mono.Nat - Network Address Translation.
    • Mono.Upnp - Universal Plug and Play.
    • Tao Framework - OpenGL, OpenAL, SDL and Cg bindings.

    We have ported Mono to a wide variety of platforms and operating systems on this 1.0 to 2.0 cycle. These platforms include:

    • Linux (x86, x86-64, PowerPC32, Itanium, SPARC, ARM, s390, s390x.
    • Solaris (x86-64, SPARC).
    • MacOS X (x86, PowerPC32).
    • Windows (x86, support for x86-64 will come in Mono 2.2).
    • Nintendo's Wii.
    • iPhone/iPod Touch (ARM, limited functionality due to licensing requirements; I will blog later this week about this).
    • *BSD (x86, x86-64).

    Developing with Mono

    Long time Linux developers will probably continue to use Emacs and VI, but some new Linux developers might want to use an IDE. New developers can use our open source MonoDevelop IDE on Linux, or alternatively the commercial X-Develop IDE or SlickEdit.

    If you are a Windows developer, you can continue using Visual Studio or your IDE of choice to write the code and compile it. Your binaries will run just fine on Linux.

    To assist Windows developers in porting their applications to Unix, we have provided the Mono Migration Analysis tool.

    Runtime Changes

    The Mono Virtual Machine gained plenty of features since Mono 1.2 was released. We have added:

    • Generic Code Sharing and VTable Compression have been implemented: this significantly reduces the memory footprint of generic type instantiations, while still getting the speed benefits of using generics.
    • AOT support: in addition to x86, we now also support ARM and x86-64.
    • COM interop is now complete (works on Windows with "real COM" and can be used on Unix with Mainsoft's COM or Mozilla's XPCOM).
    • AOT code can now AOT parts of 2.0 assemblies (assemblies that contain generics).
    • Full AOT support (allows code to run JIT-less, this is limited to 1.0 code).
    • CIL Verifier: Now Mono has a CIL verifier.
    • CoreCLR Security: the security system used by Moonlight.
    • Many optimizations that improve execution performance: New intrinsics operations (Math.Min/Max for example); various operations are now inlined by the JIT; managed allocations (no transition to unmanaged code for allocating memory); multi-array access is now tuned by the JIT; constant and block initializations are now handled by the JIT; Faster initialization and access to multi-dimensional arrays (4x faster).
    • The runtime went on a diet, many runtime data structures are smaller making Mono lighter.

    Tools

    In addition the the Mono Debugger making its debut appearance on this release, we are very proud of our code analyzer Gendarme.

    Gendarme is a extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compilers do not typically check or have not historically checked.

    Feedback

    Mono is not perfect, but we want to improve it. Like many other open source projects, we need your bug reports to improve Mono. If you have problems with Mono, help us by filing a bug report.

    Special Thanks

    Special thanks to Hacker Extraordinaire Aaron Bockover who not only brings us the best media player in the world, but created the new web site design and implemented and tuned it over very long extra hours up until 7am in the morning on his weekend.

    And to our packaging and QA team that spent extra hours to get all the bits and pieces in place for the release.

    Posted on 06 Oct 2008 by Miguel de Icaza

    Five Second Linux Boot

    I loved this LWN article on the changes necessary to make Linux boot in 5 seconds on the Asus EEE PC (a relatively slow computer).

    Hopefully all Linux distributions will adopt these changes for custom deployments.

    Posted on 04 Oct 2008 by Miguel de Icaza

    Moonlight Update: Media Codecs

    A couple of weeks ago we started the work on porting Microsoft's Media Codecs to Linux and we got the C version running.

    Popfly in Firefox3/Linux/x86

    Geoff, Fernando and Rolf have been hard at work on this, and have also added the infrastructure to download and install the codecs on demand.

    The next step was getting all the assembly language supported in Linux, and today Geoff got the assembly optimized SSE1 audio decoder running (the first chunk of the decoders).

    Of course, the rest of the team has been busy fixing bugs and improving the performance in preparation for the first public beta of Moonlight.

    Posted on 03 Oct 2008 by Miguel de Icaza

    Microsoft changes the Managed Extensibility Framework License

    A couple of weeks ago I suggested that developers interested in having their .NET software run in other platforms should avoid Microsoft's Managed Extensibility Framework (MEF) as it was not an open source library.

    I had a chance to discuss with Glenn, Sam and Bob the benefits of using the MS-PL for this library first over twitter and then over email.

    Representing .NET's loyal competitor, I did not think that we stood a chance of getting Microsoft to change the license, but I was pleasantly surprised. Glenn understood the value of open source, Sam wanted to do the right thing about this library and CodePlex and Bob argued that Mono already had Mono.Addins anyways.

    Today Glenn announced that Microsoft has changed the license for MEF to the open source MS-PL license.

    Thanks to everyone at Microsoft that helped change the license!

    Posted on 02 Oct 2008 by Miguel de Icaza

    DbLINQ, LINQ to Databases and Mono

    Atsushi Enomoto blogs about the work involved in bringing LINQ to Databases to Mono.

    The effort was a joint collaboration between the awesome DbLINQ developers, Pablo Iñigo Blasco our Google Summer of Code Student and Novell's Atsushi Enomoto.

    The DbLINQ developers had created a general purpose LINQ provider that could be used with database providers other than SQL Server. They also relicensed their code a few months ago to the MIT X11 license to allow for integration with Mono's code base.

    Read Atsushi's description of how the effort was put together and how DbLINQ is being refactored to become a full System.Data.Linq implementation and still provide the foundation for third-parties to easily create database LINQ providers.

    DbLINQ is a great project, and it needs your help to complete the effort.

    Posted on 01 Oct 2008 by Miguel de Icaza

    Mono at the PDC 2008

    Great News Mono Lovers!

    Later this month I will be presenting the session "Mono and .NET" at the Microsoft Professional Developers Conference in LA.

    Exciting times!

    Update: My talk will cover new technologies that we have created as part of Mono. Some of them are reusable on .NET (we try to make our code cross platform) and some other are features that specific to Mono's implementation of the CLI.

    Posted on 01 Oct 2008 by Miguel de Icaza

    Microsoft to incorporate jQuery into Visual Studio

    This weekend the news came out that Microsoft was going to bundle and support John Resig's jQuery as part of Visual Studio and ASP.NET. From Scott's blog:

    I'm excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward. We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch. The files will continue to use and ship under the existing jQuery MIT license.

    Beyond the obvious benefits to developers, what interests me is that Microsoft is now bundling an open source component into their commercial offerings.

    This is a first time for Microsoft.

    With IronPython they continued development of an open source project in house. With IronRuby, they were open to external contributions to the libraries of IronRuby. In both cases they were not taking external code or contributions directly into their core products.

    Hopefully they will start using more open source code in their products. Maybe one day they will bundle Mono's Cecil or Mono's embeddable C# compiler.

    Posted on 01 Oct 2008 by Miguel de Icaza

    Monovation: Assembly Injection into Live Processes

    People are loving the C# Interactive Shell.

    In the past people have embedded languages like Boo into their applications (MonoDevelop and Banshee for example both have options to embed Boo and a shell).

    Zoltan designed a new system for Mono that allows developers to inject and execute code into running Mono applications. Paolo provided significant feedback and design guidelines for the code to be incorporated into Mono.

    Thanks to both Zoltan and Paolo this functionality is now available through the Mono.Management assembly: you provide an executable and a PID, and the executable is injected and its Main method executed on the target process:

    	using Mono.Attach;
    
    	[..]
    
    	// Get a handle to a running Mono process.
    	VirtualMachine vm = new VirtualMachine (pid);
    
    	// Load hello.exe into the target process, and run it
    	vm.Attach ("/tmp/hello.exe", "");
    	

    You can use this for billions of things of course. You could patch running programs, you could attach logging software to a running program, or you could inject a C# evaluator into a live application and examine its state, or tweak it live.

    Zoltan came up with a really cool extension to the the csharp command (this is the command-line C# Interactive Shell). The csharp command now takes an --attach command line argument and a PID.

    The csharp shell can now use the Mono.Attach.VirtualMachine to injects itself into the remote process and then the client and server communicate through a couple of sockets.

    For example, this is the sample that Zoltan used to pitch his idea for supporting attaching to the virtual machine. With the following you can pause a live Banshee process:

    $ ps aux | grep banshee
    miguel   12359 17.0  2.7 141372 55708 pts/5    Sl+  14:30   0:02 banshee-1 /usr/lib64/banshee-1/Nereid.exe
    $ csharp --attach 12359
    csharp> using Banshee.ServiceStack;
    csharp> using Banshee.Gui;
    csharp> var s = ServiceManager.Get ();
    csharp> s.PlaybackActions ["PlayPauseAction"].Activate ();
    	

    All of the code is now on SVN, you need both the mono and mcs modules from trunk.

    A GUI Shell

    The above commands are a tiny bit risky and are also limited to the shell.

    The above commands will execute on a separate thread from the application, and any commands that you execute would be executed on a separate thread which could corrupt the state of your application.

    So this weekend, I wrote a tool that integrates with Gtk# applications, its called gsharp and you can find it in the mono-tools module (it borrows some code from Banshee).

    gsharp is a Gtk# version of the csharp command. What is important is that it also supports injection of the code on other programs, but makes sure that all the code executes in the Gtk# thread, by issuing all of its commands from the Gtk# idle handler. This means that it is safe to use gsharp with your Gtk# applications.

    GUI version of the tool.

    Here you can select which project you want to inject the GUI into:

    Needs some work, show process names.

    This version shows the gsharp tool attached to F-Spot, as I am not very familiar with the codebase, I can not do very much with it:

    We will need to implement one of these as well for Windows.Forms applications. This should luckily be easy to do as most of the smarts live in the Mono.CSharp assembly (our embeddable compiler).

    Security of Agents

    A couple of weeks ago, I asked for people to weigh in on a security concern for temporary files. This was for Zoltan's attach functionality.

    The code is now implemented and I would love if security experts could do a source code audit of our implementation. And validate whether our assumptions are safe.

    Here is the source code.

    Posted on 29 Sep 2008 by Miguel de Icaza

    Public Service Announcement

    In C# the defaut access level for members in classes and structs is "private".

    There is no need to pepper the source code with "private" everywhere. It only introduces noise and makes your code more difficult to read.

    Posted on 28 Sep 2008 by Miguel de Icaza

    Love World Domination!

    Chris Anderson is wearing a Mono T-Shirt on this PDC interview and IronRuby.com is hosted on DekiWiki, a Mono-powered Wiki site.

    This is clearly awesome.

    In other news, the awesome hackers at Imendio have officially released Gtk+ for OSX packages.

    Posted on 24 Sep 2008 by Miguel de Icaza

    Stream.CopyStream

    Funkists, why does System.IO.Stream not have a CopyStream method, it seems like everyone ends up implementing this.

    Discuss.

    Posted on 24 Sep 2008 by Miguel de Icaza

    reCaptcha.NET

    Kudos to Ben and the rest of the Captcha team.

    Today I downloaded the binaries for reCaptcha.NET for a web page that I was setting up and it worked out of the box. No recompiles necessary:

    • Drop the Recaptcha.dll in the bin directory of the ASP.NET app.
    • Get your public/private key.
    • Insert this in your page:
      		<recaptcha:RecaptchaControl
                              ID="recaptcha"
                              runat="server"
                              Theme="red"
                              PublicKey="YourKey"            
                              PrivateKey="YourOtherKey"/>
      		
    • Hit refresh. Ta da!
    Posted on 17 Sep 2008 by Miguel de Icaza

    Encrypted File Systems

    I just found out about encfs, a user-space encrypted file system that runs on top of FUSE.

    To use it, just type:

    	$ encfs ~/.encryptedstorage ~/secure
    	

    And follow the directions. You then will have a ~/secure directory where you can stash all the material that you would not want to become public if you were to lose your laptop.

    But it gets better than this. You can use sshfs to store files on a remote server, and then use the sshfs-backed file system as your encrypted storage, you can then keep your files stashed on a remote server, completely encrypted.

    Posted on 16 Sep 2008 by Miguel de Icaza

    Mono team, hiring again

    Hey folks, it is that time of the year when we are looking to hire some developers to work on Mono.

    We are looking for people with experience in Linux, with experience building software from source code and good C# or Java skills. Experience with ASP.NET and ADO.NET is a plus.

    The positions this time are only available in Boston, if you are interested, send me an email.

    Update: we have filled this position.

    Posted on 15 Sep 2008 by Miguel de Icaza

    Securing a Unix Domain Socket: Looking for Help

    There is a cool hack that we want to introduce in Mono that would allow a remote process to debug a examine data in a running Mono instance. The hack uses the embeddable compiler.

    The proposed extension to Mono would use a socket on /tmp/mono-USER/.mono-PID created by the Mono process and set the permissions to read/write for the owner and nothing for the group or other users.

    What can go wrong security-wise with the above setup? What should we check that is not immediately obvious?

    So far:

    • Create directory with 0600 permissions, bail if mkdir returns anything but 0.
    • Create socket in directory; It should be safe at this point, and change the permissions of the socket (is this really needed?).
    Posted on 15 Sep 2008 by Miguel de Icaza

    Credit where credit is due

    The csharp interactive shell and the embeddable compiler hacks could only have been possible thanks to the work that Marek Safar has put into implementing C# 3.0, cleaning up the compiler and laying down the foundation for a reusable compiler.

    Some time ago, our regression test suite for the compiler was taking 20-30 minutes to run. Marek refactored the compiler so that we could reuse the same instance without launching a new process for each of our 1,500 individual tests.

    Without Marek's dedication and love for the compiler, we would never have gotten here.

    Posted on 11 Sep 2008 by Miguel de Icaza

    C# Eval: An Embeddable Compiler

    Hello Internets and C# Lovers!

    After the C# Interactive Shell started working, it became obvious that we now had C#'s eval and that it would be incredibly interesting to enable people to embed a C# Eval in their application.

    I did a little bit of refactoring on the codebase last night, and now we expose a few methods that allow developers to evaluate C# expressions and statements dynamically.

    Usage is very simple, you must reference the `gmcs.exe' assembly, this contains the C# Eval, then you invoke the CSharpEvaluator.Evaluate method, and get the results back.

    The following is a small command line calculator that takes C# expressions:

    using Mono.CSharp;
    using System;
    
    class MyCalculator {
    	static void Main (string [] args)
    	{
    		Console.WriteLine (CSharpEvaluator.Evaluate (args [0] + ";"));
    	}
    }
    	

    Compile the above, and execute:

    $ mono calculator.exe '1+2'
    3
    	

    There are a number of overload methods for Evaluate that give more control over how things are evaluated. The csharp command is now written entirely using the CSharpEvaluator API. The code is now pretty simple: pretty printing of values, dealing with partial input, loading startup files (if any) and import the default namespaces.

    A few uses that come to mind:

    • Use C# as a scripting language for your application.
    • Use it for startup scripts of your own application (similar to .emacs, but with C# instead).
    • Use it to explore the state of your application live.
    • Use it to debug your application as it is running.
    • Embed the compiler on Silverlight and run C# on your web browser, similar to how Jimmy did it for Ruby.
    • Embed it into your app and expose it as a service that you can connect to, and do it live!

    The four or five public methods of the API are documented in the source using C# doc tags. When Mono 2.2 goes out, we will publish docs for them.

    As we announced back in April, Mono's C# compiler is now licensed under the MIT X11 license, so you can embed at will.

    Manhole

    Joe Shaw mentioned a few days ago that it would be nice to support something like Twisted's Manhole where your application is listening on a port and then you can connect to it and debug it. It should take a dozen lines to write it, but I am heading out for dinner now.

    But if I were to do it, I would probably make the csharp command (all 240 lines of it) support a --server command line option and have it connect to the server and send strings over the wire instead of executing locally. That way you get to use the awesome getline.cs command line editor and history locally and let the server run the code.

    Getting Your Hands on This

    To enjoy this hack, you have to either wait for Mono 2.2 or install Mono from SVN, all of the code is checked in.

    Update: Clarification

    Since it was not obvious, we do support C# 3.0, which includes the entire LINQ stack in the above expression evaluator:

    using Mono.CSharp;
    using System.Collections;
    using System;
    
    class X {
    	static void Main (string [] args)
    	{
    		Evaluator.Run ("using System; using System.Linq;");
    		bool ress;
    		object res;
    		string s = Evaluator.Evaluate (
    			"from x in System.IO.Directory.GetFiles (\"/etc\") where x.Length < 10 select x;",
    			out res, out ress);
    
    		foreach (var v in (IEnumerable) res){
    			Console.Write (v);
    			Console.Write (' ');
    		}
    	}
    }
    
    

    The above uses a LINQ expression, and this is the result in my system (files whose full pathname is less than 10 characters):

    /etc/motd /etc/mtab /etc/raw /etc/rpc 
    
    Posted on 10 Sep 2008 by Miguel de Icaza

    Enterprise Library 4.0 now Open Source

    Hello Internets!

    Some very good news: As part of the ongoing discussion on the MS Limited Permissive License, I was doing some Google searches on it and came across the Enterprise Library 4.0 release.

    Enterprise Library was a project that came out of the Patterns and Practices group at Microsoft, and they had historically used licenses that were not open source friendly. This new release is now licensed under the terms of the open-source friendly MS-PL license.

    In the past, various people have asked us to implement an open source version of it, so they could use those building blocks on Unix with Mono. We never had any spare cycles to look into this, so the blocks provided by Enterprise Library were always beyond Mono users.

    As it turns out, since May 2008 it has been possible to use the library with Mono on non-Windows platforms.

    Now all there is left to do is to package it in a convenient form.

    Posted on 09 Sep 2008 by Miguel de Icaza

    Interactive C# Shell

    During the last HackWeek, I had a chance to work on a project that we had been discussing in the Mono team: an interactive C# shell.

    The idea was simple: create an interactive C# shell by altering the compiler to generate and execute code dynamically as opposed to merely generating static code.

    The result is the csharp command. The command provides an read-eval-print loop for entering C# statements and expressions:

    	csharp> 1;
    	1
    	csharp> "Hello, World".IndexOf (",");
    	5
    	csharp> Console.WriteLine ("Hello");
    	Hello
    	

    Statements are executed; Expressions are evaluated, and the result displayed. There is support for rendering arrays, IEnumerables and dictionaries specially, consider the following C# 3 declaration:

    	csharp> new Hashtable () { { "/bin", "executable files" }, { "/etc", "configuration files" } };
    	

    You will get this back when rendered:

    	{{ "/tmp", "Temporary files" }, { "/bin", "executable files" }}
    	

    Statements can span multiple lines; In those cases the interactive shell will use a different prompt to indicate that more input is expected, for example:

    	csharp> 1 +
    	      > 2;
    	3
    	csharp>
    	

    One of the main advantages of this shell is that you can try out your LINQ expressions directly on the shell, for example, the following query works on the result from Directory.GetFiles:

    	csharp> using System.IO;
    	csharp> var last_week = DateTime.Now - TimeSpan.FromDays (7);
    	csharp> from f in Directory.GetFiles ("/etc") 
    	      >    let fi = new FileInfo (f)
    	      >    where fi.LastWriteTime < last_week
                  >      select f;
            { "/etc/adjtime", "/etc/asound.state", "/etc/ld.so.cache",
    	"/etc/mtab", "/etc/printcap", "/etc/resolv.conf" }
    	

    The LINQ expressions are not limited to working on IEnumerables, you can also use LINQ to XML or LINQ to any database provider supported by Mono by loading the assembly:

    	csharp> LoadLibrary ("System.Xml.Linq");
    	csharp> using System.Xml.Linq;
    	csharp> var xml = new XElement("CompilerSources",
    	      >   from f in Directory.GetFiles ("/cvs/mcs/mcs")
    	      >   let fi = new FileInfo (f)
    	      >   orderby fi.Length
    	      >  select new XElement ("file", new XAttribute ("name", f), new XAttribute ("size", fi.Length)));
    	csharp> xml;
    	<CompilerSources>
    	  <file name="/cvs/mcs/mcs/mcs.exe.config" size="395" />
    	  <file name="/cvs/mcs/mcs/gmcs.exe.config" size="464" />
    	  <file name="/cvs/mcs/mcs/OPTIMIZE" size="498" />
    	  <file name="/cvs/mcs/mcs/lambda.todo" size="658" />
    	  <file name="/cvs/mcs/mcs/smcs.exe.sources" size="726" />
    	  [...]
    	</CompilerSources>
    	

    A differences between csharp and the C# language is that I felt that for interactive use, it would be important to change the type of a variable, so the following is allowed:

    	csharp> var a = 1;
    	csharp> a;
    	1
    	csharp> a.GetType ();
    	System.Int32
    	csharp> var a = "Foo";
    	csharp> a;
    	"Foo"
    	csharp> a.GetType ();
    	System.String
    	csharp>  
    	

    To load code interactive I added two methods: LoadAssembly and LoadPackage.

    LoadAssembly is the equivalent of passing the -r command line argument to csharp or mcs, this example shows System.Xml.Linq in use:

    csharp> LoadAssembly ("System.Xml.Linq");
    csharp> using System.Xml.Linq;
    csharp> XDocument doc = new XDocument(
          >     new XDeclaration("1.0", "utf-8", "yes"),
          >     new XComment("Sample RSS Feed"),
          >     new XElement("rss", 
          >         new XAttribute("version", "2.0"),
          >         new XElement ("channel",
          >             new XElement("title", "RSS Channel Title"),
          >             new XElement("description", "RSS Channel Description."),
          >             new XElement("link", "http://tirania.org"),
          >             new XElement("item",
          >                 new XElement("title", "First article title"),
          >                 new XElement("description", "First Article Description"),
          >                 new XElement("pubDate", DateTime.Now.ToUniversalTime()),
          >                 new XElement("guid", Guid.NewGuid())),
          >             new XElement("item",
          >                 new XElement("title", "Second article title"),
          >                 new XElement("description", "Second Article Description"),
          >                 new XElement("pubDate", DateTime.Now.ToUniversalTime()),
          >                 new XElement("guid", Guid.NewGuid()))
          >             )
          >         )
          >      );
    	

    The variable doc is then rendered:

    csharp> doc;
    <?xml version="1.0" encoding="utf-16" standalone="yes"?>
    <!--Sample RSS Feed-->
    <rss version="2.0">
      <channel>
        <title>RSS Channel Title</title>
        <description>RSS Channel Description.</description>
        <link>http://tirania.org</link>
        <item>
          <title>First article title</title>
          <description>First Article Description</description>
          <pubDate>9/8/2008 5:13:34 PM</pubDate>
          <guid>bc6825ab-f1ab-4347-ad6e-3cf076011379</guid>
        </item>
        <item>
          <title>Second article title</title>
          <description>Second Article Description</description>
          <pubDate>9/8/2008 5:13:34 PM</pubDate>
          <guid>a474b2bb-deba-4973-9581-762857b24b53</guid>
        </item>
      </channel>
    </rss>
    
    	

    LoadPackage is the equivalent of invoking the compiler with the -pkg: flag. This is a Mono-ism that integrates Mono libraries with Unix's pkg-config. Packages allow definitions and multiple assemblies to be loaded in a single call, for example, this loads the Gtk# 2.0 package:

    	csharp> LoadPackage ("gtk-sharp-2.0");
    	csharp> using Gtk;
    	csharp> Application.Init ();
    	csharp> var b = new Button ("Hello Interactive Shell");
    	csharp> var w = new Window ("So cute!");
    	csharp> b.Clicked += delegate { Application.Quit (); };
    	csharp> w.Add (b);
    	csharp> w.ShowAll ();
    	csharp> Application.Run ();
    	

    Pleasure

    This shell has been incredibly useful to debug things in the last few weeks, as it avoids the tedious typing to try out APIs and to see what some function might return. Launch csharp and test things away.

    To improve the experience of the command line editing, I wrote a managed readline replacement, it provides history, keyboard navigation and searching.

    Also the System, System.Linq, System.Collections, and System.Collections.Generic namespaces are imported by default.

    Additionally, the csharp command will load any assemblies and C# scripts that you have in the ~/.config/csharp directory. If you are working constantly say on LINQ, you can put there all of your using and LoadLibrary statements.

    Availability

    The csharp command will be available in Mono 2.2, which is still a few months away, or it can be obtained by compiling Mono from SVN today.

    Interactive Commands

    Currently there are a few static methods and properties that you can invoke from the command line, like the "help" property that will display some help, and the "quit" property that terminates the shell as well as things like LoadLibrary and LoadPackage that I have described before. A complete list is available on the CsharpRepl page.

    I am interested in hearing which other features should be added to the shell. I think we need some special commands to describe types and objects, like monop.

    Additionally, currently values are displayed by using ToString(), but perhaps we need a method Inspect(object) that would show the values of all public fields and properties, like a debugger would.

    Which other commands should be added?

    Posted on 08 Sep 2008 by Miguel de Icaza

    Avoid the Managed Extensibility Framework.

    Update: Microsoft has now changed the license to the MEF to the open source MS-PL license. Please see the follow up post for details.

    As a .NET developer, you should avoid using the newly released Managed Extensibility Framework as its license prevents its use beyond the Windows platform. This will prevent your .NET software from running on Linux or MacOS in the future.

    Luckily, there is a cross platform solution available today that has no platform limitations: Mono.Addins, a technology inspired by Eclipse's own plugin system. We have tutorials, reference manuals, API docs, our FAQ our public groups and multiple large applications with source code available that you can learn from (MonoDevelop, Banshee, F-Spot and Gnome-Do).

    The rule obviously applies to any new APIs that are built for .NET as they are not immediately available for Mono. But unlike the binary-only APIs, these half-open source code releases pose additional problems for the open source CLI:

    • More people are exposed to the source code, preventing them from working on a fully open source implementation of it.
    • There is a smaller desire from the community to reimplement the code, as it is relatively easy to just use the existing implementation or ignore the issue for the time being.
    • Some folks might not care about the license restriction, and ignore it altogether. A practice I do not endorse.

    There are two additional issues that are worth pointing out. Should non-open source libraries be hosted on CodePlex to begin with? CodePlex is branded as the "Open Source Project Hosting" from Microsoft, yet, this license is clearly not open source and does not qualify as open source according to the definition and is a clear violation of Codeplex.Com's requirements:

    The above link points to http://en.wikipedia.org/wiki/Open_source_licenses.

    MEF should be pulled out of the CodePlex site along with all other platform-limiting software, like ASP.NET MVC (h/t to gblock for pointing out that MVC is also violating the terms). Unless CodePlex cooks up a special exception that some software and restrictions are more equal than others.

    The second point that is worth making is that picking licenses like the MS-LPL for .NET software is shooting the .NET community in the foot. The LPL license is obviously an effort to tie things into the Windows platform, putting company first, community and developers second.

    The MS-LPL is a poisonous license, do not use it (do not confuse with the MS-PL which is a decent license, the extra "L" makes a big difference).

    Update: gblock points out that CodePlex technically only requires a "license" to be picked, but does not require it to be OSI compliant. But even if the wording on the FAQ does allow for that interpretation, it is misleading as there is a link to OSI licenses next to it, and the main page clearly states that Codeplex is an "Open Source Project Hosting" site. Capital "O" and capital "S".

    The "CodePlex Basics: Getting Started" page also points to the Open Source License Definition, there are no words about custom licenses or about hosting proprietary code with source code available.

    Update2: Glenn has reached out to the community and clearly wants to improve the status quo when it comes to MEF, open source, CodePlex and the official policies. Good luck to Glenn.

    It is also worth pointing out that Glenn was one of the early adopters and advocates of the MS-PL at Microsoft (to clarify: the MS-PL is an open source license).

    Posted on 07 Sep 2008 by Miguel de Icaza

    Using Visual Studio to Debug Mono

    The following screenshots shows Visual Studio debugging a remote Mono process running on a Linux box.

    Breakpoints, current line, and stack traces.

    The setup works like this: you run a debugging server on Linux. On Windows you install a Visual Studio extension that provides a Debugging Engine and the configuration tools to start your application.

    Then you start your application from Visual Studio (Tools/Launch with Mono) which will send the binaries and debug information over to Linux and execute it.

    Showing the disassembled code generated by Mono's JIT

    The core of the above work is to get the Windows to Linux debugging functionality enabled. We will have more news when the debugging experience is more complete and we are approaching the time to test drive it.

    If you are interested in trying it out, sign up for our preview on our web site.

    Debugging Support

    Mono 2.0 will for the first time include a debugger, the command line mdb command.

    Beyond this, we want to offer GUI debugging. The native solution is being built on top of MonoDevelop and will be available when we release MonoDevelop 2.0. It will work on both Linux and MacOS hosts.

    The second GUI engine will be the above Visual Studio plugin for developers that use Windows as their main OS and Visual Studio as their IDE.

    More Visual Studio Integration

    In addition to this work to integrate Visual Studio with Mono for remote debugging, thanks to the Summer of Code (Ed Ropple) and Jonathan Pobst's work in this hack week we got some support to run applications on Mono/Windows and run our Mono Migration Analysis tool.

    Jonathan's work is available today as an MSI, check out his post for more details.

    You can also check Ed's summer of code report on CloverLeaf.

    Posted on 04 Sep 2008 by Miguel de Icaza

    getline.cs: Partying like its 1988

    In an age where the Unix shell is more relevant every passing minute, we need to have proper command line editing tools everywhere.

    For a project of mine, this weekend I put together a command-line editing class for .NET shell applications. The Mono.Terminal.LineEdit class can be used by shell applications to get readline-like capabilities without depending on any external C libraries.

    To use it, just do:

    	using Mono.Terminal;
    
    	LineEditor le = new LineEditor ("MyApp");
    	while ((s = le.Edit ("prompt> ", "")) != null)
    		Console.WriteLine ("You typed: " + s);
    	
    	

    It supports the regular cursor editing, Emacs-like editing commands, history, incremental search in the history as well as history loading and saving.

    The code is self-contained, and can be easily reused outside of my project. To use it, you just need to include the getline.cs file in your project. This is built on top of System.Console, so it does not have external library dependencies and will work on both Mono and .NET (finally bringing joy to people using command-line applications that use Console.ReadLine).

    It is licensed under the MIT X11 license and the Apache 2.0 license so there are no annoying licensing issues and can be mixed with anything out there.

    Posted on 26 Aug 2008 by Miguel de Icaza

    Second Life Demos

    Cool performance demos comparing SecondLife's LSL engine vs LSL running on Mono's VM.

    Posted on 21 Aug 2008 by Miguel de Icaza

    SecondLife rolls out Mono-powered servers

    Big news for the Mono team today.

    Linden has started the roll out of their Mono-powered simulation servers.

    Users can now opt into having their LSL scripts executed using the Mono VM (it remains an opt-in feature, because some scripts are timing sensitive and the performance increase could break code).

    Some choice quotes from Jim Purbrick's blog post:

    As well as providing immediate benefits, the integration of the Mono virtual machine makes many future improvements possible: the use of mainstream languages to script Second Life alongside the existing LSL language; the removal of arbitrary per-script limits on script resource usage and the use of mainstream libraries and tools for scripting to name a few.

    And:

    The integration of Mono is the first step in the evolution of Second Life into a true software development platform. Thank you to all the residents who have helped us take this first step.

    Congrats to Linden on their launch!

    The Technology

    From a SecondLife developer perspective, some of the technical details about how Mono is integrated into the Second Life simulators can be found on their Wiki.

    When a user opts into using Mono, a special LSL compiler that generates ECMA CLI byte codes is used. The resulting CLI byte codes are then instrumented with some magic (more below) and then the code is exectuted using the Mono VM which translated the bytecodes into native x86 code.

    I find the SecondLife technology fascinating. Embedding Mono into SecondLife was not an ordinary task, it was not just a matter of linking with Mono and writing an LSL to CIL compiler.

    SecondLife distributes the virtual world on hundreds of servers, and as visitors move through the virtual world, their inventory, character and scripts migrates from server to server.

    This migration requires that running scripts be suspended, serialized to a database and their execution resumed on a different server. This means that all the state of a script, including the current location must be preserved while the user navigates across servers.

    The technology to do this is absolutely brilliant. I strongly recommend the Lang.NET presentation that Cory and Jim did in 2006.

    The first half of the video is an introduction to Second Life, the second delves into the hackery necessary to make it happen.

    This are clearly hugenormous news for us, and for everyone that worked with Linden, for everyone that fixed bugs and implemented new features in Mono to run under the conditions that Linden has.

    Posted on 20 Aug 2008 by Miguel de Icaza

    OSX Development with Oxygene, Cocoa and Mono

    The RemObject folks have been doing some tutorials on how to build applications with Visual Studio and Interface Builder to target both Windows and MacOS with .NET and Mono respectively.

    Check out their tutorial and their notes on cross platform development. The lessons in the tutorial also apply to C#-based development.

    It is also worth noting that recent versions of their Oxygene compiler now support generics.

    Posted on 20 Aug 2008 by Miguel de Icaza

    Pleo Days

    I just got my Google Android present! An awesome Pleo Dinosaur!.

    So cute. SO CUTE!

    Posted on 20 Aug 2008 by Miguel de Icaza

    Dynamic Method Invocation Performance

    Jon Skeet has an in-depth explanation of how to improve the performance of code that needs to dynamically invoke methods through reflections.

    The bottom line is that if you have performance sensitive code that needs to invoke methods that you fetch from reflection, you should avoid using MethodInfo.Invoke() and instead create a delegate from the MethodInfo, and perform the invocations that way:

    [...]Using a delegate invocation is only about 10% slower than direct invocation, whereas using reflection takes over 600 times as long. Of course these figures will depend on the method being called - if the direct invocation can be inlined, I'd expect that to make a significant difference in some cases.

    This is a well-known trick, but Jon provides a great exploration of the subject.

    Protocol Buffers for .NET

    Additionally, you can see that Jon's effort to port Google's Protocol Buffers to C# are almost complete.

    There are currently three separate approaches to support Protocol Buffers in .NET. Jon's effort essentially mimics the existing support for C# and integrated with the Google implementation and compilers. The other efforts have taken slightly different approaches, one of them is designed with the WCF approach in mind: use C# classes/interfaces as the actual public contract, as opposed to the .proto files.

    Posted on 14 Aug 2008 by Miguel de Icaza

    First preview of Mono 2.0 is out

    Our first preview for Mono 2.0 is out; It has been almost six months since we branched version 1.9 so this is a gigantic update to Mono.

    Many of the features are listed on the release notes, but the release notes do not even begin to capture the enormous number of fixes, performance improvements, tuning and work that went into this release.

    As usual, this is our "best release ever", but it is also the longest we have gone without doing interim releases, so it is possible that we might have regressed where our test suite lacks tests. We would love to get folks to test this, with their code, and to bug reports on any issues they find before our final 2.0 release.

    See our Roadmap for more details on the release schedule and the upcoming post-2.0 releases.

    Posted on 01 Aug 2008 by Miguel de Icaza

    GovTrack.Us Interview with Joshua Tauberer

    Jon Udell interviews Joshua Tauberer on his service GovTrack.us that helps citizens track legislation and voting in the US.

    Posted on 28 Jul 2008 by Miguel de Icaza

    C# 3.0 and Parallel FX/LINQ in Mono

    For a while I wanted to blog about the open source implementation of the Parallel Extensions for Mono that Jeremie Laval has been working on. Jeremie is one of our mentored students in the 2008 Google Summer of Code.

    Update: Jeremie's code is available from our mono-soc-2008 repository.

    Dual CPU laptops are becoming the norm; quad-core computers are now very affordable, and eight CPU machines are routinely purchased as developer workstations.

    The Parallel Extension API makes it easy to prepare your software to run on multi processor machines by providing constructs that take care of distributing the work to various CPUs based on the computer load and the number of processors available.

    There are various pieces in the Parallel Extensions framework, the simplest use case is Parallel.For, a loop construct that would execute the code in as optimally as possible given the number of processors available on the system.

    Parallel.For is a simple replacement, you usually replace for loops that look like this:

    	for (int i = 0; i < N; i++)
    		BODY ();
            

    With the following (this is using lambda expressions):

    	Parallel.For (0, N, i => BODY);
            

    The above would iterate from 0 to N calling the code in BODY with the parameter scattered across various CPUs.

    C# 3 and Parallel LINQ

    Marek Safar recently announced that Mono C# compiler was now completely compliant with the 3.0 language specification.

    In his announcement he used Luke Hoban's brutal ray tracer-in-one-LINQ statement program. This was a hard test case for our C# compiler to pass, but we are finally there. I had blogged about it in the past. Luke Hoban's ray-tracer-in-one-linq-statement looks like this:

    var pixelsQuery =
      from y in Enumerable.Range(0, screenHeight)
      let recenterY = -(y - (screenHeight / 2.0)) / (2.0 * screenHeight)
      select from x in Enumerable.Range(0, screenWidth)
        let recenterX = (x - (screenWidth / 2.0)) / (2.0 * screenWidth)
        let point = Vector.Norm(Vector.Plus(scene.Camera.Forward, 
    Vector.Plus(Vector.Times(recenterX, scene.Camera.Right), Vector.Times(recenterY, scene.Camera.Up)))) let ray = new Ray { Start = scene.Camera.Pos, Dir = point } let computeTraceRay = (Func<Func<TraceRayArgs, Color>, Func<TraceRayArgs, Color>>) (f => traceRayArgs => (from isect in from thing in traceRayArgs.Scene.Things select thing.Intersect(traceRayArgs.Ray) where isect != null orderby isect.Dist let d = isect.Ray.Dir let pos = Vector.Plus(Vector.Times(isect.Dist, isect.Ray.Dir), isect.Ray.Start) let normal = isect.Thing.Normal(pos) let reflectDir = Vector.Minus(d, Vector.Times(2 * Vector.Dot(normal, d), normal)) let naturalColors =
    from light in traceRayArgs.Scene.Lights let ldis = Vector.Minus(light.Pos, pos) let livec = Vector.Norm(ldis) let testRay = new Ray { Start = pos, Dir = livec } let testIsects = from inter in from thing in traceRayArgs.Scene.Things select thing.Intersect(testRay) where inter != null orderby inter.Dist select inter let testIsect = testIsects.FirstOrDefault() let neatIsect = testIsect == null ? 0 : testIsect.Dist let isInShadow = !((neatIsect > Vector.Mag(ldis)) || (neatIsect == 0)) where !isInShadow let illum = Vector.Dot(livec, normal) let lcolor = illum > 0 ? Color.Times(illum, light.Color) : Color.Make(0, 0, 0) let specular = Vector.Dot(livec, Vector.Norm(reflectDir)) let scolor = specular > 0 ? Color.Times(Math.Pow(specular, isect.Thing.Surface.Roughness), light.Color) : Color.Make(0, 0, 0) select Color.Plus( Color.Times(isect.Thing.Surface.Diffuse(pos), lcolor), Color.Times(isect.Thing.Surface.Specular(pos), scolor)) let reflectPos = Vector.Plus(pos, Vector.Times(.001, reflectDir)) let reflectColor =
    traceRayArgs.Depth >= MaxDepth ? Color.Make(.5, .5, .5) : Color.Times(isect.Thing.Surface.Reflect(reflectPos), f(new TraceRayArgs(new Ray { Start = reflectPos, Dir = reflectDir }, traceRayArgs.Scene,
    traceRayArgs.Depth + 1))) select naturalColors.Aggregate(reflectColor, (color, natColor) => Color.Plus(color, natColor)))
    .DefaultIfEmpty(Color.Background).First()) let traceRay = Y(computeTraceRay) select new { X = x, Y = y, Color = traceRay(new TraceRayArgs(ray, scene, 0)) }; foreach (var row in pixelsQuery) foreach (var pixel in row) setPixel(pixel.X, pixel.Y, pixel.Color.ToDrawingColor());

    And renders like this:

    The above now compiles and runs as fast as it does on .NET.

    Jeremie then modified the above program to use the parallel extensions to LINQ. He replaced Enumerable.Range with ParallelEnumerable.Range and foreach with the parallel ForAll method to take advantage of his library.

    You can watch the above ray tracer with and without LINQ on his screencasts (LINQ ray tracer, Parallel LINQ ray tracer).

    Tracking Parallel FX

    There is much more information on the PFXTeam Blog. Another great blog to follow, in particular check out their Coordination Data Structures Overview, PLINQ Ordering and some demos.

    Posted on 26 Jul 2008 by Miguel de Icaza

    Must follow blog

    Another fantastic blog to follow: Fake Twitter Status.

    Posted on 26 Jul 2008 by Miguel de Icaza

    Mono 2.0 branched, and the Linear IL

    On Tuesday of last week we branched Mono for the 2.0 release; Packages are being QAed for our first release candidate and will be available next week. Bug fixing for the final release will happen on this branch.

    Meanwhile, the excitement continues on trunk. Zoltan today merged the Linear IL branch.

    The Linear IL code has been under development for two years and eight months and it was an effort that we started to address some of the main limitations in our current JIT design. Some of these limitations in the old design made it very hard to bring some code generation optimizations into the JIT, or made the optimizations not as effective as they could have been.

    The new JIT engine will debut in Mono 2.1, later this year. Now that Linear IL is the default, the entire JIT team will focus on tuning the engine and extracting more performance out of it. But even without tuning, the new engine is already performing very well as you can see in the results comparing the engines.

    Additionally, a number of creative ideas that we have to improve Mono all depended on doing this switch. We have a few surprises for developers in the next coming months.

    Congratulations to Zoltan for getting this work merged.

    Posted on 22 Jul 2008 by Miguel de Icaza

    C# 4.0 Design

    From a recent interview on the design team for C# 4.0 Anders said about the room they meet to discuss the C# design:

    We have been meeting in this room for nine years, three times a week.

    This seems to be one of the reasons C# has evolved so nicely.

    Sadly there are no actual details on the interview about what is coming up on C# 4.0. We have to wait until the PDC to get an idea of what will be coming.

    Luckily, Mono's C# compiler is already 3.0 compliant, and we are ready to start adding 4.0 features the moment they become public.

    Posted on 21 Jul 2008 by Miguel de Icaza

    Smuxi: a new IRC client

    My friend Mirco Bauer has been maintaining and coordinating the Mono packaging for Debian for many years.

    Today he released smuxi. His own IRC client that he built on top of Gtk#:

    Posted on 21 Jul 2008 by Miguel de Icaza

    Gtk+ 3.0, take 2

    Emmanuele Bassi has summarized a discussion that happened on IRC after my Gtk+ 3.0 post.

    His blog entry starts by saying that we should not use blogs to discuss and then goes on to discuss. I agree with the sentiment, but IRC is not a good place to do the meeting either as we do not even have IRC logs for whatever channel they were on discussing.

    It is about the ISVs

    Emmanuele seems to think that this is a marketing problem. It is not.

    This is about the effect that the current Gtk+ 3.0 plan has on ISVs.

    KDE has almost no ISVs, Qt does.

    GNOME has almost no ISVs, Gtk+ does.

    Most likely because anything beyond the core toolkit is too unstable in both cases, and because things are too quickly flagged as deprecated with no roadmap in place.

    The Qt situation is much better, as it is commercially designed, and they have existing customers that are paying them money to solve problems for them, not introduce new ones.

    Qt is also designed to be bundled with your application, and you can make your proprietary application not break if the user upgrades his Qt. This is not the modus operandi for Gtk+.

    Having an "abandoned Gtk 2.x" and a "maintained, but API and ABI incompatible 3.x" which will not be available everywhere at the same time is a major turn off for ISVs.

    Creating an ISV ecosystem is incredibly hard, and somehow the new generation of Gtk+ developers is now "OK" to throw away years of work of those that had to work with fewer resources than Gnome has today, fewer developers, a smaller community, slower computers, bigger challenges and yet, managed to keep Gtk+ 2.0 API compatible.

    Perhaps it is not a matter of being "OK", but the new crop of Gtk+ developers does just not appreciate just how much value ISVs are for Gtk+, Gnome and the Linux desktop in the first place. They did not have to fight to get those guys on board on the first place.

    The premises and the conclusions of Imendio's paper would not hold if you were to consider application developers in the mix. But in particular, it seems that the mindset is dangerously close to the rationalization used recently by a KDE spokesperson and lampooned by the Linux Hater Blog.

    What bothered me last night

    What bothered me last night after I blogged was the realization that most of the Imendio developers have switched to OSX as their main desktop operating system (At least rhult, hallski and kris).

    These are great developers, but for their day-to-day activities, they have given up on the Linux/Gnome desktop. Their concern is no longer to attract ISVs, as long as the source compiles with some changes, they will be OK.

    There are certainly some developers at Imendio that still use Linux, and I am sure they have a "Linux partition" to test things out. But when it comes to ensuring the viability of the Linux desktop ecosystem, I do not feel comfortable about wiping out the ISV ecosystem that we have.

    Discussion

    Emmanuele says:

    for instance, I would have loved to have Miguel at the gtk+ team meeting of Tuesday at GUADEC: it would have been a great discussion, I’m sure of it, and we might have had a different state of the union talk.

    I mentioned this problem in my previous blog entry. Even if I had made it to Istanbul on Tuesday, I am merely one of the voices concerned about API stability. "Tuesday Meeting at Guadec" is hardly inclusive:

    There was no Adobe.

    There was no VMware.

    There was no Medsphere.

    There were no Eclipse folks (who have complained previously about the ABI/API issues).

    There was no Gnumeric.

    And these are the ones I can think of the top of my head.

    Senior voices from our own community were missing, like Morten Welinder who has expressed his opinion in a shorter post:

    The best thing about tabs that I can think of is that it will keep certain people from doing more harmful things like changing the gtk+ api for no good reason.

    I do not know who attended the Gtk+ planning on Tuesday, but it was not inclusive, and I suspect it was heavily tilted towards the Nokia-ecosystem.

    From a Nokia standpoint, I understand the desire of dropping older code, get a smaller version of Gtk+ out there, and be able to get a very flashy system at all costs. The iPhone and OSX are strong UIs, and I can understand the desire to compete, but lets not throw the baby with the bathwater.

    Decisions about the future of Gtk+ can not be done without all the stakeholders, and specially without those that have worked for years in keeping the API stability under duress and have built applications on top of it.

    Features

    Emmanuele says:

    Yes, 3.0.0 might not have features. is this bad marketing? probably. so we need to fix this. a way1 to do this would be keeping the 3.0.0 in alpha state, call it 2.99.02 and add features to that until we get to a 3.0.0 that developers will want to migrate to, like the new scenegraph API or the new style API. let’s break with 2.x in style

    As I said previously, I would endorse such a plan if it is shown that fundamental new features could not be implemented in an API/ABI compatible way. Nobody has yet refuted my assessment of the various areas that would not break compatibility, and that covers most of the new features.

    Although I am not the only stake holder, nor the only ISV, nor the only developer.

    Communication

    Emmanuele says:

    communication: there’s a certain lack of communication between the gtk+ team and the users of the library. in my opinion, it’s due to the small number of active developers and to the fact that ISVs don’t really get involved into shaping the platform they are using. they have the source code, and sometimes it’s easier to fix in-house than to communicate and go through the proper process — and this is a structural problem that is caused by the small number of people involved in the said process as well. the gtk+ team needs to open up more, and at the same time the ISVs need to get more involved. sometimes it feels to me that the team is waiting for features, direction and help in the development, while the users of the library are waiting for the team to come up with the perfect plan to fix all the bugs and warts while retaining the whole API and ABI.

    I agree with Emmanuele.

    We setup the GNOME Foundation for things like this; Lets use the GNOME Foundation organizational powers to reach out to ISVs; to organize a platform and Gtk+ summit as it is now clearly needed; Lets include all the stakeholders, not only the active developers.

    Process

    Emmanuele says:

    process: this is connected to the first point - we have a lot of channels, and it might be daunting to actually follow them all; but we're also open in terms of discussion and revision. this is our strength. so please: if you want to discuss, join the IRC meetings on the #gtk-devel channel on Tuesday at 20:00 UTC or send an email to gtk-devel-list with your points. get involved. help shaping the future. don’t stand idly by, and wait for stuff to break to complain.

    Casual discussion on IRC is OK, but that should not be the repository for decision making for such a fundamental component of GNOME and the Linux desktop.

    Perhaps the discussion can start on IRC, but minutes, summaries and decisions should be posted to the Gtk+ developers and users mailing list and given enough time for all the stake holders to participate.

    Additionally, you can not expect that your blog has now reached all the ISVs, not even the gtk-devel-list (which is presumably a mailing list for the developers of Gtk+ not for its users).

    We need to have a mailing list discussion, and then we need to have an outreach program to get to all stakeholders, including the ISVs to formulate a plan.

    Posted on 15 Jul 2008 by Miguel de Icaza

    Gtk+ 3.0

    The Gtk+ 3.0 proposal being discussed currently sounds like a disaster for GNOME. The reasoning was first articulated in the histrionic Imendio Gtk+ 3.0 Vision presentation done at the Gtk+ Hackfest in Berlin. This is a meeting where application developers were underrepresented, and somehow we have accepted those proposals as the community consensus.

    The proposal goes like this: Gtk+ 3.0 will hide all public fields in objects, provide accessors to these, remove APIs that have been flagged as deprecated and introduce no new features.

    All the actual new features that some people want would come up in future versions. Which features will come is yet to be decided, because nobody knows when and what will be implemented.

    There are lots of technical problems with the proposal, and from my discussions this week at GUADEC it does not seem that the Gtk+ developers have discussed the implications with the users of Gtk+.

    There is a major strategic problem with the plan as well. The most important one is that there is no actual plan for which features will be added, and when these features will be added. There are no prototype implementations, and the idea of first developing the new features in a branch to actually study the code, the implementation and its potential APi breakage is not even on the agenda.

    Basically, we are being told that we should trust that first breaking the API and hiding fields will suddenly enable a whole generation of new features to be implemented.

    But it gets better. There are no guarantees that 3.x will not break the API if the feature in question turns out to require API breakage. Which means that we might actually end up in a situation where there will be multiple API breakages.

    This by all means sounds like a bad plan.

    Towards a Better Plan for Gtk+ 3.0

    I am not against breaking the API for newer versions of Gtk+ if the benefits outweigh the downsides, and the execution presented is not bad. But "3.0 will help us clean up" is not a good enough reason.

    We need:

    • A Clear Roadmap: We need a clear roadmap of which features will be implemented and when they will be implemented. This is the first step to making decisions.
      A clear roadmap would also allow new developers to join the efforts and big companies like Red Hat and Novell to dedicate some full time resources to make some of these feature happen. As things stand today, we are basically being told to "wait-until-3.0-then-we-will-sort-it-out".
    • Working Code: Before a feature for a future version of Gtk+ can be considered a reason to break the API, the technology must exist in the form of a patch/branch.
      This is not new, and should be of no surprise to anyone. This is how the Cairo integration into Gtk+ was done, how the layout changes are being implemented and how every other software product is ran.
    • New API-breaking features must be publicly discussed with the community: Since this will affect every application developer (open source and proprietary) we should get the feedbacks of these communities.
      We could all get as excited as we want about a "gboolean bouncing_text" field in a GtkLabel, but that does not mean that we should break the API for the sake of it.
      Application developers were underrepresented at the Berlin hackfest, and even GUADEC is a microcosm of the ISVs that we had to reach. For instance, I did not see anyone from Adobe, VMware or Medsphere at the conference.
    • Transitional 2.x Releases: For a long-enough period to get distributions to include the code, Gtk+ 2.x should include getter/setter macros to allow software developers to upgrade their source code to work with and without the public fields. To soft-land the switch to a hiding-field Gtk release (this is covered in the Imendio proposal).

    This is by no means a comprehensive plan, it is only the beginning of a plan.

    Lets please avoid inflicting in GNOME a KDE 4.0 (yes, I know its not the exact same scenario; and yes, I know those clock applets are cute).

    Gtk+ Extensions

    From looking at the original Imendio proposal. it seems that plenty of the things they want can be implemented without breaking the API:

    • Animation: doable entirely without breaking the API. The animation/storyboard framework is an entirely new codebase, that would not touch anything in Gtk+. Some widgets might require smoother rendering on changes, but all can be done in an API-compatible framework. public API.
    • Physics: same, add-on.
    • Data-binding: same, add-on.
    • Easier language bindings: same, add-on.
    • Improved back-ends, more OS integration: Can not think of a major issue, but granted, I could be missing something, and Imendio has done the OSX port.

    And my own favorite: killing all Gtk+ theme engines, and replacing it with a Qt-like CSS theme engine. This is not really an API break, as the only consumers of this code are the theme engines, and those we can safely kill and replace with CSS themes, no application code would break.

    Maybe Havoc's proposal requires an API breaking change. And maybe this is worth breaking the API for. But breaking it for no gain, and no prototype to even understand the actual effects post 3.0 is wrong.

    Update: For what its worth, I would lean towards breaking compatibility in 3.0 if it meant 3.0 would include the Havoc-like Scene system. That would make it worthier of a change.

    Update: As usual, the Linux Hater Blog has some great commentary. Some of his feedback on KDE 4.0 applies to our own decision making. Worth a read.

    Posted on 14 Jul 2008 by Miguel de Icaza

    RIA BOF at GUADEC

    Thanks to Behdad and the organizers at GUADEC, I will be having a BOF/discussion session tomorrow at 4:30pm to discuss a new class of applications built on Silverlight or Flash and how they relate to the future of the Linux Desktop.

    Some of the ideas are clearly derived from Alex and Chris thinking about the desktop; it is heavily influenced by our work on Moonlight; by the recent strides that Adobe has made on creating great looking applications on the web (Buzzword and Photoshop Express) and the future of Gnome.

    Join me tomorrow for a discussion on how to launch an effort to create an open-source, RIA-based desktop applications.

    I am very excited.

    Posted on 08 Jul 2008 by Miguel de Icaza

    Guadec/Istanbul; Rich Desktop Applications.

    Next week I will be attending the GNOME Developer Conference in Istanbul.

    Looking forward to meet old friends and looking forward to discuss with people the future of rich applications.

    BOF: Does anyone know how to apply for a last-minute BOF?

    If there is some free presentation slot, I would like to hold an informal BOF to discuss these ideas.

    Posted on 04 Jul 2008 by Miguel de Icaza

    Aaron and Banshee

    Today I walked into Aaron's office unannounced and I just saw him glowing. Like a girl that has been kissed for the first time, like a donkey in the spring.

    A voice in the background was narrating Banshee features, and I was wondering just what is that noise?

    As I went around to his monitor to see what he was watching and listening to, I saw this Linux.com review on Banshee that included a screencast/podcast.

    He was *so* excited that he was actually watching it in three computers at once.

    I could not believe it.

    Three computers at once. One, two and three. All playing the podcast. At the same time.

    I was speechless.

    From economic mastermind to flattered developer.

    He said to me: "I have never seen a production of such caliber" as he listened to the background music in the above podcast.

    I just stood there quietly. Unsuspectingly recovering the Twix office supply.

    Posted on 03 Jul 2008 by Miguel de Icaza

    Moonlight 0.7 Installers

    Yesterday I forgot to point to the actual page to install the Moonlight plugins.

    You can download the latest plugin from here. Just like the last release, these plugins are compiled without ffmpeg support.

    The source code is available here.

    You can track the progress and try out a few applications yourself from our Moonlight Status page.

    Posted on 03 Jul 2008 by Miguel de Icaza

    Moonlight 0.7 is now Available

    A new release of Moonlight is now available. The team has been working very hard on improving the performance of Moonlight as well as improving our compatibility with Microsoft's Silverlight.

    Get your copy here. Source code is moon-0.7.tar.bz2.

    This release will also work with both Firefox 2.0 and Firefox 3.0. We have also switched our installation system to use signed XPIs, but we will also require a browser restart (we could not figure out a way of avoiding this).

    Some of my favorite work that happened on this cycle is the effort to improve our multi-browser support, work towards supporting WebKit and Opera is underway and will improve over time. This work benefitted from our own work to support both Firefox 2.0 and 3.0 in the plugin.

    Windowless mode (the mode that allows blending of HTML content and Silverlight content) is vastly improved but is only available on Firefox 3.0. This is a feature that is used extensively by Silverlight designers.

    More details from the release:

    • Webkit loads the plugin (kangaroo, lewing)
    • The stream/downloader/request/response logic (used for downloading media) has been been almost entirely moved from the browser bridges into libmoon, with the browsers providing subclasses. (kangaroo, sde)
    • Finally add argument checking to all wrapped plugin objects (fejj).
    • Windowless mode fixes (lewing, toshok)
    • Plugin event handling fixes (lewing)
  • Engine
    • Many clock/animation framework fixes. We now pass both animation matrix tests, and many, *many* other bugs (and regressions) have been fixed. (mdk).
    • Bug fixes in the Stroke{Collection}.HitTest and Stroke{Collection}.Bounds code (toshok, sde).
    • Namescope merging fixes (sde, jackson)
    • Parser fixes, and changes paving the way for 2.0 work (jackson)
    • Fix mouse event bubbling behavior (toshok)
  • Media
    • Big, big strides in our media framework and the various (file, http, mms) downloaders, (fejj, rolf, kangaroo, fer)
    • MMS stream selection (kangaroo)
  • Performance
    • Shape caching and bounds computation reduction (spouliot)
    • Geometry bounds work (spouliot)
    • Fast path for position updates (Canvas.Left/Canvas.Top) (toshok)
    • Improved temporary cairo surface bounds (lewing)
    • Glyph rendering speedups (fejj)
    • Resort by ZIndex as a dirty pass (toshok)
  • Silverlight 2.0
    • work is progressing. A very simple 2.0 application successfully ran. (miguel, jackson, sde).
  • Posted on 02 Jul 2008 by Miguel de Icaza

    Hanging out at Microsoft

    I will be at Microsoft on Thursday and Friday, and only have meetings on Thursday afternoon.

    I would love to meet other hackers. If you want to meet, discuss, talk, drop me an email: miguel@novell.com

    Posted on 18 Jun 2008 by Miguel de Icaza

    oh. hai.

    People at the office became LOLcat fans by reading every day i can has cheezburger a few months ago. It was harmless entertainment.

    But recently I have discovered that LOLspeak has started to creep into our codebase.

    Consider the IHasSourceView interface or the ActiveSourceCanHasBrowser property.

    What other naming conventions should we adopt?

    Discuss.

    Posted on 17 Jun 2008 by Miguel de Icaza

    Office Justice, at Last!

    For the past few weeks, since Aaron Bockover found out that some of us like Twix. He then bought all the 70 cent twixes in the vending machine at the office and started reselling them for a dollar.

    Michael struck back by bringing fruits and vegetables today. To which Aaron replied "I hope those fruits rot".

    Today the machine was refilled:

    This has brought finally an end to the empire of speculation from this rapacious market meddler. With at least 12 new twix bars injected into the local office economy we should enjoy a smooth sailing for the rest of the week.

    Update: Some sources inform me that Aaron was trying to create an artificial scarcity in the office by buying the remaining 12 twixes, he hit a glitch in the machine, he got two bars for the price of one.

    This is not bodding well for the local Twix aficionados:

    Update 2: Capitalism knows no limits:

    Update 3: To add insult to injury, he is now selling individual Twix bars for 70 cents each, or a full pack for 1 dollar.

    Update 4: We will be picketing Aaron's office at 4pm this afternoon:

    Posted on 17 Jun 2008 by Miguel de Icaza

    LinuxHater's blog, I am a fan

    I love the LinuxHater's Blog. This is a must-read RSS feed.

    It is funny in a way that xkcd is funny to Unixers. Whoever is writing that blog has extensive experience on Linux and enviable writing skills.

    A first class grilling/roasting of Linux and the Linux community. It should help keep things in perspective.

    Some good starting points:

    Posted on 12 Jun 2008 by Miguel de Icaza

    OpenOffice-based applications with Mono and MonoDevelop

    The entire OpenOffice suite is built on top of a component technology called UNO (which is inspired by COM, but heavily extended). Pretty much all of the functionality in OpenOffice is exposed through some UNO interface, and although the native interface is built on top of C++ many bridges have been created over the years that expose UNO to a variety of languages, runtimes and object brokers.

    A few years ago, Sun implemented a .NET bridge for UNO. This bridge allowed .NET developers to script, extend and reuse open office as a library from C# or any other .NET language.

    A couple of years ago, Michael Meeks and the OpenOffice community ported the bridge to work with Mono which allows developers to create OpenOffice based solutions using any of the Mono programming languages (C#, Boo, IronPython, IronRuby, F#, VB, Nemerle and so on).

    But even if the engine existed, it was not properly installed in the system and getting a C#-based OpenOffice solution required lots of Unix skills, the kind of skills that would likely be in short supply by those interested in OpenOffice automation. We fixed this in this last development cycle, so now a Novell OpenOffice installation will have everything you need.

    Michael Hutchinson, one of our MonoDevelop hackers has put together the missing pieces to simplify the process. He has created the solution templates necessary to create these solutions, and packaged them as a Mono.Addin for exiting MonoDevelop users.

    To build OpenOffice solutions, you need to install the OpenOffice addin for MonoDevelop. To do this, follow these steps.

    Activate the Add-in Manager

    Select Templates.

    Select the OpenOffice Automation Samples

    Complete the installation for the Mono.Addin, once you are done, create a new Solution:

    You can skip this step, and get back here later, but you might want to select "Unix integration":

    Take advantage of code-completion:

    This is what the default sample looks like, you can use this as a foundation for your program. Since this is a COM-based API, it is not an API that is easy to discover with code-completion popups, so we figured it was best to ship full working samples:

    Build and run your application by hitting F5:

    Your OpenOffice solution in all of its glory, this is from the samples that we distribute as part of the templates:

    Improving the OOo API

    Sadly, the OOo API exposed by UNO does not look or feel very .NET-ish at all. It is a COM-based API and is not very discoverable. Code-completion will sadly not be of much help without the samples.

    Additionally, the conventions used in the code are not very .NETish, so it will feel a little bit odd.

    There are a few options here, we could either massage the .NET exposed API into something more .NET-friendly, or we could create a wrapper around the UNO API for most common usage scenarios. We are not sure what would be best.

    We believe using a Cecil-based tool-massager we could rewrite the cli_types.dll library to get a more .NET-ish API:

    • Rename classes and methods to follow the casing conventions for .NET.
    • Turn setters and getters into properties.
    • Change the XBlah convention into IBlah convention for interfaces.

    This still leaves the issue of interface identity to be solved where an underlying object that always implements IA, IB and IC interfaces is usually only exposed as one of those interfaces, and you must do an explicit cast to the other interfaces to access the other features.

    Thanks to the Michaels for all the hard work.

    Posted on 12 Jun 2008 by Miguel de Icaza

    Gnome-Do 0.5: "The Fighting 0.5!"

    Another beautiful desktop application, this one by David Siegel. I have become a fan of it in the last few months since David started working on it:

    Gnome-Do is another very polished application, one that shows a lot of love and care for taking care of the small details. David just released a new version a couple of days ago.

    Gnome-Do is inspired by Quicksilver from MacOS and like Banshee, it uses Mono.Addins extensively to make the application more useful:

    Go to David's page for more details and screenshots on all the new features (Skype, Flickr, Twitter, IM, Google Calendar integration; community plugins, configuration and more).

    Posted on 11 Jun 2008 by Miguel de Icaza

    Banshee 1.0 is out.

    Banshee the Gtk#/Mono based media player for Unix has finally reached its 1.0 status.

    Congratulations to the Banshee team for this release!

    This is one of the finest applications built with Mono, Gtk#, GStreamer, Mono.Addins, DBus#, C# and Boo. The Banshee developers have worked very hard in creating a very polished UI and have paid a lot of attention to the smallest details to provide an enjoyable user experience.

    This really should be considered Banshee 2.0 as SLED shipped two years ago with Banshee 0.10, which was already a stable product.

    Since that first public release, a lot of work went into improving the user experience by making Banshee faster and cope better with large libraries. This required new custom Gtk# widgets (these are reusable widgets, with a model-view-controller system, and part of the Banshee Core) as well as rethinking the way that storage was handled by pushing as much work as possible to the SQLite layer and never loading all the data in memory.

    The full list of the features will give you a better idea of what this player can do.

    Plugin Architecture, a Foundation For Experimentation.

    This is an architectural overview of Banshee's Core:

    Banshee is split up in various components, but most importantly the core does very little work. Pretty much all of the functionality for the media player is implemented as Mono.Addins. Mono.Addins provides services that allow users to install new extensions for Banshee to add new features to the core.

    To make it simpler to develop plugins we will be shipping MonoDevelop and VisualStudio templates to get developers started on creating new plugins for Banshee.

    For example, Alan McGovern, the creator of MonoTorrent a bittorrent library for Mono and .NET extended the Podcast functionality in Banshee to download your podcasts using Bittorrent (this extension is not part of the 1.0 release).

    In this screencast you can see how a download for a Democracy Now podcast goes from 1.5k/s to 650k/s (OGG, low-quality WMV).

    Windows

    In the next couple of weeks we will package Banshee for Windows to expand the reach of Banshee to more users. And as part of this distribution we will also distribute templates for Visual Studio developers to create their own extensions.

    Posted on 10 Jun 2008 by Miguel de Icaza

    Unity3D now available for the Wii

    Unity3D has announced that their game creation tool is now available for Wii developers. Unity lets you script your games in Boo, Javascript or C# with Mono.

    Congratulations to Joachim, David and the rest of the team at Unity3D for getting this working.

    Posted on 05 Jun 2008 by Miguel de Icaza

    More Gtk# Widgets

    I had forgotten about Medsphere's LGPLed Gtk# widgets, the Medsphere Widgets.

    Today Brad blogged about them.

    This is my favorite:

    Posted on 02 Jun 2008 by Miguel de Icaza

    Wow. Adobe Buzzword

    I am blown away by Adobe's Buzzword web-based word processor.

    It feels like a great native application, with great widgetry and lots of attention paid to the details.

    Posted on 02 Jun 2008 by Miguel de Icaza

    Custom Controls in Gtk# Article

    CodeProject has a nice article by Olivier Lecointre on how to write custom Gtk# controls.

    Sample widget from the article.

    Oliver writes:

    I recently made the switch to Ubuntu and I am quite delighted with it. I develop mainly on .Net and my dependence on some Windows tools was the sticky point that made me wait this long. This is now not really an issue, thanks to the great work of the Mono and MonoDevelop teams, and the related libraries like Gtk#, Cairo and Pango.

    Mono brings the .Net platform to Linux and MonoDevelop offers a good alternative to Visual Studio, making the development of GUI applications on Gtk desktop almost painless.

    I wrote a cooperation tool that I use on a daily basis and my first goal after the switch was to port it over with Mono and Gtk#. After a few adjustments caused by the fundamental differences between Windows.Forms and Gtk#, I have to admit that the port of the application was a lot easier that I initially thought; I replaced the UI controls by widgets, set the various forms to use the Gtk# layout, and that is pretty much it. The rest of the non UI code worked as expected with an overall good performance.

    An area that gave me the most difficulty was the usage of custom controls with a behavior that is different from the base Gtk components. This is the focus of this article.

    Posted on 01 Jun 2008 by Miguel de Icaza

    Holly Gtk Widgets

    Daniel has announced his "Holly Widgets" for Gtk#. A collection of useful Gkt# widgets. The widgets also support MonoDevelop/Stetic integration.

    The code is available from http://code.google.com/p/holly-gtk-widgets.

    Picker screenshots:

    Font picker.

    Date and time picker.

    Color picker.

    Nice extensions:

    Baloon Tooltips.

    Regular expression validating entries.

    IP address entry.

    Combo box with file system navigation.

    Simplified API wrappers:

    A simple combobox.

    A simple list (avoids TreeView binding, and supports Measure/Draw on a per-item basis).

    Simplified tree view API.

    Combo box with tree view.

    Daniel also has nice samples and documentation for all of his new widgets.

    Posted on 01 Jun 2008 by Miguel de Icaza

    Mono Embeds Nabble

    Mono has always been developed on mailing lists like pretty much every other classic open source project. But many of our younger or migrating users are more used to Web-based forums and have always wanted to have a forum-like interface for the Mono mailing lists.

    Thomas Wiest and Joseph Hill have just finished the integration Nabble into the Mono web site. Now people can access all of the Mono mailing lists with a Forums UI.

    Messages posted in the forum will go to the appropriate mailing list (either hosted at lists.ximian.com or groups.google.com), and messages posted on the mailing lists get reflected on the forums.

    You can access the forums http://www.go-mono.com/forums here.

    Summary

    Message View

    Enjoy!

    Posted on 19 May 2008 by Miguel de Icaza

    Games Worth Playing

    As you might know, I do not consider myself a gamer although I now understand the Penny Arcade cartoon.

    I have done my best in the past year to increasing BestBuy and Game Stop share holder value by dumping thousands of dollars in my quest to be entertained by video games.

    The games that I actuall enjoyed playing are very few:

    • Wii Sports, but the fun fades away after a couple of months.
    • Metroid Prime 3, on the Wii, fantastic controls.
    • Ratchet and Clank on the PS3, incredibly fun.
    • Bioshock on the xbox360, by far, my favorite game.
    • Ratchet and Clank on the PSP, just because I love the PS3 version so much.
    • Sudoku on the DS.
    • Update: I forgot the incredibly fun Simpsons game.

    I continue to refuse to play propaganda games and do not enjoy sport games, racing games or fantasy games. I could not get into the games in the Orange Box, even if everyone loves it (Portal was ok). And I have not tried Rock Band or Guitar Hero because I do not want to have a drumset ont he living room.

    I guess I like games that have a developing story and are not very repetitive.

    Is there anything like Bioshock on the game pipeline?

    Posted on 18 May 2008 by Miguel de Icaza

    Silverlight 2.0 Hello World

    Silverlight's 2.0 deployment model changed significantly from the 1.1 alpha model. In the past you would load a XAML file, and then on demand load any managed libraries referenced from the XAML file before parsing could continue.

    With Silverlight 2.0 the model has changed. One of the downsides is that now you deploy things as a ZIP file with a manifest file which feels obnoxious. On the upside, the loop "try-to-parse-or-keep-requesting-files-from-the-browser-until-all-dependencies-are-downloaded" is now gone. Now you get a zip file asynchronously, unpack it, load all the assemblies in the zip file, create an instance of the class specified as the entry point, and off you go. No more latency.

    This hopefully also solves an obnoxious pattern that was common in 1.1: calling createFromXaml from Javascript could hang execution while Moonlight waited for the browser to fetch a missing assembly.

    This week Silverlight 2.0 said hello in Linux:

    This corresponds to the standard template with the content of the user control set to a TextBlock.

    There are some peculiar patterns in Silverlight 2.0 instantiation model. Instead of creating objects from a XAML description, an object of a known-type is first created, and then the object is initialized from a XAML file. Your object is supposed to call LoadComponent ("my-xaml-definition") to initialize itself.

    Posted on 18 May 2008 by Miguel de Icaza

    Google IG and Sudoku

    A few months ago, am not sure how, but Nat talked me into getting a widescreen laptop. I no longer remember what were the touted benefits of it, but this warpig of a machine is both buggy and heavy.

    Since the warpig is just too heavy to carry home every day (and also requires a base station hooked up to high-def output to stay at 2.4 GHz of speed) I just leave it at work and use my five year old computer at home to surf the internets. When I bought the machine I remember distinctively describing it to friends as "a silent computer". Five years later every time I load a new web page the fans make as much noise as the construction site across the street. Was I deaf back then, or did the fans become dirty and loud?

    I am a fan of Google IG, and recently I discovered that they have a tiny IDE that you can add to your Google IG page. So I decided to try to write a Silverlight Sudoku application entirely using that tiny editor in my old computer at home:

    I actually cheated a little and used Emacs here and there every once in a while.

    But I ended up with this cute Sudoku/Silverlight application that has exactly one puzzle:

    I am very proud of my one-puzzle Sudoku because it has some of the features that I like from Big Bang's Sudoku (click to flag, double click to set the value, hints) and some cute and simple animations that I wrote in xaml and shows my allegiance to the clean and simple configuration religion:

    I published it on IG as "Moonlight Sudoku". To add it to your IG home page, go here and click "Add to Google".

    Now the only problem with it is that it seems to work just fine with Firefox but seems to have problems with IE and Safari. I must be doing something wrong with Javascript, but I have no idea what it could be. If you can find the bug, let me know so I can make it work on other browser.

    My toy sudoku only has one puzzle, this is clearly a design decision to prevent people from becoming addicted to Moonlight Sudoku. But if you know of a source of http-fetchable Sudoku puzzles, let me know, as I might want to revisit this design decision to include more puzzles.

    You can download the self-contained module (ig + html + xaml + js) from here. You might also need the Silverlight.js file.

    In clear violation of David Mamet's advise to the aspiring actor, I am now going to act surprised:

    In other news, Firefox 3 RC1 came out, and the release notes have nothing to say about the bugs that prevent Silverlight from working with it.

    Posted on 17 May 2008 by Miguel de Icaza

    Moonlight - Full Packages Available from Packman

    Larry Ewing pointed this out.

    PackMan now has full packages of Moonlight for OpenSUSE users (it includes ffmpeg codecs).

    You can use these packages to check some videos at channel9 or see the dual-stream updated videos from Mix 08. Keep us posted about bugs and limitations.

    Posted on 17 May 2008 by Miguel de Icaza

    Mono's Winforms 2.0 is now API Complete

    Jonathan Pobst has posted the update on our Windows.Forms 2.0 work.

    Some interesting points from his blog entry:

    • We are now API complete, which means that our public API is exactly the same as .Net's (all 12,776 methods).
    • The first check-in to our current Winforms implementation was on July 8th, 2004. It took 4 years to get here, and 6,434 individual SVN commits.
    • The toolkit is made up of 115k lines of code.

    Also:

    • We currently have three backends: X11, OSX and Win32.
    • There is a Google Summer of Code effort to improve our theming and OS integration this summer.
    • Winforms 2.0 will also debut support for XIM to allow input for CJK character sets.
    • We have a nice binding to Gecko as our implementation for WebControl which we started last year (currently we are limited to Gecko on X11 though, no Mac support yet for this WebControl).
    • The Desktop team at Novell is adding UI Automation and accessibility support to Windows.Forms integrating it with Gnome's ATK. They have a full team dedicated to that goal.
    • R-to-L support: It is not an priority for us at this point, but it would be nice if someone with RtoL needs were to complete the work that Sebastien did last year to use Pango inside GDI+.

    Winforms 2.0 was the last piece of code holding off the Mono 2.0 release. We anticipate that there will be bugs, so we want to encourage folks to submit their bug reports and to evaluate the portability of their sofwtare using our Mono Migration Analyzer tool.

    Congratulations to the Winforms team, and everyone that provided bug reports, test cases, contributed code, tested and worked with us to bring it to where it is today.

    Posted on 13 May 2008 by Miguel de Icaza

    First Moonlight Release

    Today we are making the first public release of Moonlight, supporting the Silverlight 1.0 profile for Linux. The release comes in two forms:

    • No-media codecs supported, but easy to install: head to http://www.go-mono.com/moonlight and click on the cute installer for Moonlight. This currently hosts builds for Linux x86 and x86-64 for Firefox.
    • Source-code compilation, but you can optionally compile FFMpeg codecs yourself. To do this, download our moon-0.6.tar.bz2. And follow the build instructions.

    Update: I apologize for the confussion; This is not Moonlight 1.0, this is the first source code release that we are making of Moonlight for interested contributors and developers. This release is not even a Beta release, as we are not yet feature complete (missing components in media codecs, the media pipeline, as well as fixing about 70 known bugs). Apologies for any confussion.

    Although Moonlight works on Firefox 2 and Firefox 3, recent changes in Firefox 3 prevent Silverlight and Moonlight from working (For details see #432371, #430965). There is a user contributed Greasemonkey script that will work around this bug for some sites (requires Greasemonkey).

    Windowless: Moonlight supports "windowless" mode, a mechanism that allows Silverlight content to blend with other HTML ements on a page. This is only supported by Firefox 3, users of older versions of Firefox might run into Silverlight applications and web sites that do not work correctly as many Silverlight applications depend on this functionality (Flash sites have the same problem with Firefox 2).

    1.1 and 2.0 support: This release only supports the Silverlight 1.0 profile. The 1.1 support is no longer maintained and the release happened at the time when we are transitioning the APIs to 2.0.

    If you find bugs, please file them for us to fix.

    Posted on 13 May 2008 by Miguel de Icaza

    Cross-platform, standalone Silverilght Applications

    Tamir Khason published an interesting approach at hosting standalone Silverlight applications.

    His solution is a Windows.Forms application that hosts a Windows.Forms.WebControl and inside the WebControl he hosts Silverlight.

    Unlike my proposal for standalone Silverlight Applications that is currently Moonlight-specific (and currently limited to Linux/X11) this approach works on Windows with .NET and with Linux using Mono and Moonlight:

    Left side: .NET hosting WebControl and Silverlight on Windows; Right side: Mono hosting WebControl and Moonlight running on Linux.

    In addition to hosting the WebControl for hosting Silverlight, a thread is running to dispatch http requests locally using HttpListener. HttpListener is an embeddable HTTP server that is part of the class libraries, and exposes a very limited API. You can host ASP.NET with HttpListener by doing the bindings by hand, or you could use our Mono.WebServer library (part of our XSP/mod_mono distribution) to allow your applications to have a fully hosted ASP.NET server.

    Mono.WebServer is what iFolder uses to embed the ASP.NET server to expose SOAP-based WebServices to clients.

    Of course, this currently does not work on MacOS X as we do have no implementation of WebControl for Windows.Forms on OSX, something that a contributor might want to look into.

    You can get the source for the sample from Tamir's page.

    Posted on 06 May 2008 by Miguel de Icaza

    Consulting Gig at Novell

    We are looking for consultants to work on a six to nine month project at Novell to write a prototype for a Visual Studio addin in C# or C++ that will connect Visual Studio and its debugging infrastructure to a remote Linux machine running Mono and the Mono Debugger.

    If you are interested in working with us in this project, you must have good C# and C++ skills, experience with networking and protocol design, knowledge of COM and assembly language programming are pluses.

    We are looking to bring two consultants for the duration of this project. If you are interested, please click this link and attach your resume, pointers to some existing projects of yours and so on.

    Posted on 06 May 2008 by Miguel de Icaza

    Rodrigo Kumpera Completes the Mono Verifier

    Rodrigo Kumpera, one of our VM developers has completed the instruction verifier for Mono's virtual machine. This effort started in June of last year.

    The verifier is a late addition to the Mono VM as it was not a priority to run untrusted code inside the virtual machine.

    But as Mono user base grew, it became important to support this feature. Second Life needs this to run potentially malicious code that is uploaded by a user, and we need this to provide an execution sandbox when running Moonlight on the browser.

    Rodrigo did this work in stages: the first stage was to add support for the 1.0 virtual machine opcodes. Once that was done, verificiation for the 2.0 generic instructions was added.

    This is an important milestone in our support for Silverlight 2.0 support on Linux.

    Congratulations to Rodrigo for his work!

    Posted on 30 Apr 2008 by Miguel de Icaza

    Mono and the Google Summer of Code 2008

    This year Mono is participating again on the Google Summer of Code. A list of the applications that were accepted is available at Google's page.

    This year the quality of the applications and the new ideas submitted (aside from those we proposed) was fantastic. They were too good, and it was very hard to select the final projects (we wanted to pick 33 of the 75 projects proposed, but there were only 15 slots available).

    Posted on 28 Apr 2008 by Miguel de Icaza

    LinuxersForObama

    Linuxers, BSDers, FLOSSers, GNUers, OSSers, Mysqlers, Gnomers, KDErs, Monoers, Javaers, PHPers, I invite you to donate to Obama through the LinuxersForObama campaign hosted at My.BarackObama.com web site.

    If you are a US citizen, or a legal immigrant (green card holder), you can contribute 10, 20, or perhaps 2,300 to the Obama campaign.

    You can donate here http://my.barackobama.com/page/outreach/view/main/LinuxersForObama.

    I called the campaign "LinuxersForObama" because its short. I know it should have been called "GNULinuxBSDApacheX11PythonPerlMySQLPostgressPerlRubyJavaRailsMonoForObama", but it was getting hard to type.

    And if you are a Windowser or Mac()er, but you like how Linuxers stick it to the man, feel free to donate to my LinuxersForObama campaign.

    In retrospect, I should have created one campaign per product, and use that to settle once and for all, which is the best FLOSS project.

    Posted on 18 Apr 2008 by Miguel de Icaza

    Standalone Silverlight Applications

    Last year we created a framework to run Silverlight applications as native applications. At the time we called those applications moonlight desklets.

    The desklets are Silverlight applications that run in standalone mode, with full access to the entire Mono API stack (as opposed to be limited to the .NET subset for the web) and that can optionally render without frames. This is a screenshot from three desklets running on Linux from last year:

    Beyond hack-value, there are in my opinion many reasons why this is valuable. Powerful .NET programming model, powerful graphics and animation framework, reuse the same code base for Web and desktop development, and a sandboxed execution model.

    Many people have asked us privately about this.

    The Magical mopen Command

    To run a standalone desklet, all you have to do run the mopen command, like this:

    	$ mopen ruler
    	

    The above command will look for a directory called "ruler" listed in your PATH, and if the file default.xaml lives inside that directory, it will open that file up. This XAML file can in turn reference managed code.

    We did this so applications could be deployed in directories, very much like they are deployed on MacOS. The rules are simple, applications should be self-contained, keep all their data relative to their executable base directory, the foundation for this started with our application deployment guidelines.

    It also draws inspiration from the bundles from MacOS X and the `open' command there.

    How does this work? Lets consider our enterprise pixel measuring tool, the Moonlight ruler, which is made up of two files:

    • default.xaml, the basic XAML container, it references the managed code in ruler.dll
    • ruler.cs contains the code to draw the ruler.

    This is what it looks like when you run it:

    Awesome Moonlight desktop ruler.

    Details

    At LugRadio Live this weekend in San Francisco I decided to turn my Mono talk into a Moonlight talk, and I discussed some of the things that we have been doing with Moonlight.

    Let me start with this artist rendition of Moonlight's Core:

    The orange pieces were built by the Mono/Moonlight team at Novell. The green pieces are provided by Microsoft (and only for use in the browser context, we will get back to this later) and the blue stuff is stuff that we consume from the community.

    The Moonlight Core provides the high-level canvas, the XAML loading, the animation framework, timers, media streaming and demuxing and event dispatching. It also has very few dependencies, it uses Cairo to render graphics and interfaces with our media pipeline and needs codecs to do video (currently ffmpeg if you build from source, or Microsoft's when we release).

    Our engine today has three frontends:

    The most important one of course is the plugin front-end, the one that is embedded into Firefox and renders the Silverlight content.

    The other front-end is a Gtk# widget, a simple Gtk+ host that embeds the Moonlight Core into a widget and allows developers to embed any kind of XAML content (including managed code) inside it. I did a demo of Banshee embedding a grid of video players at LugRadio.

    This is a widget that can be used to spice up your application. If you feel that you need some bling for your application, some gratuitous animations and special effects, the GtkSilver widget can help you. Using it is trivial:

    	using Gtk.Moonlight;
    
    	[...]
    	void SetupWidget ()
    	{
    		Application.Init ();
    	
    		GtkSilver surface = new GtkSilver ();
    
    		surface.LoadFile ("MyAnimation.xaml");
    
    	        
    		Window w = new Window ("Demo");
    		w.Add (surface);
    		w.ShowAll ();
    		Application.Run ();
    	}
    	

    If you want to get a handle on specific objects, you can just use the FindName method on the surface's canvas:

    
    	MediaElement handler = (MediaElement) surface.Canvas.FindName ("MyVideoPlayer");
    
    	// Start playback.
    	handler.Play ();
    	

    And the third interface is the fabulous mopen command that we previously described (which is conveniently implemented on top of GtkSilver; yes, we know, we are geniuses).

    The Two Stacks

    As you might suspect from reading about GtkSilver and the browser, the Moonlight managed stack (that is, the C#/.NET APIs) actually comes in two shapes:

    • Browser API: This is what people creating Silverlight applications are familiar with. Its a subset of .NET 3.5 and it has limitations as to what you can do: no local file system access and a sandbox that encapsulates all the actions of Silverlight applications.
    • Full API: We also offer the full API, this is our implementation of .NET 3.5 that has been augmented with the Silverlight APIs.

    As you can guess, GtkSilver and the desklets today use the Full API; And our browser plugin uses the more limited Browser API and the security sandbox.

    We will get back to this soon.

    Adobe Air

    Adobe AIR has a great experience for installing native applications on your system, and they are cross platform (Windows, Mac and Linux).

    I found a cute twitter application built with it, and have been a happy user of it for a few weeks (see screenshot).

    I have no idea how extensive the AIR APIs are, whether they are sandboxed or whether they provide full access to all the APIs like our Moonlight Full API provides, but you can build some cute desktop applications with it.

    I like it.

    Silverlight Desktop Apps

    Part of the reason why our Desklets did not evolve much in the last year was because there were no controls for them. You could build your own, but that was a lot of work, and it was hard to share, and most importantly, everyone knew that Microsoft was going to ship controls for Silverlight.

    Now that controls are part of Silverlight 2.0 and that most of the high-level controls have been open sourced and that they are incredibly powerful and great to skin it makes sense to think again about native desktop applications using Silverlight.

    We as a team can certainly create a Linux-only platform for these controls, and live happily with mopen, but we would miss an opportunity of having something cross platform like AIR is.

    Ideally, Microsoft would follow our direction and implement and distribute the same mopen functionality that we have for Windows and Mac. This would ensure maximum adoption of standalone Silverlight-applications.

    In a less ideal world, we (the Mono/Moonlight community) could port Moonlight's mopen command to Windows and MacOS, but with none of the power of influence that Microsoft has.

    Directions and Challenges

    Michael Hutchinson has suggested that we should have an minstall tool in the same spirit of mopen. This tool would take care of installation on each platform, creating shortcuts, desktop links and using the right icon.

    Moonlight currently runs on systems with Cairo, and requires Gtk+ for event processing. It might be interesting to get it running on Win32, OSX and others with the tiniest footprint possible (bundling Gtk+ for Windows and MacOS for native apps sound large).

    Another alternative is to use Microsoft's Silverlight on Windows to implement `mopen' as opposed to porting Moonlight. Apparently its possible to instantiate it through COM in some form, but that would still leave OSX out.

    The codecs that Microsoft will distribute for use with Moonlight are limited to use inside the browser. This will prevent Moonlight's standalone applications from playing back any vc-1, wmv, wma, mp3 content.

    We could add OS-specific codecs; On Linux we could call into Fluendo's commercial codecs, on Windows and Mac use the system codecs.

    But we could also standardize on free video and audio codecs for the desktop edition: add support for the free video and audio codecs (BBC's Dirac, which will become VC-2, Vorbis and Theora).

    We are currently busy doing Moonlight 1.0, and then we will get busy doing 2.0. So we will not be able to spend time on any of these projects for quite some time, but these are projects that developers in the community could work on or companies interested in pushing Moonlight in that direction.

    Discuss.

    Posted on 17 Apr 2008 by Miguel de Icaza

    Mono C# compiler now also MIT X11 licensed

    I know, so exciting, a license.

    We are dual-licensing under this uber-liberal license because:

    We are changing the license to allow parts of the compiler to be reused as part of MonoDevelop, our LINQ class libraries and to embed it in ASP.NET.

    In MonoDevelop: This will allow the compiler to be used to improve code-completion to support C# 3.0 as well as improving the heuristics when offering completions. This will reuse the front end and parts of the backend.

    Compiler hosting inside ASP.NET: This will embed the whole compiler into the ASP.NET process, eliminating about one second for each compilation of a piece of code. In the past, for each request for an uncompiled resource, we would have to call the compiler, wait for its output and then load the output. This typically shaves between 0.7 to 1 second on those scenarios, ideal to improve the developer experience.

    LINQ Class Libraries: This will allow us to reuse parts of the compiler in our System.Core implementation for LINQ for the current 3.5 generation and upcoming generations. Many corner cases are handled by the compiler, and we will now be able to lift those pieces. This will mostly use the backend of the compiler.

    Posted on 16 Apr 2008 by Miguel de Icaza

    Detailed InvalidCastException Goodness Comes to a VM Near You.

    When you perform an invalid cast in Mono (trying to force one type into another with a cast) or JIT would throw an InvalidCastException. If you are lucky, you would get a line number (compile with -g, run with --debug), but if you had a complicated expression you would have no idea what the problem was.

    A few weeks ago, in support of Marek's growing pains in tracking down some bugs, Zoltan checked in support for a new feature in the Mono runtime: --debug=casts. Now, When you pass this option to the runtime, it will report the type that you are trying to cast. This feature is not activated by default as it generates more code, and consumes more memory.

    This sample:

    	$ cat demo.cs
            class Test {
                    static void Main ()
                    {
                            string s = "hola";
                            object j = s;
    
                            object d = (Test) j;
                    }
            }
    	$ mono demo.exe
    
    	Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
    	   at Test.Main () [0x00000] 
    
    	$ mono --debug=casts demo.exe
    
    	Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'Test'.
    	  at Test.Main () [0x00008] in /tmp/demo.cs:10 
    	

    Awesome.

    Posted on 16 Apr 2008 by Miguel de Icaza

    Generic Code Sharing: Good and Bad News

    Mark Probst has been working for the past few months on adding support to the Mono JIT to support generic code sharing. This is a technique that allows the JIT to share the same code generated for two differently instantiated types, for example:

    	class Stack<T> {
    	    T [] data = new T [10];
    	    int top;
    	
    	    public void Push (T t) { data [top++] = t; }
    	    public T    Pop  ()    { return data [--top]; }
    	    public int  Count      { get { return top; } }
    	}
    
    	class Test {
    		static void Main ()
    		{
    			Stack<long> ls = new Stack<long> ();
    			ls.Push (10);
    	
    			Stack<Test> ts = new Stack<Test> ();
    			ts.Push (new Test ());
    	
    			Console.WriteLine ("Count={0} {1}", ls.Count, ts.Count);
    		}
    	}
    	

    The JIT must generate different code for the actual Stack instantiation, one must contain a pointer (32 bits on 32 bit machines) and another one must contain 64 bits. So the structures are different in memory, and so is the implementation for Push and Pop.

    But certain methods do not depend on the datatype sizes (for example) and could be shared regardless of how their container type is instantiated.

    Mark posted the Good news, the bad news and his strategy to deal with the bad news. Am going to limit myself to the good news, and you can click on the link and read the thread for the bad news:

    Now for some interesting statistics.  Apart from the runtime's test
    suite I've used three other test suites/benchmarks, namely IronPython
    (running pystone), Nemerle (compiling its own compiler) and FSharp
    (compiling and running a Hello World program).  Here are the
    Good-News-statistics.  The numbers given are "no sharing / sharing"
    and have been collected on a 32 bit system:
    
    IronPython
      Methods compiled: 3614 / 3368
      native code space used: 719k / 691k
    
    Nemerle
      Method compiled: 7210 / 6302
      native code space used: 2001k / 1943k
    
    FSharp
      Methods compiled: 15529 / 11431
      native code space used: 2193k / 2062k
    	
    	

    See his post for the rest.

    Update: Mark informs me that the "bad news" that I conveniently left out of this post (memory consumption in FSharp for bookkeeping was 600k of memory) has now been fixed.

    The 600k of bookkeeping in the FSharp test has been now turned down to 14k. So we can scratch that "bad news" part. Congratulations Mark!

    Posted on 16 Apr 2008 by Miguel de Icaza

    Open Source Powershell Implementation

    This weekend ath the Code Camp in Waltham, Igor Moochnick announced the release of pash his open source power shell implementation. It currently runs on Linux, MacOS, WindowsCE and Windows.

    pash on Linux.

    Igor's project is hosted on sourceforge.

    A few years ago Ryan Paul from Arstechnica wrote a nice guide to powershell (when it was still called Monad Shell).

    Posted on 07 Apr 2008 by Miguel de Icaza

    OOXML: The Wins

    Regardless of where you stand on the outcome of OOXML becoming an ISO standard, it is worth pointing out that the opposition to OOXML pushed Microsoft into more open directions.

    If you are sulking because OOXML was approved, it is worth looking at what actually was accomplished since December of 2005 when the process begun.

    Before OOXML came to ISO and the global review of it begun:

    • Microsoft moving away from their proprietary file formats to open, and XML-based (easier to manipulate, produce and consume) file formats.
    • Novel raised a record number of issues on the specification, many of which were solved before the spec was approved by ECMA.
    • About 700 pages worth of descriptions for the formula specifications (one of the major issues from our end when we joined ECMA TC45 in December of 2005).
    • The OOXML specification placed under the OSP.

    Once OOXML went for discussion at ISO, a number of good things came out and are major community wins:

    1. The specifications for the old binary file formats were published under the OSP (February of 2008).

    2. The above documents were backed up by the British Library in case Microsoft ever stops publishing them (announcement).

    3. Microsoft is funding the development of a translator between the old binary file formats and OOXML which should assist folks that have experience in one format and want to understand the other, or just want to convert documents back and forth. If your app lacked support for OOXML, but had support for the old formats, you can use these tools.

    4. Microsoft agreed that future versions of OOXML will be covered by the OSP a concern that some people had about future versions of the document.

    5. Microsoft pledged to modify future versions of Office to implement the ISO version of OOXML.

    6. working group was created to look into harmonization of OOXML and ODF, something that many developers involved in office suites have been advocating for a long time.

    7. Microsoft pledged to support features to support other file formats as native file formats in their office suite:

    Last year we sponsored a translator project that gave people the ability to read and write ODF files from Microsoft Office. Last month we announced that we would update the Office product so that the ODF translators could natively plug into Office and give people the same options they get from the other file formats. People will be able to set ODF as the default format in Office if that's what they want by simply installing the translators and then changing their settings.

    8. Lots of clarifications went into the spec, and people should be happy about that.

    9. And finally, now that OOXML is an ISO standard, as Patrick Durusau implied there are many winners.

    Anyways, I wanted to keep this short and uplifting, this seems like a win for everyone all around.

    Preemptive-reply-to-the-above-paragraph: I will not reply/approve any flames, FUD or half-truths.

    Posted on 02 Apr 2008 by Miguel de Icaza

    I love Reddit Captions

    Posted on 28 Mar 2008 by Miguel de Icaza

    OOXML, looking forward

    I have been reading the OOXML storm in a teacup for more than a year now. Am looking forward to the approval of OOXML as an ISO standard and to be able to move the discussion back to the things that actually matter: free and open source software.

    For a year, countless bytes have been wasted on what is now a very difficult plot to follow, specially for people that have not followed it since the start (or as Bill Maher said last week "Its like trying to make sense of a LOST episode". Note: am a Lost fan).

    When we go back to what matters, we should be ready to ask IBM to open source its Lotus Notes software based on Open Office (as staunch supporters of open formats, and open source, I think its in their best interest to do so). There are nice components in Lotus Notes that would be nice to integrate into the upcoming OpenOffice 3.

    But most importantly, it is a time for all of those strong advocates of open standards to stop talking, and start walking. I look forward for all that energy that went into discussing the pros and cons of OOXML to join an open source project and start contributing code, documentation, support, create support forums, file good bug reports and help us make free and open source software better.

    In case you have not been noticing, Apple is gaining market share on the desktop. Some of our own kernel hackers, desktop hackers, web hackers that used to be Linux or BSD users are flocking to the proprietary OSX.

    We need to change that, lets reverse that trend, and lets focus on what actually matters: the free and open source desktop. To make this happen we will need all the help that we can get.

    Punditry and lobbying will not get us very far, real work will.

    Posted on 26 Mar 2008 by Miguel de Icaza

    Mono: 2008 Google Summer of Code

    The Mono project will be participating once again in the Google Summer of Code.

    Although some ideas from various teams are available in our student projects page this year, I want to encourage students to feel free to submit ideas that they think should be done with Mono.

    In past years, a handful of students suggested their own ideas as to what would be an interesting project to work on during the summer, we liked those and turned those into full fledged projects.

    Feel free to suggest a project that you think would be useful to the Mono community, and to discuss your idea with us in the Mono Summer of Code IRC channel: #monosoc on irc.gnome.org

    Posted on 24 Mar 2008 by Miguel de Icaza

    Documentation: Generics and CSS

    Mono contributor Jonathan has been hard at work and has added support for Generics to Monodoc as well as importing the ECMA documentation for the new generic APIs.

    Monodoc now also support man pages (we have a handful now, and we will later add all the mono ones) and we now render using a CSS stylesheet instead of the collection of gross hacks that we used to have.

    Check the new docs out.

    Posted on 24 Mar 2008 by Miguel de Icaza

    Pastor Wright

    From Dave Winer's blog:

    Melroy Hodge, from Queens, NY, a contact on Twitter, sent a pointer to a YouTube video of a longer excerpt of Jeremiah Wright's post-911 sermon, one of the speeches that soundbites were shown repeatedly on cable news this week. I guess it's not surprising that the cable news excerpts gave a very misleading impression. (Next time this happens we must do an immediate fact-check.) http://www.youtube.com/watch?v=QOdlnzkeoyQ

    This is a must-watch video. Stop what you're doing, right now, and watch it.

    I found myself captivated by Wright's ideas and the way he expresses them.

    I agree with everything he said.

    I would have been willing to cut him some slack, because this was less than a week after the attack, and those were crazy days, who knew what was coming next. But he was right, we have done what they did to us, and we're doing it again in Iraq. The US was led by despotic people and we followed; we wanted to punish someone, anyone, and it didn't matter if they had anything to do with what happened to us. And we did.

    Read the whole post from Dave Winer's blog. The video as he says, is a must-watch.

    Also, from the twitter-o-sphere:

    Posted on 22 Mar 2008 by Miguel de Icaza

    OOXML SDK

    Microsoft is working on a OOXML SDK for managed languages. They have announced a roadmap:

    Being selfish here, I would love to see this SDK relreased under an MS-PL license myself, I think it would be great to get folks outside of the Windows world consume and produce OOXML files easily.

    This is a win-win for everyone. Microsoft gets more products consuming and producing OOXML documents on the Windows and MacOS worlds through Mono, and we get a great API to use on Linux with .NET languages.

    Although I have emailed a few friends, am not sure am reaching the right people inside Microsoft. I would love to discuss the advantages that MS-PLing the code base would have.

    It has to be under a license like the MS-PL as opposed to just a license to use and distribute on Linux for this code to make it and be distributed eventually into Linux distributions.

    Posted on 22 Mar 2008 by Miguel de Icaza

    Dog Whisperer

    We became fans of the Dog Whisperer TV show from the Discovery Channel in the past few months. Sadly, we are unable to have a dog at home, so we might look for a new place.

    My friend Shelly pointed me to Gladewell's article on the New Yorker about Cesar Milan, just as fun and interesting as watching the show.

    Posted on 22 Mar 2008 by Miguel de Icaza

    Mono Debugger, now with 2.0 support

    Last week, Martin Baulig announced that the debugger in trunk adds supports to many 2.0 features, our last major feature missing in the debugger.

    The biggest news is that the debugger now has support for C# 2.0
    features such as generics, anonymous methods and iterators:
    
      * We can currently print fields in generic instances, print their
        types and parent classes.
    
      * Recursive generic types (see test/src/TestRecursiveGenerics.cs for
        an example) are supported, but need more testing.
    
      * There is some limited support for method invocations, but we can't
        get their types yet.
    
      * Support for anonymous methods and iterators should now be pretty
        much complete; we can fully access captured variables etc.
    

    To try out the updated debugger in trunk, you must use Mono from trunk. With this code in place, we have now started the work to integrate it into MonoDevelop.

    MonoDevelop 1.1 (due in six months) will have support for the debugger.

    Remote Debugging

    Additionally, Harald announced that they have modified the Mono Debugger to support remote debugging (useful for debugging embedded systems for instance).

    They wrote a detailed document on the architecture for their remote debugging framework.

    Their work is now licensed under the MIT X11 license, which will allow us to integrate this directly into the Mono and Mono Debugger distributions.

    Posted on 19 Mar 2008 by Miguel de Icaza

    Banshee Release

    Yesterday Aaron released the first preview of Banshee 1.0, the Digg-o-Sphere does an in-depth review of the release announcement:

    This is what Banshee looks like:

    Banshee on Linux.

    In other news, thanks to the work of Scott, Banshee will soon be distributed for Windows as well:

    Bringing open source media players to Windows.

    Banshee uses Lluis' Mono.Addins framework to allow third party developers to extend banshee with interesting new features.

    Posted on 14 Mar 2008 by Miguel de Icaza

    MonoDevelop 1.0 has been Released

    After a few years in the oven, we are ready to announce the first release of MonoDevelop. Lluis has put together a set of in-depth release notes that covers the major features available in MonoDevelop and links to various tutorials and screencasts as well as extensive screenshots of what is available in MonoDevelop 1.0.

    MonoDevelop 1.0 is designed mostly for Linux developers creating Gnome and ASP.NET applications but MonoDevelop is also available for MacOS users that download our Mono installer and will still be useful if they are building Mono-based applications on OSX.

    The IDE has many of the features that you would expect from a modern IDE for Mono: support for programming in multiple languages, an extensible design, editors and designers for ASP.NET and Gnome applications, integration with Unix toolchains and Visual Studio Solutions, support for source code control and following standard Unix development practices, integrated NUnit testing, Unix Packaging and Deployment (following the GNU conventions, and Mono conventions for libraries and packages), internationalization and localization, tools to maintain your project documentation and command line tools to access this functionality.

    We have some pretty good language support in this release: C#, VisualBasic.NET, Java, C and C++. Check the previous link for the details as to how extensive the support is for each feature.

    Some screencasts:

    There is more documentation on MonoDevelop available as well.

    The Early MonoDevelop History.

    In late 2003, a few developers were looking for an IDE to write C# code in Linux, not something too fancy, but something that would provide Intellisense features.

    Windows developers were used to Visual Studio, and Mike Krueger and the developers at Alpha Sierra Papa had created the very successful SharpDevelop project, a .NET Windows.Forms-based application. At the time, Mono did not have a working Windows.Forms implementation (it would take another three years before our official 1.0 release of Windows.Forms) so this ruled.

    Although there had been an attempt to make SharpDevelop portable by Mike (with a variation on the theme of Eclipse's toolkit) this effort had not been completed, and SharpDevelop continued to be a Windows.Forms application.

    Pedro Abelleira first extracted the editor and intellisense engine from SharpDevelop into a standalone component that rendered using Gtk# instead of Windows.Forms. This was back late in 2003. Initially it was only going to be a text editor.

    Development started mostly on irc and quickly contributors started to porting various other pieces from SharpDevelop or rewriting the GUI components with Glade and Gtk#. By late 2003 Todd Berman had taken over the maintenance duties of MonoDevelop and sent me a email on December 31st:

    Oh, and we are shooting for eating our own MonoDevelop dog food by the end of this coming weekend, and it looks like we will be there even before then.

    History of the GUI Designers

    As regular Gnome developers were were very happy using Glade and Gtk#'s [Widget] attributes to bind the XML GUI representation to our own variables. You double clicked on the .glade file, and Glade would launch from within MonoDevelop, you would tweak your UI, save it, and rerun from MonoDevelop.

    Around this time Dan Winship from the desktop team started working on a new GUI designer for Gnome, the Stetic GUI designer. This was a Gtk#-based GUI designer, and the idea is that this could be embedded in other applications. An early screencast of Stetic capabilities is available here:

    Stetic in March 2005.

    Work continued, but Dan eventually moved on to other projects. By the end of 2005 we were looking at integrating a GUI designer directly into MonoDevelop and Stetic was not ready to do that, so instead Lluis integrated Glade-3 into MonoDevelop:

    MonoDevelop with Glade-3, January 2006

    This project did not live for too long. Glade-3 had to be patched, and we quickly realized that all the features that we wanted would require more than trivial changes to Glade-3. So we decided that instead of investing time in the C code base and the bridge to C#, that we would complete Stetic which was entirely written in C#, this is what it looks like today:

    Stetic Designer inside MonoDevelop.

    A complete screencast of Stetic and today's MonoDevelop integration shows all the work that Lluis and his team did to provide a smooth editing experience.

    Today MonoDevelop not only supports forms design, but it also provides menu and toolbar editors and support for managing your icon collection in your application.

    Menu editor

    A key feature of .NET is the creation of reusable components. Lluis brought this to MonoDevelop and the stetic editor. This screencast shows how to create widget libraries with MonoDevelop and Stetic that you can later reuse in your projects or in other projects.

    The Future

    The team has already started work on the next release of MonoDevelop, version 1.1. Our goal is to release new versions of MonoDevelop every six months. To do this, we are planning on doing all of the disruptive changes on branches, and always keep our HEAD revision stable.

    There are a number of incremental improvements on our task list, but also some exciting new features. There were many things that we could not get in time for 1.0 are being incorporated or implemented since the 1.0 tree branched a few months ago. Some of the new features that trunk users or alpha testers can get include:

    New Managed Editor: The text editor is now entirely managed and has many new features like configurable keybindings (Really nice Emacs keybindings), split windows, Emacs/Firefox-like incremental search on a toolbar (no more annoying dialog box popping up in the middle of your source code) and one of the most requested features: region folding.

    Moving to a fully managed widget written in C# gives us a lot of flexibility to improve the editor. This is a theme that was consistent in the 1.0 release, moving from Glade to Stetic and moving from the GdlDock to our own managed dock paid off every time in terms of developer agility and features that we could implement.

    ASP.NET editor: new improvements will provide auto-complete and intellisense while editing .aspx files. Also, with the maturity of WebKit/Gtk we are hoping to replace Mozilla as the GUI editor for ASP.NET pages with this.

    Integrated Debugging: Currently the Mono Debugger is only available as a command line tool. Our next release of MonoDevelop will provide debugging directly from the IDE.

    Windows Port: There is now a Windows profile release of MonoDevelop. This will be great for developers that are building applications using Gtk# on Windows and want to get access to the Stetic GUI designer which currently requires them to use Linux to do this. It is not our intention to compete with SharpDevelop as an open source IDE for Windows Programmers although there might be some overlap.

    msbuild-based model: We want to move to the Visual Studio build model to improve interoperability with Visual Studio, Blend and SharpDevelop and other tools that use msbuild files as their interoperability layer. This will allow developers to easily move across tools to work on different parts of a project.

    XML Editor: A backport from SharpDevelop's XML editor has been integrated.

    Future versions of MonoDevelop will extend on this feature set an integrate Ivan's Windows.Forms designer, Alan's Silverlight designer and improve Michael's ASP.NET designer.

    Posted on 14 Mar 2008 by Miguel de Icaza

    Mono on the iPhone, video

    This video shows the Mono C# compiler building a sample native ObjC# application on the iPhone and then running the resulting executable on the iPhone.

    Pay special attention to the beautiful error messages that our C# compiler generates.

    This is using the ObjC# bindings that provide access to the Objective-C APIs from C#.

    Discussion of the bindings and the Cocoa# APIs takes place in the cocoa-sharp and mono-osx mailing lists.

    Update: better version, this one the typing with two hands and with some widgets on the screen and some events hooked up:

    See Geoff's Norton for more details and also this one with comic included.

    Of course, the iPhone is a locked platform, and chances of people being allowed to run Mono seem low.

    The real question is when Android will be open enough that we can do a port of Mono to it (there is no C SDK at this point for Android).

    Posted on 12 Mar 2008 by Miguel de Icaza

    Mix 08

    Just got back from Mix 08 in Las Vegas. It was good to catch up again with old friends and make new friends. As usual, the event was a blast. To me the big interesting news were Silverlight 2.0 and the ASP.NET MVC release (details at Phil's blog).

    Ray's keynote was light on the details, and too abstract for my taste.

    The IE8 announcements were interesting. Their contributed test suite for CSS is good news, and came up with two nice new features: activities and webslices. Both ideas and their specifications were released under the OSP, and apparently by the end of the day there was a Mozilla plugin that implemented Activities. Hopefully we will get WebSlices on Linux as well.

    Of course my personal favorite were the Silverlight 2 updates.

    Since I attended mostly the hallway session, am using this weekend to catch up on the actual sessions. But I loved Joe Stegman's presentation on Silverlight 2 which Mike Harsh described as "we wanted to show code, not slides, lots of examples; you know, developer porn".

    Sadly, I could not make it back to Part 2 with Mike, as the room was full and the bouncers were turning people away (and I also missed the repeat the next day).

    Office Ribbon

    If you love the software that you build, Jensen Harris' presentation on the History of the Office Ribbon is probably the most inspiring talk I have seen in years.

    Every developer building GUI applications should listen to this presentation. This is as inspiring as Joel's articles on UI design were a few years ago when we were working on GNOME 2 or Andy's focus on empowering users were back on the Eazel days.

    Silverlight 2

    First things first. Catching up with Silverlight 2 is a great place to get demos, samples, tutorials, presentations and in-depth coverage of what is new in Silverlight 2.

    Silverlight 1.1 consisted of a .NET binding on top of the core Silverlight 1.0 engine and the addition of the DLR and DLR-based languages. This was never intended to be the last word on it, and it was mostly a showcase of things to come.

    Silverlight 2 is the evolution of the 1.1 model in a number of directions.

    The distribution model: Possibly the most interesting change is that there is now a "core" of Silverlight that will be available on every system and a model to bundle extra libraries for Silverlight. This keeps the Silverlight 2 download small, but most importantly it means that Silverlight 2.0 can ship without having to complete and freeze the APIs for every possible feature that people want.

    The "extras" collection of controls are delivered in this way (like the databound controls) as well as things like the DLR. This means that you can use the DLR today, and still allow the DLR and Iron* teams to continue working and improving it without locking developers to an old version of the DLR that would have been deployed with every 2.0 installation.

    Some other important changes:

    • The application model is more consistent, and some of the common usage patterns for applications are directly handled by the new model (download all assets at once).
    • A control framework. In 1.0 and 1.1, every developer had to create his own control framework, with 2.0 the control framework is in the core, and there is a nice collection of standard controls available (with text input!).
    • Styles: The control framework also allows for skinning of controls through XAML snippets. For instance, consider a button, there a number of states that a button is rendered as: focused, unfocused, pressed, not-pressed. To transition from one to the other you can specify a XAML storyboard that will transition the button from any state to any other state. And you can also controls what is rendered, and how, independently of the control itself.
    • Seadragon images. This is the support to quickly download images and implement infinite zooming. See this TED presentation for the details and a nice demo.
    • Networking: support for socket connections (there are many restrictions here on what can be done) and support for allowing clients to issue HTTP requests to other web sites (this is similar to Flash policy files for the same feature).
    • Updated DLR and Iron*.

    Open source Silverlight Controls

    At the keynote Scott announced that the high-level Silverlight controls were going to be open sourced, they will be released under the MS-PL.

    There was apparently a miss-understanding and the controls were released inadvertently under a more restrictive license, but both Scott and Brian confirmed that they wanted us to use those controls.

    This is brilliant, not only because it helps us, but for a load of useful reasons: it will let developers learn how to write controls early on the Silverlight 2 release process and will allow developers to fine-tune controls if they don't do exactly what they need.

    This is important in particular for things like the DataGrid view, as there history has shown that there is no one-size-fits-all (regardless of how parameterized these controls are)

    Moonlight

    On Thursday I did a presentation on Moonlight. Due to the general nervousness of this presentation I forgot to do a few demos that I wanted to show. I wanted to show Popfly and wanted to show the Silverlight Journal (both 1.0-based applications).

    If you install Moonlight from SVN, you will be able to watch the presentation on Linux.

    Sebastien is now working on the security aspects of Moonlight (auditing code, understanding the attack surface, trying to break our code). He posted an updated diagram of the trusted callers in the various Silverlight 2 assemblies.

    Improving Mix

    I personally would like to see "Meet the Experts" come back. Meet the Experts last year (and at the PDC) happens in the afternoon, as a last-session, there is food delivered and there are no other sessions scheduled, so its a good time for everyone to get together and quickly get some questions answered.

    In my opinion, the bars and the party are no substitute for this session. Discussing styling of Silverlight controls on the bar goes more or less like this "WHAT ARE THE LIMITATIONS?", "NONE, YOU CAN CHANGE THE ENTIRE VISUAL TREE", "THE WHAT TREE?", "VISUAL", "WHAT?", "THE VISUAL TREE", "WHERE IS THE TREE?".

    I still had a blast, but I would like to see "Meet the Experts" back on the agenda.

    Posted on 11 Mar 2008 by Miguel de Icaza

    Mono on the iPhone

    Luke Howard from PADL Software Ltd sent me some screenshots of Mono ported to the iPhone:

    Some stats:

    # hostinfo
    Mach kernel version:
             Darwin Kernel Version 9.0.0d1: Wed Oct 10 00:07:50 PDT 2007; 
    root:xnu-933.0.0.204.obj~7/RELEASE_ARM_S5L8900XRB
    Kernel configured for a single processor only.
    1 processor is physically available.
    1 processor is logically available.
    Processor type: armv6 (arm v6)
    Processor active: 0
    Primary memory available: 116.00 megabytes
    Default processor set: 26 tasks, 164 threads, 1 processors
    Load average: 0.00, Mach factor: 0.98
    # export MONO_DISABLE_SHM=1
    # ./mono hello.exe
    Hello Mono World
    #	
    	
    Posted on 10 Mar 2008 by Miguel de Icaza

    Channel9 works with Moonlight!

    I just got back from Mix, updates my Moonlight from SVN and the videos at channel9 are now working with Mono.

    Inside Silverlight 2 Beta 1, an overview with Scott Guthrie

    This is one of the important pieces of our media pipeline that was missing (support for the HTTP streaming protocol). The implementation is based on the work that Fernando and Rolf did using the recently released specifications that Microsoft published.

    Sadly, I was not able to show that at Mix. Its also the first take, so more testing and exercising will be required.

    Posted on 08 Mar 2008 by Miguel de Icaza

    Pre-Mix 08: Moonlight Updates

    We have been hard at work in Moonlight and I keep postponing when to blog some updates about our work every few days hoping to cram some new feature in the blog post.

    And every few days turn into every few weeks and the next thing you know what should have been published a month ago ends up being my pre-Mix post.

    Some of the most important changes in the last two months have been:

    Moonlight Media Pipeline: So far we had been using ffmpeg's pipeline to process media. This means that ffmpeg was in charge of detecting the media formats, locating the codecs, demultiplexing the data, and decoding the data into video and audio frames.

    The ffmpeg pipeline was fine as a sample pipeline, but we needed a few more things. We needed more control over the pipeline to implement things like media streaming and supporting seek operations over HTTP; We want to be able to relicense the code under non-LGPL terms (for people that can not use the LGPL or some commercial uses) and we need to plug Microsoft's Media Pack media decoders.

    Rolf rewrote our multimedia pipeline so that the code on SVN no longer depends on ffmpeg's pipeline and only uses ffmpeg's decoders for video and audio:

    The end goal is to plug Microsoft's Media Pack (this contains the codecs video and audio) into Moonlight:

    The installers that we currently distribute for Linux do not contain the ffmpeg media codecs. If you need to test media you will need to compile the code from source.

    Streaming: With our new pipeline we are now able to stream media. In the past Moonlight downloaded the media file into the local file system, and only when the entire file was downloaded we would start the playback.

    Moonlight can now start playback as soon as there is enough buffered data. This works for media that is only available over HTTP. Fernando has been working on the support for media that supports the MMS-over-HTTP (controlling seeking for example). Luckily, the specs for HTTP-based streaming to Windows Media servers were released last week (also the specs for the ASF container format, which should help validate our implementation).

    Test Tools: As part of our collaboration with Microsoft we received various tools that are used to test Silverlight. We could not reuse the tools directly for Moonlight (too many Win32-isms, too hard to plug into Mozilla/Linux) so Jackson rewrote all of that code for Linux.

    The test tools include plugins that expose Javascript APIs to control Silverlight and the browser, simulate user events and take snapshots of the screen. Microsoft has given us permission to open source our implementation of these tools.

    This should help us in creating our own tests, and in checking our own code for regressions beyond the test suites that we will have received from them.

    The code should hit SVN soon.

    Mozilla Installers: We created some installers for Mozilla that should offer a one-click install experience for users on Linux.

    Verifier: Rodrigo continues to work on Mono's CIL verifier and on strengthening the image loader, work that will not be used immediately for our Silverlight 1.0 support, but that will be important for 2.0 (when Mono is required).

    Historically Mono had not been used to execute untrusted code as we mostly were a runtime for desktop and server applications and errors in the images fell directly in the "doctor it hurts when I do this" category.

    But with Silverlight 2.0 the story changes, Mono will be executing potentially hostile code so this work is mandatory. Additionally, Sebastien has been improving Gendarme and his Monoxide tool to help in the audit process and we have created a security audit plan for the runtime. This work, like the verifier work is a work in progress.

    In addition to using it for Silverlight, the verifier work will enable the SecondLife folks to allow the execution of binary code in their simulators instead of being limiting SecondLife to use LSL-based scripts.

    Windowless Support: As it turns out Windowless rendering is used by many Silverlight applications. This is where Silverlight content seamlessly blends with the HTMl content. This is a must-have for things like Tafiti, the XamlPad, and the Vista simulator and nice-to-have for some other sites.

    The good news is that Chris has implemented the support for it:

    The bad news is that this is limited to Firefox 3.0, the 2.0 edition does not have support for Windowless rendering.

    See Chris' blog entry for the details about the challenges and limitations of Moonlight/Windowless in Firefox/Linux.

    Bug weeks: With the test suite running on Linux we have been focusing on passing all the Microsoft tests that we can and implementing the major features missing (like Windowless support).

    Silverlight 2.0 Other than the JIT support for Silvelright 2.0 at this point we have not done any work on it (well there are 3 classes stubbed privately).

    There are two reasons for this: the updated 2.0 API is not public and although we have access to it, it is a bit of a mess to try to keep two separate trees (public and private) to support this and since Mix is just around the corner, we will just wait until next week.

    The second reason is that we want to focus on shipping 1.0, completing the media pack integration and working on the configuration aspects of Moonlight (auto-update configuration for instance).

    Our Priorities

    Everyone on the team has been working very hard to get all the pieces in place, and we are getting closer to completion. Every time we fix a bug, it has a nice ripple effect of fixing various other issues that we had seen in some sites at once.

    Our priority currently is to ship Moonlight 1.0, and this means more or less:

    • Integrate the Microsoft Media Pack.
    • Complete our media pipeline.
    • Fix all the bugs exposed by the test suites.
    • Investigate some of the problems with some video card/driver configurations that seem to burn a lot of cycles.
    • Improve the performance for heavily animated scenes.

    Am excited about the Mix conference, looking forward to see the demos and what gets announced. And obviously very excited about my own session on Thursday to talk about Moonlight and Mono.

    Time to go to sleep. Marek and myself are on a 7am flight and it will be hard to make it.

    Posted on 03 Mar 2008 by Miguel de Icaza

    Wooohooo! Am on Channel9!

    The interview that I had when I visited Microsoft for the Lang.NET 2008 has been posted to Channel9. Its a conversation between Charles, Dragos (from the Volta team) and myself on open source, .NET, Mono, Moonlight and other fun topics.

    Posted on 29 Feb 2008 by Miguel de Icaza

    Mono and the Game Developers Conference

    Last week some of us from the Mono team at Novell went to San Francisco for the Game Developers Conference. As some of my dear readers know, I was not much of a gamer a year ago, and I do not claim to understand this industry.

    Mono is currently being used by a major publisher [1] to script a new version of a popular franchise (the new edition) and Mono is also the engine that drives Unity3D for scripting and SecondLife is beta testing Mono now on their beta grid.

    Other than being fascinated by Unity3D and SecondLife, we had not really paid much attention to games. But in the last nine months we started to get a constant stream of requests to license the Mono runtime to power more and more games.

    When Joseph Hill joined Novell in January as Mono's product manager we started to revisit some of these request. People wanted to get a proprietary license for Mono to use on the PlayStation, the XBox and the Wii and some folks also wanted Mono under non-LGPL terms (as it turns out, important to prevent cheating).

    Three weeks before the GDC conference, our in-house expert on the game industry Michael Hutchinson told us that this conference existed. In a couple of days we booked some space on the show and we got things in place, we were going to promote Mono as an accelerated scripting engine.

    Mono in Games

    As it turns out, .NET-based tools and .NET-based scripting of tools are pervasive in the game industry.

    As for the games themselves, engines are typically written in a combination of C++, C and assembly language and the high-level code is written with scripting languages. Lua is the most popular language to embed in a game (a procedural C-like language) and Python, variations on Lisp and a never ending stream of evolved batch languages.

    People want to reuse Mono on games for a few different tasks. These are some of the reasons that we know about:

    • Speed: as games become more complex, and people spend more money on software that takes advantage of GPUs, optimizing compilers and even special hardware for physics the weakest performance spot on a game has typically been the language that has been used to implement the high-level portions of the game.
      In a world that is increasingly green, it is a waste of perfectly healthy computer cycles to interpret your code when you can use an optimizing JIT compiler to run your code.
    • Mainstream Language Support: In some cases, game companies have created their own languages, evolved or modified existing languages (modified versions of Lua are common). Some people would like to get access to more mainstream languages to develop their game logic.
      In the short term, jumping from procedural languages to object oriented languages is a first jump.
      Hopefully they will drink the functional kool-aid and use some of the C# functional features, or even F# to write their games.
    • Code Sharing: C# or .NET code that is today written to run on servers, or as part of the tools being used to create games can now be easily be reused on the game itself.
    • Mainstream Tool Support: Many games engines are already being developed with Visual Studio. Game developers can use the same tools to develop and debug the high-level game play scripts that they use to develop and debug the game engine.

    Luckily, developers that have been writing Lua code for years will be happy to know that they can compile their Lua code to run on Mono (and get the performance boost they need) by using the Lua2IL compiler.

    Update: The always great Lua developers have pointed out that the new thing is not Lua2IL but LuaCLR.

    Mono and XNA

    Mono does not really attempt to compete with Microsoft XNA

    Microsoft's XNA is an end-to-end solution for game developers that want to create games for Windows, the XBox and the Zune, the XNA approach is to write manage code on *top* of XNA.

    This works for certain kinds of games, but in the game developer space, some developers need to support more than one console and the high-end games (am sure there is a technical terms for these) end up licensing game engines, audio engines, graphics and physics from all kinds of middleware vendors.

    In those cases (even when targeting the XBox) C# and .NET would not be available to the game developer.

    So we basically think of the Mono runtime merely as a fast scripting engine with all of the ECMA/ISO CLI benefits and not really as providers of gaming APIs.

    There has been some discussion in the #mono channel recently about whether we would create or endorse a gaming API developed by a third party. Like blessing Tao or OpenTK as the standard way of building games for Mono.

    Although there is some value in having a blessed set of libraries for Mono, and I have no problem if people want to call their libraries Mono.Gaming, at this point the team at Novell is not able to dedicate any cycles to this effort (we can provide spiritual support, along the lines of yelling "Go team! Go" from the sidelines).

    Intrinsics and Parallel Code

    Am personally fascinated by running computational code on the GPU or taking advantage of special CPU instructions at the runtime level. Last year I wrote a bit about how we could implement this in Mono (Microsoft has already an implementation) and later we even made it part of our interviewing process.

    Gratuitous Cell Processor imageAt the conference some people asked as to whether it would be possible to take advantage of the PlayStation3 six SPE processors. During the conference I had no idea that there was already a project using Mono on the PS3 with Linux that already does this, but the idea sounded fascinating.

    It is particularly fascinating because the SPEs on the PS3 do not have the same limitations than GPU computations have, these are full blown CPUs (with some memory limitations) but still general purpose computation devices.

    Paolo pointed me to CellDotNet: A project to make it possible to run .NET code on the Cell architecture.. CellDotNet is basically a JIT compiler (written in entirely in C#) that can compile CIL bytecodes into native code for the PS3 SPE processors (this is a project from Klaus Hansen and Rasmus Halland).

    They have ported the SciMark benchmark to use some vector operations in the SPE. Currently I am unable to report the numbers as I do not have a PS3 running Linux, but I am expensing a PS3 as we speak to be able to report these back to you dear readers.

    What makes CellDotNet all the more interesting is combining C# new functional features with the the Parallel Extensions to .NET.

    Two good articles to get a grasp on what this offers are: Optimize Managed Code For Multi-Core Machines and Parallel LINQ: Running Queries On Multi-Core Processors.

    PLINQ is built on top of the Language Integrated Query (LINQ), and although it has been promoted mostly as a technology to do database queries, the Parallel LINQ extensions basically supports map/reduce inside C#.

    These libraries are only available as a technology preview currently for .NET and they do not exist yet for Mono. Hopefully we will get these implemented at some point.

    [1] Our contract with said major publisher does not allow me to disclose who they are or the the game they develop on my blog. But it allows Novell to publish the information on the Novell site. After a year of asking Novell people to put this information on the web site, the information has not yet been posted. So the mystery as to what this is will sadly continue.

    Posted on 26 Feb 2008 by Miguel de Icaza

    Lang.NET talks available

    The Lang.NET 2008 talks have been published.

    They require Silverlight 1.0, but Moonlight compiled from source with ffmpeg support is able to play those presentations back.

    If you are in a rush, see the following post for details on downloading the WMV file (so you do not need to install Moonlight from source on Linux).

    Posted on 24 Feb 2008 by Miguel de Icaza

    Mono Hackweek Summary

    Some of the Mono folks have blogged about their work for last week hack-week:

    Paolo and Zoltan rearchitected the Regular expression library in Mono and got a 9x performance improvement in regular expression matching. The work had two components: redesign of the opcodes in the regular expression engine, and generating native code using Reflection.Emit. At least for the Language Shootout case, the new regular expression code is the second best (Tcl is faster, but apparently Tcl does not cope with Unicode regexes).

    Wade worked on MythTV under XGL and making Tomboy Scale.

    Andrew added Zeroconf/Bonjour support to Giver (a tool used to easily share files with friends or nearby users). And he also worked on Tasky a simple task management tool that integrates with Remember the Milk. He also wrote a command line tool to remotely control Tomboy. screencast.

    Mike added support to importing data to his Exert Project (fitness/workout log software) that he started last Hack Week.

    Sebastien revamped and added various new rules to Gendarme, our analyzer for CLI assemblies to spot errors and common programming mistakes.

    He also improved its APIs and performance. He also started to fix some bugs in our class libraries based on the analysis done by Gendarme.

    Jonathan ported his XMPP/VB.NET client to Mono:

    And also got MonoDevelop running natively on Windows:

    Jonathan Pryor spent the week polishing various loose ends. Including the release of his fantastic NDesk.GetOptions command-line parsing library and providing documentation to various components in Mono.

    Atsushi worked on the implementation of WebHttpBinding (part of 3.5 WCF) and various other parts. See his blog for details.

    Mark polished his MathMap composer tool.

    Marek did some work towards replacing System.Reflection.Emit with Cecil. After some discussion we believe we can keep both backends, one to keep things as usual, and another to be used with MonoDevelop (so MCS provides the actual parsing for the editor intellisense and compile-as-you-type support).

    Jackson worked on a couple of interesting demonstrations with Aaron, which hopefully they will be able to demo soon.

    Carlos spent his time improving System.IO.Serial, there were a handful of events not implemented that he worked on.

    Andreia and Marek worked on a Gtk# native client for Bugzilla.

    Stephane created a new Gtk.Print/Cairo dialog for F-Spot and worked on support for TimeZones in F-Spot (code has not been commited yet).

    Everaldo worked on packaging Mono for Maemo4. He has promised a number of blog posts detailing the work on GarMono, and the new packages that will be included on it.

    Rolf continued to replace SRE with Cecil in the VB.NET compiler.

    Lluis worked on improving Mono.Addins and creating an add-in for authoring add-ins in MonoDevelop.

    Paolo early on also extended C# to allow inline-IL assembly language code (similar to __asm__ in C or C++ in some compilers). See the blog post for the various samples of C# with embedded IL.

    Chris worked on a scheme compiler.

    Jeff learned more about Regular Expressions than he wanted to. Update: Jeff wrote an add-in for MonoDevelop to do Evolution plugins in C#.

    Update: I had not finished reading all the status reports on the mailing list. Dick Porter wrote bluetooth support for F-Spot. There is a bug in the system underlying bluetooth C libraries that prevents it from working correctly out of the box, but hopefully that will get fixed.

    Update: Mike Krueger improved extensively the search functionality in MonoDevelop, it now implements Emacs/Mozilla-like searching and he also wrote an assembly browser/decompiler that is plugged right into the solution browser.

    As for me, I spent the week going insane over the incredibly frustrating T61p problems with performance. Inspired by Marek's encouragement to learn LINQ and functional-style programming, I started a project that I abandoned quickly to implement a managed spreadsheet.

    At least I learned two lessons: am more comfortable writing tokenizers using the regular call-back system than the automatically generated state machine from generators. I also learned that OOXML is very easy to parse, but it would be nice for PDF files to have hyperlinks in the spec.

    I am probably missing a few things, but I did not catch all the blog posts this week.

    Posted on 23 Feb 2008 by Miguel de Icaza

    Game Developer's Conference

    Some of us in the Mono team are in San Francisco for the Game Developers Conference at the Moscone Center.

    For more details see Joseph's post Mono at the Game Developers Conference.

    Posted on 20 Feb 2008 by Miguel de Icaza

    Politics as Theater

    My friend Jon Perr (he was Ximian's Marketing VP) did a fun presentation at Ignite Portland.

    The presentation uses an unusual format: you talk for 5 minutes, and 20 slides are displayed, each for 15 seconds (they advance automatically).

    Watch his presentation here. The slides contain more data than the 15 seconds allowed, so you can read that here (also check the notes).

    Posted on 18 Feb 2008 by Miguel de Icaza

    ThinkPad T61P Speed Problems

    I recently upgraded to a ThinkPad T61p. I did not reinstally my OS, but instead just moved the old hard drive into the new machine.

    The new machine is supposed to run at 2.4Ghz when plugged to the AC power, but it keeps going down to 1.2Ghz when am trying to get some work done (start a build: cpu speed goes down; Start firefox, cpu speed goes down). When am idling, the CPU speed will happily go back to 2.4Ghz. It can get as bad as 800Mhz, and in fact, it tends to boot in that mode at 800Mhz so booting takes forever.

    The machine is cool, unlike the last laptop it does not feel warm at all (perhaps because it never performs better than a PC/XT).

    I have Googled and Googled and various people seem to be having this problem across some other machines and Linux distributions, but there does not seem to be any solution posted. This is also not a new problem.

    gnome-power-manager shows that the speed policy is "Always Maximum Speed":

    This is what cpufreq-info shows:

    I have tried:

    • powersave -f, it sometimes makes the machine go to 2.4Ghz, but it will happily go back to 1.2 a few seconds later.
    • Setting the minimal frequency in /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq by writing 2401000 to it. This sometimes works, but sometimes I get:
      		root# echo 2401000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 
      		sh: echo: write error: Invalid argument
      		
    • Calling: cpufreq-set -c 0 -d 2401000 -u 2401000 -g userspace this again works sometimes but when the CPU insists on sticking to 1.2Ghz it will just produce an error.
    • Variants on cpufreq-set's governor: I tried userspace, and performance. They both seem to fail sometimes, and work sometimes. When they work, the processor speeds only stays for a few seconds before it goes back to slow speed.
    • Tried disabling the speed stepping support in the BIOS. Although /proc/cpuinfo then reports that the CPU is running at 2.4Ghz, regular benchmark programs show that the machine is actually running at 1.2Ghz (building mcs goes from 2.7 seconds to 4.7).
    • Tried killing powesaved, gnome-power-manager to make sure they wre not interfering, they still do not work.

    If you got some ideas, drop me an email, I will post any solutions

    Posted on 13 Feb 2008 by Miguel de Icaza

    MonoDevelop goes to MacOS X

    We have released an updated Mono 1.2.6 package for MacOS X that contains Imendio's Native Gtk+ for OSX, Gtk# and MonoDevelop with Mac support. It is now available from our downloads page.

    MonoDevelop on OSX.

    MonoDevelop has pretty much the same feature parity than Linux does. There are a few missing features that we hope to resolve in the future, and there is plenty of room to improve.

    Our recent efforts to better support the OSX stem from our belief that some Windows expats will want to continue building .NET applications using the Mac. And once they have updated their applications to run on the Mac, the code will run just as well on Linux.

    Also, we believe that Unity3D developers will find auto-complete a useful tool when writing extension scripts for Unity. No templates or integration yet, but hopefully we will have those in the future.

    This is only our first step.

    MonoDevelop for Windows

    Eventually, we would also like to bring MonoDevelop to Windows. Not to compete with SharpDevelop as they are focused on being a great IDE for Window developers. Our focus will be in bringing Stetic (our Gtk# GUI designer) to developers building cross platform applications.

    Posted on 07 Feb 2008 by Miguel de Icaza

    Updated Mono VM

    Joseph blogs about our updated Mono VM. This new release is based on OpenSUSE 10.3 (instead of what we had been using which was based on 10.2).

    It includes various new .NET and Mono applications that we had not shipped before (and that you can find the Mono:Community section of the Build Service).

    Posted on 07 Feb 2008 by Miguel de Icaza

    Lenovo ThinkPads preloaded with Linux

    I was doing some shopping today for a Lenovo ThinkPad T series, and noticed that they are finally offering them with SUSE Linux Enterprise Desktop 10 preinstalled.

    (At least in the US).

    Posted on 07 Feb 2008 by Miguel de Icaza

    Election Results

    Larry Lessig has a fantastic presentation, in the very best Larry Lessig style, of why he supports Obama over Hillary. Chris has a transcript of the presentation for those reading blogs from work.

    While reading CNN summary:

    But the two-term senator from New York surpassed the one-term senator from Illinois when voters were asked about experience, with 91 percent of voters saying she "has the right experience," versus just 5 percent who said the same thing about Obama.

    Both John F Kennedy and Bill Clinton were younger than Obama is today when they became presidents. It seems odd that this fact is not mentioned more often. (Update: Raphael pointed out that I used the wrong word here; Sorry, not a native speaker and all that).

    And Wonkette goes through the checklist: Hillary Pre-Election Day Cry For Points: Check:

    With Super Tuesday coming tomorrow, and polls showing Hillary Clinton in a dead heat with Barack Obama in states like, let’s see... Connecticut... it seemed like a good opportunity to CRY again. Not that this has anything to do with anything, but Hillary Clinton did cry in New Haven today while discussing children’s health care, one of the various things that she cares about. We’re ashamed at Hillary for this: If she had planned it around mid-afternoon, it might be a fresher topic for the evening news cycle.

    Which is at odds with the speech I heard from her appearance in Massachusetts two nights ago when I jumped in a taxi. She was yelling repeatedly "am ready to lead" with a loud and strident voice. Which makes the perfect timing for the crying all too suspicious.

    Larry Lessig's post underlines an important point about the way that Obama is conducting his campaign vs the way Hillary is. Hillary will have a debt with all the lobbyist, there will be favors to repay, concesions to make, special initiatives to pass through congress.

    The video with Hillary's position on taking lobbyist's money is educational. Not only she is very happy taking their money, but she also twists facts when she says "They represent real Americans, they actually do". She should have added "The top 1% of Americans", you know, the Americans that actually count.

    This is the complete context for the debate where the previous video was taken from. Edwards and Obama interventions are brilliant, "we do not have to start for the next election to start reforming, we need to start a grass roots movement to start reform today". Edwards and Obama went down this path: they did not take lobbyist money. Watch the full thing.

    Obama as a president would not have those ties, he refuses to take money from the lobbyists.

    Posted on 06 Feb 2008 by Miguel de Icaza

    Moonlight Talks (Paris Tech Days, Las Vegas Mix 08)

    Next week I will be in Paris for the Microsoft Tech Days talking about our work on Moonlight. JB Evain will be doing a tutorial on Moonlight on Monday as well. Sadly, due to all the work we have right now in Mono-land, I will only be in Paris for a very short time before I have to head back home. But hopefully Mono-ers and Opensourcers can have some dinner on Sunday night. Drop me an email.

    I will also be speaking in depth at the Mix 08 about Moonlight. This will be a more detailed talk about Moonlight than the talk at Lang.NET which was more of a potpourri of Mono stories.

    Posted on 04 Feb 2008 by Miguel de Icaza

    MathMap

    Only recently I found out about Mark Probst's MathMap plugin for the GIMP. I ran into it when he posted about a new feature in it called the MathMap Composer.

    Check out this video demostration of MathMap's Composer.

    I would have put a good screen capture of it, but Google Video seems to have regressed and no longer lets user skip over parts of the video.

    Posted on 04 Feb 2008 by Miguel de Icaza

    Mono Does Robotics

    Shawn at Cogmation has written us to notify us that Mono is being used as the scripting engine for their robotFoundry application.

    From their testimonial page:

    We needed a portable cross-platform, architecture compiler system that would allow us to develop code on one OS or architecture and deploy it on another with out recompiling. The problem with using gcc was that for every target OS or architecture we would need a separate cross compiler. Additionally maintaining and developing this toolset would be a large task.

    Initially Python was selected as our cross platform language. Python was great but we were always concerned with its speed, especially in real-time applications.

    We discovered Mono while we were evaluating 3D engines. Mono was successfully being used to develop video games and it was extremely fast. We performed a small test and compared the speed between Python and C# mono and were shocked at how fast mono was compared to python. In addition to the speed increase and portability, we now had the ability to allow our users to write scripts in any .Net language.

    Switching to Mono has given us the ability to write very fast cross platform applications and has provided us with a multi-language scripting interface, and the integration of Mono within our application suite has proved to be a huge success.

    (Emphasis added).

    From the product description:

    robotFoundry is a powerful graphical coding environment for robotics. Use drag and drop modules to add functionality to your code, quickly linking them to create program flow and robot controls. Generate code with a click, and transfer your code to your robot or robotSim with another click.

    Code for a physical robot or simulated robot at the same time - switch between them at any time to generate code for the robot or robotSim to run identical code. Choose from pre-existing robotFoundry robot templates, or add components to create your own. Many modules are available, ranging from simple controllers such as line trackers and wall followers to basic building blocks like variables, mathematics and logical operators. Choose your own level of programming, and allow robotFoundry to take the coding out of your coding.

    Additionally their robotSim lets you simulate your robot software in a simulated virtual world. RobotSim is built using Unity3D which is also scripted with Mono:

    RobotSim: Simulated Packbot with ARM

    You can use robotFoundry and robotSim to write code for your Roomba or your iRobot Create without burning the batteries:

    RobotSiming a Roomba

    Posted on 03 Feb 2008 by Miguel de Icaza

    Dave Winer Posts

    Dave Winer has a couple of great posts on the campaign:

    Here he points out:

    Most of what Chris Matthews says is mindless trash, but today he pulled out a great analogy immediately after Ted Kennedy's stirring endorsement of Obama.

    He compared Hillary Clinton to the character Salieri in the movie Amadeus. Until Mozart came along he was the leading composer in Vienna, but he was just a workman, a technician. Mozart had inspiration, feeling, the spirit. Salieri, even though he lived a long life and Mozart died young, is a footnote to Mozart's lasting greatness.

    Matthews nailed it.

    This is a great nugget that encapsulates perfectly how I feel about Hillary.

    Dave also wrote: Bill Clinton as Trent Lott 2.0, some parts that I liked:

    It was an interesting election until the Clintons started calling Obama the nice young African-American candidate.

    [...]

    The problem for Clinton is actually much worse, we now saw how she'd govern. Let's say a young African-American Senator from Illiinois got in the way. Would she argue the issues with him in a respectful way? Why bother when you can smear him into silence.

    [...]

    What a fantastic way to recover from Bush, who so completely represented the greed and arrogance and uglyness of America, to reinvent ourselves in the image of our best, in the image of hope.

    (Emphasis added).

    Posted on 01 Feb 2008 by Miguel de Icaza

    Mig Tamale in da Sim!

    My SecondLife dude walks around the Mono Simulator in SecondLife, am running this with the Linux client:

    Mig Tamale Explores the Space.

    The work that we are doing on Mono's runtime to support Silverlight (the sandbox system and the hardening of the runtime) is going to enable the use of other programming languages to script components on Second Life.

    Go SecondLife! Go!

    Posted on 31 Jan 2008 by Miguel de Icaza

    Second Life Opens Public Beta for Mono Scripting

    Today Jim announced the beta launch of their Mono integration into SecondLife.

    We’re very pleased to announce the beta testing of Mono in Second Life. Mono is a technology which will increase the speed of scripts running in Second Life. The goal is that everyone will experience reduced lag and improved stability and that it will be possible to script complex behaviours that were not previously feasible in Second Life.

    With a mono viewer on a Mono region, normal LSL scripts can optionally be compiled and run on Mono. If you are a scripter we would love you to download the Mono viewer, connect to the beta grid, teleport to a Mono-enabled region and test your scripts on both the Mono and LSL virtual machines side by side

    Currently the focus of this beta is to focus on identifying any problems with the Mono integration, so the language use is currently still limited to LSL. Linden has plans to allow any .NET language that will run on Mono to be used to write scripts for SecondLife.

    For more information of Mono on SecondLife see the Mono page and if you want to participate in the beta, see SecondLife Mono Beta FAQ

    Congratulations to the Jim and the Lindens for their beta launch and for seeing this project through.

    I strongly recommend Cory's and Jim's video from the Lang.NET 2006 conference which explains some of the formidable things they did to bring Mono into their simulators.

    I can not stress enough how interesting this talk was. It is a great introduction to SecondLife and it is a great talk on software engineering and the wonderful hacks that they came up with.

    Brady, this is your chance to start hacking on it!

    Posted on 29 Jan 2008 by Miguel de Icaza

    Lang.NET 2008

    Next week, am attending Lang.NET 2008 in the Microsoft Campus, two years ago this conference was a blast.

    Am looking forward to what looks like a fantastic program. Marek Safar, one of Mono's C# compiler developers, will be there as well.

    Since am not really a language designer myself, my talk will focus on discussing a few interesting solutions to a number of problems that we have faced while developing Moonlight and Mono and show a few creative applications that have been built with Mono.

    Posted on 24 Jan 2008 by Miguel de Icaza

    Usability Disaster Story

    In December, someone asked me about how many Mono downloads we had per month to estimate the size of Mono users. With software like Mono the download numbers do not mean much, because most of our users get their software through their distribution, package channels or as a bundled executable.

    Since we are short on space on the machine hosting the files, we do not keep logs for too long, they are rotated and discarded pretty quickly, but we could at least do some guesswork based on a week worth of downloads. The data would not have been very useful, as this story takes place on December 27th, but I was still curious.

    What I discovered with horror as I looked through the logs was that people using Windows and MacOS were downloading software that was two years old. Mono 1.1.7 (released sometime in May of 2005) was the most popular download.

    Only 5% of the Mac downloads were actually getting the latest version, 95% was downloading this two year old version. I don't have my notes handy for Windows, but they were similarly abysmal [Update: found the notes, they were 95% as well].

    The Linux downloads for RPMs were mostly fine (probably because they had to select the architecture from a separate list). But a whole 1/3rd of the people downloading the Mono "Universal Installer" were getting the wrong Mono as well (Update: clarified).

    Using the referrer logs, we tracked down a few problems to people that had linked for their software directly to a particular version of Mono, but this could not explain the popularity of this aging Mono 1.1.7 release, and the logs were very odd, people apparently were selecting this from our list of options.

    This made no sense.

    Can you spot the problem?

    I clicked on our links, they were fine. They downloaded the proper software, the logs matched the download. I was puzzled.

    Only after a while I realized what was going on:

    Since we are using MediaWiki for our web site and we were adding cute little icons for each platform, clicking on the image actually took users to the page for the image. In the Windows case, this was the page:

    	http://www.mono-project.com/Image:Mono_icon_windows.gif
    	

    Which happens to contain the image, and some automatically generated content for the image. Some of the generated content lists all of pages that *link* to the image:

    Now, that looks like a messy page, but most users were picking the largest number they found listed there, which happened to be an old legacy page of ours for the release "1.1.7". Going to this page, would be a very similar download page to the main one, and people at this point figured out "do not click on the image, click on the text". Except now they were clicking on the downloader for this ancient release.

    I have no idea for how long this has been going on, but this is a colossal disaster.

    We came up with a quick fix, luckily, you can replace the markup [[Image:Blah.png]] in MediaWiki with [url] and if the url points to an image, it will insert an unclickable image into the page.

    But the quick fix could not address another problem: we probably had the worst download page in the history of human kind. It was incredibly bad, and you can still see it on the archives.

    In the past few weeks, we wrote the beginnings of a new download page. Users will now be directed to this page, you can see it here. Thanks to the whole team in Provo that put together this new system and the folks in x-m-l that provided feedback on it.

    There is still some work left to do on it, but the entry page is no longer the disaster that it was. Luckily since the correctly on December 27th or so, people have finally been downloading our latest Mono.

    We of course feel terrible to all of the 95% of the users that wanted to try Mono on Windows and the Mac and ended up using a two year old version of Mono.

    Posted on 24 Jan 2008 by Miguel de Icaza

    Free Software Users Taxonomy

    For people in the Windows world, Bruce Byfields' A Field Guide to Free Software Supporters will help them understand the various groups that make up the free software/open source software movement:

    When you look, there are at least seven different types of FOSS supporters.

    To outsiders, these schools of thought are more similar than different. In the same way that many Europeans see few real differences between a New Englander and a Californian, outsiders may see little to distinguish a Softcore Advocate from an Activist.

    It is a great piece.

    This is a great starting point for anyone that is getting involved in FOSS. Understanding that these groups exist and their positions will make it much easier to understand the dynamics of development and advocacy that you will run into while working with the FOSS community.

    I feel that this article could be expanded on in a few areas, but eventually this could become a great taxonomy of the FOSS movement.

    For instance, I think that there is room to dissect the editorialist advocate. This is the do-as-I-say-not-as-I-do advocate which will praise and preach open source, freedom, open systems, open standards but yet always ends up using the latest-and-greatest proprietary, DRM-enabled, crypto-locked gadgets and software.

    Bruce has written a couple of other pieces that I liked on a similar subject: Conspiracy Theorists and Free Software and his follow-up Writing About Conspiracies essay.

    Posted on 23 Jan 2008 by Miguel de Icaza

    New Mono Packages in RPM form

    Last year we ported various ASP.NET Starter Kits and we also started an effort to package popular Mono and .NET-based software in easy to install RPM packages using the OpenSUSE build service.

    The OpenSUSE build service allowed us to submit source packages with a specification on how to build it, and get RPM packages for various Linux distributions and various versions of those distributions. Currently we support Fedora, OpenSUSE and SUSE Enterprise.

    ASP.NET Starter Kits

    The starter kits were a useful test of Mono's ASP.NET implementation, and we routinely use these for QA before we make a release.

    When we did the port of these applications, this is what we did:

    • Switch the database to Postgress (so it is easier to test on Linux).
    • Cooked up a policy that our ASP.NET applications should follow to integrate with the system (Apache or FastCGI and our xsp engine). The docs are currently here and we are going to migrate them into our main server.
    • Integrate the application with the system, you can install and remove ASP.NET apps using the mono-asp-apps command line tool.

    RPMs of the Starter Kits are available from the Mono:Community directory from the build service, we have packages for various distributions there (OpenSUSE, Fedora and SUSE Enterprise).

    The OpenSUSE 10.3/noarch (platform independent, that means, they do not contain any x86 code) packages can be downloaded from here:

    There are of course many new starter kits published at www.asp.net, and someone (hint, hint) should look at porting them as well ;-)

    More Software

    Also, over the past few months we have been packaging some other popular Mono-based applications. Packages can be found from the community page as well, some favorites include:

    Web Apps:

    • MindTouch's DekiWiki: the GUI Wiki from Mindtouch. The cutest Wiki engine in the world.
    • MojoPortal: one-stop portal software based on .NET.

    Hopefully, when it comes to ASP.NET, our recent work on supporting FastCGI with Mono should expand the ways you can deploy ASP.NET apps on your Linux systems (in addition to our Apache support).

    Libraries and Tools:

    • gnome-keyring-sharp (access to the Gnome keyring from your desktop application).
    • Google GData's APIs for C#.
    • MySQL 5 connector.
    • The latest NUnit.
    • OpenTF, client and libraries to communicate with Team Foundation servers.
    • The TAO Framework for building cross-platform OpenGL, OpenAL, SDL, Cg, PhysicsFS and FreeGlut applications with C# and Mono.
    • Mono.ZeroConf, for all your Bonjour needs, with tutorials here.
    • Mono.Fuse: support for writing user-level file systems on Linux using C#. A sample is here.

    Desktop Apps and Libraries:

    • Banshee with ipod-sharp and podsleuth (the latest versions).
    • Gnome-do, the crazy delicious application starter for Gnome.
    • GBrainy, Jordi Mas' puzzles and training game.
    • WF-Apps: a collection of open source Windows.Forms applications that we use to test Mono's Windows.Forms.
    • Last Exit, the Last.FM player.

    Installing the Software

    You can either download the individual RPMs from your distribution and have your browser install the software, or you can subscribe your package management software to the repositories.

    OpenSUSE users for example, have to type this command:

    $ zypper ar -r http://download.opensuse.org/repositories/Mono:/Community/openSUSE_10.3/Mono:Community.repo
    	

    Or add it from the GUI Yast tool.

    After you have done that, the software collection will be ready to use, and you will be able to search for the new packages and install or upgrade software that we put in the Mono:Community group.

    YUM users just need to grab the above .repo file and save it in /etc/yum.repos.d.

    Debian and Ubuntu Users

    Although the OpenSUSE build system supports both of these platforms, it requires us to create new "descriptions" on how to build the software for those platforms.

    So far, we lack the experience and the time to maintain the Debian based packages ourselves.

    We would love if someone with Debian/Ubuntu experience wants to co-maintain the packages here (maybe a script to transform the .spec + sources into a debian package can be written?).

    Future Directions

    We have a long list of things that we want to package for Mono. The only thing that is limiting us at this point is the lack of time (some software needs to be massaged a bit to make it conform to our ASP.NET deployment guidelines, or our Application Deployment Guidelines.

    The Build Service is an open service (and its also open source, if you want to host your own build service in the comfort of your own living room).

    Hopefully some folks in the community can help us package some of the other pieces of software that we have listed there.

    Thanks!

    Thanks to our QA team, Marek and everyone else that has contributed to package this software for Mono.

    Posted on 23 Jan 2008 by Miguel de Icaza

    As seen on JWZ

    As seen on JWZ's blog:

    outrage fatigue

    Posted on 18 Jan 2008 by Miguel de Icaza

    Zing is acquired by Dell

    Zing, the company that created the Mono-based Sansa Connect has been acquired by Dell and is now offering at a discount price.

    They have released a new product for listening to Satellite Radio with Sirius in the US. The Stiletto 2.

    Posted on 17 Jan 2008 by Miguel de Icaza

    Obama Fund Raising

    My friend Nat Friedman is raising funds for the Obama Campaign. If you are an American Citizen or a permanent US resident, please consider donating to Obama's campaign through Nat's fundraiser page (all the money goes to Obama, and you help Nat with his personal fund raising goal).

    Although am myself a Kucinichista myself, I also supported Obama's campaign by donating to Nat's fundraising effort.

    As readers of this blog know, am not a fan of the policies of the last seven years, and as an extension, not really a fan of the republicans.

    On the democratic side, I just can not agree with Hillary on anything.

    I have been personally bothered by Hillary Clinton since this March 2003 incident in which she walked out on the Code Pink girls and was parroting the administration party line.

    These days those that voted for that disastrous war claim that they were "tricked" into voting for it. But like some comedian said recently, "All these democratic candidates claim that they were tricked into War by President Bush. [...] but if you are a person that can be tricked by President Bush you are not presidential material".

    This Flash animation from November 2002 turned out to be prophetic and right on the spot.

    Chomsky turned out to be right: September 2002 interview.

    Fisk turned out to be right: September 2002 interview.

    The French and the Germans turned out to be right as well.

    The facts were there for anyone to see.

    Nat recently pointed out that Obama did not rush to "support the President" like every other drone did. He made a conscious decision at a time when it was not popular to oppose the crooks and liars at the White House.

    Posted on 17 Jan 2008 by Miguel de Icaza

    Writer Strike: Daily Show and the Colbert Report

    Despite the writer's strike, both the Daily Show and the Colbert Report have been fantastic these last two weeks.

    The first couple of days, Stephen seemed to have fall out of shape after this long break, but by the end of last week he was in full Colbert swing.

    They have both been fantastic, and am even more impressed now with John and Stephen. They truly are masters of their domain.

    Still, a few things are missing here and there. I miss "The Word" segment very much.

    Posted on 17 Jan 2008 by Miguel de Icaza

    Good News on File Formats

    Brian Jones posted two great news today on his blog.

    Microsoft has agreed to:

    • Publish their file format specification for the .doc, .xls and .ppt and do this under their Open Specification Promise.
    • To simplify the understanding of the mapping between the old binary formats and the new ones, they will start an open source project to generate OOXML files from the old binary file formats.

    These specs and projects are scheduled for February 15th.

    The full details are on Brian's Blog. These are great news for all third party implementations that need to interop with those documents.

    Some cheering is in order.

    Posted on 17 Jan 2008 by Miguel de Icaza

    Joseph Hill Joins Novell

    Long time Mono contributor Joseph Hill (also an early advocate of Boo, and its integration and use in MonoDevelop) joined Novell today as Mono's Product Manager.

    Joseph will be my peer in the PM organization at Novell.

    Joseph blogs at Beyond Focus and is currently based in Dallas, but will soon be moving to Boston.

    Posted on 08 Jan 2008 by Miguel de Icaza

    GNOME Do Gets Home Page

    David has setup a web site for Gnome DO, my new favorite app. The one that is helping me move away from the shell.

    See some screenshots or his latest screencast.

    For Banshee and Evolution integration, you need to download the extra plugins from here.

    Posted on 06 Jan 2008 by Miguel de Icaza

    Mono goes Accessible!

    Brad Taylor has announced the first release of the Mono Accessibility stack:

    UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.

    Mono's Accessibility Framework is an implementation of UI Automation. The same API that is available for WPF and the framework is used by Silverlight and Windows.Forms.

    Client Code: The initial launch of Mono Accessibility adds accessibility support to applications built with Windows.Forms to be accessible.

    Backend Code: The code has a bridge that talks to the existing ATK framework on Linux.

    In the future the Mono Accessibility framework will be used in our own Moonlight 2.0.

    Check the release notes, install from source or use OpenSUSE's 1-click install.

    Posted on 05 Jan 2008 by Miguel de Icaza

    Obama Wins Iowa

    Wow.

    Barack Obama just won in Iowa.

    It was nice to see that Dennis Kucinich endorsed Obama on the second Iowa ballot.

    I love it! Go Obama!

    Obama speech at Youtube.

    Posted on 04 Jan 2008 by Miguel de Icaza

    Moonlight

    My good friend Robert O'Callahan discusses Silverlight on his latest blog entry, in particular, he asks the question:

    No matter how good Silvelright is or how bad the alternatives are, Silverlight domination will be a really bad thing for free software so I question why Miguel wants to push in that direction.

    Robert, it is very easy.

    I have been using Linux as my main desktop operating system since 1992 and endured every missing feature, every broken driver, every broken X setup and every missing application since I started.

    I did so because it was free software, and I had decided that I wanted to run my entire system with free software. I felt that dogfooding Linux and improving Linux on a day-to-day basis would help improve this OS as opposed to improving a proprietary OS.

    Sure, using a proprietary OS had its benefits: more consistency, more QA, more applications, lots of support, latest video drivers, but they were not free. So I stuck with free software. Today the only proprietary software that I use on my desktop is Flash (I have acrobat installed, but I use Evince instead, keep it for those cases where Evince has a bug).

    From my perspective, it is crucial for Linux to have good support for Silverlight because I do not want Linux on the desktop to become a second class citizen ever again.

    Robert, you are asking those of us that use FOSS operating systems to "take one for the team" by not endorsing Silverlight, but yet, you are not willing to live among us. If you are going to preach, preach by example.

    The core of the debate is whether Microsoft will succeed in establishing Silverlight as a RIA platform or not. You believe that without Moonlight they would not have a chance of success, and I believe that they would have regardless of us.

    In fact, I believe strongly that it is part of Microsoft becoming more open and adapting itself to the multitude of shifts in this industry (open sourcing IronPython, IronRuby, the DLR, the JS library for ASP.NET, the MS-PL, the MS-RL, opening up their code, and so on).

    Ever since I met Benjamin Zander am a hopeless romantic, and believe in a world of possibility. I find myself to be happier this way than joining these ranks. And what better way of bringing Silverlight to Linux than to work together with Microsoft: they are giving us specs, they are giving us their test suites, and they are providing technical assistance. Its been a pleasure to work with them, and everything we write is open source software, I for one, could not ask for more.

    Now, regardless of the strategic discussion about endorsing Silverlight, there are technicalities about Silverlight that make it a fascinating platform. I personally want to write cross platform web applications using C#, Boo, Python and Ruby. And that matters to me, and matters to others.

    And I have loved Silverlight since it embedded the CLR runtime. Nothing new there, you can read the gory details of my fascination from back then.

    You advocate using standards that are implemented by multiple vendors. But what if none of those vendors is providing what I want? What if the vendors do not care about my opinion?

    What we got here is a case of an underserved market.

    This is why competition is good. Now Microsoft is providing something that none of the existing web vendors had provided and some of us want. I liked it so much, that I did not hesitate for a second when a journalist asked me whether we would do an OSS implementation of it. "Can I quote you on that?" he said during the coffee break at Mix "Yes, you can".

    You talk about Microsoft's control over Silverlight.

    What prevents anyone from taking the Moonlight source code, embracing it, extending it, innovate with it, prototype with it, and enter the same cycle that Linux, or web browsers have entered? Or someone turning it into a standard?

    Nothing.

    The only thing preventing it is lack of imagination.

    Posted on 04 Jan 2008 by Miguel de Icaza

    Plastic 2.0 Preview

    The guys at Codice Software have just announced the release of their Plastic 2.0 Preview.

    Plastic is a cross-platform, distributed source code control management system that has a few interesting features like visualization and it integrates into a number of IDEs.

    This is a Windows.Forms application that was originally built for Windows and they have created their own look and feel across multiple platforms. Here is Plastic running on a Mac with our new native drivers for OSX:

    And this one is showing their diff tool on Linux:

    We are very excited to see a happy Mono user making their software available on new platforms.

    For a full tour of the new features see their blog entry.

    You can test drive Plastic with their VMware image.

    The Plastic guys are great in that they provide great bug reports and are working with our Windows.Forms team to iron out some of the wrinkles in our Windows.Forms implementation.

    Posted on 03 Jan 2008 by Miguel de Icaza

    Mono on the OLPC

    My good friend Torello Quercy has been working on creating OLPC activities using Mono.

    He wrote a tutorial on creating Mono-based activities for the OLPC.

    See his blog for screenshots of his own game and a port of Jordi Mas' GBrainy and how he Sugar-ified the apps:

    GBrainy Sugarified on the OLPC.

    You can get the activity bundles from here and here.

    Posted on 03 Jan 2008 by Miguel de Icaza

    Language Shootout

    Alvaro points out that in the Language Shootout Benchmark Mono comes in 18th place compared to Java's 10th place.

    We know that Sun's proprietary Java edition (not the open source one, as that one is nowhere to be found yet) is faster than Mono, but I was surprised that we were so far behind. So I looked at the comparison between Java6 and Mono.

    Memory usage wise, we mostly come ahead, but in performance, there were two places where Sun's server VM beat Mono seriously in performance (5x or more), one is the regex-dna test and the other one is pidigits test.

    The regex test is a test of the regular expression matching engine in the class libraries, not really a test of the language or VM performance, but library implementation. Clearly, our Regex implementation could use some work.

    The pidigits test was showing up as 6x better with Java than with Mono. But the test is basically comparing C# vs assembly language. In Mono's case it is using a full C# implementation of BigInteger while the Java version uses the C/assembly language GMP library that has been tuned with hand-coded assembly language.

    I ported Java's pidigits to C# to also use native GMP, and the results are promising, we now have a 4.7x speedup and the process size is one megabyte smaller. I was unable to test the Java version on my machine, as I could not find the native "libjgmp" library.

    I wonder what the policy is for the language shootout to use external libraries. If its ok, I should contribute my port, if its not, the Java test should be rewritten to be a fully managed implementation.

    If you run all the tests the gap between Java and Mono goes from 8 places, to 3 places; If you remove the two bad tests (Our Regex implementation, and the pidigits test) Mono is only one slot behind Java server; and if you also account for memory usage (but still account for all the tests), Mono comes ahead of Java.

    Of course, we got homework to do: why is our Regex implementation so much slower?

    Update: As it turns out, Mario Sopena pointed out that, another 25% performance improvement can be achieved if the implementations are similar. The C# sample does a lot more regex work than the Java implementation does. The Python implementation has further refinements on the algorithm that could improve the performance further.

    Some Observations

    It is interesting to see in the benchmarks the progression:

    • Close to the metal languages are the first tier (C, C++, D, Pascal, even Eiffel).
    • Compiled functional languages come next (OCaml, ML, Haskell, Lisp).
    • Java and Mono are on the next tier.
    • A big jump comes next: Erlang, Smalltalk, MzScheme.
    • Next big jump: Pike, Perl, Python.
    • Another jump: PHP, Javascript.
    • Tcl: a class on its own.
    • Ruby, last one.

    There are a few rarities, like Fortran being in the same tier as Java and Mono, which probably means the tests for Fortran have not been tuned up, I would expect it to be in the same tier as C.

    Also, am surprised by Ruby being the last on the list, I expected it to be roughly in the same range as Python, so I suspect that the tests for Ruby have not been tuned either. Update: my readers also point out that Ruby 1.9 will improve things.

    Update: I just noticed that Eiffel is on the first tier, performance wise, but has pretty much all the properties and features of the third tier (garbage collection, strong typing, bounds checking). This means that you get the best of both world with it (and Eiffel's compiler is now also open source).

    Language Productivity

    And of course, at the end of the day, what matters is how productive you are writing code in a language. The Wikipedia is powered by PHP, Amazon by lots of Perl and C, Google uses Python extensively, and the stellar productivity that can be achieved with Ruby on Rails is hardly matched. So even if your language is slower than the first few tiers, to many developers and sites deploying software what matters is productivity.

    Choosing between Mono's C# and Java, both languages being roughly on the same class, is a function of the libraries that you use, the ecosystem where the code will be developed/deployed and to some extent the language.

    Alvaro's teammates at Sun have a difficult challenge ahead of them when it comes to the language: how to fix a language that has been so badly bruised by their generics implementation, their refusal to acknowledge delegates, the ongoing saga over the catastrophic closure proposals [1] and the lack of a strong language designer to lead Java into the future.

    So even if we have a slow regular expression engine, we have working closures, iterators, events, the lock and using statements in the language and LINQ.

    Of course, I wish them the best luck (in the end, Mono is a language-independent VM, and we are just as happy to run C# code as we are running Java code, which incidentally, just reached another milestone) and we certainly plan on learning from the open source Java VM source code.

    Alternatively, you can use Mainsoft's Grasshopper to write C# code, but have it run on a Java VM.

    [1] Am tempted to write a post about the mistakes that both Java closure proposals have. But it seems like it will be a waste of time, it feels like there is just too much hatred/NIH towards C# in that camp to make any real progress.

    Posted on 28 Dec 2007 by Miguel de Icaza

    Paint Mono Update

    paint-mono is a port of Paint.NET. The only way it could be built in the past was using a development version of MonoDevelop and there was no way of generating packages for it.

    Since then, MonoDevelop has progressed to the point where it can generate standard Unix makefiles and generate the proper scripts, pkg-config files and produce code that conforms to the Mono Application Deployment Guidelines from a Visual Studio solution.

    It is now easier than ever to try Paint.NET on Linux, all you need is:

    • Mono 1.2.6.
    • Your favorite form of Unix (Linux, BSD, OSX, Solaris).
    • An SVN client.

    To build it, use the following steps:

    	$ svn co http://paint-mono.googlecode.com/svn/trunk/src paint-mono
    	$ cd paint-mono
    	$ ./configure
    	$ make
    	$ make install
    	

    To run, just type "paintdotnet" on the shell, this should come up:

    I have not spent much time porting the SystemLayer.dll, but it is enough to access most features in Paint.NET. A real method-by-method audit needs to be done for the port to be considered complete though.

    We are calling it "Mono Paint" as the authors of Paint.NET have requested us that we do not use the same name for the porting effort. The idea is that eventually the port will merely be a drop-in replacement for the "SystemLayer.dll" the library where all the OS-specific code is located.

    For more details on downloading it, filing bugs, or tracking the project, see the paing-mono's home page at Google Code.

    Posted on 21 Dec 2007 by Miguel de Icaza

    Colorful Error Output

    This is a cute hack that I put together today.

    For months I have wanted to colorize the output of the compiler for errors. Sometimes in a sea of warnings its difficult to find the error that broke the build with a quick visual inspection.

    Most civilized people use IDEs, or even Emacs to build their stuff, but for some reason I end up building from an xterm all the time.

    Today I introduced the MCS_COLORS environment variable that the compiler will use to configure its colors, the default. This is the default, witness this high-tech beauty:

    My personal default is slightly different, as I use grey-on-black terminals, its more of a DOS-days Turbo-Pascal kind of color scheme for errors:

    This is my personal setting:

    	export MCS_COLORS=errors=brightwhite,red
    	

    Am not making this the default, it seems too strong for public consumption.

    If you absolutely hate this, you can use:

    	export MCS_COLORS=disable
    	
    Posted on 21 Dec 2007 by Miguel de Icaza

    I did not see this one coming

    Am not sure how come I never made the connection between Matt Warren and his involvement in C# 3.0 and LINQ (I only made the connection while reading Tim Anderson's review of VS 2008).

    I have been re-reading his blog in fascination in my spare time, but this caught my attention:

    Ever since I joined up with the C# team nearly two years ago I've been frustrated by my inability to wax poetic about all the goodness we were working on. I was sworn to secrecy. Mum was the word. Perhaps if you were paying attention to the work in C# 2.0 and C-Omega, you may have guessed what was to come. Looking back, it's easy enough to recognize it in the design of Generics, Iterators and Anonymous methods. The existence of Nullables in there as well should have made it obvious. We were planning ahead for the big pay off, language integrated query.

    You may be amazed that so much planning goes on in the features that we roll out version to version. Sometimes big ideas and far-reaching visions take many releases to come to fruition. You cannot always do them in one release. Sometimes you have to take a risk and dole them out piece by piece. This may cause a bit of confusion at first, when no one can truly understand why a particular feature was included and not others, or why one design was chosen. Yet once all the pieces are together you can finally make sense of it all, and then as if by magic it all just seems right.

    At some ECMA meetings in 2004 (the time stamps for some of my notes on the disk are January of 2004) some of the new features were being presented at ECMA and it was obvious to see the benefit for those features (generics, check; anonymous methods, check; iterators, check; partial classes, check) but a few of the features made no sense.

    Nullable type decorations made no sense to me ("int? a"). I remember feeling that they were pure compiler bloat and that the use case of databases made no sense. Am not a database developer, but I felt that the syntactic sugar at the time really was not bringing much to the plate. During one of the meetings, I remember putting together a parody for new type qualifiers (which is the timestamped file I kept) for other domain-specific features that I felt were just as useless.

    Even with early access to the C# 2 specification for so long, I did not see these components coming together and fitting perfectly to create LINQ.

    Posted on 19 Dec 2007 by Miguel de Icaza

    gui.cs update

    After the world acclaimed announcement of gui.cs eight months ago the developer user base has doubled!

    That is correct. We now have 2 (two) applications using the awesome gui.cs rich-console-application development platform to deliver the best ncurses has to offer to all those vt100-derived emulators:

    You can see some screenshots.

    Of course, the UI still has to support some legacy users that require GUI support (Vista with Gtk# and the same app running with Gtk# on KDE).

    Although I had a great testimonial from my first user, it was not suited to be printed on a family blog.

    Posted on 18 Dec 2007 by Miguel de Icaza

    Nat in Boston

    Nat just landed, and we were touring the office when we ran into a messy room.

    Nat: what happened here?

    me: Oh, that's the xbox room.

    me: but the xbox is not here now.

    Nat: so what do you call this now? "The room"?

    Posted on 18 Dec 2007 by Miguel de Icaza

    Mono/Winforms jobs: follow up

    Calvin who is way better organized than I am posted the details about the job positions at Novell working on UIA for Linux.

    In Calvin's blog there is a link to Michael's details about the work that they will be doing.

    You can still send me your information, I will likely help the guys doing the interview, but the actual HR-esque process that organized people at Novell use is available.

    Again, these are not a jobs in the Mono team, but in the desktop team although plenty of the code that you will write will end up in the standard Mono distribution.

    Posted on 17 Dec 2007 by Miguel de Icaza

    We are hiring: Accessibility Work

    We are doing some work to make Windows.Forms and Moonlight accessible. The desktop team is hiring people for the Cambridge office (USA) that want to work on accessibility technologies, free software, C#, Mono and the UI Automation framework.

    If you are interested, drop me an email with the subject line "AccessibilityJob" and we will reply in the next couple of weeks with one of those exercise interviews that we do.

    Although a lot of the work will end up in Mono, this is part of an effort from the desktop team, so technically you will be reporting into a different organization than the Mono team.

    Posted on 14 Dec 2007 by Miguel de Icaza

    Hopeless Romantic

    The Dennis Kucinich campaign is doing a fund drive this Saturday. You can sign up here or contribute directly by clicking on "Contribute: Online" at the top.

    Reddit-poll after reddit-poll has shown that am most closely aligned with Kucinich than any other candidate for president of the US. Read the summary of his positions:

    More details: here.

    Posted on 14 Dec 2007 by Miguel de Icaza

    Diabetes Experimental Treament

    My dear friend Chris Toshok recently discovered that he had developed diabetes.

    Tomorrow he is going to be admitted into an experimental treatment program for it. He will undergo four days of treatment.

    The day that he told us about the experimental program, I had just seen this:

    Good luck Chris!

    Posted on 12 Dec 2007 by Miguel de Icaza

    Essential Chomsky

    Amazon reports that a new Chomsky book is on the pipeline. Essential Chomsky. Hope it is as awesome as some of the collected essays from Gore Vidal.

    Am myself a fan of his Understanding Power book. Maybe as much as a fan of it, as a fan of the various Gore Vidal books that they sell on airports, the pocket book editions (Imperial America, Perpetual War for Perpetual Peace).

    Posted on 12 Dec 2007 by Miguel de Icaza

    Wii Remotes

    Guy Lunardi just emailed me a link to a very clever hack from Johnny Chung Lee at CMU.

    How to use the Wii remote to capture finger movement. A brilliant hack.

    The Wiimote library is released under the MS-PL, and I think this requires a port to Linux. I have added this wish-item to the Google Highly Open Participation project for Mono.

    Posted on 12 Dec 2007 by Miguel de Icaza

    Wanted: Game Console

    Having missed on games for the past 15 years last year I finally got myself a Wii. Other than Wii Sports and now Metroid 3, I have yet to find anything worth playing.

    Nat recommended a Nintendo DS, and you guys had some great suggestions back in September. So far the only one I liked was Metroid Hunters (the control is so similar to the Wii, that its a pleasure to play) and am still making my way through the Sudoku's on the DS.

    I tried Halo3 but with its up/down/left/right-cursor-like technology to aim at enemies, it feels almost like am playing with a keyboard in 1988. After using the Wii for point-and-shoot, anything short of that for point-and-shoot feels unnatural. Like when the dentist stuffs your mouth with junk and still tries to have a conversation with you or trying to use a bendy straw for snorkeling.

    So am looking at expanding my Console Empire at home and purchasing either a PS3 or an XBox360. Aaron insists that I should not get the PS3 because Blue Ray this-and-that which I do not particularly care about.

    Aaron also claims that eventually you get used to up/down/left/right. I guess I will have to live with that, as the Wii is barely getting any games worth playing. And as a rule, I do not play anything that glorifies war, but am OK shooting at strange looking aliens.

    So am stuck, and willing to learn to use those unnatural controls on the PS3 and the XBox if there is something worth playing.

    Dear readers, what should I get, PS3 or XBox? And which games are worth playing? I do not care about movies on demand, or whatever other TV features they are trying to sell me, I already have Tivo HD and Tivo with DVD playback and recording.

    You can either email me or post here your suggestions.

    Posted on 08 Dec 2007 by Miguel de Icaza

    Embedded, its not part of foreplay, but it is still very important.

    I still hate the classification of anything that describes itself as enterprise (and I work for a company slogans are sprinkled with enterprise).

    Yesterday someone emailed me:

    It was not the point of your blog today but I'd be interested in hearing about company's usage of Mono in embedded systems. Because of our affinity for C#/.NET we originally looked at WinCE for the next generation of one of our product platforms. It didn't go very well (we were still at WinCE 5 so I can't say how 6 is). Ironically, using Mono on a Linux Embedded system seems to give you more .NET / C# then you get with CF on WinCE.

    So I reached out to a friend that has raved about Mono in the past, and I wanted to get a quotable answer from him (I asked him if I could quote one of his emails from last year). He did give me a quote that I can send around to folks, but his company will not publicly endorse his quote.

    Which is exactly the problem that I was describing yesterday. Anyways, the quote is:

    C# and mono is a great way to develop embedded products. If you separate the heavy lifting from the application logic properly, the performance impact of C# is not significant and makes application development much faster and less buggy.

    I've been doing embedded development with C# for over 5 years and mono is way better than .NetCF due to superior performance and binary compatibility with MSFT's desktop .Net.

    One thing that is particularly handy is that you can prototype on a desktop PC and just drop the managed binaries on the device and they just work - no need to recompile.

    So anyways, you are going to have to trust me that I did not make up that quote myself.

    And today we delivered a gift (or in Don Box parlance, a "small bouquet of flowers") for those embedded people that use ARM processors.

    Update: The author of the quote comments:

    When you mention embedded development with mono, it might be worth mentioning that there is some startup cost for the JIT, depending on the CPU speed and how much managed code there is, and that the memory footprint with mono will be larger than it would be without. For most devices this may not be an issue, but it is something a device developer should keep in mind. Hopefully the AOT support will mitigate the startup costs.
    Posted on 07 Dec 2007 by Miguel de Icaza

    Pre-compilation support for ARM processors

    Zoltan just checked-in support for ahead-of-time (AOT) compilation in Mono for ARM processors.

    We are looking for volunteers to test the support and post their findings to mono-list@lists.ximian.com. In particular, we are hoping that this should further reduce startup time and memory usage on Maemo devices.

    An old post of mine covers the basics of using it.

    Posted on 07 Dec 2007 by Miguel de Icaza

    Track Moonlight Status

    Rusty has setup a nice page that tracks the Moonlight 1.0 status with various applications out there. We are using this as part of our QA and development process.

    As it turns out, it was easier to support .NET-based Silverlight (1.1) applications than the Javascriped-based ones (1.0) as the .NET-based ones tend to do all the heavy lifting in managed code. And it was very easy for us to use tools like corcompare to ensure API completeness.

    With 1.0, the story was different, we were debugging things on a when-we-find-a-problem-we-fix-it approach. JB recently created a tool based on the Microsoft specifications that helped us close the gap quickly. We went from hundreds of missing entry points to less than a dozen in a week.

    We now have cute Firefox installers for 1.0 and 1.1 on Linux/x86 and Linux/x86-64, once we have the new codec framework in place we will make them available to the public for testing. In the meantime, people interested in testing Moonlight still need to build it themselves. See our Mono Olive mailing list for details.

    Posted on 07 Dec 2007 by Miguel de Icaza

    Mono Usage in the Enterprise

    Over at the Enterprise Linux Blogs there is a quite positive article about Mono and I wanted to comment on it without having to fill 20-pages worth of questions to post a reply there.

    Schley makes a few good points, but its worth pointing out some things:

    2. People assume that Mono is not ready for the enterprise.

    One of the reasons for this is because not many enterprise projects are being built with it (I'll get to that later.) Instead, Mono is primarily being used to construct desktop software.

    The second reason for this misconception is the Mono project's inability to stay in step with Microsoft .NET. Currently, Mono is somewhere between .NET version 1.1 and 2.0 while .NET 3.5 was just released. This is not the Mono team's fault. Microsoft does not collaborate with them, so everything the Mono team accomplishes is through their own blood, sweat and tears. Nevertheless, this version discrepancy creates the perception that Mono is just a .NET wannabe.

    [...]

    With the exception of iFolder, Mono is not being used to develop any truly useful enterprise applications. Great desktop applications are being created, like Tomboy and Beagle, but no one has created the next great server application using Mono.

    He is correct that Novell's use of Mono has been mostly focused on the desktop.

    But there are quite a number of applications beyond the desktop that are being developed with Mono outside Novell. We have been tracking a list of companies using Mono and the list of programs and libraries keeps on growing every day.

    A problem that we do have is that of the companies using Mono have policies of not publicly endorsing third party products. Also, we typically only find out about who is using Mono when they have a bug to report, or need some new feature to be implemented. And in many of those cases we are not in a position to use them as reference customers.

    If you look at the posts, sigs and domains of people posting to the forums and the mailing lists, you will get a better idea of what kind of applications people are building, and who is building them.

    A few companies have agreed to allow us to publish success stories about their use of Mono, some of them are:

    Some other serious uses of Mono, but without a full success-story case include Fiducial.FR (their intranet runs on Mono), Zing (mp3 and Sirius radio players), Medsphere (Health Care software), Quantify Solutions (financial tools), MindTouch (commercial Wiki hosting) and its even used by companies in the USC 2257 space to build enterprise solutions (for an interesting definition of enterprise).

    At least a few years ago, the Wikipedia search engine was powered by Mono. I do not know if that is still the case.

    The goal of the Mono team at Novell is not only to help our internal users, but to make sure that external developers can use Mono without a problem. We fix bugs, improve performance, improve compatibility and write new libraries (both Microsoft compatible, or part of Mono's own stack).

    Maybe the issue is that we do not have a lot of server-side applications that are part of a default Linux install. What we do have are plenty of vertical applications that people are developing or porting.

    Memory Leaks If you have ever used Beagle you know that it can heinously crash your system. Since it's inception, Mono has been plagued with a random memory bug. Your system memory will go from 1% to 1000% in a matter of seconds, without warning. If the Mono developers want to make Mono more than just a desktop hobbyists language then they need to fix this bug once and for all.

    As for memory usage problems: there are certainly memory leaks in Mono, but nothing as bad as a show stopper. Mono can not reduce memory usage if an application uses a lot of memory. Sometimes the blame for memory consumption falls on the application and is usage patterns.

    Beagle might have had bad memory usage patterns on its early days, but a lot of this changed in newer releases.

    There is one particular class of memory-hungry applications: any .NET applications that used generics (the 2.0 profile) extensively was negatively impacted by memory consumption before Mono 1.2.5. On one hand, we are glad that application developers switched to 2.0, as they helped us find the bugs and limitations in Mono, but it also meant that users had to suffer as we understood all the ramifications of the 2.0 profile and generics.

    The situation will dramatically improve with our upcoming Mono 1.2.6. As Aaron already reported 1.2.6 had a dramatic impact on memory usage in Banshee (a generics-heavy application).

    Python Effect There is a huge movement in the Gnome community to make Python the standard language for Gnome development. Mono is a close second, thanks in part to the great desktop applications being written with it. However, if Python is officially adopted, there will be a backlash against Mono, or pressure on developers to adopt Python and port their once Mono applications to the official language. In order to prevent this from happening, Mono developers need to demonstrate Mono’s cross-compatibility.

    Python is indeed making great strides as a desktop development platform and am not sure that we are in the business of competing with it. If people like writing Python code, they should just keep writing python code.

    Myself, I like the IronPython variation of Python more. IronPython just happens to be JITed Python and in most tests it is faster than CPython. For the past year or so, we have also been in love with Boo, another .NET language. Boo has support for strong typing, so for certain scenarios you will get even better performing code (basically, when you can determine the type of a variable ahead of time, instead of having the variable be entierly late bound).

    At the Mono Summit, a developer had built a game that was scripted with Python, said something more or less like this: "Our game used to be very slow, when we switched to Mono, all those problems went away" (edited for political correctness).

    So each developer will make up his mind as to what is best for a particular use case.

    The Mono team needs to have Mono installed by default into Linux so that if you write an application with Mono it can run in Windows AND Linux (and even OS X).

    We agree with that. Applications built with Mono on Linux already work on Windows and MacOS (including Windows.Forms).

    When it comes to Gtk# applications, Our Mono on Windows ships with Gtk# and we recently announced that we will be supporting it as well on MacOS X and that we will be extending our OSX support.

    Posted on 06 Dec 2007 by Miguel de Icaza

    Real Time Linux

    Today there was some claims from a Red Hat VP regarding Novell shipping of Real Time Enterprise Linux.

    I find it odd that Red Hat would make those claims, as for more than a year on all sorts of meetings SUSE Real Time development status updates come back and forth. Usually they are high level, but we get to hear a lot about Moiz's team work at these meetings.

    Kevan Barney from Novell PR posted a response to the claims that Novell has not contributed code. And points to the mailing list where you can see that Novell engineers have been contributing code and participating on Real Time Linux with the rest of the community for a long time.

    Posted on 05 Dec 2007 by Miguel de Icaza

    Pure Comedy

    It can not get better than this.

    The neoconservatives response was swift, check the professionally summarized version of all the punditry in one easy blog post.

    Posted on 04 Dec 2007 by Miguel de Icaza

    Love Kucinich

    This is just brilliant.

    Hope my American friends like Kucinich as much as I do.

    Update: Slate covers the health plans. Kucinich is the best.

    More Kucinich Awesomeness: New NIE Report Shows Bush Administration Has Once Again Tried To Falsify Grounds For A War With Iran.

    Posted on 04 Dec 2007 by Miguel de Icaza

    Mono on OSX, Win32

    In general, the focus of the Mono team is on Unix system, and more specifically for open source versions of Unix (Linux and BSD) but we still provide provide some support for Win32, Solaris and OSX even if they are proprietary and OpenSolaris (even if its licensed for mininal collaboration and cross pollination with Linux).

    In general, our cross platform story has suffered a little bit when it comes to GUI toolkits: our Windows.Forms implementation works with X11, but Mac users really want to run a native version of it, without requiring an X server.

    Gtk# suffers from the same problem: it works on X11, OSX and Windows, but on OSX it requires the X11 driver which is suboptimal.

    In general, I do not like to support proprietary operating systems, but in the particular case of OSX, there is enough of a user-base that it made sense to bend backwards for the sole purpose of increasing the contributor and user bases.

    At the Mono Summit we outlined our new strategy for OSX:

    • Our Windows.Forms now has a native OSX back-end. Mono 1.2.6 will ship with it, and Mono 1.2.7 will ship with several upgrades (some already on SVN) that will make Windows.Forms applications run even better on OSX.
    • We will distribute Imendio's Gtk+ for OSX and Gtk# as part of our runtime. It has now reached a maturity point that allows applications like MonoDevelop to run natively (without X11).
    • We will distribute MonoDevelop for OSX users as a pre-compiled package, and we will provide support for it.
    • MonoDevelop will also be ported to Windows. The work necessary to port MonoDevelop to OSX is also going to help the port of MonoDevelop to Windows. This should be useful for people that are building Gtk#-centric applications on Windows. For other uses Visual Studio and SharpDevelop will continue to be better IDEs to use.

    We will support the following, but only as a lower priority, and work on them will be preempted by other needs in Mono:

    • We will support Objc-Sharp for those that need bridges between Objective-C and Mono. But
    • We will depend on the community, and provide some assistance to those that rather use the CocoaSharp bindings to the native Cocoa APIs.

    A screenshot of a Windows.Forms app running with the native driver (click for a full shot):

    A screenshot of MonoDevelop, our Gtk# based IDE on MacOS with Gtk's native OSX driver:

    We are shipping MonoDevelop 1.0 at the end of January, after this, we will start work on the debugger integration into MonoDevelop (the most requested feature) and we will also add support for developing Silverlight applications with it.

    At the Mono Summit, we got Moonlight running on MacOS X (including desklets!) which means that our Silverlight designer (currently called LunarEclipse) will be available on MonoDevelop on OSX. But we will not support Moonlight on the browser on Safari or Firefox on OSX as you can run Microsoft's edition there.

    Posted on 02 Dec 2007 by Miguel de Icaza

    The Mono Summit is Over

    The summit was fantastic. The first two days we did a bit of internal planning for the project (we had Novell employees and contributors that day).

    Although I had originally wanted to have as much empty space as possible to do some more Unconference style presentations, we probably had too much structure in place. At least we had some large holes between presentations for people to talk to each other (except that not one talk finished on time, which meant that we were always a few hours later to end the day).

    The event was supposed to end every day at 17:45pm, but most of us barely left the place before 9pm (which was nice of them, to keep the place open for us until late). Followed by a late-dinner in Madrid, and a then some socializing in the hotel lobby or nearby bars turned into four hours of sleep every night.

    Thanks to everyone that made this happen, and for our Ismael Olea who provided our logistic support at the event every day and Alejandro S�nchez that got us this beautiful venue in Madrid.

    I hope that all the attendees got to talk to the team members; I know that many of you did, and I hope that we fixed your issues, or we came up with a solution for your issues.

    Posted on 02 Dec 2007 by Miguel de Icaza

    XML Conference

    Next week I will be attending the XML Conference here in Boston. Am looking forward to the opening keynote on Monday by Douglas Crockford.

    My friend Rich Saltz invited me to talk about Moonlight: our open source implementation of Silverlight on Linux (Wednesday).

    On Tueday I will talk about our efforts to support both ODF and OOXML at Novell in our edition of OpenOffice.

    Posted on 02 Dec 2007 by Miguel de Icaza

    Botijos in New York City

    My friend Karla Frechilla will be presenting her artwork in New York City starting this Saturday until the 15th.

    There will be an opening reception on Tuesday December 4th from 6 to 8 pm at Jadite Galleries 413 W 50th St in New York City.

    She will be presenting her Botijos as well as some of her paintings.

    Posted on 30 Nov 2007 by Miguel de Icaza

    Generics Memory Usage

    Aaron walked into my office today to get some some feedback on some implementation detail for his new listview in Banshee.

    Before he left the office he said something like, but not necessarily "In some Microsoft blog someone commented that I should not use generics for small arrays of value types" (see Update at the bottom).

    So we decided to measure with a trivial program the memory consumption for storing small arrays with and without generics with Mono 1.2.5 and Mono 1.2.6.

    Storing 8 megs of ints (32-megs of data) on an array of objects has a high overhead: the actual data, the box, the object lock which means that you end up using about 21.5 bytes per int:

    		object [] e = new object [size];
    
    		for (int i = 0; i < size; i++)
    			e [i] = 1;
    	

    With a generic array, you are as close as possible to a real array and you only consume 38 megs of ram (this is the full process size, the 32 meg array plus the Mono runtime, JIT, etc), the following sample ensures that am not using a regular int array, but an instantiated generic class with ints:

    		public class D<T> {
    			public T [] t;
    			
    			public D (int size)
    			{
    				t = new T [size];
    			}
    		}
    
    		D<int> d = new D<int> (size);
    		for (int i = 0; i < size; i++)
    			d.t [i] = 1;
    	

    The regular collection consumes 178 megs of ram, while the generics collection consumes 38 megs of ram (when running with Mono).

    I was a bit shocked about the 178 megs of ram used by regular object wrappers, so I wrote the equivalent for Java, to see how they fared compared to Mono:

    	      Object [] x = new Object [8*1024*1024];
    
    	      for (int i = 0; i < 8*1024*1024; i++)
                         x [i] = new Integer (i);
            

    Java uses 248 megs of ram, so it is chubbier than regular C# at 30 bytes per boxed int on average (this was with Sun's Java 1.6.0, maybe there are newer versions, but thats what I got on my system).

    I got no Java/generics skills to implement the above with Java, but since Java does not really have generics at the VM level (they are implemented purely as a language-level feature), I do not think that the numbers would be significantly different).

    Mono 1.2.6 also introduces a number of memory reduction features for generics that reduce the size of our interfaces. When using generics, in 1.2.5 on a List<int> case we were generating a lot of useless stuff:


    IMT tables size: 7752
    IMT number of tables: 102
    IMT number of methods: 2105
    IMT used slots: 872
    IMT colliding slots: 486
    IMT max collisions: 27
    IMT methods at max col: 134
    IMT thunks size: 19060

    With the upcoming 1.2.6 release the memory savings for the metadata kept resident by the runtime are also significant:


    IMT tables size: 7752
    IMT number of tables: 102
    IMT number of methods: 4
    IMT used slots: 2
    IMT colliding slots: 1
    IMT max collisions: 3
    IMT methods at max col: 3
    IMT thunks size: 34

    There is still an issue of locality. Using the boxing collections has the advantage that the same code is shared across all possible types. The generic versions on the other hand get their own JITed versions of every method involved (at least today).

    You can track Mark's progress to change this as he continues with our implementation for generic code sharing.

    Summary: From a memory consumption point of view, the bottom line is: if you are storing value types (non-object values like ints, longs, bools) it is better to use generic collections (System.Collections.Generic) than using the general-purpose collections (System.Collections). If you are just going to store references to objects, there is really no difference.

    Update: The comment was from Rico Mariani, and the source of the confusion was:

    List<T> offers generally better performance than ArrayList as well as type safety. We recommend using List<T> over ArrayList always if T is a reference type. If T is a value type there is additional cost assocated with creating a specialized version of List<T> for that value type. When T would be a value type we recommend List<T> if the savings in boxing is greater than the cost of the additional code -- this tends to happen if you store about 500 elements across all your List<T> objects.

    OK, so the confusion is not that it might be worse for value types, but that the JIT will have to generate specific instantiations of generic methods (Insert for example) based on the parameter type.

    So the JIT generates separate code for a List.Insert of int and for a List.Insert of long. Considering the savings for even small apps, I will go with "Go wild with the value types" myself as the code for the collection code is really small.

    Posted on 21 Nov 2007 by Miguel de Icaza

    Javascript Decompressor Roundup

    Thanks to everyone that emailed me answers to the Javascript decompressor issue. This is a reply in case other people are looking at ways of de-obfuscating or have to debug some compressed Javascript code.

    I included the names of the nice folks that emailed me, and some comments for those that I actually tried out.

    Some annotations:

    • [CMD] works from the command line, my favorite kind.
    • [WEB] Provides a web UI.
    • [GUI] GUI
    • [SOURCE] comes with source code.
    • [WINDOWS] Windows-only

    Here they go:

    • [WEB, CMD, SOURCE] Beautify is a PHP-based, server-side decompressor. This was the one I used to debug some of the problems we were having, and the results are very good. Source code is available for you to run on your local server, or you can reuse it from the command line (some assembly required for command-line use).
    • [CMD, SOURCE]Qooxdoo's pretty printer written in Python (Fabian Jakobs, Sebastian Werner), to use:
      $ INSTALL_PATH/frontend/framework/tool/modules/compiler.py file.js
      		

      Alternatively, you can get only the pretty printer from SVN:

      $ svn co https://qooxdoo.svn.sourceforge.net/svnroot/qooxdoo/trunk/qooxdoo/frontend/framework/tool/
      $ modules/compiler.py -w originalFile.js
      		
    • [WEB, SOURCE] Beautify.aspx. Get the source code as the link from their web page is broken (Jokin Cuadrado, Steven Coffman).
    • [GUI, WINDOWS] A Plug-in for Fiddler: Fiddler is a Windows HTTP debugger, if you are using Windows and Fiddler this plugin might be for you (Jokin Cuadrado, Steinar Herland).

    If you are a VIM user, this VIM script provides Javascript indentation. but it seems like a lot of work for general-purpose decompression of javascript (Kjartan Maraas).

    If you feel that none of the above is good for you and you want to prepare for your interview at Google, Jeff Walden suggests a hard-core approach:

    One of the less well-known aspects of SpiderMonkey, Mozilla's C JavaScript engine, is that it includes a decompiler which translates from SpiderMonkey bytecode to JavaScript (most people only use it the other way around). You can see it at work any time you convert a function to a string. Most JavaScript engines, when asked to convert a function to a string, do one of two things: return the exact source text (I believe IE does this, but I haven't double-checked), or return a string provides the minimum ECMAScript requires -- that the string have the syntax of a function declaration, i.e. that it be be evaluable to create a function (I think this is what Safari does). SpiderMonkey's choice to eliminate the overhead of storing source text after converting means that it can't do the former, and the latter is unpalatable from a developer standpoint. Instead, it decompiles the bytecode back to a JavaScript string representing the function as exactly as possible, while at the s ame time formatting the decompiled source to be reasonably readable. How would you use SpiderMonkey to reformat obfuscated source? First, you get a copy of SpiderMonkey:
      export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
      cvs co mozilla/js/src
      cd mozilla/js/src
      make -f Makefile.ref clean && make -f Makefile.ref  # work around broken dependency system
      .obj/js # to run the interpreter
    

    Next, you dump the JS code you want to reformat into a function, and you have SpiderMonkey pretty-print it:

      echo "function container() {" > obfuscated.js
      cat file-to-clean-up.js >> obfuscated.js
      echo "} print(container.toString());" >> obfuscated.js
      path/to/js -f obfuscated.js
    

    SpiderMonkey will then print the container function's string representation, adjusting indentation and such to create a readable, if still name-obfuscated, version.

    A couple things to know about this: first, SpiderMonkey doesn't pretty-print functions found in expression context:

      (function() {
         print("this won't get cleaned up");
       })();
      call_method(function() {
        print("this will probably be crunched to one line");
        print("not pretty-printed");
      });
    

    These examples are converted (once stripped of the containing function) to:

      (function () {print("this won't get cleaned up");}());
      call_method(function () {print("this will probably be crunched to one line");print("not pretty-printed");});
    

    The former pattern's become fairly common for reducing namespace collisions (unfortunately for the decompiler), and the latter's become more popular as the functional aspects of JavaScript have been more played up recently in libraries. For now at least I think you just have to tweak the original source file to fix these problems. The decompiler could do a better job on these given some changes, but I don't see this happening any time soon. The decompiler is generally agreed to be one of the hairiest and least-well-understood pieces of code in SpiderMonkey, and people don't touch it that often.

    Incidentally, the decompiler is also what allows SpiderMonkey to give the informative error messages it gives when your code throws an uncaught exception; the error messages I've seen in any other JavaScript interpreter are woefully less useful than the ones SpiderMonkey gives you using the decompiler.

    Posted on 16 Nov 2007 by Miguel de Icaza

    RayTracing in one LINQ statement

    Through Don Syme's blog I read about Luke Hoban moving from the C# team at Microsoft to the F# team, I did not know about Luke's blog until now, it is a fantastic collection of cool C# 3 nuggets.

    One of the things that impressed me the most is a recent sample he posted.

    Luke implements a RayTracer in one line LINQ code. This test is insane (and sadly, our C# compiler is not yet able to handle that kind of complexity yet for LINQ statements). I reproduce it here (directly copy-pasted from Luke's blog):

    var pixelsQuery =
      from y in Enumerable.Range(0, screenHeight)
      let recenterY = -(y - (screenHeight / 2.0)) / (2.0 * screenHeight)
      select from x in Enumerable.Range(0, screenWidth)
        let recenterX = (x - (screenWidth / 2.0)) / (2.0 * screenWidth)
        let point = Vector.Norm(Vector.Plus(scene.Camera.Forward, 
    Vector.Plus(Vector.Times(recenterX, scene.Camera.Right), Vector.Times(recenterY, scene.Camera.Up)))) let ray = new Ray { Start = scene.Camera.Pos, Dir = point } let computeTraceRay = (Func<Func<TraceRayArgs, Color>, Func<TraceRayArgs, Color>>) (f => traceRayArgs => (from isect in from thing in traceRayArgs.Scene.Things select thing.Intersect(traceRayArgs.Ray) where isect != null orderby isect.Dist let d = isect.Ray.Dir let pos = Vector.Plus(Vector.Times(isect.Dist, isect.Ray.Dir), isect.Ray.Start) let normal = isect.Thing.Normal(pos) let reflectDir = Vector.Minus(d, Vector.Times(2 * Vector.Dot(normal, d), normal)) let naturalColors =
    from light in traceRayArgs.Scene.Lights let ldis = Vector.Minus(light.Pos, pos) let livec = Vector.Norm(ldis) let testRay = new Ray { Start = pos, Dir = livec } let testIsects = from inter in from thing in traceRayArgs.Scene.Things select thing.Intersect(testRay) where inter != null orderby inter.Dist select inter let testIsect = testIsects.FirstOrDefault() let neatIsect = testIsect == null ? 0 : testIsect.Dist let isInShadow = !((neatIsect > Vector.Mag(ldis)) || (neatIsect == 0)) where !isInShadow let illum = Vector.Dot(livec, normal) let lcolor = illum > 0 ? Color.Times(illum, light.Color) : Color.Make(0, 0, 0) let specular = Vector.Dot(livec, Vector.Norm(reflectDir)) let scolor = specular > 0 ? Color.Times(Math.Pow(specular, isect.Thing.Surface.Roughness), light.Color) : Color.Make(0, 0, 0) select Color.Plus( Color.Times(isect.Thing.Surface.Diffuse(pos), lcolor), Color.Times(isect.Thing.Surface.Specular(pos), scolor)) let reflectPos = Vector.Plus(pos, Vector.Times(.001, reflectDir)) let reflectColor =
    traceRayArgs.Depth >= MaxDepth ? Color.Make(.5, .5, .5) : Color.Times(isect.Thing.Surface.Reflect(reflectPos), f(new TraceRayArgs(new Ray { Start = reflectPos, Dir = reflectDir }, traceRayArgs.Scene,
    traceRayArgs.Depth + 1))) select naturalColors.Aggregate(reflectColor, (color, natColor) => Color.Plus(color, natColor)))
    .DefaultIfEmpty(Color.Background).First()) let traceRay = Y(computeTraceRay) select new { X = x, Y = y, Color = traceRay(new TraceRayArgs(ray, scene, 0)) }; foreach (var row in pixelsQuery) foreach (var pixel in row) setPixel(pixel.X, pixel.Y, pixel.Color.ToDrawingColor());

    Although the above is pretty impressive, you might want to read about Luke's history of writing ray tracers as test cases for a new language (I write the factorial function, Luke writes Ray Tracers). His original sample from April goes into the details of how to define the scene, the materials and the objects and is useful to understand the above LINQ statement.

    The full source code (includes the support definitions for defining the Scene and materials) is available here.

    The original code (not LINQ-ified) is available here.

    Posted on 16 Nov 2007 by Miguel de Icaza

    Javascript decompressors?

    Recently we have been debugging lots of Javascript from web pages, and the Javascript is either white-space compressed or obfuscated.

    Does anyone know of a tool (preferably for Unix) to turn those ugly Javascript files into human readable form?

    Am currently using GNU indent which is designed for C programs, but it does a mildly passable job at deciphering what is going on, but it is not really designed to be a Javascript pretty-printer. I would appreciate any pointers.

    Posted on 13 Nov 2007 by Miguel de Icaza

    Mono Summit Schedule Published

    Jackson has published the Mono Summit 2007 Program Schedule.

    If you are attending, please remember to register.

    Posted on 13 Nov 2007 by Miguel de Icaza

    A Cool Mono Success Story

    Salvatore Scarciglia wrote an email today to tell me their story of using Mono on Clinical Trials. His team currently uses Oracle Clinical Trials, but when they wanted new features, they decided that it was better for them to build their own software than licensing the extra modules they needed to grow.

    Salvatore has a description of their project where he explains why they built the software using .NET in the first place (they were mostly a Microsoft shop, with Microsoft servers, and they liked Visual Studio).

    Recently something changed:

    I believe in Mono (take a look at the projects page of this site) and I think that it can grows very fast in the next years. When I read that one of the latest release of Mono supports almost all the .NET Framework 2.0 I've decided to try our framework with it. The original architecture based on:
    Windows Server 2003 + .NET Framework 2.0 + SQL Server 2005

    has been substitute with:

    Debian 4 + Apache + Mono 1.2.5 (mod_mono2) + MySQL (with .NET connector)

    and... it works !

    It was very hard to rewrite all the stored procedures and views developed with T-SQL in SQL Server, but at the end all the "dirty" work was done. On the other hand Monodevelop 0.16 has compiled the entire framework with no errors. The .NET connector provided by the MySQL team works fine and, finally, Apache + mod_mono was not so easy to configure but I did it.

    Using Microsoft technology you have the advantage to use the best development environment (Visual Studio 2005), a fully supported database engine (SQL Server 2005) and the availability of many documentation and tutorial sites (first of all the MSDN). Using Mono you have the great opportunity to develop in C# on Linux.

    [Ed: some typos fixed by my speller while quoting.]

    This has also been our experience: porting the stored procedures from a SQL server to another is probably the most time consuming piece of work and it is also not mandatory. Mono comes with a SQL Server provider, and if you just want to replace your front-end ASP.NET servers with Linux hosts, you can continue to talk to your backend MS SQL Server if you want to.

    Sadly, it has also been our experience that the most difficult piece to setup in Mono is mod_mono. The last time I set it up it was difficult, and people regularly have problems setting it up. A year or so ago, we came up with a pretty cool extension to mod_mono that (in my mind) simplified the deployment: AutoHosting, but it does not seem to be enough.

    Am hoping that the new the FastCGI support for Mono will make it simpler to configure for some setups.

    If you are interested in porting your ASP.NET application to Linux, you will like Marek Habersack's tutorial on porting ASP.NET apps that covers many of the details.

    Posted on 13 Nov 2007 by Miguel de Icaza

    Android's VM

    Or <jwz>I, for one, welcome our new virtual machine overlords</jwz>

    A very interesting theory on why Google created a new VM for Android instead of using an existing VM:

    Dalvik is a virtual machine, just like Java's or .NET's.. but it's Google's own and they're making it open source without having to ask permission to anyone (well, for now, in the future expect a shit-load of IP-related lawsuits on this, especially since Sun and Microsoft signed a cross-IP licensing agreement on exactly such virtual machines technologies years ago... but don't forget IBM who has been writing emulation code for mainframes since the beginning of time).

    But Android's programs are written in Java, using Java-oriented IDEs (it also comes with an Eclipse plugin)... it just doesn't compile the java code into java bytecode but (ops, Sun didn't see this one coming) into Dalvik bytecode.

    So, Android uses the syntax of the Java platform (the Java "language", if you wish, which is enough to make java programmers feel at home and IDEs to support the editing smoothly) and the java SE class library but not the Java bytecode or the Java virtual machine to execute it on the phone (and, note, Android's implementation of the Java SE class library is, indeed, Apache Harmony's!)

    With this VM, they managed to not depend on Sun terms for the future of the language and the VM or be bound by any definitions of the Java language. It is worth reading the entire article.

    Once the source code for Android is released, it would be interesting to look into integrating Mono wiht it. It should already run on it, as its just Linux. What would be interesting is continuing to use C# to write code for it.

    Some ideas that have been bounced around in the mono channels recently include:

    • CIL to Dalvik recompiler: Translate CIL bytecodes into Dalvik ones, like (like Grasshopper does) and provide a class library add-on.
    • DalvikVM: Implement a VM similar on top of Mono that can run Dalvik bytecodes side-by-side with other CIL code. This would be similar to the IKVM approach: a JavaVM for CIL.
    • Dalvik Support in Mono: Paolo suggested to add support to the Mono VM to have a Dalvik loader and turn the Dalvik instructions into the internal Mono IR (the rest at that point would be shared).
    • D/Invoke: Add support to the Mono VM to transparently call code into another VM. Very much along the lines of P/Invoke or COM's it-just-works support.

    Looking forward to the release.

    Posted on 13 Nov 2007 by Miguel de Icaza

    On parsing integers: Jeft Stedfast's Beautiful Code

    While the world is debating what is the proper object oriented and syntactic decoration for another wrapper around getElementById we back in Mono-land were coping with a bug related to parsing integers.

    In the CLI the original API to parse integers threw exceptions when an overflow was detected. So if you tried to parse a value that is too large to fit on an int, you would get an overflow exception. This is trivial to implement in C# because you just write the parser code more or less like this:

    		int value, digit;
    		...
    		value = checked (value * 10 + digit);
    		
    	

    If the result for the expression value * 10 + digit the JIT just throws. Beautiful.

    This is great as long as your input is error-free, but if you are going to cope with lots of errors, you are going to be coping with a lot of exceptions. And throwing and catching exceptions is consideraly slower than returning an error code. So with .NET 2.0, a new family of methods was introduced, something like this: bool Int32.TryParse (string value, out int result).

    The idea here is that instead of raising exceptions left and right we instead try to parse the value, and if the value overflows we just return an error condition.

    A simple approach is to use a type that is bigger than the type you are parsing and you just check the boundaries for errors, for example, a byte could use an int:

    
    		int value;
    
    		value = value * 10 + digit;
    
    		if (value < Byte.MinValue || value > Byte.MaxValue)
    			// error.
    	

    The downside with this is that parsing 32-bit ints requires 64-bit longs. This alone is quite expensive as 64-bit operations on 32-bit machines take many more instructions, consume more registers and produce slow code for a very common case. For the 64-bit case, things are worse, since there is no 128-bit longs in .NET, which means that we have to either come up with something clever, or you need to do checked expressions (like before), use try/catch and return an error on the catch handler. Very suboptimal.

    The ideal situation is to do the parsing with the data type at hand (use an int for int parsing, a long for long parsing) and catch the overflow before it causes a problem.

    Without going into the embarrassing details (which anyone with an inclination to point fingers can do) recently we had to rewrite these routines and Jeff Stedfast came to the rescue with two beautiful routines: one to parse signed integers, and one to parse unsigned integers in C.

    His routines are beautiful because they are able to parse a 32-bit int in a single loop, only using 32-bit ints; And 64-bit ints in a single loop, only using 64-bit longs.

    His routines were for C code, but variations of these rewritten for C# are now part of our runtime (they will ship as part of Mono 1.2.6).

    These routines have a very clever way of coping with overflows.

    Posted on 13 Nov 2007 by Miguel de Icaza

    Undoing Bush

    Joseph Stiglitz discusses the Economic Consequences of Mr. Bush. Looking back at seven years of mistakes, a great big-picture summary of what went wrong and why, and the damage these policies have inflicted in the US.

    Harper's Magazine ran a series of essays on how to fix the mess left behind in Undoing Bush: how to repair eight years of sabotage, bungling, and neglect.

    Posted on 10 Nov 2007 by Miguel de Icaza

    Mono Bug Days

    On Monday and Tuesday (November 5th and 6th) we want to spend some time triaging, prioritizing and applying easy fixes to Mono from Bugzilla.

    We will be on irc.gnome.org on the channel #monobugday on Monday and Tuesday going over various Mono components.

    Our entry point is: http://www.mono-project.com/Bugs.

    There is a lot of low-hanging fruit that could be easily fixed in Mono, bugs that are invalid, bugs that are missing information, bugs that needs owners, bugs that need confirmation and patches that have been waiting on the bug tracking system to be applied.

    I have zero experience running a bug day and am not sure quite how to run this on Monday, if you have some experience, feel free to drop by, or send your comments.

    Posted on 03 Nov 2007 by Miguel de Icaza

    FastCGI support for Mono's ASP.NET

    Brian Nickel worked on extending our hosting server for ASP.NET applications (XSP) to support FastCGI. Robert Jordan today integrated his Summer of Code project into the main distribution for XSP.

    Until today developers had two options to host ASP.NET applications with Mono: mod_mono (using Apache) or using a standalone, minimalistic HTTP 1.0 server (the xsp command).

    XSP provides the Mono.WebServer.dll ASP.NET application hosting library (controls application domains, starts up new instances of HttpApplication, configures and most importantly implements the communication endpoint for HttpWorkerRequest). Mono.WebServer.dll is not very useful on its own as it does not actually implement the HTTP protocol.

    For Mono.WebServer.dll to actually be useful, it is necessary to write an HTTP front end for it. Something that speaks the protocol and passes on the request to the application hosting interface.

    Most setups today look like this:

    You just have to imagine the "Internet" on the left side (TODO: get a cloud picture, and copy-paste it).

    Some courageous people use our test server (xsp) which merely implements HTTP 1.0 and has no configuration options (other than the port to listen to):

    Courageous because really, there is not much other than serving files and requests in that server and it is limited to HTTP 1.0.

    With Brian's setup, we now add this to the family:

    From the FastCGI and Mono Documentation:

    The FastCGI Mono Server was developed as part of the 2007 Google Summer of Code with the goal of increasing the availablity of ASP.NET and simplifying configuration. Requiring as little as zero command line options and supporting a large number of servers, the FastCGI Mono Server makes it simple to include ASP.NET on your server.

    Documentation on how to configure the FastCGI support for various servers is available here (In particular lighttpd).

    This code is available now from our SVN Repository. This should be available on Mono 1.2.6.

    Thanks to Brian for writing this nice code and Robert for integrating this into trunk and Marek for his ongoing maintenance of the ASP.NET stack.

    Now, who does one have to bribe to get early access to the ASP.NET MVC bits around here or get invited to the ASP.NET SDRs ;-)

    Posted on 30 Oct 2007 by Miguel de Icaza

    Mono Versioning

    A common problem that I face is explaining to people the current situation of Mono. This is a problem of our own creation when we sketched the major milestones for Mono.

    When we originally plotted the course for the Mono Roadmap things looked pretty simple, they were roughly like this:

    Mono 1.0:

    • Ship the VM 1.0
    • Ship the C# 1.0 compiler
    • Ship System, Xml, Data, Drawing Web and Web.Services
    • Gtk# and friends.

    Mono 2.0:

    • Upgrade VM to 2.0
    • Upgrade compiler to 2.0
    • Upgrade libraries to 2.0
    • Add Windows.Forms
    • Ship Gtk# 2
    • Favorite extra stuff (debugger, compacting GC, internal embedding API upgrade)

    As you can see, we intended our versioning scheme to track the major Microsoft releases to expedite explanations of what level of APIs Mono supported. So Mono 1.x would be roughly .NET 1.x, Mono 2.x would be roughly .NET 2.x, Mono 3.x would be roughly 3.x and so on.

    There is a bit more than just tracking the API, as you can see, there are really two dimensions to what we wanted to call Mono 2.0:

    One dimension is the 2.0 compatibility with .NET, and another one has some internal goals of ours. For example, we considered that 2.0 was a good time to break the embedding API for the runtime and also to release the compacting collector.

    Complications

    There were a few factors that started to complicate our numbering scheme:

    • Our Windows.Forms implementation was lagging behind other class libraries (as writing a Winforms control requires much more work than say a Web Control).
    • Our desire to implement some major optimizations and improvements in the VM (improved code generation, AOT for 2.x, compacting garbage collection, switch to eglib-based public APIs, change in the embedding API).
    • Generics being a requirement for a lot of the 2.0 work that was necessary.
    • Microsoft releasing .NET 3.0 which was really just a new set of libraries that just ran on top of 2.0 (we track these in a separate project, called project Olive).
    • Microsoft releasing .NET 3.5 which is the actual upgrade to 2.0.
    • Some areas would be developed faster than others: sometimes this was due to planning, lack of planning, or big boosts in external contributions (for example, Mainsoft contributed extensively to making ASP.NET 2.0 and ADO.NET 2.0 happen, and they have been shipping their Grasshopper product since ~May).
    • We might not support the full API for a given assembly: there might be some features that do not make sense on Linux or features that will never be implemented (like System.Management).

    By the time we shipped our Mono 1.2 last year, the problems with the simple versioning numbers started to show. Mono 1.2 included many features from 2.0:

    • C# 2.0.
    • Generics support in the VM.
    • A lot of the 2.0 support in the class libraries. (core, XML, Data and ASP.NET was almost done).
    • Support for Windows.Forms 1.0.

    Almost a year has passed and we are about to release Mono 1.2.6, six releases after Mono 1.2. Compared to last year's Mono, this upcoming release is a major upgrade, we have since:

    • Completed most of the 2.0 support, including:
      • Completed C# 2.0.
      • Completed ASP.NET 2.x (modulo WebParts).
      • Completed ADO.NET 2.x.
      • Most of Windows.Forms 2.0 (about 80% of it at this point).
    • Implemented most of C# 3.0 (few tidbits missing).
    • Implemented LINQ, and LINQ to XML (.NET 3.5).
    • Implemented some other bits from .NET 3.5
    • A Visual Basic.NET compiler, and its runtime.
    • Added a Silverlight toolchain (.NET 2.1).
    • Added COM/XPCOM support to Mono.

    From an API perspective, with the exception of Windows.Forms 2.0 we have pretty much completed the 2.0 support (what remains to be done is tracked here for the core and here for winforms).

    In addition, some bits from 3.5 are being shipped in this upcoming version.

    Since we continue to ship updated versions of Mono every 8 to 10 weeks we have only felt that we needed to update the smallest version number (1.2.6 is our upcoming release) each time.

    My concern is that 1.2.xx does not really convey the feature set in Mono and some people get the wrong impression of where Mono is at. This problem is made worse because we have been using the simplified numbering scheme for years.

    Just today someone emailed me asking when ASP.NET 2.0 will be released, another person asked about ASP.NET AJAX (supported in SVN, and in the upcoming 1.2.6).

    Options

    We are looking for a creative solution to this problem.

    Without using Mono versions, these are roughly the upcoming milestones:

    • Mono A: Estimated 3-4 months of work.
      • The core 2.0 done + ASP.NET 2.
      • 2.0 profile (minus Winforms) becomes officially supported.
    • Mono B: Estimated 6-9 months of work.
      • Windows.Forms 2.0 complete.
    • Mono C: 9+ months.
      • When the Compacting GC is done.
      • Make the runtime embedding API changes here.
    • Mono D: 9+ months.
      • When the new IR/optimization framework is ready
    • Mono E: 6-9 months of work.
      • When System.Core and other 3.5 libraries are finished; maybe we could even split this up in chunks.
    • Mono F: 12 months of work, Silverlight security features:
      • New security system (done).
      • StackOverflow protection (done).
      • Complete the Verifier.
      • Harden the Mono loader (for Silverlight).
      • Full runtime security audit.

      The order of the above releases is not necessarily the one listed above, and I used letters to avoid discussing the actual release numbers. Three of those (C, D and F) are difficult to come up with an estimate now.

      Massi advocate a model where for large Mono upgrades (ABI changes, like the GC and the runtime API change) we change the major version.

      This would mean that we could ship a Mono 1.4 at the time that the "core" 2.0 is done; A Mono 1.6 when Winforms 2.0 is done; A Mono 1.8 when the 3.5 APIs are ready; and Mono 2.0 when we do the GC changes. This proposal does not fix the confusion problem with "1.x" though.

      Marek has a slightly modified proposal: when we ship 2.0 minus winforms we call it Mono 1.8; Mono 2.0 includes Winforms, GC, ABI breakage; Mono 2.2 includes new optimization framework;

      Jonathan suggest that we could use the major version number to document what is the version number that we feel we can officially support. 2.0 means "2.0 minus Winforms" with an upcoming 2.2 version with Winforms support and 3.5 thrown in the middle at some point (you will notice that the Olive/3.0 discussion is not part of this decision making).

      Thoughts? email them to the devel group and CC me (miguel@ximian.com).

    Posted on 29 Oct 2007 by Miguel de Icaza

    DB_LINQ now MIT X11

    George Moudry from the DB_LINQ team has just emailed me to inform me that his multi-database LINQ implementation for .NET is now MIT X11 licensed!

    Posted on 28 Oct 2007 by Miguel de Icaza

    Rob Conery Joins Microsoft

    Wow. Rob Conery, the author of SubSonic has accepted a job to work for Microsoft. These are the highlights:

    • He will continue to work on Subsonic, paid by Microsoft.
    • Subsonic will remain open source.
    • Rob will continue doing his SonicCasts.
    • Subsonic will be playing an important role on ASP.NET's new MVC framework.

    Congratulations!

    Now only Jon and Jeff remain independent after Mix 07.

    [from Phil Haack].

    Posted on 27 Oct 2007 by Miguel de Icaza

    OpenSource LINQ providers

    Microsoft upcoming .NET 3.5 and C# 3.0 have support for Language Integrated Queries (LINQ). This gives C# and VB users a SQL-like syntax right in the language to access databases directly. For example, this is now valid C#:

    public void Linq1() {
        int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
    
        var lowNums =
            from n in numbers
            where n < 5
            select n;
    
        Console.WriteLine("Numbers < 5:");
        foreach (var x in lowNums) {
            Console.WriteLine(x);
        }
    }
    	

    For more samples, check the 101 LINQ Samples.

    There are a number of LINQ providers for different kinds of sources. For example, there is a built-in provider for things like arrays, collections and IEnumerables.

    A more useful sample comes from Don Box, this is a program to extract the top ten read articles from an Apache log file file:

    	var regex = new Regex(@"GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/[^ .]+)");
    
            var grouped = from line in ReadLinesFromFile("logfile.txt")
                          let match = regex.Match(line)
                          where match.Success
                          let url = match.Value
                          group url by url;
    
            var ordered = from g in grouped
                          let count = g.Count()
                          orderby count descending
                          select new { Count = count, Key = g.Key };
    
            foreach (var item in ordered.Take(10))
                Console.WriteLine("{0}: {1}", item.Count, item.Key);
    

    There is another provider for creating and consuming XML data: LINQ to XML. The LINQ distribution comes with a nice sample where many of the samples from the XQuery specification have been rewritten into C# with LINQ with code that is roughly the same size (which sadly, I can not find online to point to).

    Luckily, we have implementations for both of these in Mono.

    And finally there are providers for databases. Microsoft ships one that will integrate natively with Microsoft SQL.

    Unlike the XML and in-memory providers, the SQL providers are more complicated as they need to turn high-level operations into optimized SQL statements. Unlike many object to database mapping systems that produce very verbose SQL statements LINQ is designed to provide a very efficient representation.

    The Db_Linq is an open source project to create a LINQ provider for other databases. The project is lead by George Moudry and so far has providers for PostgreSQL, Oracle and Mysql.

    George keeps a blog here where you can track the development of DbLinq.

    Thanks to Bryan for pointing me out to this fantastic piece of code.

    Mono users on Linux will now be able to use LINQ with open source databases from C# (in addition to our in-memory and XML providers).

    Currently we are still missing some support in our compiler and our class libraries for this to work in Mono, but this will be a great test case and help us deliver this sooner to developers.

    Update: A nice blog entry talks about Parallel LINQ. A version of LINQ that can be used to parallelize operations across multiple CPUs:

    	IEnumerable data = ...;
    	
    	// Regular code:
    	var q = data.Where(x => p(x)).
    		Orderby(x => k(x)).Select(x => f(x));
    	foreach (var e in q) a(e);
    
    	// Parallelized version, add the "AsParallel" method:
    	var q = data.AsParallel().Where(x => p(x)).
    		Orderby(x => k(x)).Select(x => f(x));
    	

    See more details about the above in the Running Queries On Multi-Core Processors article.

    Update2: Am not up to speed in the databases vs object databases wars, but am told that there is also a LINQ binding for NHibernate. A sample is here.

    Posted on 24 Oct 2007 by Miguel de Icaza

    Cardboard Regatta

    Today, before lunch Aaron, David, Jeff, Michael and myself went to the Carboard Regatta at MIT, the Head of the Zesiger competition.

    A perfect complement for the Head of the Charles this weekend. Here are some cell-phone pictures of the event:

    The Black Pearl:

    The winner was a cardboard boat called "Ship Happens" that looped the swimming pool twice without sinking. All other boats sank. The "Titanic" award was given to the "Unsinkable 2" ship.

    Here is "Ship Happens":

    Everything sank, except for "Ship Happens". I suspect that the cleaning crew was as surprised as I was to see one of the boats disintegrate so quickly into so many little pieces that went to the bottom of the pool.

    Posted on 19 Oct 2007 by Miguel de Icaza

    JIT Updates

    For people interested in JIT technology, there are two great posts this weekend from folks in my team.

    JIT engines have some great properties, but unlike batch compilation they suffer from having to cope with code generated dynamically. Paolo talks about the memory reduction tricks that he has implemented in Mono.

    The tricks are related to the temporary thunks that are generated during JITing ("trampolines"), and some future directions to reduce memory usage in the JIT even more.

    Mark talks about his ongoing work to implement generic code sharing. Unlike Java generics that are a language feature, .NET generics are a virtual machine feature. Each approach has its pros and cons. In Java you only JIT the code once, and every generic instantitation reuses that implementation (because it is really a language feature); The .NET approach makes for simpler use or generics and better performance, but it comes with a price: new instantiations of the generics class need to be re-JITed.

    Mark discusses his ongoing work to share generics JITed code (when two instantiations of a generic type would generate the same code, say when the sizes and semantics of the types are compatible).

    Posted on 15 Oct 2007 by Miguel de Icaza

    Moonlight at the Boston Remix Conference

    On Monday I joined Brad on stage at the Boston Remix conference to show a preview of Moonlight.

    As you can imagine, after years of working on Mono, I was pretty excited to be able to show our work at a Microsoft event.

    Brad blogged a summary of all the things that he showed on his keynote here. I was familiar with some of the stuff there, but there were various new things, like the ComponentOne controls for Silverlight 1.1 (they are similar in spirit to Flex: you get some high-level controls that you can use with your Silverlight applications).

    Videos of the keynote have been posted, see this page for the videos. The Moonlight section is covered here.

    I was running development versions of both Mono and Moonlight (SVN as of 24 hours or so) and you can see that some of the performance tuning that has been going into the Mono runtime (Paolo has not blogged about it, but Mono 1.2.6 will have plenty of performance improvements in the JIT and the memory consumption keeps going down).

    I showed the Chess game and you can see from the numbers that Mono running Chess is now getting similar scores as the .NET runtime gets on similar hardware.

    Brad also gave us a copy of TopBanana in advance, and everyone in the team worked hard to get it ready for the show:

    Lastly, I got a chance to show the Compiz Cube to the audience while playing some videos with Moonlight from the Halo web site.

    It was the old cube, the one that we shipped with SLED, but still it makes for a good demo. On my Tuesday session, I borrowed a machine that had more up-to-date software to show the latest Compiz.

    Q and A on Moonlight

    On Tuesday I had a session on Moonlight (the slides are here).

    One of the problems that I face with my presentations is that am not good at transitioning from the presentation to the questions and answer part of it. I always enjoy the questions and answers more than the presentation, and somehow I always botch it by reaching the end and asking "Questions?".

    This presentation was quite fun, because the audience asked a lot of questions as I did the presentation which made the presentation a lot more interesting than the slide deck shows.

    This was mostly a Windows audience, and I took the chance to show them the Linux desktop, the Mono/.NET compatibility, the MonoDevelop IDE, showed internationalization on Unix, the automatic right-to-left support and automatic layout of desktop apps and a few other features of Mono-based apps on Linux.

    Silverlight Performance

    On Sunday I had the chance to meet Seema Ramchandani who is a performance PM on Silverlight. On her blog she has some useful hints on how to improve the performance of your Silverlight apps (here and here).

    Posted on 11 Oct 2007 by Miguel de Icaza

    iPhones

    Mark Pilgim shares his opinion on his managed expectations on the iPhone.

    Love the post, worth reading from top to bottom.

    But what is really interesting is that the majority of the replies to that post are incredibly insightful, worth reading as well. How does Mark manage to get this much of an educated audience?

    Update: correction, as you keep reading the blog, the crazies come out of the woodworks. I guess we are doomed.

    Posted on 05 Oct 2007 by Miguel de Icaza

    Mono Summit, Spain

    We will be holding the Mono Summit in Madrid Spain, from the 26th to the 30th of November. Five days of Adventures in Open Source Managed Code and tapas sampling.

    The first two days are focused on project planning and discussion among the active contributors to the Mono and Moonlight projects (contributors and employees).

    The second three days are more general, these are for users of the Mono project: the application developers. In these days we will have some talks and tutorials on what we have been doing, what is available since the last year, meet-the-experts discussions and to present our roadmap and plans that we discussed in the first two days.

    This is a good time to introduce a gorgeous Moonlight logo that was designed by Tony Alexander and Miguel Liberero on the Mono-Olive mailing list.

    I will be working on an agenda in the next few days and post it next week on the Mono web site.

    Alejandro Sanchez and Juantomas worked very hard to look for our venue, it was tricky to schedule in the original dates that I had planned ("sometime in October"). Thanks Alejandro and Juantomas!

    Update Booking: Jonathan suggests that booking Sunday-to-Sunday gives you good prices, better than Saturday-to-Saturday, I have not checked.

    I have been using Kayak.com myself to book trips recently, and it is my favorite so far.

    Posted on 05 Oct 2007 by Miguel de Icaza

    A Journey Into the Dumb-o-Sphere

    It did not take long for the IT pundits to declare that having the source code available for .NET is either "a trap for Mono", "the end of Mono" or some similarly low accuracy per bit arguments.

    It is amazing though, as some of these pundits are supposed to be covering "free software" and "open source" and yet, they know very little about history and how open source software is actually developed. More worrying is the fact that they could have researched this instead of sticking their foot in their mouth.

    I was not going to blog about this, hoping that this would just go away, but I keep getting emails asking about these articles (which am not going to link to, you can google them up):

    Lets look at Pundit #1:

    Thanks to Mono, we now have the popular Linux programs such as the Banshee music player, Beagle search tool and F-spot photography program. With Mono, you can also now run Visual Basic programs on Linux. Mono is also working on porting Microsoft's Silverlight 1.0, a cross-browser, cross-platform plug-in for delivering richer Web user experiences in a project called Moonlight.

    All of these programs are now in danger from Microsoft.

    I know, I know, if you just look at the headline, the executive summary, "Microsoft opens up .NET," it sounds great for Mono open-source developers. It's actually a death trap for Mono.

    No, it is not a death trap for Mono.

    It seems that Pundit #1 needs a history lesson on free software.

    When GNU was launched in 1983 there were concerns similar to this one. In particular, a concern was what would happen to people that contributed code, but the code came from the wildly available proprietary source code?

    To put things in perspective, at the time, Universities were getting source code licenses to ATT's Unix and it was wildly available (by the 1980's standards of availability). It was important that contributions to GNU were not tainted by proprietary code that belonged to someone else.

    I quote section 2.1 of the GNU Standards document on this matter:

    2.1 Referring to Proprietary Programs

    Don't in any circumstances refer to Unix source code for or during your work on GNU! (Or to any other proprietary programs.)

    If you have a vague recollection of the internals of a Unix program, this does not absolutely mean you can't write an imitation of it, but do try to organize the imitation internally along different lines, because this is likely to make the details of the Unix version irrelevant and dissimilar to your results.

    For example, Unix utilities were generally optimized to minimize memory use; if you go for speed instead, your program will be very different. You could keep the entire input file in memory and scan it there instead of using stdio. Use a smarter algorithm discovered more recently than the Unix program. Eliminate use of temporary files. Do it in one pass instead of two (we did this in the assembler).

    Or, on the contrary, emphasize simplicity instead of speed. For some applications, the speed of today's computers makes simpler algorithms adequate.

    Or go for generality. For example, Unix programs often have static tables or fixed-size strings, which make for arbitrary limits; use dynamic allocation instead. Make sure your program handles NULs and other funny characters in the input files. Add a programming language for extensibility and write part of the program in that language.

    Or turn some parts of the program into independently usable libraries. Or use a simple garbage collector instead of tracking precisely when to free memory, or use a new GNU facility such as obstacks.

    (Emphasis added).

    Now, Mono is an open source project and follows those rules (and I have followed those rules myself since 1992 when I first started writing free software).

    If only reporters had a way to find out this information, some kind of wizard that they could use to fact check their pieces...


    [Ziing!] Hi! Am the Great Gazoogle!

    Oh hi, Great Gazoogle. Say, what’s this?

    Mono Project -- Contributing -- Important Rules
    • If you have looked at Microsoft's implementation of .NET or their shared source code, you will not be able to contribute to Mono.
    • In general, be careful when you are implementing free software and you have access to proprietary code. We need to make sure that we are not using someone else's copyrighted code accidentally.
    • Do not use the ildasm, reflector or other equivalent tools program to disassemble proprietary code when you are planning to reimplement a class for Mono. If you have done this, we will not be able to use your code.
    • Please stick to published documentation for implementing any classes; when in doubt, post to the mailing list and discuss the possible approaches with others.

    This text was originally added before the launch of the project, as indicated by the Great Gazoogle:


    [Zeerp!] "I looked it up, this horse was beat to death on the mailing lists!" says the Great Gazoogle.

    The Great Gazoogle can be used to identify other times when we the issue of Rotor, SSCLI and Mono has come up in the past.

    We go even further than that. We do not even accept LGPL contributions to our own class libraries, we use the MIT X11 license for that, and as such we are unable to incorporate changes that were developed as LGPL or GPL with exceptions (which is why we could not work together or accept patches from pnet folks unless they relicensed their code).

    So we do not take proprietary code, and we do not take open source code that is not suitably licensed to be included in Mono itself.

    A similar situation existed forever for Java. Java was only open sourced less than a year ago, but before it became open source, the source code for Java was wildly available for anyone that wanted to look at it under a non-open source license.

    Obviously open source efforts --GNU Classpath, the older class library project and the various open source Java VMs-- could not accept contributions from people that had looked at Sun's code.

    And of course, there was Rotor. Rotor was Microsoft's first attempt at giving developers some access to the source code of .NET. Rotor used a Shared Source license instead of MS-RL that prevented people from using its source for commercial purposes (so just like this new release, it is a non-stater for Mono).

    Rotor differs also from the upcoming release in that Rotor contained the source to the C# compiler and the virtual machine and this release does not. But Rotor did not include the "major" class libraries like ASP, ADO and Winforms that are included in the upcoming release.

    So the doomsday scenario has existed for as long as 24 years for free software, but Pundit #1 just thought of this scenario all by himself:

    If you ever, and I mean ever, want to write open-source code, I recommend you not come within a mile of Microsoft's .NET Framework code or any other similar projects that the boys from Redmond "open" up.

    To be fair though, it is an important warning, and it is good that this is kept in mind by anyone contributing to open source software.

    Now lets look at Pundit with an Axe to Grind (referred to from now on as Pundit #2). Pundit #2 likes to setup a strawman, but he does so in a careful way, with plausible deniability, look at this carefully crafted piece:

    If you believe some of the headlines, Microsoft just open sourced a bunch of software related to its .Net libraries. Don't be fooled. The definition of open source is very clear. This is not open source. Not even a little bit. In fact, this may actually be an insidious trap (more on that below).

    Microsoft never claimed they were open sourcing anything in .NET. They do not even use that language. Am not sure where the rumor that it was open source started, but clearly people did not even bother reading the actual announcements from Microsoft, because such text is nowhere to be found. You would think that in this day an age they could have done a quick check. But alas, when you got an Axe to Grind the axe comes first. Facts and research come last.

    Some creative uses of the Axe (I had to use the great Gazoogle to get the "joke"):

    Far-fetched? Well, not if you look at Microsoft's history. Microsoft is playing to win, and it seems to believe the only way to win is if open source loses. This is myopic, but the company refuses to get LASIK.

    Do you get it? LASIK: so you can fix the myopic view!

    So this is a pundit that repeats and quotes the claims from Pundit #1 (the guy that did not know history) and invokes history. To be fair, he is a pundit, his depth of knowledge is razor thin.

    In my opinion, Pundit #2 is failing at both punditry and humor.

    Credits: Great Gazoogle artwork and concept originally from Gavin M. at Sadly, No!.

    Posted on 05 Oct 2007 by Miguel de Icaza

    GInterfaces in Gtk#

    Mike Kestner has been working for the past few months in supporting GLib's GInterfaces in Gtk#. He has commited his code, and written a tutorial.

    There were two main use cases that people discussed with us:

    • The need to implement new Gtk TreeView models.
    • The need to support interfaces for the sake of Atk.

    Am not sure if there are any other uses for this.

    If you have experience with GInterfaces, we would love if you could send us some comments (Mike Kestner) about the implementation and suggestions on improving the tutorial.

    Posted on 05 Oct 2007 by Miguel de Icaza

    Extending Evolution with Mono

    Sankar has updated the Mono-based plugin for Evolution the Gnome email/calendar/pim client.

    It is possible again to write plugins using any of the Mono supported languages to extend Evolution.

    The code builds on the previous effort from Michael Zucchi.

    You can download the sample plugin here. The sample plugins adds a new menu option to translate an email message to Spanish, and then uses Google to do the translation.

    Posted on 04 Oct 2007 by Miguel de Icaza

    Mono on OpenMoko

    Cliff Brake has announced that there are now packages of Mono available for OpenEmbedded which you can use on your OpenMoko NEO1973 phone, to install, he says:

    add the following to a /etc/ipkg/*-feed.conf file:
    src/gz mono-armv4t http://dev.bec-systems.com/feed/openmoko/mono
    
    ipkg update
    ipkg install mono
    

    OpenMoko is a completely open phone platform: starting at the hardware level (they have hardware kits for hardware developers) up to the software level (all the software is open source/free software).

    Unlike other phones, this is completely open, and development and innovation on the phone are encouraged.

    All those people that were disappointed that the iPhone is being locked down to developers, this is a good time to help improve a completely open platform. And you should be able to run Gtk/WebKit (the same engine from the iPhone) on the device.

    A comparison chart for the hardware is here. OpenMoko today is a developer platform, so expect some updates in the near future.

    Posted on 04 Oct 2007 by Miguel de Icaza

    Microsoft Opens up the .NET Class Libraries Source Code

    I read on Scott Guthrie's blog the news that Microsoft will release the source code to the class libraries that make up .NET:

    Today I'm excited to announce that we'll be providing this with the .NET 3.5 and VS 2008 release later this year.

    We'll begin by offering the source code (with source file comments included) for the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc), ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows). We'll then be adding more libraries in the months ahead (including WCF, Workflow, and LINQ).

    The source code is released under a new license they are calling the Microsoft Reference License, this is not an open source license.

    First of all, congratulations to everyone at Microsoft that made this happen. Am sure many .NET developers will be happy with this new development and there will be many genuine uses for this.

    I heard a podcast with Shawn Burke where he discussed some of the history of behind this move. The discussion seemed mostly tactical, and am sure that to do this they must have presented a strong business case to their management that opening up the access to the source code (even under the MS Reference License terms) was important.

    Even if the license for the code is not open source, it is an important step. Sun had done something similar with Java in the past and over time they moved towards opening more and more of it. Am still hope that one day Microsoft will open pieces of this under more liberal licenses that would allow those pieces to be used for any purposes, including Mono.

    Mono, free software and the source code release

    The source code that will be released goes beyond the scope of the C# source code that was released as part of Microsoft Rotor.

    But like Rotor, the license under which this code is released is not open-source. People that are interested in continuing to contribute to Mono, or that are considering contributing to Mono's open source implementation of those class libraries should not look at this upcoming source code release.

    At the same time, Microsoft already releases some class libraries under an open source license, the Microsoft Permissive License (MS-PL, which will soon be renamed the Microsoft Open License).

    Mono manages to benefit from code that Microsoft releases under the MS-PL license and we even redistribute some of it: The Dynamic Language Runtime, IronPython, IronRuby and the ASP.NET AJAX Javascript client-side library.

    Speculation

    Am not sure why Microsoft did this, there have been a few theories around this, but my own guesses are:

    • Scott and many people reporting to him understand developers (Scott did ASP.NET). Scott being in charge of .NET probably has made this organization be more Web-y, in that they understand that developers are more effective if they can "View Source". So it might be a natural cultural shift.
      Scott and his team are behind the Microsoft/Novell collaboration on Silverlight for instance.
    • Large .NET users probably already had access to the source code, and probably had access to under a myriad of customer-specific NDAs or licenses and this was hard to work with, and hard for the organization to manage. This could be license consolidation and streamlining of the process to get people access to the source code.
    • Getting access to the source code alone was probably very cumbersome. This is probably why the focus of the release is on the simplicity of getting the source code for debugging (the most important scenario presented so far).
    • Sun and Java: it is possible that some customers were getting cozy with the ease of access to Java source code to the class libraries and this had some mounting pressure on Microsoft.

    Some of the statements are very similar to what Sun used to make about Java before they agreed to open source it:

    Allowing developers to rebuild a framework, any framework, from source, and then redistribute the modified result, can introduce problems with providing support, serviceability, integrity and security of the framework itself. This is true with .NET, Java, Ruby, and other frameworks. Multiple independent redistributed modified versions of a framework can decrease the reliability and dependability of the common platform, which is not desirable. In the path we've taken here, we are seeking to balance the requirements we hear from the developer community for transparency and of reliability and dependability of the platform. In striking that balance, we believe the Microsoft Reference License is the right license for this release.

    There are a number of scenarios that go beyond looking at the source code which are think are valuable in the existing Microsoft ecosystem and which is ultimately why it would be useful for some chunks to become open source.

    For example:

    • Bugs in Class Libraries: If there are bugs in the class libraries that can not be worked around, the user does not have to ship a replacement System.dll, but he could copy-paste the code, make the adjustments in the code and ship the resulting executable.
    • Different Needs: If the code is close, but not quite what he needs, a developer could cut-and-paste, and then tune the code to do what he needs. This is a very common case that we see with Mono's own source code.
    • Complement Existing Frameworks: Microsoft ships a number of reduced versions of .NET: Compact Framework and Silverlight 1.1. People often need features that are only available on the full framework.
      Many folks today cut-and-paste code from Mono to be used on the Compact Framework edition because the subset that Microsoft chose for the CF is a good starting point, but it does not fit all the needs, specially in a market that is heavily slanted towards embedded systems (our XML Serializer is one of the most cut and pasted pieces of code for example).
    • Supporting old Frameworks: With 3.5 coming out it is very likely that some features would be useful for applications that must run with 1.1 or 2.0 on systems that can not be upgraded to 3.5. Cut and pasting code would be useful.
    • Innovation: Although people can always innovate on "top" of an API, some kinds of new features can only be done if you can alter the inner workings of it. Certainly Microsoft has the right to not let people do that.

    For the above cases, people today can continue to use the Mono source code and cut and paste at will (with our super-liberal license the MIT X11 that comes with no strings attached).

    But I still believe that there is a good business case for opening more stuff under the more liberal MS-PL license.

    And of course, beyond the Microsoft ecosystem, there is the Mono ecosystem, where we could leverage that code if it were open source :-).

    Posted on 03 Oct 2007 by Miguel de Icaza

    Talks at MIT: The Israel Lobby and U.S. Foreign Policy

    As Jeff and myself walked back from a dose of fried quesadillas from Anna's taqueria on MIT I was telling him "There is always an interesting event announced on these walls".

    And in the middle of one of the corridors I found that both John Mearsheimer and Stephen Walt, the authors of the "The Israel Lobby and U.S. Foreign Policy" will be talking at the Stata Center at MIT on Wednesday.

    The book has been excellent so far. It expands on a paper that was widely discussed last year but goes into a lot more depth.

    Another excellent book that I just finished reading recently is Israel-Palestine on Record: How the New York Times Misreports Conflict in the Middle East.

    Update: Robert pointed out that I forgot the link to the event.

    Posted on 01 Oct 2007 by Miguel de Icaza

    Google Summer of Code: Database Support in MonoDevelop

    Over the summer Ben Motmans rewrote the database support in MonoDevelop. Working with Ben was a pleasure.

    Part of the challenge was that I personally had no idea what it is that people do with these database UIs. My contact with databases is so bad that about once a year I google up the instructions to setup Postgres again, and figure out my login, password and connection string followed up by extensive cut-and-pasting of "CREATE" statements until I have something that roughly can store a few values.

    His work has now been integrated in the First MonoDevelop Beta release.

    Query Result and Database Explorer

    Alter Table

    Creating a SQLite connection.

    This Database Add-in replaces the old Mono.Query add-in, and will hopefully continue to improve to have a central location for all of your database needs.

    Posted on 01 Oct 2007 by Miguel de Icaza

    Media you can't trust

    Dave Winer on Media you can't trust. Reflections on Ahmadinejad and its coverage.

    Dave also recommends "All the Shah's Men" a book that I recommended earlier this year.

    Posted on 26 Sep 2007 by Miguel de Icaza

    Evo Morales on the Daily Show

    Tonight, Jon Stewart had Evo Morales, the president of Bolivia on his show and interviewed him.

    I learned in the interview that Evo Morales made two promises during his campaign: to nationalize the energy sector and to do "Reforma Agraria" (sorry, forgot the translation).

    He achieved both within eight months in office.

    In the energy sector, he said that the Bolivian government used to receive 300 million dollars for its energy and today it receives 2,000 million dollars.

    Posted on 26 Sep 2007 by Miguel de Icaza

    Remix Boston

    In addition to my participation on the keynote at Remix07 with Brad Abrams, I will be hosting a session on Silverlight on Linux which will be heavily oriented towards questions and answers.

    Now, I have been living in Boston for seven years, and I have no idea that there was a Hyatt Regency in town.

    Hope to see you there!

    Posted on 25 Sep 2007 by Miguel de Icaza

    Mono-less Moonlight

    For the sake of minimizing our valgrind time, dividing and conquering the task of spotting leaks, and to reduce the surface that must be audited for security for Silverlight, Rolf has commited support that removes the Mono dependency from Moonlight.

    Moonlight 1.0 will not require Mono anymore (Moonlight 1.1, that tracks Silverlight 1.1 will).

    In the meantime the team has been busy performance tuning video playback for Moonlight. As it turns out there is no one-size-fits all optimization for video on Linux as different video cards are accelerated differently.

    When we were describing one of our hacks to improve performance to Kevin Gallo he quoted a friend of his on graphics performance, and it went more or less like this "Graphics performance work is basically a collection of hacks".

    It inspired confidence in some of the tricks that we have been doing to reduce the work that Moonlight does.

    My friend Chris Toshok is looking for a college to attend to learn a few new tricks. He has a few constraints, but if you can help him find a place in Boston, we might be able to bring him back to the Norteast.

    Posted on 24 Sep 2007 by Miguel de Icaza

    LugRadio Interview

    Last week I was interviewed by the LugRadio crew. The interview is now available.

    The last question I think was the most interesting, but I did not have time to actually finish answering it.

    The crew has a nice gallery of pictures for their Rock-band look. But a picture at Starbucks?

    Posted on 24 Sep 2007 by Miguel de Icaza

    Bullet-proof Gandhi

    From Scott Adam's Sorry I confused You post where explains his satiric post from the day before:

    Still, the bulk of my sympathies are with whatever group suffers the most, regardless of how much of the problem is their own damned fault. To feel otherwise would be inhuman. Sometimes it feels as if the Palestinians are only one Gandhi away from fixing their problems. But he’d need to be bulletproof.
    Posted on 23 Sep 2007 by Miguel de Icaza

    Weekend Movies

    Am pondering which movie we could go see tonight, here are some of the reviews of what lies ahead:

    "This monster film makes even the remake of Godzilla look good."

    "The only winners in Dragon Wars are the computer-imaging geeks who must have logged tons of overtime. The rest of the world is left scratching its head at a monster epic so dismal that it doesn’t even register as a guilty pleasure."

    "...wants to position itself as a first-date movie, but it's a first-date movie for those who don't believe in second ones."

    "How hard could it be to make a clever parody of Snow White? Very hard, apparently." and "Sydney White has a concept and a title, but beyond that it draws a blank."

    "There's more genuine humor to be gleaned from saying 'Woodcock' over and over again than from watching Mr. Woodcock."

    "Less a brave movie than a foolhardy one. Trapped in a no man's land between seriousness and pulp trash, it plays like a combination of Death Wish and The Hours. If that sounds like an awkward fit, it is."

    "It wants to be a moody, dark exploration of pain and revenge (the same feelings I experienced during and after the movie)."

    Sounds like its another weekend of skipping the movies.

    Am stuck in Megatron 3 (or Meganoid? Its some kind of Mega) on the Wii, there is some dude that I cant kill. I think its time to hire a professional through Craig's List, get them to come home, kill the dude and move on with the game.

    Posted on 21 Sep 2007 by Miguel de Icaza

    Generics Improvements

    Mark, the hacker behind Mono's CoreCLR Security implementation has committed to SVN the support for generic code sharing.

    Generic code sharing allows the same native code generated by the JIT to be reused for more than one generic instantiation. This can be done when the JIT can ensure that the code generated for the given method would be exactly the same.

    This optimization currently needs to be enabled with -O=gshared

    Update: Mark blogged some details and clarifications

    Posted on 21 Sep 2007 by Miguel de Icaza

    One Day We Won't Know What To Do

    On the comments section at Sadly, No! comes this observation:

    (This is about American conservatives, as the word has different meanings across country boundaries).

    Posted on 20 Sep 2007 by Miguel de Icaza

    Apple locked ecosystem and the EU

    Ian Williams mailed me to point out an article this morning at the BBC about Apple and its practices.

    The article builds on the EU ruling against Microsoft and points out:

    Apple has spent much time trying to ensure that anyone who buys an iPod is completely locked in to an Apple-centred world in which they use iTunes, buy from the iTunes Music Store, purchase only Apple-certified iPod accessories and, ideally, abandon their plans to migrate from Windows XP to Vista and instead purchase a shiny new iMac.

    It is very nice to see the BBC coverage go into the depth of the issues involved in the closed interfaces (the now read-only database; the streaming limited to Apple products by means of using encryption to lock the competition out; the new cable add-ons; the locking-out of Linux jukebox software; and the ringtones fiasco):

    It is hard to see what justification there can be for these various measures other than an attempt to lock customers in and keep competitors out.

    I've asked Apple why it is doing this, but it has remained characteristically silent, preferring to invest its time and energy in the iPhone's UK launch.

    [...]

    But its business practices do not stand up to scrutiny, and when it comes to music downloads it is just as bad as Microsoft on servers, putting its time and energy into creating barriers to competition instead of letting its developers and designers concentrate on doing great stuff.

    If Apple was serious about building a music industry around downloads and digital devices then it would open up its devices and interfaces to allow greater innovation and greater competition.

    It would have faith in its own products to compete in this larger ecosystem instead of trying to lock everyone in with tactics that resemble those of IBM in the days of the mainframe.

    I wrote a presentation this morning using Microsoft's PowerPoint, but displayed it using Apple's Keynote. Apple can sell Keynote because it took PowerPoint apart and figured out how the files work.

    Had Apple been unable to do so, or found that every time it figured out what was happening Microsoft changed the format, it would have complained loudly.

    Yet this is exactly the technique it is using against third party jukeboxes. And it is time it stopped.

    Read the whole piece.

    The BBC article missed the bit where purchasing DRM music also locks you into a particular platform (Apple could license the DRM to allow users to re-encode the songs into another DRM if necessary).

    So the EU has teeth, lets make sure that they do not end up wrapped around Apple marketing and they act decisively to ensure interoperability and an open ecosystem.

    Posted on 20 Sep 2007 by Miguel de Icaza

    Qt bindings for Mono

    Back in June David Canar from the Qyoto project emailed me pre-announcing the launch of Qyoto. Qyoto is a Mono/.NET bindings for TrollTech's Qt4 library:

    You can:

    This is another toolkit that you can use to develop cross platform GUI applications.

    Posted on 18 Sep 2007 by Miguel de Icaza

    iPods Hash Puzzle Unlocked

    The folks in #gtkpod figured out the hash used for newer iPods using a debugger on Windows. The code is here and hopefully it will be integrated in the relevant applications soon enough.

    Thanks to everyone on #gtkpod that made this possible (wtbw, nopcode, retar_d, oleavr, desrt and everyone that provided DBs and IDs).

    Although we -the Linux community- can choose not to buy iPods, many other people will. And it is our goal to make Linux a viable modern computing platform that allows people to use all of their existing devices.

    Breaking the hash is not really a long-term solution, as they can keep making the process harder every time. The long-term solution is for iPods to have a standard interface that third parties can communicate with.

    This probably should be compounded to the EU's findings on Apple's anti-trust practices to ensure open access to a popular device.

    Posted on 16 Sep 2007 by Miguel de Icaza

    iPods

    Yesterday after rumors that new iPods require a cryptographic checksum on the song database we confirmed that Banshee can no longer store songs on the new iPods.

    The new firmware will now refuse to play any songs that you legally own unless you use Apple's iTunes (which is only supported for Windows and MacOS)

    A temporary solution is to not upgrade the firmware on your current iPods and avoid purchasing any of the new iPods until someone figures out hwo to generate the checksum.

    As a consumer I can vote by not buying Apple products. What bothers me is that they are the market leader and pretty much own that space, other people will buy iPods and they will just not be able to use them with Linux.

    With this move they are preventing people from using their iPods with Linux which will be added to the list of things that "Linux can not get right". Not because we can not get it right, but because of Apple's anti-competitive practices. What better way to keep your potential competitors down than with a little lock-out strategy, using the strength in one market to help weed out the competitors on another market. In fact, today's experience with Banshee is no different than using iTunes: plug, sync, unplug.

    Apple being the darling of the computer industry will face little or no criticism over this.

    Maybe this need to be brought up with the EU commission as another unfair business practice from Apple.

    Although someone will eventually break the new lock from Apple, they can keep changing it, and every time they change it, they will keep stopping consumers from using their iPods with Linux. Maybe it is time for Apple to be subject to some quality-time government sponsored regulation.

    Update: As Lennart points out, this is hardly the first time that Apple has locked out competitors or products that interoperate.

    Cory Doctorow weighs in on the issue, and states:

    I guess my next player won't be an iPod after all.

    Cory last year stated that he would switch to Linux from OSX. I hope that he did.

    Posted on 15 Sep 2007 by Miguel de Icaza

    Mono's GC

    Paolo covers three issues on his blog post about the Mono GC:

    • Setting expectations as to what the new Compacting GC will be able to do.
    • The new support for purely managed object allocation (without having Mono transition from managed to unmanaged code to allocate objects).
    • Performance improvements that you might expect from this optimization in Mono 1.2.6

    Zoltan has also implemented the needed support for managed-based allocation on the ahead of time compiler.

    Posted on 12 Sep 2007 by Miguel de Icaza

    Not a Gamer, Part 2

    As I discussed back in January am not much of a gamer. The only redeeming feature of the Wii was watching Laura and my friends play Wii Sports

    Nat recently convinced me to get a Nintendo DS, he said something like, but not necessarily "This stuff is great while waiting for your next flight, and going through all those security checkpoints". He strongly recommended the brain training games for the Nintendo DS.

    So I went and purchased a DS and just like in January, I asked the sales guy to give me a bunch of the best games for the DS he had on store. I figured, maybe am the kind of gamer that could get used to the DS.

    Like January, I did not really get into any of the games.

    A few observations:

    • The Internet Destroyed the Fun in Puzzle/Adventure Games: I still fondly remember playing Space Quest: one hour every day, then discussing with friends the possible solutions and eventually solving it.
      The Internet makes it so easy to get solutions to most of the problems that it has taken the fun out of it.
    • Stories: The stories for the games I have tried so far (on the DS and the Wii) seem incredibly dull and there is a linearity and lack of interesting challenges.
    • Game Play is Not That Different: Until this year, I had spent about 15 years not playing games (with a short stint for about nine-twelve months playing Quake) and the games are not significantly different.
      But at least the graphics are superb (uh oh, hope Slashdot does not come after me), the animations are very gracious and some of the details are incredibly well taken care of.

    I got some mistery game (Hotel something or other), a remake of SimCity, some cooking game, some Lego point-and-shoot and some others that were not worth remembering.

    The only game that I liked was the brain games. I like the practice exercises and most importantly, the Sudoku which I play every night before going to sleep.

    So I spent about 300 dollars in hardware and games to end up playing Sudoku. A better investment would have been to buy a 5 dollar Sudoku book.

    So all of the above was just an excuse to blog about my good friend Jordi Mas' brain games for Gnome.

    He has been working on a set of pretty cool games for the desktop. He wrote GBrainy which comes with an assorted collection of mind games that are quite fun in the same way that the Brain Games for the DS is:

    Anyways what are good games for the Wii and the DS for aging software developers? (And am not really a fan of Quake derivatives; I got Metroid, and its passable).

    Posted on 12 Sep 2007 by Miguel de Icaza

    Mono Bugzilla Migration

    This Saturday morning (September 15th) at 8am MDT we will be doing our final migration to the Novell Bugzilla system. Although we expect this migration to take much less time, we have planned a http://bugzilla.ximian.com outage until Monday (September 17th) at 8am. During the outage, http://bugzilla.ximian.com will not be accessible.

    Once the migration is complete, http://bugzilla.novell.com will be the official Mono Bugzilla. In preparation for the switch, please create a Novell.Com account by going to the following URL.

    Novell Login Creation Page.

    It is important that you use the same e-mail address for this account that you use on http://bugzilla.ximian.com.

    Posted on 12 Sep 2007 by Miguel de Icaza

    Jon Galloway Introduces New Acronyms

    From Twitter today:

    Posted on 10 Sep 2007 by Miguel de Icaza

    Short Internet Case Studies: Creating Mortal Enemies

    Jeff Artwood uses Twitter to quick-blog (as opposed to his usual larger treaties).

    From today's twitterness, how to go from "Flickr, good but not for me" to "Flickr, mortal enemy" in 10 seconds:

    Posted on 09 Sep 2007 by Miguel de Icaza

    Moonlight Follow-Up

    After my last post, Matt Asay and myself exchanged a few emails regarding Novell and open source. And Matt posted a very nice follow up: "80% on Novell" on his blog about Novell and our involvement in open source, so some good came out of this:

    Net net: I'm going to work on seeing Novell with less bite and more neutrality. It's admittedly very hard for me.

    His post is difficult to quote without removing too much context and doing justice to it, so you should read it yourself.

    Simon engadged in a lengthy discussion on my blog's comments on Google Group here and here.

    We exchanged platitudes and concluded that patents are bad (shocking, I know) and that the "system" is far from optimal (second shock). We both agreed that Sticking it to the Man was a worthy goal.

    Posted on 09 Sep 2007 by Miguel de Icaza

    ReMix 07 in Boston

    Brad Abrams (one of the authors of the .NET Framework Design Guidelines, which PVanhoof really likes) invited me to share the stage at his keynote for ReMix 07 in Boston.

    Oh the excitement!

    Posted on 09 Sep 2007 by Miguel de Icaza

    Servers Storing Passwords in Plain Text

    Turns out that one of my favorite sites (Reddit) stored plain text passwords on a database. The reddit database recently was stolen, and now whoever stole it has all the passwords to reddit. The rationale for this was:

    Personally, I prefer the convenience of being having my passwords emailed to me when I forget, which happens from time to time since I use difference passwords everywhere.

    Not hashing was a design decision we made in the beginning, and it didn't stem from irresponsibility-- it stemmed from a decision to provide functionality that I liked.

    It bit us in the ass this time, and we are truly sorry for it. The irresponsibility (and there is some) was allowing our data to get nabbed.

    So the convenience of emailing a password when you forget it is what caused the developers to keep the passwords in the open.

    Now, I do not particularly care if my reddit password is stolen. I have a policy of using a different password for every site that wants me to create an account with them. I use wildly different passwords for each site that I register with, so I manage to limit my exposure by limiting the damage to that particular site.

    But many of my friends use combinations of "the same password everywhere" (specially the non-technical), "the password with the site name" (slightly more technical), "three tiers of passwords: weak, normal and high-security".

    Everyone in those groups is vulnerable to have their password cracked open on other sites. Not good.

    But the second realization that I had is that this practice is incredibly common. In the last month I have probably requested to "recover my password" from six or seven sites and at least two of them sent me back my original password. I remember thinkin "Oh, that is handy, am glad I did not have to go through a reset password process". Only now I realize that these sites are basically exposing my password to the world. This is not a phenomenon limited to reddit, it is incredibly common.

    Here is a tutorial on how to implement this correctly on your web site: Don't let password recovery keep you from protecting your users. If you are using ASP.NET, the Membership infrastructure will take care of this for you.

    Server folks also need to use stronger encryption mechanisms. As Jeff points out on his Rainbow Hash Cracking

    You should use a differnet password for each site that you visit. Even if you knew the site you visit will not store the password in plain text (and there is no way of finding out) these days tools to crack passwords take advantage of available memory and disk space to crack stuff rapidly. See Jeff Artwood's Rainbow Hash Cracking post where he installs Ophcrack (open source software, available for most platforms) and cracks most "strong" passwords in a matter of minutes.

    For dealing with one-password-per-site I keep a GPG encrypted file and use a script that Gonzalo wrote. Maybe its too simple, but it works (source is here).

    Windows has a couple of tools that can keep your passwords encrypted. It would be nice if someone wrote a nice UI for this for Unix. The gnome-keyring is a step in the right direction, but the UI (gnome-keyring-manager) is not really designed for end users to use. It is more of a front-end to the password backend for the desktop.

    We need to make this kind of tool pervasive on all of the desktop systems (and Mozilla remembering passwords is not enough to be practical).

    Update: Jensen Somers in the comments points us to Revelation a tool for the Gnome desktop that does this.

    Posted on 09 Sep 2007 by Miguel de Icaza

    Naomi Klein's Shock Doctrine

    Always loved Naomi Klein and today I found on reddit that Alfonso Cuaron did a short based on her latest book The Shock Doctrine. Am a fan of both.

    The short-film is six minutes, and you can watch it here.

    Posted on 08 Sep 2007 by Miguel de Icaza

    Reading Comprehension and the English Language

    Last night Simon Phipps blogged about the Moonlight announcement.

    It is funny to be lectured about software freedom from people that use MacOS computers as their main desktops instead of Linux. And to be lectured about whether implementing Moonlight for Linux or not is a good idea. If you smell an inconsistency here, is because its their trademark.

    Simon is usually a sensible person, I met him at GUADEC a few years ago and I consider him a good friend and has a great reputation in the open source world for helping Sun open source Java. I have fond memories of hanging out at FooCamp and FOSDEM with him, so I was surprised about his post.

    As I pointed out on his blog entry comments he made a number of mistakes on his analysis of the license.

    He opens with the following paragraph:

    I see Miguel is expecting flak for his initiative to implement Silverlight on GNU/Linux, and I'm sure he'll get it. The thing that caught my eye, however, was what terms I was asked to agree to if I as much as give Silverlight a try on any other platform in the ecosystem Miguel is helping create. Just take a look at the license agreement you're assumed to agree to if you so much as click the "Get Silverlight" button (yes, your acceptance is there in 4-point text in the Get... graphic). You will be agreeing you will not:

    He is implying that Moonlight will be covered by Microsoft's EULA. This is not the case. Moonlight is released under a combination of LGPLv2 and MIT X11 licenses. I did bring this up on his comments, and Simon replied with:

    Oh, and I didn't intend to imply Moonlight was equally tainted, I didn't think for a moment that you'd license it as anything but Free software and I think I made that clear in my first paragraph. My apologies if you thought otherwise.

    I keep re-reading the original paragraph and it is very ambiguous to the point of leading to the confusion. The only point where he addresses this is several paragraphs later: "Miguel is encouraging you to surrender your freedoms if you're using the technology he promotes anywhere but the operating system he is working on. He's the lure for someone else's trap.".

    Simon is concerned that using Silverlight on Windows comes with a bunch of requirements that are contrary to software freedom. But Simon, if you care about your software freedom, why are you using MacOS (or Windows) in the first place? If people care about that issue, they should switch to a fully open source system. And correct me if am wrong Simon, but since you link to a Mac license, I can imagine your main desktop is a MacOS machine (I vaguely remember that to be your main desktop; Why not OpenSolaris or Linux?), it seems like you have already surrendered your software freedom rights a long time ago.

    And let me add, you can always port Moonlight to Windows. It is free software, remember?

    His blog post is confusing, a commenter on Simon's blog points exactly that:

    Just to let you know that I skimmed this post after it was linked on Louis' blog and got the impression that the points in the license that you raise are in Moonlight rather than Silverlight.

    I didn't realize until I read Miguel's comment that this is not the case.

    Of course, it is obvious on a second reading that you are talking about Silverlight. But I hope no-one else makes the same mistake as me, but worse does not realize it.

    So one person is already confused. But it gets better. Pundit Matt Asay gets it wrong too (For those not familiar with Matt Asay, he is like the Robert Novak of open source punditry). He opens his own blog entry with:

    Simon Phipps takes apart the licensing maze required to start "enjoying" Novell's Moonlight. Novell clearly wants to be popular with someone, and so has settled on Microsoft.

    So Simon text is definitely obscure enough that pundits are making the same "mistake" I made when I read Simon's obscure blog post. On the other hand, it was pundits that got the US into the Iraq war, so we must cut the punditry circles some slack, we can not expect them to be scholars.

    Now it is time to take exception at Matt's claim that:

    Simon [...] takes apart the licensing maze required to start enjoying Novell's Moonlight"

    No Matt, Simon did not explain anything about Moonlight, he was talking about Silverlight's EULA license, and while doing so, he managed to botch his analysis on several counts.

    I am not in the business of defending Microsoft's EULAs, but in this case Simon tried to imply that we were covered by it. And well, Moonlight is not, as I said above Moonlight is under the LGPL/X11 licenses.

    It seems that the EULAs for these proprietary plugins are pretty much all the same. As Stephen Walli pointed out on the comments for Simon, he is throwing rocks in a glasshouse, here are some EULAs that just as bad or worse as the Silverlight one:

    Silverlight terms are simpler to read than any of the previous five. This seems like an improvement.

    When it comes to damages, a topic that Simon seems to care about as he writes: "that the limit of Microsoft's liability in any matter (including "internet services") is $5", here is the breakdown of the other EULAs:

    • Acrobat: 50 dollars.
    • Helix: 5 dollars.
    • Silverlight: 5 dollars.
    • Java: 0 dollars.
    • Flash: 0 dollars.

    And for good measure the GPL, LGPL and MIT X11 licenses put that at zero. So Acrobat, Helix and Silverlight are actually the most generous in this space.

    I am not going to accuse Simon of double-standards, as he acknowledges in a comment that he would like to see those removed from Sun software as well:

    As to glass houses: I expect there are Sun agreements that actually are a threat to software freedom, but it's my (and I believe Sun's) goal to eliminate as many of them as possible. By contrast, the Silverlight agreement is new, and its terms appear intended not just to protect Microsoft but to advantage them. I'm a bit surprised to find you making this apples-to-oranges comparison. I'm an easy target when I'm talking about what concerns me, but do you really believe there's no issue here?

    I am not sure to what extend the EULA for Silverlight "its terms appear intended not just to protect Microsoft but to advantage them". Simon botched the analysis on most of his claims (including his statement about video and the MPEG-LA claim, he needs to read the (b) section).

    So what we have is a case of exaggerated outrage over a silly license and for good measure a little bit of smearing of Moonlight by association.

    Simon also complains that by accepting the license, "* that Microsoft can gather information about your computer and internet connection; * that they can automatically modify the software."

    That is incorrect Simon. The license that you accept does not give Microsoft the right to gather the information (unlike the Java license that explicitly states that Sun can gather the information). In addition, Simon conveniently ignores the fact that the the Silverlight EULA states that you can opt-out from automatic-updates (see the license for yourself).

    Finally, Simon's take on Mono:

    I suppose this is just the same as my issue with Mono; that it's a trailing-edge implementation of an ecosystem that's intended by its architects to take away freedoms. That's what I'm reacting to.

    Simon, that was uncalled for. Mono might be trailing behind Microsoft's APIs, but Mono has its own vibrant community and its own stack of open source libraries that are 100% independent of Microsoft's own stack based on the ECMA 335 core. You should know better than that. Mono is able to plot its own destiny and its own ecosystem on his own thank-you-very-much.

    Matt Asay Shortsightedness

    Matt Asay's bitter blog post misses the point as well, his argument of "position of strength" is a laughable one. Lets play, spot the inconsistencies (post your thoughts):

    In other words, if someone is going to be Microsoft's toady, Novell wants to be darned sure it's them. It would be much better to command interoperability from a position of strength, as Red Hat is doing (or as MySQL is doing in databases, JBoss has done in application servers, etc.), rather than between mouthfuls of Microsoft's toejam.

    Well Matt, we actually started on Moonlight without any management approval. All my bosses knew about our effort to implement Moonlight was that I requested a trip to Paris on June 21st ("Am going to accept this invitation to ReMix in Paris, the opportunity sounds priceless"). Nobody knew what my engineering group was cooking. And I for one had no expectations at that point to become a "toady", but I guess that is for a psychiatrist to figure out the day I get one.

    So we are very excited that we turned our 21-day hackaton into a collaboration to productize Moonlight and to be able to bring Silverlight to Linux users.

    To me, Moonlight is of crucial importance because I believe that Microsoft will be successful in getting Silverlight deployed in many sites, and as a Linux desktop user (unlike some outraged open source advocates that stick to OSX :-) I want to make sure that I have access to the Silverlight content from my Linux box.

    And speaking of freedom and outrage, Simon you do not seem to mind surrendering your freedoms to Apple when you buy proprietary iPods and proprietary connectors, using the proprietary iTunes. And there are other mp3 players that are purely open source. Why are you using that instead of the purely open source Linux + Banshee?

    You have the right to choose to iTunes, and others have the right to choose Silverlight. But of course people like to paint things in apocalyptic terms, more along the lines of "Will someone think of the children?". It may be funny, but only when its part of a Simpsons sketch.

    It took real change inside Microsoft and Microsoft's internal organization to push for an agreement with Novell that would officially endorse Moonlight and would provide assistance of a kind that has never been seen between Microsoft and the open source community.

    Moonlight will probably help Silverlight get adoption, and advance Microsoft's interest position in this space, but:

    • From a pure technical perspective: Silverlight is the best of breed on this space. I like it, and it matches my opinions. Maybe not everyone's opinions, but mine and some others.
    • As long as I can have my LGPL/X11 licensed code base, am more than happy for Silverlight to become another option on the Internet. Live and let live kind of scenario (Unlike others, I actually love Flash as well, and I love the open source efforts trying to create an open source version even more).
    • Silverlight vs Flash vs JavaFX vs AIR is not a zero-sum game. Those who believe that have a strong scarcity mindset. I for one believe that the ecosystem will become richer by having more options. You know, competition, choice, options, styles.
      Just like on the server space source we have competing frameworks: django, rails, turbogears, asp.net and j2ee.
    Posted on 07 Sep 2007 by Miguel de Icaza

    Sun and NetApp Lawsuit

    Am no fan of patents or patents lawsuits, but this lawsuit is going to provide some entertainment value for months to come.

    It is quickly moving into "he said, she said" territory. NetApp claims that Sun started this thing when they approached NetApp to monetize some patents:

    Like many large technology companies, Sun has been using its patent portfolio as a profit center. About 18 months ago, Sun’s lawyers contacted NetApp with a list of patents they say we infringe, and requested that we pay them lots of money. We responded in two ways. First, we closely examined their list of patents. Second, we identified the patents in our portfolio that we believe Sun infringes. With respect to Sun’s patent claims, our lawsuit explains that we do not infringe, and ---in fact--- that they are not even valid. As a result, we don’t think we should be paying Sun millions of dollars.

    If this is true, Sun brought this upon themselves.

    Of course, on the other hand, Sun claims that this was not the case:

    Many of the claims raised in the lawsuit are factually untrue. For example, it was NetApp who first approached Sun seeking to acquire the Sun patents NetApp is now attempting to invalidate. It is unfortunate that NetApp has now resorted to resolving its business issues in a legal jurisdiction (East Texas) long favored by "patent trolls."

    BURN!

    And from Jonathan Schwartz:

    NetApps first approached StorageTek behind the cover of a third party intermediary (yes, it sounds weird, doesn't it?) seeking to purchase STK patents. After Sun acquired STK, we were not willing to sell the patents, We've always been willing to license them. But instead of engaging in licensing discussions, NetApp decided to file a suit to invalidate them. To be clear, we never filed a complaint or threatened to do so, nor did anyone, to the best of my knowledge, in the ZFS community.

    Sun also positions this as an attack on open source (since ZFS is under some open source license, the one that is incompatible with the Linux kernel GPLv2):

    NetApp's legal attack against Sun's open source ZFS solution which is freely available in the marketplace is a clear indication that NetApp considers Sun technology a threat, and is a direct attack on the open source community.

    So software patents suck, we all know that.

    One one side, if there is any truth to NetApp's claim that Sun tried to monetize their patents by going on the offenseive this seems to be a case of Sun bringing this upon themselves.

    NetApp could respond by issuing a patent covenant for users of open source operating systems (which would include Linux and OpenSolaris, but would still allow them to monetize from the Solaris uses).

    Someone on Jonathan's blog raises a good point:

    I find your comments contradictory.

    "First, Sun did not approach NetApps about licensing any of Sun's patents and never filed complaints against NetApps or demanded anything." on the one hand, and "... we were not willing to sell the patents, We've always been willing to license them."

    Can you please address the contradiction between "never demanded" and "always willing to license", Since "Willing to license" is usually simply a code word for "demanding payment for licensing."

    If Sun's position that NTAP does not in fact violate the patents in question, and Sun does not violate NTAP's patents, why can't Sun affirmatively state that instead of leaving the issue unresolved?

    Warmest Regards,
    Max

    That is one good question.

    On the other side, perhaps NetApp has turned into a patent troll. And there are some indications from NetApp's blog. This is worrysome:

    On the other hand, I won’t pretend that we would never have sued if Sun hadn’t approached us first. We focus on innovation as a company, and we do intend to defend our intellectual property.

    [...]

    Our interest is on commercial use of ZFS. That is, we are concerned with companies who take our IP and turn it into products that they make money on. For obvious reasons, we are especially concerned about commercial use of our IP that would compete with NetApp.

    This seems to undermine NetApp's initial claim.

    In the meantime, am buying POPC-orn shares, I predict this drama will have the same ratings as the second season of Lost.

    Posted on 06 Sep 2007 by Miguel de Icaza

    Sample Interviews

    Some folks have been asking what kind of interviews we conduct over email for hiring in the Mono team. We allow people to work remotely. To find out how well they can work independently away from our office we came up with some tasks that we give out on job interviews.

    In my experience with hiring people at Ximian, the face-to-face interviews did not yield as good results as reviewing someone's existing track record and contributions or these programming exercises.

    A resume, plus an interview when you ask the candidate to "implement XX on the whiteboard" and some trick questions have too many problems which are probably worth discussing some other day. In my experience these kinds of interviews that have been popularized in the industry are bad. They evaluate developers on all the wrong dimensions that you need to produce software.

    Am posting here two of the interviews that we used in the past to hire for positions into the Windows.Forms group and the Mono VM engine. These interviews are typically conducted over two to three weeks.

    A story that I find funny was when we did the Windows.Forms interview. Once I emailed back the applicants with the 2 week deadline, Andreia Gaita replied to me within 2 or 3 days. She was the first to reply, but thought that she was the last, and her code was great, did everything I requested (and if she gives me permission I can post her submission).

    Andreia turned out of course to be a superb hacker, see her recent work on Mono/Mozilla integration.

    The interviews follow.

    These are not the interviews that we will use for Moonlight, but it will give you an idea of what kind of thing we do ;-)

    Windows.Forms Interview

    Remember: these interviews are designed to be answered at home during your afternoons when you get back from school/work and would usually take a few days.

    * The Widget
    
        You must implement a small rendering engine for a small
        XML-inspired markup language, the language accepts:
    
        <p>...</p>    To start paragraphs.
    
        Paragraphs in turn can contain the following:
    
        <b>...</b>    Where the text ... is bolded.
    
        <i>...</i>    Where the text ... is italicized
    
        <link>...</link> Where the ... is rendered as a link
    
        <blink>...</blink> The text should blink.
    
            The control must expose one property:
    
            string Markup { get; set; }
    
        Which allows the developer to programatically set the markup
        language, for example:
    
              m = new MarkupControl ();
              m.Markup = "<p>Hello <b>World</b>!</p>";
    
        The control must also expose an event, so I can hook up
        whenever someone clicks on a link:
    
        delegate void LinkClicked (object sender, string link_text);
    
        So I can use it like this:
    
              m.LinkClicked += my_clicked;
          ...
            
          void my_clicked (object sender, string link_text)
          {
            Console.WriteLine ("The link {0} was clicked", link_text);
          }
                    
        You must also provide a complete program that will run when I
        run it in Linux, and you must also exercise the property and
        the event, this would be nice to have:
    
          void my_clicked (object sender, string link_text)
          {
            Console.WriteLine ("The link {0} was clicked", link_text);
            ((MarkupControl) sender).Markup = "<p>This is the new text after clicking</p>";
          }
    
        Extra points: when I use blink, you will have to refresh,
        bonus points if you avoid flicker by using double buffering, or
        by only repaining the area that has changed. 
    
        I want a small and succinct implementation, but this is your
        opportunity to show that you can write *robust* code, so impress
        me.
    
    * Trick Question
    
        In our corlib implementation, in System/DateTime.cs we have a
        suboptimal implementation of the method "TryParse", we basically
        call Parse inside try/catch.
    
        Explain:
    
            * Why do I say that our solution is "suboptimal"?
    
            * What would it take it to make more efficient?
    
            * Why did the maintainer that wrote that code not do
              the more efficient thing?
    
        The trick question is: Why was the faster process not done in
        the first place.
    
        Explain.
        

    JIT Interview

    This interview was constructed by Paolo Molaro when we were hiring folks for the JIT. The developers that joined us have been fantastic, Mark and Rodrigo. They are working in adding the CoreCLR security (I blogged about Mark's work before) and the verifier to Mono (which we will need for Moonlight) and have also been doing many other needed tasks on the VM.

        This interview should take a week to complete in your
        afternoons.  Between 8 to 16 hours for someone not familiar
        with Mono.
    
        We figured that not everyone has time to allocate to this
        immediately, so we will wait until March 30th to review the
        applications.
    
        All of this can be answered by using the officially released
        Mono packages from:
    
                http://www.mono-project.com/Downloads
    
        Get the mono-1.2.3.tar.gz source code download.
    
        Feel free to ask any questions privately or in any Mono public
        forums.
    
    First Task: Extending the Mono VM
    
        Given the following program, change the mono JIT to intercept
        the Datum.Add () function and implement it internally with a
        SSE instruction so that the additions happen in
        parallel. Datum.Add () is to be treated like an intrinsic:
        this means that the JIT knows exactly what it's supposed to do
        and doesn't need to actually compile the IL code in it.
    
        Ie, you catch early on the call to Datum.Add (), there is no
        need to do any advanced compiler optimizations.  The current
        implementation here will be ignored once you have this
        implemented.
    
    using System;
    
    struct Datum {
        float f1; float f2; float f3; float f4;
    
        Datum (float val) {
            f1 = f2 = f3 = f4 = val;
        }
    
        void Add (ref Datum b) {
            f1 += b.f1;
            f2 += b.f2;
            f3 += b.f3;
            f4 += b.f4;
        }
    
        void Print () {
            Console.WriteLine ("{0}:{1}:{2}:{3}", f1, f2, f3, f4);
        }
    
        const int count = 100;
    
        static void Main ()
        {
            Datum[] array = new Datum [count];
            float f = 0.1f;
            for (int i = 0; i < count; ++i) {
                    array [i] = new Datum (f);
            }
            for (int i = 1; i < count; ++i) {
                    array [i].Add (ref array [i - 1]);
            }
            array [10].Print ();
            array [count - 1].Print ();
        }
    }
    
    Second Task: 
    
         Pick one of two:
    
            * GC Analysis
    
            * JIT and Generic Analysis
    
    * GC Analysis.
    
        Given the description in:
    
            http://www.mono-project.com/Compacting_GC 
    
        and the implementation in 
    
                    mono/metadata/sgen-gc.c
    
        describe briefly 3 changes to the GC code and/or JIT-GC
        interface that would provide a significant performance
        speedup. 
    
        Explain the changes, the reasons it will improve performance
        and provide rough speedup numbers with a benchmark of your
        choice.
    
    * JIT and Generic Analysis
    
       Mono supports generics in its compiler and VM, this means that
       code like this is supported:
    
           class MyStack<T> {
                   T [] storage;
                   int top;
    
                   MyStack ()
                   {
                           storage = new T [10];
                   }
    
                   public void Push (T datum)
                   {
                           storage [top++] = datum;
                   }
    
                   public bool Empty {
                           get {
                                   return top == 0;
                           }
                   }
           }
    
       If the above code is used like this:
    
           MyStack<object> object_stack = new MyStack<object> ()
           MyStack<string> string_stack = new MyStack<string> ()
           MyStack<int> string_stack = new MyStack<int> ()
    
       Explain:
    
           * When a generic class is instantiated, what pieces of
             code are shared?
    
           * Why they should be shared?
    
           * Are they shared in Mono?   
    
           * If yes, why?   If not, why not?
    
           * How could this be improved?
    
        
    Posted on 05 Sep 2007 by Miguel de Icaza

    Microsoft/Novell Collaboration on Silverlight.

    Update: I have updated this post addressing some questions that people have raised over email and the group. The updates are flagged with an Update label.

    Update: Scott Guthrie at Microsoft blogs about the news: updates to Silverlight 1.1, organizations adopting Silverlight 1.0 and links to various tutorials.

    Today we are announcing a new collaboration with Microsoft around Silverlight. The Mono team at Novell will implement open source versions of Silverlight 1.0 and Silverlight 1.1.

    Our implementation of Silverlight is Moonlight.

    We have had a cordial relationship with many developers at Microsoft for quite some time. Scott Guthrie and Jason Zander provided us with informal advice on how to implement Moonlight, and we also have good relations with the open source teams working on IronPython and IronRuby.

    Today we are formalizing a collaboration between Microsoft and Novell with the explicit purpose of bringing Silverlight to Linux and do this in a fully supported way. The highlights of this collaboration include:

    • Microsoft will give Novell access to the test suites for Silverlight to ensure that we have a compatible specification. The same test suite that Microsoft uses for Silverlight.
    • Microsoft will give us access to the Silverlight specifications: details that might be necessary to implement 1.0, beyond what is currently published on the web; and specifications on the 1.1 version of Silverlight as it is updated.
    • Microsoft will make the codecs for video and audio available to users of Moonlight from their web site. The codecs will be binary codecs, and they will only be licensed for use with Moonlight on a web browser (sorry, those are the rules for the Media codecs[1]).
    • Novell will implement Silverlight 1.0 and 1.1 and will distribute it for the major Linux distributions at the time of the shipment. We will offer some kind of one-click install for Linux users (no "Open a terminal and type su followed by your password..." as well as RPM and DEB packages for the major distros and operating systems.

    This is an historical collaboration between an open source project and Microsoft. They have collaborated with other folks on the server space (Xen and PHP) but this is their first direct contribution to the open source desktop.

    Microsoft benefits by making Silverlight reach the Linux and BSD spaces. We benefit by ensuring that users of open source operating systems get access to sites that adopt Silverlight to deliver content or spice up their web apps.

    [1] Currently Moonlight video support has been prototyped using the fabulous and LGPLed ffmpeg engine for video and audio. We are unable to redistribute this code commercially due to licensing conflicts. Update: This means that individuals that want to use a 100% pure free software setup can do so. We are unable to redistribute this edition though.

    The binary codecs will initially support x86 and x86-64, with other platforms supported on an as-needed basis. Update: The full list of codecs supported in Silverlight 1.0 are listed here (scroll down a bit).

    Update: Some comments indicate that people would like to use GStreamer as the media backend (as GStreamer already has licensed codecs and some people might have purchased them already). We would be glad to merge any patches that people send us (copyright assignment required) to add support for GStreamer.

    Update: Some folks are asking whether they could use OGG for the video rendering in Moonlight. Today this is already possible because the media engine we use to prototype is ffmpeg which has support for this. From the standpoint of a desktop developer this might be enough, but for the web, the problem becomes an issue of compatibility with the Microsoft Silverlight implementation.

    We will bring up with Microsoft the issue of adding a new codec, but I suspect that since they are pressed to minimize the download size this might be difficult. There are other competing codecs though that people on the Silverlight groups are fairly vocal about and my eclipse our request. If you want official Ogg support from Microsoft, please bring this up on the Silverlight.net forums, Microsoft does listen to user feedback.

    Update: The "Silverlights"

    Update: There are two versions of Silverlight. The version released today (1.0) is basically a canvas that can be programmed through the browser's Javascript engine. ie, you can use "View Source" on your browser to see how everything is done.

    The upcoming version (1.1, a year from now) extends the browser plugin with a embedded CLR runtime. This is what got us in the Mono team interested in the technology was precisely this.

    Moonlight was originally designed to only implement 1.1, and only later we noticed that it was forwards compatible with 1.0 and that we could deliver both 1.0 and 1.1.

    For developing 1.0 applications the only tool you need is either a text editor or a programming language that supports the "print" command. Designers are useful, but not mandatory (on Windows Blend supports Silverlight, and there might be others). We are building an open source designer ourselves for using on Linux.

    If you want to take advantage of the features in 1.1, you will most likely want a .NET compiler and the Silverlight 1.1 libraries to link against. Our next release of Mono (1.2.6) contains a C# 3.0 compiler as well as the Silverlight 1.1 libraries that you can use to target Silverlight 1.1 using Mono on your favorite OS. Of course, with this setup you lose the ability to "View Source" as it now features compiled code in binary form (although if you really want to, you can just use Lutz's Reflector to look at it).

    Today our plugin depends on Mono on both cases (1.0 and 1.1), but we are exploring our options to remove Mono from the 1.0 case as it would simplify our profiling and valgrinding of our C++ runtime (valgrinding Mozilla + Mono + Moonlight + a web site is a bit slow).

    Working Well With Others

    We will be supporting Firefox and Linux initially (that is our first goal).

    But we are looking forward to work with developers from other operating systems (BSD, Solaris) and other browser (Konqueror, WebKit and Opera) to ensure that Moonlight works fine on their systems.

    Thanks

    Getting this collaboration in place took a lot of work on both ends: both the business and legal teams in both companies as well as various people inside Microsoft that endorsed the idea of having an independent implementation of Silverlight endorsed by Microsoft.

    Special thanks to Bob Muglia at Microsoft and Jeff Jaffe at Novell for getting the official collaboration rolling.

    Scott Guthrie, Bill Hilf and many members of his team that are transforming Microsoft from the inside out and have championed approaching the open source community. Brian Goldfarb made sure that the clock ticked and we got the agreement in place and Marc Jalabert invited us to demo Moonlight at the Paris ReMIX, which led to our 21-day hackathon. And everyone that has so kindly answered our questions on .NET and Silverlight and have championed us from the inside.

    In the Novell side, Frank Rego, Denzil Harris, Patrick McBride and Guy Lunardi worked around the clock to get everything in place for this launch.

    And of course, none of this would be possible without all the members of the Mono team that made our original proof-of-concept possible on June 21st and that have continued to work on all the various pieces that make up Moonlight possible.

    Oh, by the way

    We are hiring.

    If you are a talented software developer with experience in C#, C++, graphics, fonts, audio, Mozilla, Opera, WebKit, QA, packaging or Gtk+ and you do not mind intense and grueling hours of work to produce something millions of people will see and use, send me an email.

    Interviews with the Mono team are usually conducted over email and usually include a complicated and completely useless programming exercise that you complete at home.

    Watching Moonlight in Action

    If you are attending the IBC2007 conference in Amsterdam you will be able to see Moonlight in action at the Microsoft booth. Hacker extraordinaire Rolf Bjarne (of Mono's VisualBasic.NET fame) will be demonstrating Moonlight running on Linux at the show.

    Alternatively, if you want to try out Moonlight yourself, you will need to follow the instructions on our Moonlight page. It currently requires users to compile code from our Subversion repository, we will try to put together in the next few weeks a VirtualBox/VMware image for people to try it out easily.

    If you try it out, please report bugs here.

    Recently we have been fine tuning Mono to render the Halo3 site:

    Halo3 Site on Linux.

    You can see more screenshots of Moonlight in action here.

    Posted on 05 Sep 2007 by Miguel de Icaza

    Steve Jobs on Jon Stewart

    From Engadge's coverage, Steve Jobs apparently just said today:

    "I love Jon Stewart, I hope all of you watch his show. It's the best place to get the news every day."

    People living outside the US can watch Jon Stewart on the web. Highly recommended.

    Posted on 05 Sep 2007 by Miguel de Icaza

    Mono's WebControl

    As part of the work that we are doing to implement Windows.Forms in Mono we needed to provide a WebControl that applications could use to embed a Web browser.

    We needed a bit more control than the control that gtkmozembed offers. Zac Bowling started the work to wrap Mozilla and Andreia Gaita completed it:

    See Andreia's post on wrapping Mozilla for use in Windows.Forms.

    The public interface is Mono.WebBrowser which currently only provides access to Mono.Mozilla, but we envision that we will have other providers as time goes by (in particular our users on MacOS X with Windows.Forms).

    Posted on 04 Sep 2007 by Miguel de Icaza

    Michael Hutchinson

    Michael Hutchinson who co-created during the first Google Summer of Code Project the Mono ASP.NET designer has started work at Novell in the Mono team.

    Michael will be joining Ankit Jain, Lluis Sánchez and Mike Krüeger on improving MonoDevelop.

    Michael started working today from the UK, but will be joining the enormous Mono team (all two of us) in Cambridge (USA) in October.

    I hope he likes sushi. He looks like someone that would like it:

    Posted on 03 Sep 2007 by Miguel de Icaza

    Diary of a Web Media Player

    On Scott Guthrie's blog I found out about Jose Fajardo's journey on learning Silverlight.

    Jose decided to write an iTunes-like media player using Silverlight. He has documented his development in about 20 blog posts here.

    His application looks like this:

    His exercise is aimed towards pixel-similarity with iTunes. Joe Shaw took a more Web-by approach at playback on the web.

    Posted on 02 Sep 2007 by Miguel de Icaza

    Am Becoming Chubbier

    I just noticed that I can barely fit in a shirt that used to be my favorite two years ago. It must be the large amount of fat in those carrots:

    	miguel: I think am becoming chubbier
    	snorp: it's your part-time veggie diet
    	snorp: carrots are high in fat
    	snorp: stick to cow
    	
    Posted on 31 Aug 2007 by Miguel de Icaza

    Nice Unity Interview

    An interview with Nicholas Francis from Otee, the makers of the Unity game development system.

    The Unity folks have been reusing the Mono JIT engine as a game engine, here is a nice blurb about what Mono got them:

    If I have to pull out a specific feature it would be our scripting interface: We use Mono to get C#, JavaScript and Boo languages in there for gamecode. This means you get a scripting language running incredibly fast (*footnote: Initially, we used Python for GooBall. With that we were spending 50% of the CPU time inside scripting code. When we switched to Mono, the same functionality dropped to 1-2% CPU usage - we were completely blown away with how fast it is.) so this is what you make your games in (we also have C++ plugins for people who are passionate about C++ or need to use an existing library). When you make a Mono class, all public variables show up in the inspector for easy modification. So basically, Scripts are 1st class citizens of Unity. We're also using Mono for extending Unity - It really is that good.

    Hopefully, when I have some spare cycles (hahahaha) I would like to assist the Unity folks in porting their game engine to Linux.

    Once we have a port to Linux, we could run most of the games unmodified (the only exception would be those that require C++ plugins), educational software, architecture and advertising software that is being built today with Unity.

    Posted on 31 Aug 2007 by Miguel de Icaza

    Moonlight Designer

    Alan McGovern who worked with us last summer as part of the Google Summer of Code to build a BitTorrent API for Mono called MonoTorrent joined us at Novell this summer as an intern.

    When Alan arrived in Cambridge we had just decided that we would start our hack-a-thon on Moonlight to demo whatever we could get done in 21 days to show at the Mix Paris event.

    Alan worked in the summer on a XAML designer for Silverlight that he called "Lunar Eclipse":

    Ok, do not make fun of it. The important stuff is the engine, not the looks. Am sure Christianism has a quote for this, but I would not know how to google it up, but something like "look at the heart, not at the look". And if not, it is probably on one of those self-help books that I got at a discount price on that bookstore in Newbury St before they shut down.

    The idea was to write the Silverlight designer in Silverlight itself. Currently our designer uses Gtk+ for its user interface plus a Silverlight surface for the designer. We felt that we could also build a web version of it and hence tap into the MacOS crowd that would not have access to the Blend designer either.

    He started when we barely got anything working, it was quite challenging, because every few hours the code would be in a completely different stage. He reported more bugs than anyone else as he was our first "native" user of Moonlight.

    The designer is able to serialize the designs into XAML, it is possible to hand-edit the XAML and go back to the rendering surface and is also has a timeline editor for creating animations.

    Some videos for your pleasure created by Alan:

    Of course, our long term goals would be to polish this up and create a Mono Add-In for MonoDevelop to offer a complete Silverlight development stack on Linux.

    On the development stack side, we have most of the bits to have a Silverlight development stack for Linux, Unix and MacOS ready. Sadly this will not be part of Mono 1.2.5, it will be part of our next release: Mono 1.2.6 scheduled for sometime in October or November. The adventurous among you can already use this by using Mono from SVN (for full instructions, see this link).

    You might notice that LunarEclipse lacks file loading and file saving. This was because Alan insisted that file loading must use the Bittorrent protocol (his argument was that XAML files one day could span multiple gigabytes), but he did not know how to save files with Bittorrent.

    For the time being, you can use cut-and-paste to load and save your XAML files. Either that, or send us a patch ;-)

    Working with Alan this summer was a pleasure. It was my first time working with an Irish that considered the idea of a "seven course meal" to be a six-pack of Guinness and potatoes. The good news is that we turned him around, and by the end of the summer he was an avid chicken-quesadilla consumer.

    Posted on 31 Aug 2007 by Miguel de Icaza

    Gtk+ on OSX

    Michael Natterer posts on the work to integrate the Gtk+ menu with the OSX menu:

    A video is available here.

    Congratulations to the folks involved in getting Gtk+ running on OSX.

    Update: Replaced the ugly screenshot with a beautiful one from Mikael Hallendal from Imendio.

    Posted on 30 Aug 2007 by Miguel de Icaza

    Automatic Playlist Generation Using Similarity Models

    Dominik Schnitzer's Mirage is an automatic playlist generation plugin for the Banshee Media Player.

    This is what makes it interesting:

    Mirage uses the latest AI/music information retrieval techniques to compute a similarity model for each song. So before you can use Mirage to automatically compute playlists, your whole music collection has to be analyzed once.

    After it is analyzed just drag and drop a song you like on the Playlist Generator item in Banshee and a playlist with similar sounding music will be computed.

    Mirage is by far not perfect! Yet :-) - Imagine it is a radio station playing songs from your collection.

    Video: banshee-mirage.ogg.

    Posted on 30 Aug 2007 by Miguel de Icaza

    Google SoC: Gtk# Ribbon Library

    This is the first on a series of posts to comment on the results from the students that contributed to Mono as part of the Google Summer of Code.

    Laurent Debacker completed his Ribbons widget for Gtk#:

    You can also see the widget in action in the following screencast: Ribbons-final.ogg.

    Laurent posted his final SoC status report on this blog entry.

    Laurent needs a special mention because he also documented this class.

    My hope for this widget would be:

    • To move the widget to Mono's SVN repository from the Summer of Code temporary repository.
    • To start packaging it for developers to start using and provide packages for multiple distributions.
    • Get applications to start using the Ribbon. Am I crazy thinking that MonoDevelop could take advantage of the Ribbon to better expose the extensive functionality it has?
      Nobody has used the Ribbon for an IDE before. This has a lot of potential.

    Update2: Laurent followed up with a proposal that he had drafted to improve MonoDevelop with the Ribbon UI. What a funny coincidence!

    Update: Alan found some nice prior-art applications that used the Ribbon-like interface:

    Alan posted on some blog comments a few months ago a much better screenshot. If you own that blog, and remember it, please post the link.

    Posted on 30 Aug 2007 by Miguel de Icaza

    Nice Mono Testimonial

    Found this today, it is a very nice testimonial from someone that tried out Mono to port their code using our VMware image.

    This is for ProMesh.NET a Web platform built on top of the basic System.Web that replaces ASP.NET:

    I was a little curious to see how ProMesh.NET (MVC Web Framework for .NET 2.0) would run on Mono (if at all), so I did the following:

  • Download the VMWare image with a pre-installed Mono installation on SUSE Linux 10.2
  • Download VMPlayer (free)
  • Copied the latest ProMesh.NET source tree to the virtual machine
  • Fired up MonoDevelop
  • Compiled the framework... Works (well, it compiled)
  • Copied the ProMesh.NET demo application to the virtual machine
  • Compiled the demo app... Works!
  • Started xsp2.exe (the lightweight .NET web server for Mono)
  • Opened the index.ashx page using FireFox: WORKS
  • Went through the complete demo site. Everything worked!

    I was utterly amazed by the painless process of compiling and running a ProMesh.NET application on Mono, something I've never tried before (I did have some previous experience with MonoDevelop, but not a lot).

    This is pretty exciting stuff, knowing you can just grab your ProMesh.NET web application, dump it on a Linux box and run it from a Linux web server.

  • Posted on 30 Aug 2007 by Miguel de Icaza

    Replying to My Critics


    Vector-based, then rasterized,
    electronic burger with bacon.

    Some people continue their unabashed criticism of my life-style choices.

    Yes, that was a meat burger with bacon. But as I also explained before we walked into the burger joint that consuming such a burger configuration was perfectly within the limits of my part-time vegetarianism.

    I was not on veggy duty while I chugged it down.

    Also, for those interested, recommended link of the day: The Meatrix.

    Update: My critics have also pointed out my spelling mistakes in the sphere of meat-related naming actitives.

    Posted on 29 Aug 2007 by Miguel de Icaza

    Vegetarianism


    Vector-based, then rasterized, electronic carrot.

    As a part-time vegetarian, I face some small problems. They do not bother me very much, but I feel discriminated by both my meat-eating friends and my full-time vegetarian friends.

    The former mock my ways, the latter doubt my commitment.

    Posted on 29 Aug 2007 by Miguel de Icaza

    Blogging: Interesting Observation

    Dave Winer has an interesting observation on blogging, fact checking and correcting previous statements.

    Sometimes I use an "Update" tag when corrections are sent my way, sometimes I use a new post, sometimes I update and link, sometimes am guilty of being sloppy.

    What is your take?

    Posted on 29 Aug 2007 by Miguel de Icaza

    Mono and XPCOM: Scripting VirtualBox

    A few weeks ago Thomas introduced me to Achim Hasenmueller from Innotek, the makers of VirtualBox, an open source virtual machine system (similar to VMware and VirtualPC).

    It turns out that much of the functionality of VirtualBox is exposed through COM interfaces and at least on Unix they use Mozilla's XPCOM as their COM layer.

    Achim wanted to use Mono to script and control VirtualBox through its XPCOM interfaces.

    The good news is that for the past few months, Jonathan Chambers has been working on adding COM support to Mono. Jonathan has some software that exposes COM interfaces, and wants to be able to control it from Mono, instantiate COM classes from Mono, consume COM interfaces from Mono and export Mono objects to COM applications.

    Jonathan's initial goal was to support COM on Windows, but as the recent testing showed, Mono can use Mozilla's XPCOM to script VirtualBox.

    Last time I talked to Jonathan he was putting together a tool that can import type libraries from XPCOM and generate the C# stubs that are necessary to get access to all the APIs exposed by XPCOM instead of having to manually bind each interface.

    Hopefully Jonathan will post his sample code for folks that might be interested in using COM with Mono on Unix.

    Here is a C# sample that he emailed me recently (for VirtualBox):

            static void listVMs(IVirtualBox virtualBox)
    	{
    	    IMachineCollection collection;
    	    IMachineEnumerator enumerator = null;
    	    collection = virtualBox.Machines;
    
    	    if (collection == null) return;
    	    enumerator = collection.Enumerate();
    	    if (enumerator == null) return;
    
    	    while (enumerator.HasMore)
    	    {
    	    	IMachine machine = enumerator.Next;
                	if (machine != null){
    		    IntPtr ptr;
                        string machineName;
                        ptr = machine.Name;
                        machineName = Marshal.PtrToStringUni(ptr);
                        Console.WriteLine ("\tName:        {0}\n", machineName);
    		}
    	    }	    
    	}
    	
    	static int Main (string[] args)
    	{
                    int hr = 0;
                    nsIServiceManager sm;
                    hr = NativeMethods.NS_InitXPCOM2 (out sm, IntPtr.Zero, IntPtr.Zero);
                    IntPtr ptr;
    
                    nsIComponentRegistrar cr = (nsIComponentRegistrar)sm;
                    Guid kEventQueueServiceCID = new Guid("be761f00-a3b0-11d2-996c-0080c7cb1080");
                    sm.getService(kEventQueueServiceCID, typeof(nsIEventQueueService).GUID, out ptr);
    
                    nsIComponentManager cm = (nsIComponentManager)sm;
                    string NS_VIRTUALBOX_CONTRACTID = "@virtualbox.org/VirtualBox;1";
                    IVirtualBox virtualBox = (IVirtualBox)cm.createInstanceByContractID(
    			NS_VIRTUALBOX_CONTRACTID, null, typeof(IVirtualBox).GUID);
    
                    listVMs(virtualBox);
    
                    Marshal.ReleaseComObject (virtualBox);
                    
                    NativeMethods.NS_ShutdownXPCOM(sm);
                    return 0;
            }
    
    	

    The code above would also automatically work with any other .NET language (for scripting purposes, IronPython, and one day IronRuby).

    COM on Unix

    COM does not exist on Unix as a service that applications can depend on. Developers today have a choice between using Mainsoft's COM runtime or embedding a variation of Mozilla's XPCOM in their application.

    For example, VirtualBox today bundles a copy of XPCOM in its source code distribution.

    Some folks have a lot of code that has been built with COM in mind and this should open the doors for folks to take advantage of it on Unix with Mono.

    Posted on 28 Aug 2007 by Miguel de Icaza

    ASP.NET AJAX in Mono

    The Mainsoft developers have been busy implementing the core foundation for ASP.NET AJAX. They usually do all their testing on Grasshopper.

    Recently System.Web.Extensions got added to the default build in Mono (I do not think this will make it into Mono 1.2.5, you will need to use the code from SVN for that) but we had not really tested it directly with Mono.

    Onur Gumus posted a How To: ASP.NET Ajax with Mono document today.

    For doing native development in Unix this is a bit cumbersome (due to all the new stuff that needs to be added to the Web.config file; Should we put most of this in the standard machine.config?) but if you are moving an application, the Web.config should have been produced by Visual Studio already.

    Konstantin Triger reports that the open source ASP.NET AJAX Toolkit works on Grasshopper, we have not tested this directly with Mono and XSP, but hopefully someone will try it soon.

    Posted on 28 Aug 2007 by Miguel de Icaza

    Election Money

    A useful Flash interactive application to browse how much money candidates have raised, how much they have spent and who are their major donors.

    Three folks that have impressed me (Dennis Kucinich, Mike Gravel and Ron Paul Gravel) have raised very little money compared to the multi-million juggernauts in the mainstream.

    Electability seems to be highly correlated to how much money these folks are raising and spending.

    Posted on 27 Aug 2007 by Miguel de Icaza

    Libros Educativos

    Cuando era niño, era fan de esta colección de libros de Pemsa que tristemente ya no están a la venta.

    Ahora un esfuerzo está tratando de digitalizar libros de segunda mano y completar un acervo histórico en línea (por Barrapunto).

    Posted on 27 Aug 2007 by Miguel de Icaza

    Silverlight and Moonlight: A Summary.

    Edd Dumbill has authored a superb summary on where Moonlight is.

    He has put together a great description that pulls information from multiple sources to put together a really nice story and give a good idea of where we are headed to.

    Posted on 23 Aug 2007 by Miguel de Icaza

    Google Summer of Code: Windows.Forms Designer

    Ivan has posted the final status report for his Mono.Design work for the summer:

    During the summer Ivan worked on implementing a Windows.Forms designer surface and various pieces of the infrastructure to load and save designs. He also worked on integrating Windows.Forms with Gtk# to enable the designer to be used from within MonoDevelop.

    Read his entire report here and you can comment on his blog.

    Posted on 23 Aug 2007 by Miguel de Icaza

    OMG2 OMG2 OMG2 OMG2 OMG2

    OMG2 OMG2 OMG2 OMG2 OMG2 Mark Probst pointed me out to the announcement of Canon's 40D camera. I skipped over the 30D, so this is my opportunity to continue shopping until I drop.

    OMG3 OMG3: it can do Wifi file transfers and hook up to a GPS.

    Posted on 22 Aug 2007 by Miguel de Icaza

    OMG OMG OMG OMG OMG

    As a very happy Rhapsody customer, the news that Rhapsody will start selling DRM-less music at 0.89 cents a pop is ubertastic.

    If I was European or Canadian I would be 30% more excited -- considering the falling dollar.

    I have been using it mostly as a radio so far, and avoided purchasing music because it would be DRMed, but there are a bunch of titles that I would like to own.

    Let the double-click all-amateur shopping begin!

    Posted on 22 Aug 2007 by Miguel de Icaza

    Annotated C# Standard

    Today I received my copy of the Annotated C# Standard that Jon Jagger, Nigel Perry and Peter Sestoft put together.

    This book is an annotated version of the C# specification that comes with plenty of comments and contributions from people that have implemented the language (It has contributions from Mono's Marek Safar, Martin Baulig, Paolo Molaro, Raja Harinath and myself, but also from the C# team at Microsoft, contributors to ECMA and some universities that researched C#).

    Jon has been passionate about C# for a long time. The C# specification that we distribute as part of Monodoc was based on his hyperlinked version of the standard.

    Nigel contributed to both the CLI and C# standards over the years and recently joined Microsoft.

    Peter has written a number of books (Java Precisely, C# Precisely) and is also behind the implementation of C5 a Generic Collection Library (this was a great test case for Mono's C# compiler: it was quite a challenge).

    Congratulations to Jon, Nigel and Peter. They have been working on this project for a long time.

    Posted on 22 Aug 2007 by Miguel de Icaza

    Rafi on Grasshopper

    A few years ago we met Rafi at one of our Mono summits in Boston, he works for Mainsoft and he has always been amazing.

    Watch his interview on what he is doing with Grasshopper here and here.

    He talks about Mainsoft's contributions to Mono, about his testing procedures and the kind of things that are possible with Grasshopper when integrating ASP.NET applications when running on J2EE servers.

    Posted on 16 Aug 2007 by Miguel de Icaza

    Mono Bugzilla: Important

    As you may or may not know, the Mono team is in the process of switching from the Ximian Bugzilla to the Novell Bugzilla. The Ximian Bugzilla installation is a very old, patched, modified, buggy and unmaintained version of Bugzilla. The Novell Bugzilla team has offered to take over the maintenance of Bugzilla and give us both a modern Bugzilla installation and access to various tools that will help our process.

    As part of this process we need everyone to create Novell.Com accounts.

    When creating your Novell.Com account, please make sure to use the same e-mail address that you use to login to the Ximian Bugzilla. This will ensure that your Bugzilla configuration stays the same.

    Please create your Novell.Com account now, so that you will be able to immediately access the Novell Bugzilla when we do the final switchover.

    To create a Novell.Com account, please go to this URL and fill out the form: here

    Important: To link your existing bugs from bugzilla.ximian.com to the new bugzilla make sure that you use the same email address in that form so you can keep tracking the bugs that we had for you before.

    We appreciate all of the contributions that you have made to mono in the Ximian Bugzilla and hope that you will continue to contribute in the Novell Bugzilla.

    Posted on 16 Aug 2007 by Miguel de Icaza

    Toshok: International Man of JSonified Xaml

    Given Toshok's initial reaction to the lack of JSon support in Silverlight last night:

    He decided to do something about it.

    Silverlight is "webby" in that you can use plain text files and you can generate its content from PHP or any other webby framework by using the mighty print statement.

    But XAML is annoying to type, it is webby, but its not uber-webby. It would be nice if Silverlight supported incarnation from JSon instead of incarnation from XAML, for one, it is more wrist friendly than XAML and it also a lot nicer on the eyes.

    This morning Chris implemented a JSon to XAML. See his blog post.

    This is done with a Javascript program, so it will work with your stock Silverlight installation.

    It would be much nicer if Silverlight's Control class had a CreateFromJson in addition to CreateFromXaml.

    See Chris post on the subject. You can now use syntax like this for Silverlight:

    	
    var json = {
      Canvas: {
        name: "Toplevel Canvas",    children: {
          TextBlock: {
            Text: "Hello World"
          }
        }
      }
    }
    	
    Posted on 14 Aug 2007 by Miguel de Icaza

    Moonlight's 2.1 profile

    Silverlight comes with a shrunk down version of the CLR called the CoreCLR and also comes with a reduced version of the core class libraries.

    Silverlight uses a subset of the 2.0 API and removes a lot of stuff that would only be used on a desktop or a server and removes overloads that people are not likely going to use and according to some blog posts even things like System.Collections will be removed giving preference to the generics-based API in System.Collections.Generic.

    Nice graphic showing my Inkscape skills:

    To support this "thin" profile in Moonlight we had a couple of choices.

    We really did not want to branch our source code and chop code left and right until we removed all the extra baggage. We also did not want to use compilation defines because that would get ugly very fast.

    Instead what we did was productize Linker tool that was developed as part of the Google Summer of Code last year.

    The Linker could take an assembly and a description of the desired API entry points and produce a new assembly that only contains the requested entry points plus any of its dependencies. Although the Linker from last year was able to do some basic linking, but as with all software projects, the devil is on the details. JB has been working on productizing the tool ever since he joined Novell back in May.

    The idea was that we would feed the linker a superset of our 2.0 library (2.0 plus the handful of Silverlight-esque APIs) plus a linker description file, and it would produce the resulting Silverlight compatible assembly.

    The above approach allowed us to minimize the number of ifdefs that were required in the source code. In addition to the linking stage we also needed a way of inject a number of security attributes (again to avoid having a mess of ifdefs everywhere).

    So JB created new specialized tool that allows us to add, remove and validate assemblies. We call this the Tuner. Both the linker and the tuner are based on Cecil a library for handling CIL files.

    The tuner can do most of the heavy lifting, but there are a couple of areas that still required human intervention:

    • In a handful of cases abstract methods are no longer exposed in Silverlight, we had to work around this directly (XmlReader).
    • In a few cases there are some interfaces and class hierarchy changes required, those also had to be done manually.

    Finally, since our C# compiler depends very strongly on its mscorlib (the reason we have 3 compilers today, one for each profile is linked precisely to this dependency on mscorlib) we had to add special support to the VM to allow the compiler to call into methods that we had hidden as part of the tuning process.

    This afternoon for the first time JB was able to build the 2.1 profile from the start up to the Silverlight support libraries and the Silverlight plugin with the tuned assemblies.

    Although we have been debugging Moonlight with 2.0 assemblies for the past few months due to some of the API changes some applications like the SimpleXPSViewer did not work.

    There is still some work left to do as you can see from the warnings generated by the tuner, but we are getting there.

    Silverlight Toolkit

    With the 2.1 profile in place it is now possible for people on Linux and MacOS to develop Silverlight applications without using Windows.

    The bad news is that the 2.1 profile will not be available in Mono's 1.2.5 release as we branched that release a few weeks ago. So developers interested in doing Silverlight development on Linux or MacOS will have to wait until our 1.2.6 release in a couple of months.

    In the meantime Ankit has added support to MonoDevelop for compiling existing Silverlight VS Solutions as well as generating Unix makefiles from the VS solution file. You must be using an SVN release of MonoDevelop (sadly, 0.15 wont do it). for this to work though:

    bash$ mdtool generate-makefiles SilverlightAirlines.sln --simple-makefiles
    Creating configure script
    Creating rules.make
    Creating Makefile.include
    Adding variables to top-level Makefile
    Makefiles were successfully generated.
    bash$ 	
    	

    The default is to generate auto-tools based makefiles. It is recommended that people with acid reflux, ulcers or other delicate stomach conditions use the --simple-makefiles option. --simple-makefiles produces a configure and Makefile script that are essentially the labor of love.

    If we can sort out the license for the Silverlight.js template, we should also be able to ship MonoDevelop templates for creating Silverlight content.

    Posted on 11 Aug 2007 by Miguel de Icaza

    Microsoft Visit

    Chris Toshok and myself will be in Microsoft offices in Redmond, WA from Monday to Wednesday next week. Email or post in the comments if you are interested in doing some kind of get together/dinner.

    In related news, Jackson posted a screenshot of Silverlight Scribbler running on Moonlight on his blog:

    Jackson and Sebastien also got parsing of XAML bezier paths working just in time for the June 21st demo, I like this screenshot:

    Posted on 11 Aug 2007 by Miguel de Icaza

    CoreCLR Security

    An important component of Silverlight is a simplified security system for protecting what can be done and what can not be done by user code.

    .NET 1.x and 2.x have a system called the "Code Access Security" (CAS) which Mono has never completely implemented since it there are very few applications that actually took advantage of it (Update: On the comments someone points out that CAS is fundamental for any uses of ClickOnce deployment; Mono has no support for ClickOnce deployment either). This is probably due to its complexity, which leads to people not trying it out in the first place.

    With Silverlight it becomes very important to ensure that we can execute code in a secure fashion and without allowing malicious code to get access to any resources on the system. Code that is downloaded and executed inside Silverlight/Moonlight needs to be sandboxed.

    This new security system is described in a few blog entries from Shawn Farkas:

    Today Mark posted his first implementation of this new security system for Mono for use in Moonlight:

    Here's a preliminary patch for CoreCLR security, including a small patch for System.Security. It should do pretty much everything with the exception of catching method calls via reflection (I'm not sure how this is handles in Silverlight yet, and Silverlight on my Windows machine doesn't like me anymore - grr). I've included a small C# test program which tries out all the different ways (of which I'm aware) to call a method. That'll become a regression test eventually.

    If mono is called with "--security=core-clr" then security attributes are only honored in system assemblies (those in $(PREFIX)/lib/mono/2.1) - other assemblies are always security transparent. To do better testing there's also an option "--security=core-clr-test" which honors security attributes in all assemblies.

    Comments are welcome.

    In addition to the new CoreCLR security system, the needs of Silverlight have finally pushed us to implement the code verifier in Mono. This is currently under development by Rodrigo.

    CoreCLR is very similar to the design that Jim Pubrick has prototyped for SecondLife. Hopefully Jim can switch to the CoreCLR security system. Some of the needs for sandboxing that folks like SecondLife have (execution of untrusted code) can be found in our MonoSandbox page.

    This is a great summary of how the security system works, from Shawn Farkas:

    Over the last week we took a look at the new Silverlight security model. When you're writing a Silverlight application though, there's a lot of information there that you may not want to wade through to get yourself unblocked.  Here's a quick cheat sheet highlighting the important points that you'll need to know when working with the Silverlight security model:

    • All applications written for Silverlight are security transparent.  This means that they cannot: [details]
      • Contain unverifiable code
      • Call native code directly
    • Silverlight applications can access public methods exposed by platform assemblies which are either: [details]
      • Security transparent (neither the defining type nor the method has any security attributes)
      • Security safe critical (the method has a SecuritySafeCriticalAttribute)
    • Silverlight applications may contain types which derive from: [details]
      • Other types defined in the application
      • Unsealed, public, security transparent types and interfaces defined by the platform
    • Silverlight applications may contain types which override virtual methods and implements interface methods which are: [details]
      • Defined in the application itself
      • Defined by the platform and are transparent or safe critical
    Posted on 08 Aug 2007 by Miguel de Icaza

    Silverlight Chess in Mono

    Early this morning Jackson got the Silverlight Chess program working on Mono's Moonlight:

    This demo did not work for a while as it requires that the x:Name declarations from controls created dynamically be merged with the container namescope.

    Between Chris and Jackson the javascript bridge is complete enough that a few hours later (after fixing a double free) it is now possible to have the Mono VM play against the browser Javascript in Firefox/Linux as well:

    Although the original plans were to only support Silverlight 1.1 because we thought that they would be very different runtime, it turns out that by supporting 1.1 we can also support 1.0.

    Various 1.0 demos are working with our implementation as well. The limitations currently are more with our overall support than in a 1.0 vs 1.1 difference.

    Speed

    Testing the Chess on Windows vs MacOS on relatively similar hardware seems to give an edge to Windows (as I do not have any two identical machines to compare, it just feels like the Windows box is performing about twice as fast).

    Am interested in finding out from folks that have similar hardware if there is any significant performance difference in the CoreCLR implementations between OSX and Windows.

    The second screenshot is Mono running on a ThinkPad T60P (T2600@2.16GHz) am curious if someone with Windows with the same machine can report on the .NET vs Javascript nodes/sec.

    Posted on 06 Aug 2007 by Miguel de Icaza

    Mozilla JIT Choices

    I was reading a comparison between Adobe's Tamarin JIT and Sun's HotSpot and there was some discussion started by Chris:

    Maybe, I'm missing something, but I really don't see why Mozilla doesn't build on the Java platform rather than Tamarin. Investing effort in writing a full ECMAScript 3 or 4 translator to JVM byte-code seems like an easier and faster way to get much better results than Tamarin.

    To which one of Brendan Eich's replies was:

    We don't depend on closed source in-process code, period. I've also mentioned the license requirements, not that it mattered due to the lateness of Java's open source transition (GPL alone is not ok).

    I ran the same program that was posted there on Mono, and extrapolating the values (my machine is faster than Chris, but am using Java HotSpot 1.6):

    • Tamarin: 58 second
    • Rhino JS engine: 31.944 seconds;
    • Mono: 10 seconds;
    • HotSpot: 2.23 seconds

    Someone on the thread pointed out that using type annotations might bring Tamarin to 11 seconds. Update: , but Chris was not able to replicate that behavior..

    It is clear that Mono's floating point performance is far from ideal. Currently Mono on x86-32 platforms is still using the x87 "stack" style of floating point operations as opposed to the more efficient XMM style of code generation that we used on x86-64. We should look into this.

    Update: Mike ran the tests on x86-64 where Mono has a different floating point implementation and the results are promising, instead of being 4 times slower than Java in this test Mono is only 2 times slower.

    That being said, for Mozilla purposes, it seems that using Mono as their JIT instead of Tamarin would be a better choice:

    • Mono can be shrunk down to 5 megs by picking files (uncompressed) and even more if you are willing to ifdef stuff.
    • Mono's VM is licensed under the LGPL.
    • Mono runs IronPython, IronRuby and the DLR out of the box, no need to modify either one of them.
    • Mono already supports more platforms than Tamarin (and I believe we support more than Sun's JVM).

    Planning-wise its probably too late to use Mono on Mozilla, which is a shame.

    It might still be interesting to prototype using Mono + Rhyno as a Javascript engine or completing the DLR-based Javascript and see how fast it can get.

    This could probably be prototyped on WebKit/Gtk easily.

    Posted on 06 Aug 2007 by Miguel de Icaza

    ZeroGravity: Winning

    There is some kind of bug in Mono's implementation of Silverlight that is causing ZeroGravity to claim that I have won:

    But at least Aaron's favorite music is playing in the background.

    In other news, Chris just got Silverpad Pad working with the refreshed version of Silverlight:

    And Silverlight Airlines from the 1.1 Refresh:

    Posted on 04 Aug 2007 by Miguel de Icaza

    Progress on C# 3.0

    Marek Safar reports on the progress on the C# 3.0 compiler front:

    This week:

  • Finished 3.0 type inference.

    Next Week:

  • Review and finish the implementation of collection initializers and anonymous types. They are the only remaining bits to have all LINQ components ready for the integration.
  • Pretty much all the C# 3.0 features are now completed. As Marek points out there are a couple of areas that still need some work (collection initializers and anonymous types), but we are in good shape to complete the LINQ support in Mono's C# compiler.

    JB Evain has also been busy creating a new profile of our compiler for developing Silverlight applications. The new command is smcs and it differs from gmcs in the following ways:

    • It enables -langversion:linq by default (so C# 3.0 is the default in the Silverlight profile).
    • Generates assemblies that reference the 2.1.0.0 mscorlib (as opposed to 2.0 that gmcs does).
    • It references by default all the Silverlight assemblies. With mcs and gmcs we only reference System and System.XML by default. We felt that in the case of Silverlight we could reference all the libraries needed by default.

    The majority of our C# 3.0 support will be available in Mono 1.2.5. The recent developments (type inference) did not make it into the release, so folks will have to wait for 1.2.6.

    Posted on 04 Aug 2007 by Miguel de Icaza

    Mono Summit 07

    Last year we had a pretty fun meeting in Boston, but there were a few problems: the event was too short, and renting the hotel was too expensive and we also announced it with very little time ahead.

    We want to do another Mono Summit and we would like to do this event in Spain if possible. The reason is that it is relatively easy to reach Spain and for the European Mono developers (the majority of the Mono team is European) it would be cheaper to fly there than to fly to the US. Spain is also a bit cheaper than other destinations.

    I would like to find a University that could host us for a week of talks, meetings and conferences of the Mono community.

    We would need space for about 120-150 people: maybe some conference rooms for a couple of talks, otherwise classrooms and a place to hack, discuss and some internet connection would be all that we need. This would be sometime in October.

    My preference would be for Madrid or Barcelona as they both are well connected by international air travel.

    Anyone out there interested in hosting us?

    Posted on 03 Aug 2007 by Miguel de Icaza

    Strawman Central

    As I was reading this morning Twenty-Five Ways To Suppress Truth: The Rules of Disinformation I was pointed to about Groklaw's latest attempt to defy gravity.

    As it is becoming common in some circles, some folks like to be purer than the virgin Mary. Groklaw has been for a while expanding into new levels of fundamentalism. The ends justify the means and all that:

    That, to me, wasn't the news, since a Microsoft license was submitted once before, although I gather not by the company. But what I'm noticing is reactions. ComputerWorld collected some truly astonishing responses, and if you follow their links, it gets worse. First, though, the reaction that matters, from Michael Tiemann:
    Michael Tiemann, president of the non-profit Open Source Initiative, said that provisions in three out of five of Microsoft's shared-source licenses that restrict source code to running only on the Windows operating system would contravene a fundamental tenet of open-source licenses as laid out by the OSI. By those rules, code must be free for anyone to view, use, modify as they see fit.

    "I am certain that if they say Windows-only machines, that would not fly because that would restrict the field of use," said Tiemann in an interview late Friday.

    Why would this need to be said? What nerve Microsoft has to even dream of trying for such a restriction. A license that restricts use to only the Windows operating system. Why would OSI even consider that? Have we lost our minds?

    Groklaw: Another Smooth Move from Microsoft: Watch out, Ruby. Watch out OSI.

    Really?

    4. Use a straw man. Find or create a seeming element of your opponent's argument which you can easily knock down to make yourself look good and the opponent to look bad. Either make up an issue you may safely imply exists based on your interpretation of the opponent/opponent arguments/situation, or select the weakest aspect of the weakest charges. Amplify their significance and destroy them in a way which appears to debunk all the charges, real and fabricated alike, while actually avoiding discussion of the real issues.

    The Rules of Disinformation

    Microsoft has a number of licenses under the "Shared Source" umbrella. Most of them are completely useless from an open source standpoint. Michael Tiemann correctly points that out and they would fail the test.

    The only license that can be submitted for OSI approval is the Microsoft Permissive License (Ms-PL) and possibly the Microsoft Community License (Ms-CL). The former is an Apache-like license, the latter is a GPL-like license. Am personally only interested in the first as that is what IronPython, IronRuby, the Dynamic Language Runtime and the ASP.NET client library are licensed under.

    Groklaw goes on to rally up the troops over *other* licenses that are not even under discussion. You would think that this was so obvious that it did not need pointing out, but I guess it needs pointing out.

    Later Groklaw seems confused: how a company can have software open sourced but not embrace it as an open source?

    And does Microsoft want to be an Open Source company? Puh-lease. They may want you to think that, but Steve Ballmer just told the world that it can't embrace that model:
    "Open source has been the issue that surrounds us. Could a commercial model like Microsoft compete with open source? And we've worked very hard on making the value of a commercial company surpass what the open-source community can deliver, because frankly, it's not a business model we can embrace. It's inconsistent with shareholder value."
    Does it get any clearer? And if they have no intention of adopting that business model, the right question is: why are they proposing open source licenses?

    There is no contradiction here. It is only contradictory if you live in a binary world world of black and white. Or if you find images like this to be magic:

    You can open source pieces of software, contribute to open source projects and still not embrace open source as your business model. It is easy to prove this by way of existing examples. Consider IBM and Google: they use open source software, they contribute to open source projects and they fund open source development, but yet their business model is not an open source model.

    An ugly trend is the adoption of the absolutist mindsets. "You are with us or you are against us". Well, for one, am not with Groklaw and am not with Microsoft. My goal is to make open source succeed as a platform and use open source for all of my server and desktop activities. I see no problem in taking open source contribution from companies that have not embraced open source as their business model as long as the code is open source. So I will happily consume open source code produced by Google, IBM and even Microsoft.

    Groklaw asks:

    By the way, guys, check those license submissions carefully. Do they exclude the GPL? Do they exclude sublicensing or allow it only if the sublicensee contacts Microsoft to get permission? How about if a licensee sells the company?

    Well, you would think they would have read the license, but it is easier to get on a rage binge than actually reading the licenses. There is no exclusion for the GPL or Copy-left licenses, the only problem is that the GPL is incompatible with pretty much anything, so chances are these will be incompatible altough am no lawyer and I do not know for sure; They do not exclude sublicensing and you do not need permission from Microsoft, nor do you need to contact them if you sell the company.

    The rage binge continues:

    In that connection, I suggest you look very, very carefully at the IronRuby initiative. The first rule with Microsoft proposals has to be: look for the devilish part. It won't be obvious. Here's the license for it, Microsoft's Permissive Licence, one of the shared source licenses. Is it Open Source?

    The MsPL seems to satisfy both the open source definition and the Debian Free Software Guidelines.

    Groklaw questions IronRuby motives and in the best conspiracy theory tone ponders:

    Is that the only question we should be asking? Here's another. Is IronRuby Ruby? [...] Ruby with a Microsoft twist.

    Obviously they do not know much about IronPython and IronRuby and the trouble they went to in IronPython to remain compatible with CPython. The troubles they went into to be compatible have been explained numerous times, but they are also available on Jim's Zen of the DLR slide deck. I removed the OpenXML remarks as they were just more pandering.

    The article continues by mixing half-facts and speculation as it is now a tradition over there:

    In Ruby's case, my understanding is that it started as Ruby.NET under the MIT license.

    It has different goals, IronRuby is layered on top of the DLR. They got permission to reuse the parser and tokenizer from Ruby.NET which had done all the leg-work of figuring it out (since Ruby does not have a formal language specification).

    The half facts continue:

    Microsoft has added some WPF functions to it. WPF stands for Windows Presentation Foundation. Some would tell you that WPF threatens an open web, the W3c standards, and basically anything involved with the open Internet. I don't know, not being a programmer, but that's what I hear.

    I will agree that you do not know what you are talking about. IronRuby can call any CLI methods and classes just like Ruby.NET and IronPython can (or, gasp, CPython extensions can do so as well) . WPF being just a collection of .NET classes they can be invoked by IronRuby.

    Being able to call CLI code is why I can write IronRuby applications that use Gtk# today on Linux without any changes to IronRuby, there is no magic needed:

    IronRuby Alpha running on Linux/x86 with Mono, calling Gtk#.

    LOOKOUT! ITS SPIDER PIG! MICROSOFT'S SECRET PLOT TO OVERTAKE THE INTERNETS BY ADDING GTK# SUPPORT TO IRONRUBY!

    Oh wait. Does that means that libraries are an evil plot as well? Tune in next week at the same bat-time on the same bat-channel for an answer.

    Then, Groklaw tries a little of guilt by association, always a fine choice in the most reputable sophistry circles:

    For me, it's enough of a warning that Miguel likes the MPL as he did the patent deal and all things Microsoft. He says the license is "by all intents and purposes an open source license". Whose intents? And whose purposes? Remember Lily Tomlin's old joke? If love is the answer, can you rephrase the question? And if this is "by all intents and purposes an open source license" then maybe it's time to look at that definition again.

    Facts and legal terms mean nothing. If Miguel likes it, it must be bad. I hope Groklaw gets nominated for "Best use of Fallacies to Advance a Political Cause" award next year.

    So if the license were to fit the open source definition then "it's time to look at the definition again". Why? Well, because Groklaw said so. Not because "they know" as we already know that they barely researched the subject.

    Now am off to get some more work done on Moonlight, which will serve two purposes: allow Linux users to access Silverlight content and produce an ulcer on Groklaw's posters.

    Disclaimers

    And as usual to avoid the usual round trip in the comments:

    • I speak for myself, I do not speak for Novell;
    • This blog entry does not represents the views of my employer.
    • I do not like Microsoft's overall business model, I do not like the pricing, I do not like lock-in into proprietary standards, do not like their patent threats, nor do I endorse FUD (theirs or anyone else's).
    • Liking MsPL does not mean "endorsing Microsoft" wholeheartedly.
    • I have been asking for collaboration between Microsoft and the open source community for years, and advocating it with their employees and representatives at every turn in the past. Most recently, before I even knew about the Microsoft/Novell agreement am on the record calling for such a thing.

    I think that we have reached a sorry state when our community has to resort to half-truths pandering with fear, uncertainty and doubt. The very actions that people criticize Microsoft for. We can do better than that.

    Posted on 31 Jul 2007 by Miguel de Icaza

    Support the Troops: Conditional Blogger Style

    Last week or so an article that described some ugly scenes in Iraq was published, the article was written by an American soldier in Iraq under a pseudonym.

    Since the picture painted was not very rosy, war supporters set out to discredit the article and its author. The author eventually had to come out and now the war supporters are launching a campaign to punish him.

    Blogger Jon Swift has collected the twisted logic and hillarious conclusions in a phenomenal post.

    You could not ask for a better radiography of cognitive dissonance.

    On the Topic of Serving in Iraq, oh, and the anti-Christ.

    Continuing with the previous topic, Max Blumenthal from the Nation has a great video: Generation Chickenhawk: The Unauthorized College Republican National Convention Tour:

    Max goes on to ask College Republicans why they have not enlisted to serve in Iraq, the answers are pure gold.

    If you liked that video, check also his new "Rapture Ready" video as it contradicts the common notion that the antichrist is Rosemary's baby:

    Posted on 28 Jul 2007 by Miguel de Icaza

    Microsoft and Open Source

    These are good news, as reported on the O'Reilly Radar by Tim:

    In his keynote at OSCON, Microsoft General Manager of Platform Strategy Bill Hilf announced that Microsoft is submitting its shared source licenses to the Open Source Initiative. This is a huge, long-awaited move. It will be earthshaking for both Microsoft and for the open source community if the licenses are in fact certified as open source licenses. Microsoft has been releasing a lot of software as shared source (nearly 650 projects, according to Bill). If this is suddenly certified as true open source software, it will be a lot harder to draw a bright line between Microsoft and the open source community.

    Bill also announced that Microsoft has created a new top level link at microsoft.com, microsoft.com/opensource to bring together in one place all Microsoft's open source efforts. Bill sees this as the culmination of a long process of making open source a legitimate part of Microsoft's strategy. Open source has survived Microsoft's process of "software darwinism" and is becoming an ever more important part of its thinking.

    Bill understands open source.

    As I said last year on Microsoft's Port25, in my opinion, part of the reaction that Microsoft had towards Linux and open source had its roots in the way it was portrayed as a Microsoft killer. Anything that is portrayed as a killer of something will be less than welcome. Or like they say out there, you attract more bees with honey than with vinegar.

    Open sourcing software is a great step for Microsoft. I hope that they continue on this path of openness, and I hope that they will have a good experience with external collaborations with the software projects that they are opening up to external contributors.

    In the last year Microsoft moved away from merely opening up source code under open source terms to actually creating communities that would co-develop components with them. This is the case with their AjaxToolkit for ASP.NET AJAX (Mono-plug: soon in a Linux server near you).

    With IronRuby and its class libraries they will be taking new steps again. These will be the the first projects in which the software is not only open source, but where they will taking contributions back into it.

    Update: In the comments to the piece, Tim has some interesting things to say, and I agree with them:

    Ultimately, I believe this is significant because I believe that Microsoft realizes that they are on the losing side of history. Year by year, they have come closer to recognizing that the old models are dead, and that new ones need to be explored.

    This doesn't mean that all their software will be open source. But I don't see people abusing Chris DiBona about Google's open source program because all of Google's software isn't open source either. And IBM gets lots of love for eclipse and other open source moves without being castigated for all the things they (still) do on the other side of the ledger.

    You guys seem like the Shiites and Sunni in Iraq. No, the other side isn't to be trusted. But the consequence of not trusting, and escalating hostilities, is far worse than exploring what trust is offered, and building on it.

    If you care about Microsoft becoming more free and open, support the people at Microsoft who are trying to bring them along.

    This other piece is right on track:

    Demonizing the other side (in business or in war) is an easy way of actually ignoring the actual facts, after all its easy to say that the devil is bad:

    Dalibor -- my reference to "you guys" was specifically to all the people saying Microsoft is innately bad. All I can say is that if you believe that, you've never spent much time with folks at Microsoft. It's easy to demonize someone you don't know. Harder when you actually talk with them. There are some people there (including the top leadership) that I don't trust, but there are a lot of people trying to make positive change. Help them, don't hate them.

    As to the "losing side of history", my thinking is shaped profoundly by my study of the history of the IBM PC, which broke IBM's old stranglehold on the industry via proprietary hardware. That change didn't make IBM go away, but they had to change to survive, and now everyone thinks they are a good guy.

    I predict a very similar outcome for Microsoft. Free and open source software have changed the world, but not in the way we expected. It doesn't mean that "free" triumphs, just that the locus of proprietary value capture and protection changes from software to something else, just as it previously changed from hardware to software.

    I've written about these ideas at length in The Open Source Paradigm Shift and What is Web 2.0, and events since I wrote those pieces have only confirmed my view.

    I completely agree that Microsoft is participating where they find it useful ... but so is IBM, and Sun, and Google, and Oracle, and even Red Hat, Canonical, MySQL and other "open source" companies. It's never just black and white.

    I could not agree more.

    Posted on 27 Jul 2007 by Miguel de Icaza

    Getting Your Priorities Right

    Republican candidates have been busy crying wolf in the past set of presidential debates. They have gotten their share of softball question on the issue ("if a bomb is about to go off and kill a million people and you had a chance to stop it, would you?") but they barely discuss anything that actually matters.

    From St Pete for Peace Fact Sheets there is this interesting chart on the real threats to America:

    Click on the previous link for the sources.

    More fact sheets here.

    Posted on 27 Jul 2007 by Miguel de Icaza

    IronRuby released

    John Lam at Microsoft has released the first preview of IronRuby: a Ruby compiler that targets the .NET framework (licensed under the MS-Pl license, which is by all intents and purposes an open source license).

    The source code is here. Seo Sanghyeon has already put together a kit to build and run it on Linux with Mono. There is one downside, you will need Mono from SVN, as you need the same fixes for Mono that were required to run IronPython 2.0 and Dynamic Language Runtime (DLR).

    Congratulations to the DLR team at Microsoft for this release. They have also been working towards opening up the development process to external contributors:

    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.

    It is worth noting that the future home of IronRuby wont be CodePlex but RubyForge, John said:

    I (and I'll use I here since I fully take responsibility for this decision if it doesn't work) felt that more folks contributing to open source projects were comfortable with Subversion than with TFS. I wanted to make it as easy as possible for folks to contribute, so Rubyforge was the natural choice here.

    This is a probably a good time to point to Joel Reed's work. He wrote an open source client for accessing TFS systems (CodePlex or your own company's server) from Unix systems running Mono.

    Value Types and Null, the mistery continues

    You will notice a patch in Seo's distribution. This patch is necessary because until today I had refused to implement this broken behavior of CSC 2.0 in Mono's C# compiler.

    Today I finally gave up the resistance and implemented it in version 82517. But I must point out that so far there is no good explanation as to why this broken behavior is present in CSC in the first place. A few months ago I posted the question on this blog and we had a lively discussion but never found a satisfactory answer to this behavior.

    Posted on 23 Jul 2007 by Miguel de Icaza

    Olive Oil

    I like Olive oil so much, that I would be willing to pay good dollars to whoever manufactures an Olive-oil based soda product.

    Posted on 23 Jul 2007 by Miguel de Icaza

    Weekend Videos

    "Feel Good", by Nick Anderson, my favorite part: the Dick Chenney rap sequence.

    video.

    The United States, Israel and the Jewish Community.

    Jeff Halper on is the director of the executive director of the Israeli Committee Against House Demolitions. This is a video from his talk in Portland, Oregon. Produced by PDCJustice.org.

    He is a superb speaker. In particular he touches on a few points that we discussed a few weeks ago on the comments section.

    Watch it here.

    The presentation is 1:10 or so, and there is about 50 minutes of questions and answers at the end.

    It will save us all time if you watch the two hours before you post on the comments section.

    Posted on 23 Jul 2007 by Miguel de Icaza

    Hack Week reviewed in Ars Technica

    Ryan Paul interviews various folks from the Novell HackWeek in this article.

    Posted on 19 Jul 2007 by Miguel de Icaza

    PyroDesktop

    Our own Chris Toshok (Moonlight, Winforms, ASP.NET, Japhar, Hungry hacker) and Alex Graveley (Tomboy, VMware, libSoup) have cooked a pretty interesting desktop environment based on Firefox. It is a combination of window manager, compositing manager built on top of Firefox.

    Check their PyroDesktop project.

    Posted on 18 Jul 2007 by Miguel de Icaza

    Google Gears and Silverlight

    Nice post on using Silverlight with Google Gears.

    Posted on 13 Jul 2007 by Miguel de Icaza

    ASP.NET AJAX in Mono/Grasshopper

    Noam Lampert posted an update on the ongoing efforts at Mainsoft to implement the ASP.NET AJAX APIs for Grasshopper and Mono.

    Mono's implementation of ASP.NET AJAX is limited to the server components. Luckily the client-side library is effectively open source under the terms of the Ms-PL license (same one used by IronPython, DLR; it lacks the OSI stamp of approval, but it is effectively a FLOSS license).

    A bunch of AJAX-enabled ASP.NET components are also being developed in an open source way. You can check out Microsoft's sampler here.

    In other news, Mainsoft has also launched http://blog.mainsoft.com/blog, an aggregator for all-things Grasshopper, .NET on Java and Mono. Check it out!

    Posted on 13 Jul 2007 by Miguel de Icaza

    Go Michael Moore Go!

    Magnificent interview with Michael Moore on CNN.

    That was one solid intervention.

    Stay tuned until the end, when Lou Dobbs has a chance to show his rethorical skills.

    Posted on 10 Jul 2007 by Miguel de Icaza

    Life Imitates The Onion

    Life Imitates The Onion, as seen on reddit.com:

    Posted on 09 Jul 2007 by Miguel de Icaza

    Runtime Sizes

    Mirco Bauer maintains the Mono packages for Debian Linux. Today a minimal install of Mono is quite small.

    He has posted some details here.

    A minimal Mono installation (just the basic runtime) is 2.4M for download and takes 7M on disk.

    Beautiful.

    What was surprising is that a minimal Python install is larger (3.9M download, 13.4M intalled).

    Not surprising is that Sun's Java (JRE) is 34.5M and uses 95.2M on disk. But this is just because its an all-or-nothing installation due to licensing. A full Mono installation is 27M and takes up 78M on disk (this is with symbols stripped, with symbols that goes to 32.7M for download and 107M after unpacking).

    Mono is somewhere in between the JRE and the JDK. Our "complete" package includes the runtime, plus our development kit but does not include documentation, that is separate.

    If we pull in Gnome#, Gtk# and the Mono documentation browser and XSP (with all of their deps) it goes up to 84M for download and 250M installed.

    Mirco has some stats for the various other open source Java VMs as well.

    Silverlight/Moonlight size

    Just looking at the native libraries that we will have to ship with Moonlight/Silverlight I estimate that we will need about 7 megs of disk space plus any other native libraries that we might end up linking statically (Cairo most likely) plus the Dynamic Language Runtime + compilers when they are ready (another 3-4 megs).

    Compressed it will likely come down to 4-5 megs, so our Silverlight implementation for Linux will likely be in the 8M-9M range for the download.

    Rumors

    We know that some products like OTee's Unity ship a stripped down version of Mono for the generated games they produce.

    A friend mentioned that Cisco's DVD documentation ships with Mono and Mono's ASP.NET server (Sadly, Windows-only). Can anyone confirm this?

    Posted on 08 Jul 2007 by Miguel de Icaza

    Font Rasterization -- from Maxim

    Maxim ---of AntiGrain fame--- has written a fantastic analysis of the various text rendering systems used in Windows, MacOS and Linux and proposes some solutions to this problem: Texts Rasterization Exposures -- An attempt to improve text rasterization algorithms using only publicly available information:

    Joel Spolsky in his article "Font smoothing, anti-aliasing, and sub-pixel rendering" [1] compares Microsoft and Apple ways of text rendering and explains why windows people don't like Safari. Text in Safari looks too blurry and that must be why. I want to go further and sum up my experience and observations about it. I'm not an expert in digital typography, but I "have something to say". At least, some ideas may be useful for the GNU/Linux community.
    Posted on 08 Jul 2007 by Miguel de Icaza

    Basic Tuning of Mono's ASP.NET

    Someone was asking the other day about raw PHP vs ASP.NET performance. I do not remember on which forum this was, but I found on JuanCri's blog a couple of simple tips that can improve the performance of your apps:

    • Disable ViewState on forms that do not require it (put EnableViewState="False"). You can set this on a per-control basis for a page, or for all the pages.
    • Use the output cache on pages that load data from databases.. From JuanCri's blog, set the <% @OutputCache Duration="60" VaryByParam="None" %>.
    Posted on 08 Jul 2007 by Miguel de Icaza

    The Pentagon Papers: How They Were Released

    Mike Gravel tells the story on how he released the Pentagon Papers and his involvement in stopping the draft. He is a great story teller. His speech is also quite funny.

    The entire episode from Democracy Now is available here. The Real Player stream is here.

    I loved the last bit about how they managed to publish the papers. When they were running out of sources and it seemed like MIT Press would not publish it, Beacon Press decided to publish them: they had the money and were willing to go ahead with it.

    The Gravel bit (alone) here:

    Posted on 04 Jul 2007 by Miguel de Icaza

    Mono Meets Facebook

    R Tyler describes how you can integrate Mono applications in Facebook.

    His solution uses Mono's ASP.NET, Mono's Facebook-Sharp and he creates a sample application: Weather#.

    Weather# combines Mono, with SOAP webservices to retrieve the weather information and render information specific to your profile.

    Check out his tutorial. It covers how to use MonoDevelop to create ASP.NET applications.

    Posted on 04 Jul 2007 by Miguel de Icaza

    Strong Words

    Someone uses better, accurate, and stronger words to succinctly describe Bush's presidential pardon from yesterday.

    Posted on 03 Jul 2007 by Miguel de Icaza

    No Criminal Left Behind

    President Bush commuted Libby's sentence on the case of ratting out an undercover CIA agent.

    We got our bread and circus when they put Paris Hilton in jail. But when it comes to the real crooks, doing real damage, those either walk free or Congress is too weak to take their jobs away.

    If this was a public corporation, stockholders would have fired the board and the CEO a long time ago and pressed charges.

    Posted on 02 Jul 2007 by Miguel de Icaza

    Porting your ASP.NET 2.x Application to Linux

    Marek Habersack has written a Guide on Porting ASP.NET Applications to Linux using Mono. This is a complement to Jonathan Pobst's Porting Winforms Applications to Linux using Mono.

    AjaxWidgets

    In addition to the two Guides above, the Thomas from Frost Innovations (the makers of Ajaxwidgets has written a tutorial on how he run ASP.NET 2.0 apps on Linux with Mono.

    AjaxWidgets announced 100% Mono-compatible Controls

    The new version of Gaia Ajax Widgets now is shipping with full support for Mono ASP.NET 2.0.

    If you were considering an ASP.NET control library for use in a cross-platform fashion, these guys offer a very nice suite of controls, and they will support you in Mono and Linux.

    In addition to the controls, they provide MonoDevelop solution files and ready-to-run components. In addition to supporting the "big browsers", AjaxWidgets works just fine with Opera.

    If you are an open source project, you can use those controls for free. For commercial projects they offer a commercial version that is very reasonably priced.

    Posted on 02 Jul 2007 by Miguel de Icaza

    Google and HMOs

    A couple of weeks ago, I was reading reddit.com when I found a link to the Michael Moore new movie Sicko playing at video.google.com. 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 video.google.com.

    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 by Miguel de Icaza

    Moonlight Desklets Update

    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 by Miguel de Icaza

    Valgrind Support for Mono

    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/vgpreload_memcheck.so)
    ==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 by Miguel de Icaza

    Jonathan Pobst's: Banshee Integration with Nike+ Accessory

    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 by Miguel de Icaza

    Hack Week: Ankit

    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 by Miguel de Icaza

    Hack Week: Moonlight Desklets.

    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:

    Screenshot

    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 by Miguel de Icaza

    Desklets and Getting Started with XAML

    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 by Miguel de Icaza

    HackWeek: Moonlight-based Desklets for the Desktop

    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 by Miguel de Icaza

    Hack Week Begins

    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: http://idea.opensuse.org.

    Posted on 25 Jun 2007 by Miguel de Icaza

    Video Capture of Moonlight in Action

    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 by Miguel de Icaza

    Concert Weekend

    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 by Miguel de Icaza

    Banshee Media Player Goes to Windows

    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 by Miguel de Icaza

    Moonlight Demo/Interview in French

    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 by Miguel de Icaza

    Paris Dinner

    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 by Miguel de Icaza

    Mono Sightings

    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 by Miguel de Icaza

    Moonlight hack-a-thon

    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 by Miguel de Icaza

    Implementing Silverlight in 21 Days

    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.

    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
      Silverlight.
      
          There are two problems: other than a video (rendered in blue,
      instead of natural colors) and a rectangle that moves, we do not have
      much.
      
          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).   
      
          Issues:
      
              * 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
                code).
      
                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?
      
      Miguel.
      	
    

    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.

    Communications

    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

    Contributing

    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 by Miguel de Icaza

    Interview with Brad Abrams

    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 by Miguel de Icaza

    Government Spies

    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 by Miguel de Icaza

    Little Snippet of News

    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 by Miguel de Icaza

    Paris, June 21st

    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 by Miguel de Icaza

    Porting Windows.Forms application to Linux using Mono

    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 by Miguel de Icaza

    Flight of the Conchords on HBO

    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 by Miguel de Icaza

    Rodrigo, Mark and Marek Join Novell's Mono Team

    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 by Miguel de Icaza

    Interview with Michael Meeks

    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 OpenOffice.org 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 by Miguel de Icaza

    C# and Silverlight

    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 by Miguel de Icaza

    Blowback, Seymour Hersh inteview

    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 by Miguel de Icaza

    The other side of Giuliani

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

    Printer friendly version here.

    Posted on 01 Jun 2007 by Miguel de Icaza

    Google Gears

    Pretty cool!

    Google published Google Gears a plugin that exposes an APIs to Javascript applications for off-line storage.

    It also comes with an embedded Sqlite3 database, very nice.

    Posted on 31 May 2007 by Miguel de Icaza

    Occupation 101 Released

    Occupation 101 has finally been released, after years in production the movie can now be purchased on DVD.

    This is an incredibly important movie to understand the living conditions of the palestinian population in the West Bank.

    The Production

    The movie was directed, shot and produced by two guys which explains why it took so long for the movie to be released.

    Resources

    B'Tselem: The Israeli Information Center for Human Rights in the Occupied Territories (West Bank and Gaza) has extensive information.

    John Pilger's Palestine is Still the Issue documentary is now available on video.google.com.

    Posted on 31 May 2007 by Miguel de Icaza

    Novell and the EFF Announce Patent Reform Partnership

    Nat was today in San Francisco to announce Novell's partnership with the EFF to work on Patent Reform.

    The details can be found here.

    "EFF is partnering with Novell to try to get rid of software patents that are hurting innovation all over the world," stated Shari Steele, Executive Director of the EFF in an interview prior to the panel session.

    In essence, Novell is committed to working with the EFF to improve patent quality, while at the same time work to lobby with government agencies to reform existing patent policies and litigation, according to Nat Friedman. Novell's Chief Technology and Strategy Officer for Open Source. Specifically, Novell will assist the EFF in two ways.

    First, they will work with and support the EFF's existing Patent Busting Project, which targets existing patents that cover technology concepts that are perhaps to fundamental or already have prior art.

    "They're awarded for fundamental concepts in computer science on a too regular basis," Friedman stated. "Things like XOR, the ISNOT operator."

    "If you go on our Web site," Steele added, "we asked Internet users to identify the ten most egregious patents out there. We have our 'Ten Most Wanted.' And we've been one by one hacking away away at them."

    The second part of the partnership will have Novell working with the EFF and legislators to lobby for patent reform, initially in the US, but also branching out to Europe, where patent problems continue to arise. The EFF and Novell will also work with standards groups to assist in patent reform.

    The news is notable because it's the first time, Steele confirmed, that a corporate entity has publicly thrown in this level of support for the EFF on the patent issue. Normally, Steele said, companies have been much more circumspect and allowed the EFF to solely take the lead on this issue.

    The goal is to continue defending Linux from IP threats (as we have done in the SCO lawsuit that has costed Novell millions of dollars) and as we did when we were one of the founding members that contributed significantly to the creation of the Open Invention Network.

    Posted on 23 May 2007 by Miguel de Icaza

    Dynamic Language Runtime: The Slides

    For those of you that could not attend the Compiler Lab but would like to see the slides, John Lam has published two slide decks:

    Posted on 23 May 2007 by Miguel de Icaza

    Compiler Lab: Second Day

    Today was a bonding day for those of us that attended the Compiler Lab, after the morning session and the lightning talks were over most of us stayed around and talk until the end of the day.

    In the afternoon, while some of us were busy schmoozing and debating important topics like what was better: Jon Stewart or the Colbert report and lamenting the results of the French elections some other people were actually busy hacking in the afternoon.

    Apparently some folks that are working on a ColdFussion compiler got their Cold Fusion compiler using the DLR. Rodrigo and JB were also quite busy hacking in the afternoon.

    Good news for Boo users: after I posted my message yesterday about readline-like functionality Cédric Vivier pointed out that he had just implemented the readline capabilities in Booish. You can see the details here.

    Hosting and the Case for Multiple Hosts

    The morning sessions focused on how to host DLR-bound languages into an application and the various services offered by the DLR infrastructure.

    A question that came up is whether it is necessary to support more than one hosting "context" in a single application. Where global variables and types would be shared across multiple scripting instances.

    Although today the DLR does not support more than one context, I believe that it should support independent contexts. A case was made for Processes and AppDomains already existing and that adding a scripting contexts was not necessary but if there were interesting scenarios for this setup they could look into it.

    In my opinion, AppDomains are too heavy of a separation barrier in an application. They are hard to setup properly and depending on them requires an entire application to be restructured around this new boundary. In the particular case of Boo, multiple hosting environments can exist in a single application and I think this is a good thing.

    The best use can I can think of for the need to have multiple hosting contexts would be if the DLR is hosted in two independent libraries A and B developed by two independent groups and then having both of those libraries consumed by a third party. The developers of A and B should not have to talk to each other.

    Another example: I could imagine a setup where I want a scripting context for extending the internals of my application and on the same process, I would like to have a second scripting context that does not have access to the internals of my application, but instead is used by the user to write/prototype whatever it is that my application hosts.

    An accounting application that is heavily scripted internally would use one hosting context for its internal scripting facilities: forms, rendering, accounting and another scripting context would be used for doing report scripting: a much more limited environment that would not get access to all the application internals and types and globals, but only those that make sense for the reporting infrastructure.

    Anyways my vote: yes, we need multiple hosts per AppDomain.

    There was a demo of some scripting editor during the talk that hosted the DLR itself but Google does not turn up anything useful about it (Nessie), it looked cute.

    DLR Code Generation Scenarios

    In the second part of the sessions they showed some examples of what kind of code IronPython, IronRuby and the Javascript compilers generate.

    The DLR in particular provides support for capturing the environment (to create proper lambda functions). A key point during the presentations was that providing as much information the DLR as possible allowed it to optimize the code.

    Rodrigo -the author of Boo- pointed out during one of the breaks that he did like the optimizations that scripting developers were getting for free.

    Milo: Compiler Infrastructure

    In a similar spirit to what the DLR team did by refactoring IronPython into the DLR and then growing languages out of it, Rodrigo and JB talked about a similar project.

    Based on the Boo codebase and their joint work on Cecil while they both worked at db4objects they created Milo (which is available here: http://code.google.com/p/milo/.

    Milo's goal is to simplify the development of a compiler that targets the .NET framework

    Cute Anecdotes

    Their new DLR-based Javascript compiler (that implements the current ECMA spec) was written by two developers in four months. Nandan Prabhu was at the conference and he explained that if they were to rewrite it today it would probably take three months for a programmer to implement as such a person would not have to keep up with the daily changes in the DLR.

    The current sizes for the runtime and the compiler are:

    -rw-r--r-- 1 root root 114688 2007-05-02 04:07 Microsoft.JScript.Compiler.dll
    -rw-r--r-- 1 root root 299008 2007-05-02 04:07 Microsoft.JScript.Runtime.dll
    	

    Extrapolating that from our compiler source code it seems that the code is roughly 35,000 lines of code for both the compiler and the runtime. And the compiler is only one fourth of that, so something in the 9,000 line range.

    Another interesting detail: the new Javascript compiler is written in Visual Basic.NET.

    Dinner

    The day ended up with a fascinating discussion in the kitchen with the Jims (Miller and Hugunin) about languages, big integer support, scheme, python, academia and practice and tons of anecdotes of the early days of the CLR and Jim's days at MIT.

    Posted on 23 May 2007 by Miguel de Icaza

    Moonlight, trivial Video and Canvas

    As part of my Silverlight for Linux research I have prototyped a native code library that uses Cairo and ffmpeg to prototype some of the ideas from the Silverlight canvas.

    The above picture shows 2 videos playing, one of them rotated and a triangle object rendered in the middle as well. This was just a test to get an idea of what is involved.

    The code does no attempt to keep up with the clock or do anything reasonable with time: it just renders stuff as fast as it can and does have no audio support. The next step is tune this a little bit (I do too many copies right now, too much stuff is done on the critical path) and then contrast this with an Agg-based implementation.

    The canvas implementation that am using right now is inspired by the Gnome Canvas in many regards.

    Compiler Lab: First Day

    Today was the first day of the Compiler Lab and got to see again many good friends and some folks I had not seen for ages. This will feel like a name-dropping blog post, but here it goes anyways.

    Scott Gunthrie introduced the day with a general overview of where they are and where they are going with .NET, Silverlight and WPF.

    JB Evain and Rodrigo Oliveira were both late for the opening session, but they looked like they had been hacking all Sunday.

    Jim Hugunin introduced the Dynamic Language Runtime in the second half of the morning and went through the design decisions behind the DLR. Although he has covered some of this information in blog this presentation was colored with the history of how decisions were made and the engineering choices that they had made that took them from IronPython to work on a general purpose framework for hosting dynamic languages.

    The historical bits are always the most interesting to me. Jim talked about how they decided to go for a general purpose framework as people started asking for support for more dynamic languages. They were not really interested in writing all the compiler themselves, so instead they decided to turn their experience in building IronPython in some reusable work that could be used by others.

    To accomplish this, they chose to implement four different dynamic languages extracting the common infrastructure into a reusable framework. Jim did not say how much they had learned from each language (which I guess is a good question for tomorrow), but he mentioned that the DLRConsole sample for Silverlight originally was pure Python. That it took him about three hours to add Javascript, three days to get Ruby in shape to work on the DLR and their new VisualBasic required almost no work.

    I have extensive notes, but they are too extensive and am not sure I want to edit those, but you can get a good idea of what the presentations were all about from his blog posts:

    The DLR is pretty serious, there were at least six people in the audience from the DLR team. I finally got to meet Dino Viehland, Bill Chiles was handing out copies of ToyScript (a reference small interpreter), Martin Maly was there, John Lam sat on the back (we all presume he was working furiously on his presentation for tomorrow) and Mahesh Prakriya was there as well.

    Jim Miller of Scheme fame was there and made things all the more amusing by pointing out the similarities of certain features to Scheme. He also brought up a few issues that would need to be included in the DLR to support languages like Scheme as the day went by.

    Jim Hugunin has always found interesting ways of demoing IronPython. He used to build a calculator with Avalon and rotate the buttons. Today he showed us some XNA space ship controlled with an Xbox control and later used IronPython to control a Lego Robot that his nine year old son had built.

    John Gough was also here and he has retired from teaching at QUT. Nigel Perry has left the University too and is now working at Microsoft.

    John Lam is organizing the lightning talks, and he has divided things neatly into three categories: Monday was the day for 5 minute talks. Tuesday was the day for 10 minute talks and Wednesday is the day for 15 minute talks.

    When I left the building there were zero talks scheduled for 5 or 15 minutes. Everyone is listed on the 10-minute column for tomorrow.

    I had a fantastic dinner with Scott Gunthrie and Jason Zander. I got a chance to pepper them with questions about the early history of the .NET framework for my pet project on the archaeology of .NET to be published in May 2nd, 2076. They were also kind enough to explain to me some of the technicalities about the Silverlight implementation. I should be updating the wiki page with the details later.

    Help Rodrigo

    Apparently "Console.ReadLine" on Cygwin in some way gets line editing even from C# applications. Am not sure how this works, but Rodrigo can not live without this feature in Booish.

    I remember that a few years ago there was a Unix program that will provide readline capabilities to any program that lacked them by running a process under a pseudo terminal and providing line editing functionality to tools like ftp, nslookup or any other Unix tool that did not provide its own command-line editing functionality.

    Posted on 22 May 2007 by Miguel de Icaza

    Rob Connery Interviewed

    In this interview Rob Connery explains how he came up with SubSonic. A tool that helps developers build applications:

    That someday came when I was refactoring the Commerce Starter Kit, trying to leverage as much Data access code into the base classes as I could. I was using generics in a way that they probably weren’t designed to be used, but in the process I stumbled on a really cool pattern for generating very little code for a full data access layer. When I first got it to work I literally jumped out of my chair, swearing to myself.

    I gave it about 2 weeks and tested and tested and when it didn’t break or slow down, I remember thinking "I’ve got something here!". I had been doing some Ruby/Rails stuff at the time, and I had the idea that much of that ΄love‘ could be brought over to the ASP world. Although the real joy of Rails is the language Ruby - but maybe someday RubyCLR will be finished (or some other dynamic language package for .NET) and that’s when I think SubSonic will come into it’s own.

    Through Phil Haack

    Once Subsonic runs on Mono, we should integrate it into MonoDevelop. Rob did a great demo of it at Mix.

    Posted on 22 May 2007 by Miguel de Icaza

    Compiler Lab Meeting at Microsoft

    I will be arriving at noon to Redmond on Sunday and spend Monday and Tuesday (skipping Wednesday) at the Compiler Lab meeting at Microsoft.

    Drop me a note if you want to get together on Sunday afternoon or swing by and say hi during the meeting.

    Rodrigo de Oliveira from Boo fame and JB Evain will be both there as well.

    Mono and the Dynamic Language Runtime (DLR)

    Thanks to Zoltan Varga, Marek Safar and Sanghyeon Seo it is now possible to run the Dynamic Language Runtime in Mono and run the new DLR-based IronPython 2.0 in Mono.

    Update: Mono already supports the pre-Alpha releases of IronPython and has for a long time. What is different is that this is the DLR-based IronPython.

    The changes did not make it into Mono 1.2.4 (Mono 1.2.4 was branched before MIX 07 even started, or the DLR was announced). So you will need to build Mono from the source on SVN or wait for Mono 1.2.5 to include the fixes.

    Posted on 17 May 2007 by Miguel de Icaza

    Paint.NET 3.0 for Mono: Now Public

    We have used Paint.NET for a long time as a test for our Windows.Forms implementation. In the past I have blogged about it (here and here).

    Until now, releasing the port was either painful (because I had botched the 1.x port) or not very useful (because newer versions of Paint.NET depended on 2.x features that we were missing). In Mono 1.2.4 we finally have an implementation of the *Strip classes that are heavily used in Paint.NET for the menus, toolbars and floating editing gadgets so now Paint.NET looks great.

    The port is not complete, but it works. Am releasing it to the public since so many people asked about it and volunteered to contribute to complete the port.

    Links:

    Feel free to join the effort.

    Posted on 15 May 2007 by Miguel de Icaza

    Mono.DataConvert

    Our just released Mono 1.2.4 contains a class that replaces System.BitConverter: Mono.DataConvert.

    We created this interface a few months ago when we ran into problems with the limitations in System.BitConverter in Mono and when we noticed that it was not possible to fix this API. Mono is switching internally to use this instead of BitConverter as it leads to subtle errors when making your code work in big-endian systems.

    Mono.DataConvert offers conversions from and to .NET types to raw byte sequences:

    • Host types to native byte arrays, little endian byte arrays and big endian byte arrays.
    • native, little endian, big endian to Host types.
    • Helper routines for Stream I/O.
    • Perl-like convenience routines for packing and unpacking data structures.

    I like the Perl-like interface, for example:

    	// The following means:
    	// Little endian encoding of a Int16, followed by an aligned
    	// int32 value.
    	byte [] r = DataConverter.Pack ("_s!i", 0x7b, 0x12345678);
    
    	DataConverter.Pack ("^ii", 0x1234abcd, 0x7fadb007)
    	// Result: 12 34 ab cd 7f ad b0 07
    	

    We also have a more traditional APIs, for example:

    	// The instance-based API
    	byte [] x;
    	x = DataConverter.LittleEndian.GetBytes (my_double_value);
    	x = DataConverter.Host.GetBytes (my_double_value);
    	x = DataConverter.BigEndian.GetBytes (my_double_value);
    
    	// Or a static version of it:
    	x = DataConverter.GetBytesLE (my_double_val);
    	x = DataConverter.GetBytesNative (my_double_val);
    	x = DataConverter.GetBytesBE (my_double_val);
    	

    The code is licensed under the MIT X11 license, and we encourage developers on both Mono and .NET to use this library as opposed to the fundamentally limited and broken BitConverter.

    This class is bundled as part of corlib, and is by default "internal". Since this is a small class, developers are encouraged to copy the source code into their own applications. See this for details

    Posted on 15 May 2007 by Miguel de Icaza

    JB Evain joins Novell

    Jean-Baptiste Evain, the author of Cecil the CIL manipulation library that is now used by various Mono components as well as the Mono Linker has joined the Mono team at Novell.

    Posted on 15 May 2007 by Miguel de Icaza

    أهلاً حَبِيبين,أهلاً (Ahlan habibin, ahlan)

    J'ai essayé de faire une interview en Français l'autre jour, mais mon français est pire chaque année, vous pouvez la voir ici.

    J'y parle de nos plans d'écrire une version libre de Silverlight pour Mono.

    Autres nouvelles: j'adore Arvo Pärt et pour quelque raison mon Emacs ne fonctionne pas avec l'arab. of أهلاً

    Posted on 13 May 2007 by Miguel de Icaza

    TimeZoneInfo in Mono

    A few months ago, Stephane Delcroix was working on F-Spot and he needed to track time zone information for pictures.

    The .NET framework did not offer anything to make this easy. Only one timezone could be constructed: the system one.

    His original plan was to implement Mono.ExtendedTimeZone that would be a derived class from the TimeZone class in the framework but that would be populated from some other database.

    He considered a few choices and discussed:

    • Use libc in some form, to pull the data out of it (external program) and create the instances of the timezone as needed. This could be slow due to using an external program with a temporary TZ setting.
    • Parse the libc datafiles, very OS/distribution-specific.
    • Ship our own databases.

    We did not want to go into the business of maintaining the timezone files and redistribute Mono updates every time new countries were created or rules changed, so we opted for dumping the data out of libc in some form.

    Stephane ended up parsing the GNU libc datafiles: they did not depend on external programs, works on Linux easily and is fast. This will require the code to be ported to other platforms though.

    Around that time we discovered that Orcas (.NET 3.5) included a class to cope with this problem in the form of System.TimeZoneInfo in the System.Core.dll assembly. So his API effort changed from implementing a Mono.ExtendedTimeZone to implement System.TimeZoneInfo. Yesterday he emailed me the above screenshot and we got the code commited to SVN.

    Check Stephane's PicasaWeb album it contains various screenshots of his F-Spot work.

    Posted on 12 May 2007 by Miguel de Icaza

    C# 3.0 updates

    Scott Peterson blogs about his recent contributions to the C# 3.0 compiler:

  • Variable type inference (the "var" keyword)
  • Anonymous types.
  • Implicitly typed arrays.
  • Object initialization.
  • Collection initialization.
  • Scott is participating in the Google Summer of Code. His summer project is to port the Banshee Media Player to Windows. But I guess he had to have those 3.0 features before he could start. It makes perfect sense. This patch was reviewed and mentored by Marek Safar who has been implementing various other parts of the C# 3 support (extension methods, the new LINQ parser and the updated delegate semantics).

    The new object initialization allows properties to be set at construction time, for example:

    	// C# 2 style
    	Gtk.Window w = new Gtk.Window ();
    	w.Title = "My App";
    	w.Visible = true;
    
    	// C# 3 style
    	Gtk.Window w = new Gtk.Window () { Title = "My App", Visible = true };
    	

    This also works for events:

    	Gtk.Button b = new Gtk.Button ("Ok") { Clicked = ok_clicked };
    	

    Or using the new lambda expressions:

    	Gtk.Button b = new Gtk.Button ("Ok") {
    		Visible = true,
    		Clicked = (sender,args) => { Console.WriteLine ("Clicked"); }
    	};
    	

    The last case (delegate) is currently not supported by mcs.

    Posted on 09 May 2007 by Miguel de Icaza

    Digger on Silverlight

    So we have all seen the spinning text, the video puzzles and the rotating spiderman trailer.

    But real programs are more complicated than those simple demos. Lutz Roeder has a page with Silverlight applications that he has written.

    My favorite: his Windows.Forms digger port. You can see it here or you can download the sources and learn for yourself here.

    Posted on 03 May 2007 by Miguel de Icaza

    Dynamic Language Runtime

    The presentation by Jim Hugunin and John Lam on the Dynamic Language Runtime (DLR) was a great introduction for the general public on what they are trying to do.

    They showed their Ruby compiler consuming JavaScript and Visual Basic code from a single program: In the above example, Ruby has been extended to allow importing modules, for instance

    	JS = require '3DText.js'
    	

    Imports the code that does 3D transformations (written in Javascript) into the constant JS. To access functions in that javascript module, you just prefix the call with JS, like show on the screenshot (JS.playAnimation for example).

    The Dynamic Language Runtime augments the Common Language Runtime and is made up of a few chunks:

    • A shared type system for dynamic languages.
    • A shared AST that can be used by language developers to create new dynamic languages.
    • Helper/utility routines for compiler developers.
    • A common hosting interface, to embed the general purpose scripting language interface into your program, and allowing developers to extend applications with one or more dynamic languages.
    • Console support, they even have a simple console interface for doing interactive programming.

    Today Jim has a post describing in more detail the shared type system:

    They demonstrated the DLR Console, a sample application written in IronPython that allows developers to interactively write and test their code for Silverlight.

    You can watch the presentation here.

    Variables and functions declared in one language are automatically visible to the other languages, and by clicking on the language at the bottom of the screen programmers can switch between languages on the same session.

    My photo did not come out very clear, but in this shot you can see vb, javascript and ruby. The popit routine written in VB, the event wired up in Javascript, and another event wired up in Ruby: An interesting feature of the DLR is that they added a mapping system for function names, so that code does not feel alien in other programming languages.

    So the event MouseLeftButtonDown from the CLR is exposed to NRuby as mouse_left_button_down in Ruby, here you can see auto-complete when running under the Ruby context: Those properties in .NET are capitalized.

    Various technical details appear on this interview by Darryl Taft:

    Hugunin: In many ways, all the DLR does is it takes these things that we did custom for IronPython and it makes them work for a broad spectrum of languages. So instead of having a Python type system we now have a dynamic type system. So any language that has dynamic operations can share them

    The DLR and Mono

    As usual, Hugunin's team keeps exposing bugs in our compiler. For example, we did not notice when C# 2.0 came out that the operator declaration grammar now allowed for attributes on operator parameters:

    operator-declaration:
    attributesopt operator-modifiers operator-declarator operator-body

    That one is fixed on SVN, but am not sure its worth backporting to the 1.2.4 branch. Another issue seems to be a case of not implementing fully method group conversions as the code seems to be comparing a delegate variable against a method and we barf on that one. A simple fix for now is to merely do a manual conversion in the source "new DelegateType (Method)".

    I did not research this one yet, but plan on doing that today.

    The final issue seems to be an issue with the operator priorities, our compiler does not like expressions like this:

    type t = var as TypeName ?? dingus;

    A temporary fix for now is to put parenthesis around "var as TypeName". It should be an easy fix

    With those fixes you can get the DLR building on Mono, I have not tried the rest of IronPython as am just freshly unpacked from Vegas.

    JavaScript

    Deepak Jain pointed out by email that the Javascript support in the DLR is their new engine, and not a research prototype.

    This new Javascript implementation is following the steps of IronPython: to be true to the original language without .NET extensions. So this is different than JScript.NET that added a bunch of extensions to be a CLR citizen.

    Their new ECMAscript implementation is more of a DLR citizen and true in spirit of it.

    Ruby, Python and the DLR are released under the MsPl, and it would be great if they also did this for Javascript.

    Posted on 03 May 2007 by Miguel de Icaza

    Mike Krueger Joins the Mono Team

    Mike Krueger, the creator of the Sharp Develop IDE, has joined Novell.

    Mike will be working with Ankit, Lluis and Jeff to improve the MonoDevelop IDE, and to try to share more code between SharpDevelop and MonoDevelop.

    Posted on 03 May 2007 by Miguel de Icaza

    Right-sizing the API

    Jason Zander's blog entry on the Silverlight announcement contains a very important information nugget:

    2. The APIs we are releasing are "right sized". That means we looked for the most powerful subset we could find while keeping the size small.

    This I think is what makes Silverlight so interesting to me. Compared to WPF which is a complete framework for desktop applications, they are doing an effort to keep the APIs to a minimum.

    Default Widgets: Silverlight comes with no pre-defined widgets, and although at first this seems like a weakness, during one of the presentations today it was clear that one-size-fits-all was not going to give everyone what they wanted.

    I believe it was during Mike Harsh presentation, where he created a nice looking custom button out of simple primitives.

    Posted on 01 May 2007 by Miguel de Icaza

    Mix 07, Silverlight, Dynamic Languages Runtime and OpenSource

    A very impressive set of demos at Mix 07, the 72 hour conversation that Microsoft is having in las Vegas.

    The focus was mostly around Silverlight, Microsoft's new web plugin to author rich application and tools used to design this content.

    The whole Expression suite was adorable, and Blend is fantastic.

    The demos were pretty amazing, Scott built a nice animation for an airline reservation system on stage:

    Silverlight and WPF

    Today Microsoft announced two Silverlight editions: one that went into beta (Silverlight 1.0) and is a relatively simple technology.

    Silverlight 1.0 uses a retained graphics system (a canvas) that exposes the internal structure to the browser DOM. It has no scripting capabilities built into it, all the scripting support is actually done by the Javascript interpreter in the browser and all changes are done by talking to a Javascript object exposed by the hosted Silverlight surface.

    The scene definition is done using the XAML markup using a subset of the WPF primitives available in the full-blown WPF. Then the big announcement came:

    The second edition was Silverlight 1.1, and this one is a different beast altogether. 1.1 extends the model by embedding a complete Common Language Runtime. Here is the slide that Scott used for this part of the presentation:

    Scott did a demo of a chess program that had logic built with JavaScript and C#, notice the nodes per second computation:

    The outcome of the famous battle between dog vs vampire:

    There are a handful of changes to the runtime. Here are some notes on what I found out about it today. It might not be complete nor accurate:

    • A new security system: Unlike the CAS there is no stalk walking but instead there are trusted and untrusted assemblies. This is part of a new sandboxing model.
    • Trusted assemblies have a way of flagging entry points as being untrusted. which requires that the caller be a trusted assembly.

      This means that calling things like FileStream File.Open (string filename) from an untrusted assembly is not permitted.

      Instead developers would call something like FileStream File.OpenDialog(...) (which is hosted in a trusted assembly) and this would in turn call File.Open(string) and this would return a FileStream that the user selected with a dialog box.

    • The API has been trimmed down: some classes were removed that did not make much sense for the core.
    • A Minimalist WPF implementation: this is now available as a new assembly. This implementation at this point does not seem to have support for high-level controls like Buttons or Sliders, those have to be authored in a per-application basis.

      There is talk about which pieces belong in the minimal WPF and which pieces do not.

      In my opinion, keeping the controls out was a good idea as the controls in the real WPF are a bit too big.

    • Dynamic Language Runtime: the dynamic language runtime is an integral part of the Silverlight distribution.

    Dynamic Language Runtime

    The Dynamic Language Runtime was announced today. Jim Hugunin's blog has the details and rumor is that in the next couple of days/weeks he will be posting on his blogs the technical details behind the design of the DLR.

    Binaries of the DLR were released today as part of Silverlight 1.1, and the source code was included with IronPython 2.0 (also released today).

    The release for the DLR is done under the terms of the Microsoft Permissive License (MsPL) which is by all means an open source license. This means that we can use and distribute the DLR as part of Mono without having to build it from scratch. A brilliant move by Microsoft.

    During the keynote they announced support for four dynamic languages built on top of the DLR: Python, JavaScript (ECMAScript 3.0), Visual Basic and Ruby.

    The rumor on the halls is that IronPython and Ruby will be released under the MsPL license, while ECMAscript and Visual Basic will continue to be proprietary. From Jim's announcement:

    For the short term, our focus is on using a small number of languages to drive the first wave of DLR development where we can work closely and face-to-face with the developers in order to iron out the worst kinks in the DLR design. After this initial phase, we want to reach out to the broader language community. If you're building a language on top of .NET and are interested in supporting dynamic language features then we want your feedback on the DLR. However, I'd discourage you from trying to implement on top of the DLR today. I don't want you to get frustrated trying to work with these really early bits and then not be interested in working with us when we're better prepared to engage with the language community. We plan to kick off a broader engagement with language implementers at the upcoming lang.net conference in three months - at the end of July. This will be the best place to really engage with the DLR and let us know what we got wrong.

    Mono and Silverlight

    For a long time a common question to the Mono team was when we were planning on implementing WPF.

    Most people want to hear a date like "tomorrow", "next month", "in a year". But the answer is more complex than just thinking "we can do this in N months".

    We as a team have to evaluate the cost of implementing a technology and contrast it with the impact that such technology would have. With our finite development resources (in the Mono community and the companies contributing to it) we have to pick our battles.

    And implementing WPF was never really high up on the priority list for a couple of reasons:

    • WPF requires a very big investment before things will start working.
    • Users of WPF is limited to those starting new applications and are willing to start those applications using WPF.
    • Only a minority of existing users (Windows.Forms) were willing to rewrite their software to move it to WPF. The rest basically will continue developing Windows.Forms and using the technologies they have been using for the time being.

    So it is fair to say that we currently do not have plans to look at WPF.

    But a Mono-based Silverlight is an entirely different story. Unlike WPF that requires people to rewrite their software to take advantage of it, Silverlight is aimed at the Web and it will become a nice complement, a way of spicing up existing web applications without rewriting what already works.

    It makes tons of sense for us to start looking at an implementation of Silverlight on Linux with Mono. There is already a XAML loader, it is the perfect excuse to use Antigrain for high-speed graphics and that only leaves the pesky media issue to be solved.

    In fact, am kind of happy that Microsoft did not do the port themselves as implementing this sounds incredibly fun and interesting.

    Upsides

    The major upside of this show has been how open the Microsoft folks have been open to discuss technicalities of any sorts.

    I had the chance of participating on an open source panel at the conference and PHP, Mozilla, SubSonic.NET and Mono were well represented and I did not fell any angry mood from anyone.

    There is also a surprising amount of talk about using the MsPL license, again, all good news.

    Finally, I also made tons of new friends, have had a great time with everyone I have met here. I also noticed that both Jon Udell and Dave Winer both look happier, they were always smiling,

    IE 8?

    Someone mentioned (and I forget whom it was) that talk about IE8 was strangely missing from the whole conversation. There were no announcements about new upcoming features in IE, no mention of whether IE8 will support what-wg nor any future plans.

    Predictions

    So how did my predictions score?

    • "They will spend most of the time showing the new features in the recently released Orcas and probably the Silverlight media encoder." At least on the keynote there were little demos of Orcas, most of the demos were demos about Expression, but they did show the Silverlight media encoder. Am going to give myself half a point.
    • "There will be a fresh Silverlight update." score 1.
    • "Blend and Expression Design will probably ship as a final product, or a new beta will be released." They did. score 1.
    • "Dynamic Language Runtime: a set of class libraries with some sort of supporting infrastructure in the CLR to help dynamic language authors speed up their code.". score 1.
    • "Javascript: probably Microsoft will announce that they are upgrading the JScript compiler in .NET." Although they did announce that it would be writing a new JavaScript compiler, it is not clear if its a research prototype to test the DLR or the real thing, so am going to go with half a point.
    • "Silverlight will bundle a micro-clr." Silverlight bundled a full CLR. So zero points, although I was close.
    • "Silverlight for Linux. And if there is no announcement, we should try to get someone drunk enough to get them to do it." There was no announcement of Silverlight for Linux, but I was still kind of joking. But I did get drunk with senior Microsoft employees. One point.

    So 5 point out of 7, not bad.

    Update: Deepak Jain points out that the new Javascript implementation is not a research prototype, but their new Javascript implementation. The real thing.

    Which gives me full point, so 5.5 out of 7, I think I fared better than most analysts and pundits. I should become an analyst at RedMonk in my next life.

    Posted on 01 May 2007 by Miguel de Icaza

    Two Great Democratic Candidates.

    Mike Gravel, ex-Alaska senator is running for the presidency. Here are some brilliant clips of his participation at the first democratic debate:

    Last night Dennis Kucinich was interviewed by Bill Maher on Real Time. The whole show was fantastic.

    See Bill Maher opening monologue and his interview here or if you want to see only the interview click here.

    Posted on 28 Apr 2007 by Miguel de Icaza

    Mix 07

    I will be at Microsoft's Mix 07 conference next week, am getting to Las Vegas around 5pm, if you are interested in talking about gnome, open source, mono and wildly speculate over the announcements of the week, drop me an email to my gmail account (miguel.de.icaza).

    I will be on a panel on opensource on Monday at 1:30pm

    Update: Dave Winer setup a signup page for those attending Mix 07.

    Posted on 28 Apr 2007 by Miguel de Icaza

    MonoTorrent Curses 0.1 released

    Due to popular demand (all two of you), I have made a tarball of the Curses GUI interface for MonoTorrent as well as Monotorrent.

    Download both:

    Update: Some folks are reporting that the internet tubes are clogged. Wait a little bit for the transfers to start, am using the Coral Cache for distribution (another de Icaza Industries innovation).

    You need to have Mono and ncurses (will work on any modern Unix with ncurses).

    You must first configure, make, make install the monotorrent-0.2.tar.gz tarball and then repeat the same for monotorrent-curses-0.1.

    Once you are done, you can start up this gem of software engineering by typing monotorrent in your console.

    Posted on 25 Apr 2007 by Miguel de Icaza

    Dynamic Language Runtime: Let the Speculation Begin

    For the last couple of weeks news started tricklying over IM and email that Microsoft was going to announce some Dynamic Language Runtime at Mix 07.

    There have been some hints on the blogs, some friends of friends of MVPs, some friends of MVPs and some journalists. The MVPs have been leaking like there is no tomorrow.

    Am not very good at predicting, but here are a few guesses for next week's Mix 07 announcements, in my confidence order:

    • They will spend most of the time showing the new features in the recently released Orcas and probably the Silverlight media encoder.
    • There will be a fresh Silverlight update.
    • Blend and Expression Design will probably ship as a final product, or a new beta will be released.
    • Dynamic Language Runtime: a set of class libraries with some sort of supporting infrastructure in the CLR to help dynamic language authors speed up their code.
    • Javascript: probably Microsoft will announce that they are upgrading the JScript compiler in .NET.
    • Silverlight will bundle a micro-clr.
    • Silverlight for Linux.
      And if there is no announcement, we should try to get someone drunk enough to get them to do it.

    The conference looks like it will be incredibly fun and I am looking forward to meet a lot of people. Lots of talks that I do not want to miss.

    Posted on 25 Apr 2007 by Miguel de Icaza

    Race to Linux Interviews

    These are the interviews for the various winners from the Race to Linux contest that we did in collaboration with Mainsoft and IBM.

    The exercise included porting existing ASP.NET-based applications to Linux. All the ports were completed in a matter of hours, in some cases the download of the VMware image took longer than the port itself.

    Here are the interviews:

    Posted on 23 Apr 2007 by Miguel de Icaza

    Mono 1.2.3 to 1.2.4 Progress

    Jonathan Pobst just emailed me the comparison from Mono 1.2.3 to Mono 1.2.4 from the Mono Migration Analysis tool:

    Mono 1.2.3Mono 1.2.4Change
    Missing Methods19,10518,425680
    Methods throwing
    NotImplementedException
    4,0043,714290
    Methods flagged as "TODO"3,7343,69143

    So 1,013 fresh new implementations since our last release.

    Update: Jonathan pointed out that the numbers for APIs included internal classes (his tool has been fixed) and for internal assemblies or assemblies that we will not be supporting (VB6 support for example).

    So the grand total for missing methods is 10,315 methods and not 18,425. I would fix the table, but I do not have all the updated numbers other than the grand total for Missing Methods.

    From those 10,315, my senses it that we can live happily with up half of them not being implemented (fringe methods that are never used, do not show up in Moma reports or other relics).

    Posted on 23 Apr 2007 by Miguel de Icaza

    Pong on Mono.XNA

    Stuart from the Mono.XNA team today posted a screenshot of the game of Pong (which am guessing is some kind of XNA demo program) running on their open source implementation (called Mono.XNA).

    Posted on 22 Apr 2007 by Miguel de Icaza

    Call for Testers: Mono 1.2.4

    We are about to release Mono 1.2.4. It has been a personal difficult decision, as only a few times in the life of a project you reach such a nicely rounded release name.

    Wade has uploaded the test packages for Mono 1.2.4 for various architectures here: http://mono.ximian.com/monobuild/preview/download-preview

    The diffs between 1.2.3 and 1.2.4 for the mono package (mono and mcs) are almost 20 megabytes in size (I did not count mono-basic, libgdiplus, monodoc, libgdiplus, xsp or mod_mono).

    This release has a pretty much finished version of ASP.NET 2.0, with the exception of WebParts, which we have not done much about yet.

    See my current embryonic release notes for more details.

    Posted on 21 Apr 2007 by Miguel de Icaza

    Clay Movie

    A few years ago I passed my Canon D60 camera to one of my younger brothers (Franciso Isaac):

    He made this animation with clay:

    Posted on 20 Apr 2007 by Miguel de Icaza

    Gonzo, part 2

    Yesterday I watched Alberto Gonzales on C-SPAN, but I did not see these shots from the audience. From Reddit:

    Gonzo did not recall or remember 71 things yesterday, and the audience was keeping track:

    Posted on 20 Apr 2007 by Miguel de Icaza

    Microsoft Happenings

    A couple of things.

    Panel at Microsoft's Mix 07

    My friend Joshua Allen invited me to participate in an open source panel at Microsoft's Mix 07 conference in Las Vegas.

    I will be paneling with Rob Conery (he is behind Subsonic, a rising star in the ASP.NET world), Mike Schroepfer from Mozilla, Sam Ranji from Microsoft (from Port25).

    Rob is collecting questions for the panel. If you have some feedback, post on his blog.

    Silverlight, Flash and open source alternatives

    Microsoft renamed their WPF/E rendering engine "Silverlight".

    Silverlight is basically:

    • An object oriented canvas, this canvas can be controlled trough the DOM by the containing web page.
    • The contents of the Canvas can be preloaded with a XAML-based description. The XAML supported is a subset of the full WPF/Avalon supported by .NET 3.0.
    • So far it offers no built-in scripting, instead it relies on the browser's Javascript engine.
    • It supports video playback using the highly proprietary VC-1 formats.
    • Silverlight is cross platform in the "Windows and Apple are supported" way, no support for Linux has been announced. So it is even more limiting than Flash.

    Silverlight has one thing going on for it, the file format to populate it can be trivially generated by web developers, so it will be easy for people to create cute controls and generate those on the flight.

    The major difference in my opinion between what-ng's <canvas> tag and Silverlight is that Silverlight includes video playback support, and I can imagine that Microsoft will try to convince content providers to switch from Flash or their existing embedded windows media experiences to Silverlight.

    As a Linux/BSD user, this might pose another setback for our desktop. For years video playback on Linux has been a pain due to the lack of codecs for the various proprietary formats (Considering that even on Windows WMA/WMV playback is a random experience). This all changed with Google Video and YouTube.

    Google Video and YouTube popularized the use of Flash for delivering video and it quickly became the norm for video delivery. This opened the doors to the Linux desktop users to watch video content just like everyone else and the pain had been mostly eliminated.

    swfdec open source Flash player.

    Although Flash is not open source and it is not available on every Linux platform at least those of us using x86/x86-64 systems could watch those videos (and in addition, there is a project that is making great progress).

    Reimplementing most of Silverlight is trivial but the difficult bit is getting the audio/video decoding in place (I will not give the Ximian crowd the pleasure of saying "its a weekend hack").

    Lacking a viable open source-based competitor today for rich media delivery on the web and given the current state of both Flash and Silverlight, it is in open source's best interest to ensure that Flash gets ahead of the competition.

    In my opinion, Flash needs a couple of things to stay ahead:

    • A text-based format to populating the flash contents, either from a JSON representation or an XML file.
    • An open specification that allows for third-party implementations. My understanding is that today's Flash specification is semi-open.

    And of course, I think that Flash should be open sourced, but that is a long shot.

    A completely open alternative would be ideal, a combination of:

    • OGG Video and Audio objects as part of the what-wg specification, to complement the existing <canvas> tag.
    • Tools to convert popular design formats like XAML and whatever Flash uses into Canvas tags.
    • Tools and Javascript hacks to implement dynamic loading of extra content for the canvas tags.

    It does not seem like a far shot, but it would require cross-browser support and would prevent us from being locked into either proprietary stacks.

    Opening up Microsoft

    Synergy

    Although there are some groups inside Microsoft that seem to be opening up, pushing open standards, and using licenses like the MsPl (for the Ajax client library for example).

    Scott Guthrie, the star from ASP.NET is now in charge of .NET at Mircosoft. If there is anyone at Microsoft that understands the value of open standards and becoming more standards compliant it is him. So there are good possibilities on the horizon.

    But it seems that larger company considerations like the use of VC-1 will prevent Silverlight from ever using unencumbered technologies.

    This reminds me of that movie In Good Company (with Topher Grace and Scarlett Johansson) where decisions in the company are made to leverage synergy.

    I look forward to discuss this at Mix 07.

    Posted on 20 Apr 2007 by Miguel de Icaza

    Alberto Gonzales' Amnesia

    Regardless of whether Attorney General Alberto Gonzales is innocent or guilty on the case of the fired Federal Prosecutors, it seems that the guy has a severe case of amnesia.

    In my opinion, he should yield the position just on the grounds of exhibiting very strong signs of senility.

    Senator Grilling

    One Republican senator told Gonzales (paraphrasis), regarding all the incompetence in the whole deal:

    "The exact same standards [that you applied to the firing of the prosecturos] should be applied to you"

    "Why shouldn't those standards apply to you?"

    "you ought to suffer the consequences that others have suffered, the best way of put this behind is for you to offer your resignation".

    Gonzales' reply is "Good work is being done, I will rectify".

    Posted on 19 Apr 2007 by Miguel de Icaza

    Ports from the Race to Linux

    The ports of the various contests from the Race to Linux are available here. There are two ports done with Mono/XSP and two ports done with Mainsoft's Grasshopper.

    We got the winners for the second Race to Linux.

    Here is what Jenna just emailed me:

    Congratulations to Mark Cafazzo from Canada! He was the first Race to Linux 2.0 entrant to successfully port the Blog Starter kit to Java EE and run it on Linux using the Grasshopper 2.0 Technology Preview, Visual Studio 2005 and MySQL as the backend database. Says Mark: "The combination of Grasshopper and VMware made porting the Blog Starter Kit a breeze!"

    The Race #2 winner in the Mono category is Rodrigo Queipo of Argentina. He used Mono's XSP ASP.Net server and SQL Server 2000 SP4 for the database.

    Both entries duplicated the look and feel of the original application to the smallest detail and can be accessed from the Race to Linux Website.

    Congratulations to the winers!

    Update: I registered to download the ports and they run out of the box. You type run.sh and its up and running on Linux:

    The Race to Linux site has the description on how the port was done by each participant.

    Posted on 18 Apr 2007 by Miguel de Icaza

    Introducing: gui.cs

    Every once in a while, people ask us "Will the Mono project implement WPF/XAML?" or "What is your position on Apollo?".

    Some suggest that we must have a one-to-one implementation available in Mono. Some others believe that we should implement a new GUI toolkit and plot our own destiny.

    Some argue that to win the hearts and minds of the Linux community we should appeal, not only to the desktop users, but also to other members of the community: system administrators, designers, musicians, perl programmers and users of Midnight Commander.

    There has been a lot of debate over Flash, Adobe's Atlas and WPF/E and how these technologies might be the future of application development.

    For the past few months we have heard you loud and clear. And we have been working on a technology that we believe will revolutionize user interfaces.

    Today we are announcing the response to Microsoft's WPF/XAML, a response to Flash and WPF/E. A cross-platform GUI toolkit (supports Windows, MacOS and Linux and is easily ported to new platforms) written entirely in managed code and 100% open source. It is completely licensed under the MIT X11 license terms as well, for your freedom-zero needs.

    We have been developing this under secrecy until we had something worth showing to the world. It builds on years of building user interfaces, toolkits and frameworks.

    This is a preview release, currently the major sample application is a BitTorrent client built using Alan McGovern and Gregor Burger's BitSharp library (Alan and Gregor wrote this library as part of Google's Summer of Code 2007).

    You can download a tarball from here, browse the source code here. To build the software, you will need to also download bitsharp and edit the Makefiles accordingly.

    The BitSharp GUI is something that I quickly put together this weekend, so it might need some extra polish, feel free to send your MIT X11 contributions my way.

    Everyone loves screenshots, you can see a few screenshots here. Or go directly to main window, torrent control and options configuration.

    You can also see an early prototype, from the days when no color was yet supported on it here.

    Some documentation is here.

    Windows.Forms UI for BitSharp

    In other news, there is now also a Windows.Forms GUI for the BitTorrent BitSharp libraries, available in http://code.google.com/p/monotorrent/.

    Posted on 16 Apr 2007 by Miguel de Icaza

    Google Summer of Code 2007: Mono Project

    The Google Summer of Code has begun!

    A grand total of 24 students were accepted this year to work on various projects related to Mono. The list of students and projects accepted is available here.

    For those interested in tracking the progress of the 24 projects over the summer, we have created a group for the students and mentors here.

    Guidelines for students have been posted in the reference page.

    And we have also created a Google Code Hosting site for all students to upload their code. If you want to track the actual source code development, the group is at http://code.google.com/p/mono-soc-2007/.

    Update: fixed the links.

    The list of accepted projects are:

    by Ivan Zlatev, mentored by Miguel de Icaza
    by David Srbecký, mentored by Martin Baulig
    by Brian Nickel, mentored by Marek Habersack
    by Hector Enrique Gomez Morales, mentored by Mike Kestner
    by Jeff Tickle, mentored by Mike Kestner
    by Lukasz Knop, mentored by Sebastien Pouliot
    by Christopher J Parnin, mentored by Sebastien Pouliot
    by Jesse Tov, mentored by Raja R Harinath
    by Ben Motmans, mentored by Miguel de Icaza
    by Marcos Cobeña Morián, mentored by Atsushi Enomoto
    by Laurent Debacker, mentored by Mike Kestner
    by George Giolfan, mentored by Miguel de Icaza
    by Gernot Margreitner, mentored by Alan McGovern
    by Jared Hendry, mentored by Alan McGovern
    by Leonardo Pires, mentored by Marek Habersack
    by Néstor Salceda, mentored by Sebastien Pouliot
    by Artur Dwornik, mentored by Raja R Harinath
    by Marcos David Marin Amador, mentored by Michael James Hutchinson
    by Kenneth Parnell, mentored by Atsushi Enomoto
    by Scott Peterson, mentored by Aaron Bockover
    by Matej Spiller-Muys, mentored by Atsushi Enomoto
    by Andrew Pendleton, mentored by Miguel de Icaza
    by Nidhi Rawal, mentored by Sebastien Pouliot
    by Khaled Mohammed, mentored by Massimiliano Mantione
    Posted on 12 Apr 2007 by Miguel de Icaza

    First few hours with the Sansa Connect

    As of 2pm am the happy owner of the Sansa Connect.

    The Sansa Connect runs Linux and uses Mono for its user interface, so am 100% biased about the level of awesomness that the device has.

    Opening up the Sansa Connect

    Zing should open up the development for the Sansa Connect.

    The device has tons of potential: the great color screen, the Wifi, their custom-built GUI toolkit and the fact that they use C# and Mono to build all of this stuff.

    In the last couple of hours, knowing that the device was running Linux and Mono, I could not stop thinking of the things I would like to implement:

    • Expose an http interface, so I can post songs to it over the WiFi instead of the USB.
    • Expose my device through HTTP, so I can download song from it using a Web client.
    • Post my songs to last.fm in addition to the Yahoo service.
    • Stream music from last.fm (we already have all the code to play it back) in addition to yahoo streaming.
    • Share my music list over Jabber (this is what Google Talk uses). I sadly have no friends in Yahoo Messenger, as I never have used it.
    • Add a picasa client for the pictures using Google-Sharp, again, because I gravitate in the Google universe instead of the Yahoo universe.
    • Allow the machine to stream from Shoutcast, HTTP or DAAP servers on my local networks (what I have at home and at work), this would automatically make it a client for the various iTunes machines around and use my server at home as my streaming source.
    • Update: I forgot to mention (thanks bhale!) last.fm playback (we already got the C# code, last-exit).
    • Games ;-)

    I understand that going from being an embedded system vendor into a platform provider might not be easy but opening up the platform just a bit would achieve plenty. All that would be needed is:

    • Publishing the assemblies that the device exposes. The community can use `monop' to actually generate the public class definitions and prototypes. We could get by with little or no documentation.
    • Documenting a process for re-flashing, uploading or tricking their operating system into loading the new assemblies.

    A hackable platform for portable media players would be one way of differentiating from the iPod. Growing an ecosystem of third party developers that produced applications and components for Zing's tools would make these devices more appealing than the iPod is.

    The WiFi on the device and the complete stack really open tons of new options on this device.

    Early Impressions

    The device came in one of those plastic seals that are known to have caused more deaths that drunk driving in Guatemala. After a few seconds of Googling I gave up and teared the thing apart by cutting and bending until the thing was reduced to pieces of confetti. In the process I ruined Katey's scissors. Sorry about that Katey.

    There was a sticker that said something along the lines of "IMPORTANT: Do not plug this device before installing the software". Or something about not turning it on before doing something. I would report the actual wording if the sticker was not burried underneath the remains of my tuna sandwich and the potato leak soup that I threw in the garbage can.

    I ignored the sticker, because programmers know best. And besides, I was not going to plug it into Windows, I was going to plug it into Linux.

    The device does not expose a USB mass storage interface, instead it exposes a Media Transfer Protocol (MTP) interface. Luckily we can use libgphoto2 and libmtp to access the device.

    With the libmtp clients you can actually copy files into the device (the clients command line arguments are awful) which worked to upload "Don't fear the Reaper" and get enough cowbell out of it.

    My Banshee was not compiled with MTP support and Amarok hung while trying to access the device. I shall look into recompiling my Banshee later with the proper support.

    Internet Radio and the WiFi

    This was fantastic. You select a wireless network and the little guy goes and gets an IP address and lets you play internet radio and browse Flickr pictures.

    The Flickr browser seems fine, but am not really a Flickr user. It appears to come with a Yahoo messenger, but since I have exactly zero friends on my Yahoo Messenger (pretty much everyone I know has moved to Google Talk) I have not even tried it.

    Service

    I am still pondering whether it is worth buying a Yahoo subscription for the device. The radio streaming from the radio stations on the device is pretty passable so am left wondering if I really want to give Yahoo 14 bucks a month. Am already paying Rhapsody and at least Rhapsody has a Linux web player (it sucks, but at least I can play it on Linux).

    Two questions: Yahoo advertises that they have 2 million songs on Yahoo Unlimited. I am pretty used and happy with the music selection at Rhapsody, but I could not find how the music collections at both sites compare.

    Rhapsody does not let me play music when am traveling outside of the US. I once read the excuse, but it must have been incredibly lame because I did not bother to remember it.

    Would Yahoo let me play music when I travel? Decisions, decisions.

    If I buy the Yahoo service, would they allow me to http get DRM-ed songs to upload to my device, so I can play all my music on Linux?

    Posted on 10 Apr 2007 by Miguel de Icaza

    Sansa Connect is Shipping

    The Mono-based Sansa Connect MP3 player is now shipping.

    The device comes with WiFi and 4 gigs of space for 250 dollars (50 dollars more expensive than the equivalent iPod, but comes with WiFi, internet radio and a Flickr browser). It has an expansion slot, so you can add more memory to it, so you can upgrade the space without upgrading the hardware and it integrates with Yahoo Music.

    I will be ordering mine today.

    Engadget has an updated review, it is pretty good, but they say regarding the music services:

    We're disappointed that the Connect isn't a little more open than it is; we'd like to be able to stream whatever the heck we want for starters, but Yahoo! Music Unlimited and LAUNCHcast aren't bad starts. Now the trick is to keep up the WiFi momentum for these things -- Apple, Creative, iRiver, Archos, we're looking straight at you!

    Someone on the blog comments a few months ago asked whether Zing would open up the platform for people to develop plugins for it, but it seems that at this point they have no plans to do so. I wish they did.

    Online Music Services

    A problem with the Sansa Connect is that Yahoo Music does not have a Linux client.

    I am currently a Rhapsody user, and I use it mostly on the Windows machine that I use for testing .NET and reading the MSDN documentation. Although Rhapsody has a Linux client, you must be using Firefox to play your music (they use a firefox plugin and a web page with Javascript for their web player).

    The situation is far from ideal, I would much rather have Banshee be my music front end.

    So this weekend I tried to make a fake plugin host that would trick the Rhapsody plugin into loading, but am getting one misterious crash while calling NP_Initialize in the plugin (it loads Flash just fine) (source here, in case someone feels like debugging it).

    Posted on 09 Apr 2007 by Miguel de Icaza

    First Race to Linux, Winners

    Lam Loune is the winner of our first Race to Linux. Lam is from Australia and ported Microsoft's Small Business Starter Kit to Linux.

    Lam picked Mono and XSP to do the port, he completed the port in five hours and twenty six minutes (5:26) since the race started.

    Hector Ramirez from Mexico was the first to port the Small Business Starter Kit to Linux using Grasshopper (so the software runs on a Java VM). Sorry, I do not have the time for this one.

    They both won Wii's.

    The Small Business Starter Kit is a sample ASP.NET 2.0 application that Microsoft distributes for people to study the patterns and best practices while developing a web application.

    This race shows that although Mono and Grasshopper do not have a 100% coverage for the entire application stack, it is possible to port most ASP.NET code out there.

    And its also interesting that the port was done by two newcomers to Mono.

    Check the Race to Linux page for upcoming articles describing how these applications were ported.

    Congratulations to Hector and Lam, and good luck for the folks on the second Race!

    Posted on 31 Mar 2007 by Miguel de Icaza

    Mexico City

    Am flying to Mexico City for the week; Mauro convinced me to buy a cheap ticket through Kayak.

    Tacos tonight!

    Posted on 31 Mar 2007 by Miguel de Icaza

    Google in the News

    Two fascinating bits today:

    Google using solar power in the Google campus:

    The move to solar made sense for Google, and not just "hippie Gaia-loving" sense. Ravitz said that Google will earn its investment back in 7.5 years, after which it will continue to enjoy inexpensive power for decades. With the company sprawled across a large campus of many low buildings, roof space was easily available. Solar also has the unique property of pumping out more energy when power is the most expensive --- peak afternoon hours. When air conditioners across California kick into action on sunny days, Google generates the most power.

    Then the fantastic response to Viacom. Worth reading the whole thing:

    Viacom is attempting to rewrite established copyright law through a baseless lawsuit. In February, after negotiations broke down, Viacom requested that YouTube take down more than 100,000 videos. We did so immediately, working through a weekend. Viacom later withdrew some of those requests, apparently realizing that those videos were not infringing, after all. Though Viacom seems unable to determine what constitutes infringing content, its lawyers believe that we should have the responsibility and ability to do it for them. Fortunately, the law is clear, and on our side.
    Posted on 30 Mar 2007 by Miguel de Icaza

    Interview

    A few years ago I met Andreas Proschofsky, a reporter that knew a lot about Mono dynamics, group and technicalities. It has ever since a pleasure to do interviews with Andreas as they are typically interesting conversations.

    This year I did not attend the Brainshare conference so we did an email interview on the state of Mono. And this year he published it in English.

    Re-reading my replies looks like they were answered by a robot though, it certainly felt more human when I originally replied to that email.

    The crowd at OSNews got upset because I said advocate more collaboration between Mono and Microosft. It is hardly news, I advocated the same thing in August during an interview that I did with Sam Ramji from Microsoft, before I knew of any MS/Novell collaboration.

    Posted on 26 Mar 2007 by Miguel de Icaza

    Bill Maher Monologues

    The last two weeks the "New Rules" Monologues from Bill Maher have been fantastic. They are now available on YouTube:

    Posted on 25 Mar 2007 by Miguel de Icaza

    Lame Blog: The Official Entry

    This is the official blog entry for the spicy Lame Blog an under-powered, static content, C# and rsync based blog system.

    LameBlog is powered by almost nothing, the idea is that you edit text files with your favorite text editor on your computer, and when you feel like publishing your blog entries you type "make push".

    Configuration of LameBlog is done through an XML file and editing a Makefile. It contains enough so you can hook reddit/digg and plug your Google Analytics, Google Reader sharing and to do posts with Google groups.

    Ismael Olea has modified LameBlog for using Haloscan for comments and include a bunch of "flag me as a cool cat" options.

    To download LameBlog, click on "download as tarball" on the link above, read the README file for details on how to install this.

    Update: folks, I need your help. Please link to this blog entry, there are tons of Google matches for "Lame Blog", but only a piece of software deserves to be at the top spot, not some lame entry about blogging.

    Posted on 24 Mar 2007 by Miguel de Icaza

    Second Ad

    A follow up to yesterday's spoof ad from Novell. This is part 2. Click here for watching it at YouTube.

    Alternatively, you can get the mpg or ogg files directly from Novell's site.

    Posted on 21 Mar 2007 by Miguel de Icaza

    Novell Linux Ad

    Yesterday at Brainshare Novell had this video spoof on Apple's campaign.

    Direct link

    Mhm, it seems to go down (some "high database load" message or something). If you have problems go here: http://www.novell.com/video and then click on "PC Mac Linux (0:55)".

    Or you can download the mpg file or ogg file.

    Other videos from Brainshare are here.

    Posted on 20 Mar 2007 by Miguel de Icaza

    Shader Languages

    The other day I wrote:

    The other day Cody Russell was asking on IRC what we could do in the Mono universe to take advantage of some special instruction sets like SIMD or how to use C# to generate code for pixel shaders or vertex shaders.

    One idea that we discussed was the creation of a library that would be able to expose this kind of functionality.

    jeevan.james pointed out on the comments to that blog entry that there is already a project that is working on precisely this idea.

    The project is called Brahma-FX and is hosted at SourceForge. And its implemented in a similar spirit that I described on that post.

    They use C# as the language to express the shading operations, they decompile the code at runtime and compile that to the hardware specific shading system.

    For example to invert an image, they write:

    
    	public override void Compute (Vector2 kernel_position)
    	{
    		Vector4 color = Sample2D (0, kernel_position);
    		Output = new Vector4 (1.0f - color.X, 1.0f - color.Y, 1.0f - color.Z, 1.0f);
    	}
    	

    Currently they have a compiler only for DirectX (and stubs for OpenGL and XNA) it looks like a great project to contribute to.

    Ananth's blog is here.

    Posted on 19 Mar 2007 by Miguel de Icaza

    SIMD support in Mono

    The other day Cody Russell was asking on IRC what we could do in the Mono universe to take advantage of some special instruction sets like SIMD or how to use C# to generate code for pixel shaders or vertex shaders.

    One idea that we discussed was the creation of a library that would be able to expose this kind of functionality. Take for example the following Cg example:

    // input vertex
    struct VertIn {
        float4 pos   : POSITION;
        float4 color : COLOR0;
    };
    
    // output vertex
    struct VertOut {
        float4 pos   : POSITION;
        float4 color : COLOR0;
    };
    
    // vertex shader main entry
    VertOut main(VertIn IN, uniform float4x4 modelViewProj) {
        VertOut OUT;
        OUT.pos     = mul(modelViewProj, IN.pos); // calculate output coords
        OUT.color   = IN.color; // copy input color to output
        OUT.color.z = 1.0f; // blue component of color = 1.0f
        return OUT;
    }
    	

    A C# rendering of the above would be:

    class MyShader {
    	struct VertIn {
    	    [Position] float pos;
    	    [Color]    float color;
    	};
    	
    	// output vertex
    	struct VertOut {
    	    [Position] float pos;
    	    [Color]    float color;
    	};
    	
    	// vertex shader main entry
    	public VertOut main(VertIn IN, [Uniform] float4x4 modelViewProj) {
    	    VertOut OUT;
    	    OUT.pos     = mul(modelViewProj, IN.pos); // calculate output coords
    	    OUT.color   = IN.color; // copy input color to output
    	    OUT.color.z = 1.0f; // blue component of color = 1.0f
    	    return OUT;
    	}
    }
    	

    The above is a direct translation. Now, the value of the library would be basically a method that generates a delegate with the proper signature:

    
    	Delegate Compile (MethodInfo method)
    	
    	

    It would be used like this:

    	delegate VertOut main_delegate (VertIn In, [UniForm][float4x4] model);
    	...
    	main_delegate shader;
    	shader = (main_delegate) Compile (typeof (MyShader).GetMethod ("main"));
    	...
    	shader (my_in_data, model);
    	

    The Compile method would use the Cecil library to decompile the code, perform flow analysis and ensure that the code in the method passed (in this case main) meets the restrictions imposed by the target (in this case Cg's target).

    In some cases (SSE instructions) you might want a delegate back, or a method token that you could then Reflection.Emit call. In some other cases you might want the code to give you some handle back that you can pass to your graphics hardware.

    (Cecil has a very nice flowanalysis engine, the one used by db4objects to provide the LINQ-like functionality with today's C# compilers).

    The above model can be extended to other operations, and in some cases the return value from Compile could be just a delegate to the original method (if the hardware is not supported).

    Today a student interested in doing something very similar for the Summer of Code emailed me, so I decided to dump here some of the ideas.

    Posted on 15 Mar 2007 by Miguel de Icaza

    Mono and the Google Summer of Code

    The Google Summer of Code has started. Students interested in participating in the Summer of Code need to submit their applications in the next ten days.

    Some ideas of interesting things that can be done with Mono are available in our Student Projects page.

    If you think that you have a good idea for a project to be implemented for Mono, but is not listed on that page, feel free to submit your idea.

    We are looking at improving Mono's OSX support (Winforms, debugger support, improving Cocoa#); new ports and improving existing Mono ports; Profiling Mono, Gtk#, MonoDevelop; low-level optimizations; New Windows.Forms widgets; Work on 3.0 components and libraries; Improving MonoDevelop and creating new C# class libraries for Mono.

    Other Apps: We are also interested in tasks improving popular Mono-based applications for the desktop to showcase how great building applications with Mono is. Make sure you send your submission on time.

    Posted on 15 Mar 2007 by Miguel de Icaza

    Eiffel now Open Source

    One of my favorite books is Bertrand Meyer's Object Oriented Software Construction

    The book explores object oriented programming using the Eiffel language and one of the things that I always loved about Eiffel was the defensive programming techniques that it teaches and the strong focus on contracts and preconditions (a technique that is used extensively in Gnome).

    Until very recently I had not noticed it, but the Eiffel compiler and the Eiffel suite of libraries and even the development IDE (EiffelStudio) were open sourced (Emmanuel mentions this to me during the Lang.Net conference and I do not remember any big news about it).

    They have just launched a community site Eiffel Room.

    There are a bunch of Flash-based presentations on Eiffels here.

    In this presentation you can see a demo of the IDE. In particular see the "System Metrics" section.

    Posted on 13 Mar 2007 by Miguel de Icaza

    Value Types and Null

    Anyone has any idea of what is going on with value type comparisons against null in the Microsoft C# 2.0 compiler (and also the Orcas compiler exhibits this problem):

    The compiler allows code like this:

    	DateTime dt = DateTime.Now;   // this is a value type
    
    	// Compare value type to null, invalid in CSC 1:
    	if (dt != null){
    		// ...
    	}
    	

    The problem is that the above is always known to be false (dt can not be null), so CSC generates generates the equivalent to "if (true)" every single time (it becomes a no-op).

    Adding support for this to the Mono compiler is simple enough but this sounds wrong. Because those testing a value type against null are doing a pointless test and they might be under the mistaken impression that the test is guarding them from an invalid state which it is not.

    A few folks have reported this, but I can not find any rationale for this in the ECMA spec, it sounds like a bug in Microsoft's compiler related to the nullable-type support in their compiler.

    Posted on 13 Mar 2007 by Miguel de Icaza

    Mono on the Nokia 770 and 800

    Everaldo and Wade have now published packages for Mono on the Nokia 770 and 800.

    Visit our Maemo page to install the packages on your device.

    The packages feature single-click install, and will add the repositories to your system so you can install only the pieces of Mono that you need to run specific applications.

    Posted on 12 Mar 2007 by Miguel de Icaza

    Must Blog This: Bush in Latin America

    As I said two days ago Bush is not really loved in Latin America.

    Wonkette asks the question: "Are the protesters hot?" on their "South Americans Welcome George W Bush -- With Style".

    The answer: not safe for work.

    This is the first time I link to Pravda, but they got photos of the welcoming.

    Posted on 09 Mar 2007 by Miguel de Icaza

    Mono JIT Developer.

    We are looking for a developer to work on Mono's JIT engine.

    What: We are looking for someone that would be interested in porting the Ahead-of-Time compilation engine in Mono for ARM processors and look at improving Mono startup performance on small devices.

    You would work on both the virtual machine and the class libraries to improve performance and reduce memory usage for embedded systems.

    Experience with assembly language, compilers, virtual machines, performance and garbage collectors will be useful, but it is not necessary. We are looking for a talented individual that is not scared by hard tasks.

    How: If you are interested, email me, you will later receive a challenging interview to respond to.

    Where: You can either work in the Boston office, or from home.

    Why: Because we got a fantastic logo, which is much better than Microsoft's logo for .NET and working on Mono is a blast.

    Posted on 09 Mar 2007 by Miguel de Icaza

    It made me smile

    From Google News a few minutes ago:

    That made my day, funniest thing so far!

    If you thought that Europe was less than supportive towards the Iraq war you have not seen Latin America. Unlike the US population that has kind of grown tired of the Iraq war in the last year, Latin America has been fuming over the retardedness of it way before it started.

    He is not going to meet a friendly audience, so unless he throws money out of the windows, announces a withdrawal from Iraq, agrees to pay reparations and announced an "open doors policy" this trip is not going to win him any bonus points.

    A timely Common Dreams article.

    Update from Friday: This is now in Reddit's home page, it links to this article:

    Second Update:

    GUATEMALA CITY - Mayan priests will purify a sacred archaeological site to eliminate "bad spirits" after President Bush visits next week, an official with close ties to the group said Thursday.

    "That a person like (Bush), with the persecution of our migrant brothers in the United States, with the wars he has provoked, is going to walk in our sacred lands, is an offense for the Mayan people and their culture," Juan Tiney, the director of a Mayan nongovernmental organization with close ties to Mayan religious and political leaders, said Thursday.

    More updates, this is the Wonkette coverage. Wonkette asks the question: Are Brazilian protesters hot?: "Of course they’re hot! They’re Brazilian, for god’s sake.".

    Posted on 08 Mar 2007 by Miguel de Icaza

    FOSDEM Presentation

    My "Turbocharging Linux With Mono" presentation from FOSDEM is now online, it is a pretty large file (300 megs) but you get to hear Coca Cola guy at the end.

    The presentation is here.

    At night, I kept running into Michael Meeks and Simon Phipps in all these tiny bars in town. Simon did a quick interview on Sunday.

    Posted on 08 Mar 2007 by Miguel de Icaza

    Need some Google Help

    Folks, it has come to my attention the fact that my blog uses Google Groups is not very Web 2.0-ish, or is not very bloggy of me or something. Either that, or people have not been flaming me in public as much as I hoped to.

    Part of the challenge is that my blog system is based on purely static HTML pages, and I would like to keep it that way. I get it for free (Thanks Gonzalo!) and server side solutions feel like cheating.

    So I had a two-prong idea to address the issue:

    • Add some comment form at the bottom that would post to the Google Group.
    • Add some Json Magic to load the comments that are posted on the Google Group to be rendered on each blog entry.

    Now, it seems that posting to the Google Group requires to be signed on to the group, am not sure if that is even fixable, but I would love to hear your thoughts.

    Now, the second issue must be solvable, there must be a simple set of steps, an HTTP url I can query that would load the content from Google Groups and then render it with some magic jay-son love on the client (just like the cute "shared" links thing on the right side of my blog).

    Google probably already has some JSon generator for this, but I have been unable to Google this information. If anyone knows how to do this, please share your thoughts.

    Again, the trick is that even if I could setup a server-side thing in my hosting provider, it has no hack value. So the trick is basically to do this without burning any CPU cycles on the blog server, am fine with delegating the cycle burning to third parties.

    A combination of Yahoo Pipes, Google searches and clogging the series of tubes with tremendous amounts of material, tremendous amounts of JSon material are all acceptable solutions.

    Posted on 07 Mar 2007 by Miguel de Icaza

    Race to Linux 2.0

    Very soon we will be launching the The Race to Linux 2.0 together with Mainsoft and IBM. The goal of the Race to Linux is to have ASP.NET developers port applications from Windows to Linux.

    Wii consoles will be given out as prizes. Guys, it is a lot easier to port an application in ASP.NET from Windows to Linux in a record time than it is to keep bidding on EBay for the console and the controls. Been there, been outbidded time and time again.

    The contest will start on March 23rd, if you are interested in participating, check the Race to Linux 2.0 web page.


    What is the Race to Linux 2.0?

    Register for the Race

    Mark your calendars! Races start:
    Race #1 -Friday, March 23rd at 5:00 p.m. (PST) March 24th at 1:00 a.m. (GMT)
    Race #2 -Friday, March 30th at 9:00 a.m. (PST) March 30th at 5:00 p.m. (GMT)
    Race #3 -Friday, April 6th at 5:00 p.m. (PST) April 7th at 1:00 a.m. (GMT)

    If you are a Windows developer, you can get started downloading our VMWare image and reading on the various articles that DevX has published, or you can check Mono's own article archive.

    A good introductory tutorial on porting your applications from Windows to Linux is Paul Ferrill's Migrating .NET Applications with Mono.

    Also, Joe Audette has written a tutorial on how to he setup a Mono Development machine here for those that want to roll out your own installation instead of using our VMware image, but also contains tips for those who want the latest and greatest:

    Posted on 07 Mar 2007 by Miguel de Icaza

    Fun Mono Updates

    Jackson has a couple of blog entries where he discusses how to use memcached for doing output caching of ASP.NET pages. Memcached was created to improve the performance of LiveJournal:

    Danga Interactive developed memcached to enhance the speed of LiveJournal.com, a site which was already doing 20 million+ dynamic page views per day for 1 million users with a bunch of webservers and a bunch of database servers. memcached dropped the database load to almost nothing, yielding faster page load times for users, better resource utilization, and faster access to the databases on a memcache miss.

    His memcached module is described here and an explanation on why and how to add caching to your ASP.NET controls is here.

    What is interesting about Jackson's approach is that it hooks up to ASP.NET's caching system and allows caching to be parameterized based on some values (for example, your login name would update only the login-bound information, but information that does not depend on this would be rendered from the cache).

    Hopefully Jackson's work will become a standard part of Mono installations in the future.

    Windows.Forms 2.0 Updates

    Jonathan Pobst has posted some screenshots showing the progress from Mono 1.2.3 released a few weeks ago and the current SVN for some of the 2.0 Strip controls:

    click for full image.

    The Winforms team has been using our Paint.NET 2.72 port as a test case, see Jonathan Pobst's blog for more screenshots.

    Jackson is also running a screenshot contest for Mono's Windows.Forms.

    Jeff's new MonoDevelop Indent Code

    Jeff Stedfast recently joined the Mono team, his first contribution was the implementation of a smart indenter for MonoDevelop's C# mode.

    We basically wanted something that indented as well as Emacs would indent C# code. See his blog entry for details, the code is now checked into SVN in the module "monodevelop".

    ASP.NET 2.0 support improving

    Marek got a few new features implemented for ASP.NET: Themes are now working, and MojoPortal 2.0 works with Mono now:

    Marek also reduced the space that we consume for ASP.NET setups. Instead of creating a new temporary directory every time, we now create predictable directory names based on the assembly name.

    We have run into a number of small problems with our TDS provider when porting applications that use MS-SQL stored procedures. Luckily Andreia Gaita has a patch that should be going into SVN in the next couple of days that resolves that.

    Posted on 07 Mar 2007 by Miguel de Icaza

    Web Development Technologies

    Dare is pondering what comes after Ajax, in response to Ted's Adobe Wants to be the Microsoft of the Web.

    On Flash Ted says:

    What is not appealing is going back to a technology which is single sourced and controlled by a single vendor. If web applications liberated us from the domination of a single company on the desktop, why would we be eager to be dominated by a different company on the web? Yet, this is what Adobe would have us do, as would the many who are (understandably, along some dimensions, anyway) excited about Flex? Read Anne Zelenka’s post on Open Flash if you don’t think that Flash has an openness problem. I’m not eager to go from being beholden to Microsoft to being beholden to Adobe.

    And later touches on OpenLaszlo, but OpenLaszlo is a server-side engine used to generate Flash, so the runtime remains the same (Yes, I know that Laszlo can now generate DHTML, but Ted's point was that Javascript was too slow for large apps running on a browser).

    Dare wants to add WPF/E to the list of web development technologies, and argues:

    Ted Leung mentions two contenders for the throne; Flash/Flex and OpenLaszlo. I'll add a third entry to that list, Windows Presention Foundation/Everywhere (WPF/E). Before discussing what it will take for one of these contenders to displace AJAX, I should point out that being "open" has nothing to do with it. Openness is not a recipe for success when it comes to development platforms. According to TIOBE Java is the most popular programming language today and it was a proprietary language tightly controlled by Sun Microsystems. Before that, it was commonly stated that Visual Basic was the most popular programming language and it was a proprietary language controlled by Microsoft. I believe these count as existence proofs that a popular development platform can rise to the top while being controlled by a single vendor.

    WPF/E has a number of challenges ahead of it: Flash-based development environments are very advanced both for designers and developers and are going through their Nth iteration, while WPF/E is not even officially launched.

    WPF/E is currently limited to Windows and the Mac, which you could argue makes up the majority of the platforms, but Flash works today on Linux and various embedded systems and portable systems.

    But like Flash, it is another proprietary tool, and the whole point of Anne Zelenka's post and Ted's comment. He wanted something that did not lock him into a vendor.

    WPF/E best feature is probably the fact that generating XAML files is trivial and requires no special tools or compilers. echo, cat and perl will generate XAML output right away. A bonus feature would be deserialization from a JSON structure in addition to XML.

    WPF/E feels more webby than Flash does.

    Then again, Flash could add support for hydrating elements from an xml or json sources as well.

    Unlike its "big brother", WPF, the WPF/E is framework looks fairly simple so far. The subset of WPF is reasonable, it is sufficiently opaque that a developer with a lot of spare time in its hands could implement it fairly rapidly.

    A major drawback seems to be the use of WMV as a video format. If there is one thing that the video industry has learned is that WMV and MOV do not work. They barely work on their native platforms, they are ridden with glitches, upgrades sometimes break and of course they do not work on Linux.

    Ignoring the WMV file format support, WPF/E has so few external dependencies today, that someone looking for a cool use for Antigrain could implement a prototype in a few weeks and get a community going in no time to finish it up (Alp has been showing around his record-time XPS renderer and viewer around).

    Flash as an Open Platform?

    Flash has really succeeded in the area of working out of the box, even on the Linux desktop the experience is outstanding (the proprietary Flash).

    The best possible outcome for the world would be to follow Sun's path in open sourcing Java and open source both Flash and WPF/E.

    Adobe is not making any money on the Flash player today on the desktop. On the mobile space the story is different, they could probably license Flash under terms that required mobile vendors to get a proprietary license (I imagine they could look into what Sun did with their mobile runtime, which would be a similar situation).

    Microsoft is not going to be making any money on the WPF/E player either, and since they are limited to Windows and MacOS X (today) they are not going to be making any money on that one either.

    If Microsoft is serious about WPF/E, open sourcing it would eliminate the doubts about WPF/E's future and the fact that some people perceive WPF/E to be a slippery slope to a full blown WPF use and tie-in (in my opinion, it is more of a rocky slope to move a WPF/E app to a WPF one).

    Dare on Java

    But I think that Dare gets this wrong:

    Before discussing what it will take for one of these contenders to displace AJAX, I should point out that being "open" has nothing to do with it. Openness is not a recipe for success when it comes to development platforms. According to TIOBE Java is the most popular programming language today and it was a proprietary language tightly controlled by Sun Microsystems.

    Even if Java was tightly controlled by Sun in the past, they did have a mechanism that was open enough to get third party companies involved in the future of Java.

    Anyone could argue that the JSR process has managed to mess up key components like Generics and has inflicted humanity with mistakes like the J2EE stack.

    But the JSR process is still relatively open. And even before Sun open sourced Java in November there were a number of independent Java VM vendors, both open source and proprietary (specially on the embedded market).

    Java became successful because it filled a space that was previously not properly serviced. At the time it hit a sweet spot.

    In the meantime, as far as Rich Internet Application development goes, we will continue to use a mix of technologies. It seems that the browser is becoming the universal runtime and it has opened the doors for incredible opportunities with the mashups. WPF/E is ready to enter the mashup scene, something that am not sure WPF will ever do.

    Ted's Update

    Update: Ted follows up.

    Posted on 06 Mar 2007 by Miguel de Icaza

    FOSDEM

    This conference was just too good.

    There is no blog entry that can make justice to how good this was. The tiniest details were taken care of, like having food and drinks all day (for those of us who could not make it to our hotel breakfasts this was a life saver).

    I think that part of the success of FOSDEM is that after the conference adjourns, folks can go back to the hotels, freshen up, go to dinner and then bar hoping and run into the attendees until 3am in the morning.

    FOSDEM deserves a full blog post in full detail, but for now a big thank to everyone that made this possible. I have not enjoyed a conference this much for years.

    Posted on 01 Mar 2007 by Miguel de Icaza

    Best Tech Support So Far.

    So I got to Mexico and my 3G connection did not work, so I repeated the European steps and called Cingular Tech Support to complain that something was wrong with my 3G card in Mexico.

    Since neither the 2g or 3g lights turned on and this was working in Boston and Washington, it must have been some configuration issue on Cingular's side.

    I explained to the tech guy my situation, and he walked me through the usual "connection manager", "try a different setting", "eject your card", and so forth and I pretended to do the Windows steps with the equivalent Linux command as far as I could.

    My goal in this call was to avoid saying that I was using Linux, I feared they would just say "Sorry, we dont support that" and hang up.

    There was the dangerous "What does the connection manager say?", to which I replied "Mhm, no network". And "What version of it you have?" to which I replied "Well, I use the equivalent, its called yast".

    But then the fatal, "Which version of Windows is this?" to which I had to say "Linux".

    Contrary to what I expected, he said "Can you configure the AT commands or enter them?", I said I could, I launched minicom and he walked me through the process of configuring the Sierra card (probing for providers, selecting the provider, reseting the card).

    He determined during the call that there was a setup problem with Mexico's provider, he was able to patch that stuff on their end and got me going with a 2g connection after a little while.

    Many thanks to Mr Robinson in tech support over at at&t

    Posted on 01 Mar 2007 by Miguel de Icaza

    Covert Operations in Iran

    On Februrary 16th, in an interview with Noam Chomsky, the interview is one of Chomsky's best.

    At one point he speculates about the potential strategy being applied to Iran:

    [...] So it could be that one strain of the policy is to stir up secessionist movements, particularly in the oil rich regions, the Arab regions near the Gulf, also the Azeri regions and others. Second is to try to get the leadership to be as brutal and harsh and repressive as possible, to stir up internal disorder and maybe resistance. And a third is to try to pressure other countries, and Europe is the most amenable, to join efforts to strangle Iran economically. Europe is kind of dragging its feet but they usually go along with the United States.

    This week Seymour Hersh publishes on the New Yorker some of his findings. The article makes the case that the US is now funding terroristsfreedom fighters in Iran to destabilize the regime (as speculated by Chomsky before). The article also happens to match some of Chomsky's observations.

    For a quick overview you can watch this video interview with Seymour Hersh.

    Chomsky:

    It’s very hard to predict the Bush administration today because they’re deeply irrational. They were irrational to start with but now they’re desperate. They have created an unimaginable catastrophe in Iraq. This should’ve been one of the easiest military occupations in history and they succeeded in turning it into one of the worst military disasters in history. They can’t control it and it’s almost impossible for them to get out for reasons you can’t discuss in the United States because to discuss the reasons why they can’t get out would be to concede the reasons why they invaded.

    If you listen to Seymour's interview it seems that the strategy is going from "unimaginable catastrophe in Iraq" to "unimaginable catastrophe in the whole Middle East".

    In the meantime, it turns out that the weapons that were presented a couple of weeks ago as being "manufactured in Iran" turned out to be manufactured in Iraq.

    If that was not enough, the UN Calls US Data on Iran's Nuclear Aims Unreliable:

    The officials said the CIA and other Western spy services had provided sensitive information to the Vienna-based International Atomic Energy Agency at least since 2002, when Iran's long-secret nuclear program was exposed. But none of the tips about supposed secret weapons sites provided clear evidence that the Islamic Republic was developing illicit weapons.

    "Since 2002, pretty much all the intelligence that's come to us has proved to be wrong," a senior diplomat at the IAEA said. Another official here described the agency's intelligence stream as "very cold now" because "so little panned out."

    For those of us too cynical to believe anything the Bush administration has to say on any matter, this is hardly news. But it is always nice to see them debunked in public.

    Posted on 27 Feb 2007 by Miguel de Icaza

    Getting Ripped Off: A Consolidation Strategy

    Last week I described how international travel for an Internet addict can be very costly, 10 euros here, 12 dollars there 20 euros for 24 hours there and very soon you have paid a hundred dollars in a two-day trip on Internet access fees.

    Now, instead of paying half a dozen people to get WiFi access, I have consolidated my "getting ripped off" with AT&T. Now they bill me an insane amount for getting "3G worldwide access".

    Two problems though: "3G worldwide" actually means "3G in Boston, and 9600 baud modem speed in Europe". During the entire trip I could not get the "3G" light on the card to turn on, it consistently stayed in "2G" mode.

    But just before you think "Well, GPRS/2G is not so bad", I want to point out that it took 25 seconds to load www.google.com.

    Posted on 27 Feb 2007 by Miguel de Icaza

    Usability Interview with Anna Dirks

    Ted Haeger interviews Anna Dirks.

    Anna leads the team at Novell that was in charge of improving the usability of the desktop. Her team launched Better Desktop, the Tango Icons and prototyped, tuned, improved, mocked-up and tested various elements of the usability elements in the SLED desktop.

    Her interview is here in Novell's Open Audio.

    She talks about the process used to design the new features of SLED and it also got a few hints on what is coming up for SLED 10 SP1 (pay attention to the physical weight of the Usability Labs).

    Posted on 26 Feb 2007 by Miguel de Icaza

    Sierra Aircard 875, Cingular and SUSE Linux

    After being ripped off by hotels and airports for my Internet connections (with some places charging as much as 20 euros per hour, and your standard 10 euro per hour at CDG), I have purchased a 3G card from Cingular and a plan to use it internationally.

    I followed the instructions on this blog post that covers another card on OpenSUSE 10.2.

    With SLED 10 and the Aircard 875, the only difference is that I had to use a different vendor and product ID:

    	# /sbin/modprobe usbserial vendor=0x1199 product=0x6820
    	

    Or alternatively dump that in the /etc/udev/rules.d/51-3g-datacards.rules file.

    Once you configure the modem in yast as described in the above blog post, go to NetworkManager, and select the "modem0" serial connection. There seems to be a bug in NetworkManager, when the modem0 connection is active, the icon seems to go away (am guessing its not finding the icon for it, and hence the applet vanishes).

    A few minutes later, you will be online.

    Am still missing some tools to determine the upload/download speed, anyone have some good pointers?

    Posted on 21 Feb 2007 by Miguel de Icaza

    Reflector 5.0

    Lutz Roeder has just released a new version of Reflector:

    This time Reflector will work out of the box with Mono on Unix (no special handling or special flags) and will even detect the presence of your Mono libraries:

    Recently, while implementing the second chunk of lambda expressions, I had to go through all the classes that derived from the Mono.CSharp.Expression and the Mono.CSharp.Statement classes to implement the "CloneTo" methods, and Reflector came in as a great tool to find those classes with minimal fuzz and without wasting any grep batteries in the process:

    Reminder: the use of Reflector to look at third-party code is prohibited if you are planning on ever contributing to Mono. You are free to use Reflector to decompile Mono code though.

    I would have blogged early this morning when the news came out, but I struggled betwen Consolas, Monaco and Tahoma for the screenshot. Solving the dilemma was only possible thanks to the extensive dinner discussion with Garrett and Jeff at Kashmir.

    One great feature is the Reflector Analyzer to explore who exposes, uses, depends or inherits a given type:

    There are no borders on the screenshots due to the way Compiz paints windows on the screen (a separate process paints the decorations).

    Jackson has been fixing various issues in Winforms to improve the rendering. These screenshots are the result of his endless hours of work. Thanks Jackson!

    Posted on 21 Feb 2007 by Miguel de Icaza

    Feedback requested: FOSDEM Conference

    This weekend am heading to Brussels to the FOSDEM conference. The last time I spoke there, Mono was in its infancy (2002). At the time the C# was about to be self-hosting on Linux, but was not quite there (0.8 and 0.9 releases).

    Now, five years later Mono has gone through 60 releases and is made up of a few million lines of code and has spawned plenty of software projects.

    The question is: What kind of things should I talk about in my two sessions at FOSDEM?

    I have one general Mono session, and one session in the OpenSUSE track. Since Mono is so large, and there are so many interesting things being done with it, I find it challenging to find a good topic to discuss with a technical audience like FOSDEM.

    I could do a general overview and give some high-level overview of what we are doing, but I feel that the FOSDEM audience is probably more interested in something more technical. So I should probably limit my presentations to two or three key topics.

    Should I talk about what is available today, and what are people doing today, or should I talk about the future, and what we want to do?

    Maybe the general session could be about the state of the project and where we want to go in the future; And the OpenSUSE session about the practical things that can be done today. Not sure.

    What would you like to hear about?

    Posted on 21 Feb 2007 by Miguel de Icaza

    Visual Basic Love

    Today we announced the support of Visual Basic.NET in Mono.

    Visual Basic is still one of the most used languages in the Windows world, and with this release we hope to assist a large segment of the population to bring those applications to Unix with Mono.

    Rolf developed the new compiler. The new compiler is fascinating because it is a VB 8 compiler (this means that it supports generics), but also because it is written in VB itself. This compiler was sponsored last summer by the Google Summer of Code (2006 edition).

    The compiler on my laptop takes 12 seconds to compile itself (78,000 lines of code).

    The new runtime (for 1.0 and 2.0) was developed by Boris Kirzner, Guy Cohen and Rafael Mizrahi at Mainsoft and just like the VB compiler it was written in VB, and it is made up of roughly 17,000 lines of code.

    As some people have pointed out, the compiler and the runtime are not enough to run applications. A lot of the portability will be mandated by your API consumption. If your application is based on .NET 1.0, you should be ready to use Mono now. If you are using .NET 2.0, you will need to check whether everything your application needs is supported by using Moma the Mono Migration Analyzer.

    Our 2.0 support these days for ASP.NET and the core is passable. It is not 100% there, but the ASP.NET Starter Kits should run, and so should applications like mojoPortal.

    Posted on 20 Feb 2007 by Miguel de Icaza

    My Name

    I was reading Rolf's post where he complains that people never get his name right. I am used to it.

    English speakers typically pronounce my name as "Mi-koo-elle", or "Mi-goo-elle", while the actual pronunciation is more like "Mig-elle".

    Bonus Update: Also most English speaking people miss-pronounce "de Icaza" as "di-eye-kaza", but it is pronounced "the-eekaza".

    Posted on 20 Feb 2007 by Miguel de Icaza

    Updated Main Menu

    Ted Haeger discusses the changes done recently to the Main Menu. Link to the video:

    I love the main menu that Anna's team designed and Jimmy implemented. The KDE folks then improved upon the design and on this new iteration some of the ideas from the KDE design are incorporated.

    The code is available from Gnome's SVN

    Update: Someone at the office told me story of how the "Search" input box at the top of the main menu ended up at there.

    In the early days of the main menu the search bar was at the bottom of the main menu, similar in spirit to Vista, but this prototype existed before Vista integrated it.

    Garrett created a "Gnome Desktop" with HTML and Javascript a few months back, and they used this HTML-based desktop to quickly try out many ideas with different people.

    During the routine usability tests that are conducted in the Cambridge office, one of the tasks that was part of the test was something along the lines of "Find the document that contains foo". But people would not use the built-in search, they did not notice it on the main menu. Instead people went to the file manager and started opening file by file to find the document.

    When the search was moved to the top, the subjects in the usability tests immediately started using it.

    Then Vista released their first menu with search integrated at the bottom of the menu. I have been wondering if the guys in the Vista team had conducted any similar tests with their start menu.

    Joel posted a few months ago his complains about the logoff functionality in the Vista menu. The developer involved in implementing that bit for Vista then blogged about it and followed up here:

    Then someone from the MacOS team weighted in and described the process used at Apple.

    From Ted Haeger's video you can see that logout/shutdown also got redesigned with the new menu. I do not know the story behind how it got implemented (there are now two options: shutdown/logoff in the menu) and both bring up two dialogs with further options.

    It would be interesting from someone on the Novell Desktop team to blog about that process to complement the Vista and OSX postings.

    Posted on 18 Feb 2007 by Miguel de Icaza

    Gnome Bittorrent Client

    Alan McGovern has created a fantastic BitTorrent client library in C#. The effort was part of last year's Google Summer of Code. Alan continued to tune it and implement many of the protocol extensions after the SoC was over so it is now a very complete.

    We have a very early Gnome UI that was created last year, but it has not been updated very much, and it could really use some work to get it updated.

    The library these days is quite mature and the command line client works well, but we really ought to have a Gnome UI.

    There is also a case to be made for a simple and clean UI for Bittorrents.

    The library, as well as the simplistic UI can be downloaded from here (tarball is here).

    A Winforms UI should also be possible, and am sure our friends in the Windows world would appreciate it.

    MonoTorrent Update

    Alan posted some updates on the current state of the library:

    uPnP support has been enabled in MonoTorrent using Mono.Nat. So all you people with uPnP routers no longer have to worry about manually creating the port mapping in your router. It'll all be done automagically (all going well ;) ).

    ...

    Disk writes are now fully asynchronous, but now will automatically throttle download speed if you are downloading faster than your harddisk can write. So you won't ever get 100s of megs of ram being used and 100% cpu usage when exceeding your write speed.

    Upload and download speed calculations have been improved drastically (ish) for torrents. What i did before was calculate each individual peers upload and download speed, then sum up that for all connected peers to see a torrents overall download rate.

    Posted on 17 Feb 2007 by Miguel de Icaza

    Compiler Updates - C# 3.0

    Progress on the C# 3.0 front.

    Marek Safar has started blogging. Marek has been a contributor to the Mono C# compiler for a long time and has made the compiler very pleasant to use (fixing bugs, improving errors and warnings and doing some large changes).

    Today Marek checked in his code to add C# 3.0 Extensions Methods to the compiler. More about it on his debut blog entry.

    In the last couple of weeks I implemented the parsing support for C# 3.0 lambda expressions and coded the support for explicitly typed lambdas. Today I added support for overload resolution in lambda expressions.

    Implementing lambda expression support in the compiler was challenging and incredibly fun.

    Parsing Lambda Expressions: The first problem was that the grammar for describing the parameters in a lambda expression caused a lot of conflicts with our yacc-based parser. For example, this is a valid lambda expression:

    	type var = (x, y) => x + y;
    

    The above is problematic because a parser would not be able to tell when it finds the first open parenthesis if it was a parameter list for a lambda expression, or if it is just a parenthesized expression).

    I originally feared that lambda expressions would force us to rewrite the parser from yacc into a hand-coded parser.

    But I came up with a cute solution: when the tokenizer sees the first parenthesis, it starts a minimal hand-coded top-down parser that will parse the lambda parameter list plus the optional arrow, and depending on the result return either a OPEN_PARENS or a OPEN_LAMBDA_PARENS token.

    Implicit Typed Parameters: The second challenge was implicitly typed parameters. Unlike anonymous methods which require the type of the parameters to be specified, lambda expressions do not require them, so it is possible to write code like this:

    	delegate string rets (string s);
    	delegate int reti (int i);
    
    	Foo (rets s)
    	{
    		Console.WriteLine (s ("hello, "));
    	}
    
    	Foot (reti i)
    	{
    		Console.WriteLine (i (10));
    	}
    	
    	Foo (x => x + "world");
    

    The complication is that the lambda expression 'x + "world"' needs to be probed for validity against `reti' and `rets', this means that x can be either a string or an int.

    For this to work, I added a cloning infrastructure that would clone blocks and expressions and attempt to resolve each expression without side effects until a valid lambda expression is parsed.

    Return Rules: Finally, the last interesting bit was the implementation that allowed code blocks or expressions to return values. The body of a lambda expression can be either a block or an expression.

    The problem with expressions is that depending on the delegate type, we might or might not be interested in the result of the expression (void return, no interest; typed return, interest).

    I believe I have a quite elegant solution in the form of the ContextualReturn statement. This is a Statement that is pretty much a copy of our "Return" statement implementation. The only difference is that it would become a "return-with-value" if there is an expected return type and would become a "expression-statement; return" in the case that this was a void return.

    Posted on 15 Feb 2007 by Miguel de Icaza

    Jon Lech's on Music

    Jon deconstructs the arguments from Steve Jobs recent letter:

    Steve takes as many poetic licenses as necessary to portray himself as the David battling the Goliath.

    Jon has more on his DRM blog.

    Am all for abolishing DRM .

    Posted on 07 Feb 2007 by Miguel de Icaza

    Packages for Mono on the Nokia 800

    Jarosław Pendowski wrote me to say that he has created proper packages for Mono on the Nokia 800 and the Nokia 770.

    His preview packages are here

    Jarosław is looking for feedback on what else to package. Please comment on his blog.

    I personally think that we should have all the assemblies shipped in units and have proper dependencies. So if an application uses Gtk# and XML, only the dependencies required are installed (System.xml, gtk-sharp*.dll and family).

    If an application needs Windows.Forms and System.Data, only those and its dependencies get installed, but there would be no need for example for Gtk# in that case.

    Posted on 05 Feb 2007 by Miguel de Icaza

    Mono on the Nokia 800

    I have good news for everyone that has been asking about how to get Mono on the Nokia 800,

    Michael Dominik has posted a HOWTO document to build your own version of Mono from source code on the Nokia 800.

    This is still a developer package to get things going. Ideally someone that understands the Debian packaging system could do the right packaging. My knowledge of Debian packages is limited to the fact that they use the ".deb" extension.

    Posted on 04 Feb 2007 by Miguel de Icaza

    Spain, Badajoz, Madrid

    Am going to Badajoz, Spain to the Free Software World Conference.

    I will be in Madrid on Monday and Friday nights, if people want to get together, drop me a line. I was thinking dinner at Rias Bajas with Juantomas, Roberto and Ismael.

    Posted on 03 Feb 2007 by Miguel de Icaza

    Mono in Games

    I have talked about Otee's Unity3D in the past. A company that is building a game runtime and development environment.

    Their game runtime provides physics, 3D rendering, audio streaming and execution of developer provided code. Developers can write code in C#, Boo or Javascript, the code gets compiled into CIL, and the Mono runtime turns that into native code, so your javascript is actually compiled down to x86 code.

    The guys at Unity have a few interesting updates:

    Global Conflicst/Palestine: Global Conflicts is about to be released. This game is not a point-and-shoot game, in this game you play a journalist and its your job to interview the players in a conflict.

    CNN interviewed the game developers here and discussed the game:

    WolfQuest: A network based game in which you are part of a wolf pack.

    A video for the wolf-hunting game.

    Libraries: Starting with Unity 1.6 it is now possible to use externally developed libraries, in the past all the code had to be bundled and managed inside Unity.

    This will be incredibly useful to have game widgets that can be reused across multiple games (on-screen keyboard entry, scores, buttons, scrollbars and all the rest).

    BigBrainz: an educational game vendor is moving their games development to Unity.

    More: Unity's updated gallery has many other games and applications (including the new Freeverse games for the Mac):

    We are currently trying to find a collaboration with the Otee guys so the Unity runtime is available for Linux. What we would want is that every game produced with Unity would run unmodified in Linux.

    Today they offer a great "Build for..." button in Unity that today generates game executables for Windows and Mac. Either as standalone programs, or as "web plugins". What we want is for them to be able to add Linux to the mix.

    I would personally love to see MonoDevelop running with Gtk+/Quartz so that game developers could use a more advanced IDE than the current text editor that they are using with Unity.

    Update: Otee is hiring.

    If you live in Denmark, and you have experiences with games, low-level coding and consoles, you might want to apply to their job posting. They are looking for Nintento Wii developers.

    Posted on 03 Feb 2007 by Miguel de Icaza

    Terror in Boston

    Bruce Schneier discussed the Non-Terrorist Embarrassment in Boston.

    For hours of fun, check Sadly No!'s coverage of the response from the paranoid districts in the blogosphere.

    Joe has the best T-Shirt material in his office. Joe, we want CafePress T-Shirts!

    YouTube interview with the guys, the reporters got pretty upset here.

    It is hilarious, they refuse to answer any questions that are not related to hair "Am sorry, that is not a hair question". Then a reporter asks if they are afraid about their hair if they go to prison. The answer "That is a very good question".

    Posted on 01 Feb 2007 by Miguel de Icaza

    Retrospective

    Yesterday Stephen Colbert's had the editor for some jingoistic web site, and one of the comments that he made caught my attention. He said something along the lines of "We have no problem against the Iranian people".

    And I was reminded of Bush's statements from 2002:

    The United States has no quarrel with the Iraqi people; they've suffered too long in silent captivity. Liberty for the Iraqi people is a great moral cause, and a great strategic goal. The people of Iraq deserve it; the security of all nations requires it.

    There might have been "no quarrel", but it does not seem that Iraqis got a great deal out of this.

    A well timed cartoon appeared on Reddit today:

    Since the US seems to be in a path to extend the war to Iran (Condoleezza Rice seems to be avoiding a direct answer to Senator Webb), the following excerpt from from 2003 seems relevant:

    The government of Iraq, and the future of your country, will soon belong to you.

    The goals of our coalition are clear and limited. We will end a brutal regime, whose aggression and weapons of mass destruction make it a unique threat to the world. Coalition forces will help maintain law and order, so that Iraqis can live in security. We will respect your great religious traditions, whose principles of equality and compassion are essential to Iraq’s future. We will help you build a peaceful and representative government that protects the rights of all citizens. And then our military forces will leave. Iraq will go forward as a unified, independent and sovereign nation that has regained a respected place in the world.

    The United States and its coalition partners respect the people of Iraq. We are taking unprecedented measures to spare the lives of innocent Iraqi citizens, and are beginning to deliver food, water and medicine to those in need. Our only enemy is Saddam’s brutal regime --- and that regime is your enemy as well.

    In the new era that is coming to Iraq, your country will no longer be held captive to the will of a cruel dictator. You will be free to build a better life, instead of building more palaces for Saddam and his sons, free to pursue economic prosperity without the hardship of economic sanctions, free to travel and speak your mind, free to join in the political affairs of Iraq. And all the people who make up your country --- Kurds, Shi’a, Turkomans, Sunnis, and others --- will be free of the terrible persecution that so many have endured.

    The nightmare that Saddam Hussein has brought to your nation will soon be over. You are a good and gifted people ---the heirs of a great civilisation that contributes to all humanity. You deserve better than tyranny and corruption and torture chambers. You deserve to live as free people. And I assure every citizen of Iraq: your nation will soon be free.

    George W Bush
    President's Message to the Iraqi People
    April 10, 2003

    Ignoring the political angle (the lies and deception of the administration) there is still an issue of execution.

    These people have drank their own kool aid, they almost seem unable to accept that they should stop digging the hole they are in. It feels like the government is in the hands of Jim Jones and they are doing anything in their power to convince people around them to follow them.

    It seems that war with Iran will happen.

    My prediction based on the news from the past two weeks is that they will either provoke the Iranians to get their casus belli or an appropriate incident will be manufactured.

    History of Iran

    Patrick Cockburn's Occupation: War and Resistance in Iraq book contains a colorful popular saying.

    The popular saying was something along the lines of Iraq was a religious country ruled by a secular government, while Iran is a secular society ruled by a religious government.

    I found "All the Shah's Men: An American Coup and the Roots of Middle East Terror" a fascinating read.

    The 1953 CIA coup on the democratically elected and populist Mohammad Mosaddeq had repercussions that went beyond 1953.

    The overthrow of Mosaddeq and the appointment of the Shah lead to the the Savak repression police. This in turn lead to 1980's Islamic Revolution and the Hostage Crisis, which would lead to the funding of Saddam's war against Iran (the motives for the war, the lies and deception used to push Iraq into the war are described in great detail in Robert Fisk's "The Great War for Civilization" book).

    Posted on 01 Feb 2007 by Miguel de Icaza

    We did it!

    Today Novell announced in Paris that Peugeot Citroën will be deploying 20,000 Linux desktops and 2,500 Linux servers.

    These are very important news. Linux on the desktop has got good traction with governments, but it is just great to see the open source desktop being chosen for commercial deployments of this size.

    Congratulations to the team!

    I know that folks have been working really hard for the past few months to make sure that our server and desktop offerings were solid and that they meet the needs of a large organization.

    Congrats to Anna's team for all their hard work in doing the usability studies that made the desktop so much better, and all the desktop hackers that worked on making all those features happen.

    For those of you considering a migration to Vista, you might want to see Novell's Compare to Vista web site.

    Btw, I think someone should do a "We did it" animation like the one that shows up in Stephen Colbert's Colbert Report, as it captures the emotion of making this deal happen.

    Posted on 30 Jan 2007 by Miguel de Icaza

    The EU Prosecutors are Wrong.

    The file format wars between Open Document Format (ODF) file format against the Office Open XML (OOXML) are getting heated.

    There are multiple discussions taking place and I have been ignoring it for the most part.

    This morning I read on News.com an interview with Thomas Vinje. Thomas is part of the legal team representing some companies in the EU against Microsoft.

    The bit in the interview that caught my attention was the following quote:

    We filed our complaint with the Commission last February, over Microsoft's refusal to disclose their Office file formats (.doc, .xls, and .ppt), so it could be fully compatible and interoperable with others' software, like Linux. We also had concerns with their collaboration software with XP, e-mail software, and OS server software and some media server software with their existing products. They use their vast resources to delay things as long as possible and to wear people down so they'll give up.

    And in July, we updated our complaint to reflect our concerns with Microsoft's "open XML." (Microsoft's Office Open XML is a default document format for its Office 2007 suite.) And last month, we supplemented that information with concerns we had for .Net 3.0 (software designed to allow Vista applications to run on XP and older-generation operating systems).

    And I think that the group is not only shooting themselves in the foot, they are shooting all of our collective open source feet.

    I'll explain.

    Open Source and Open Standards

    For a few years, those of us advocating open source software have found an interesting niche to push open source: the government niche.

    The argument goes along these lines: Open Office is just as good as Microsoft Office; Open Office is open source, so it comes for free; You can actually nurture your economy if you push for a local open source software industry.

    The argument makes perfect sense, most people will agree to it, but every once in a while our advocacy has faced some problems: Microsoft Office might have some features that we do not have, the cost of migration is not zero, existing licensing deals sweeten the spot, and there are compatibility corner cases that slow down the adoption.

    A new powerful argument was identified a few years back, when Congressman Edgar Villanueva in 2002 replied to a letter from Microsoft's Peru General Manager.

    One of the key components at the time was that the government would provide free access to government information and the permanence of public data. The letter those two points said:

    To guarantee the free access of citizens to public information, it is indispensable that the encoding of data is not tied to a single provider. The use of standard and open formats gives a guarantee of this free access, if necessary through the creation of compatible free software.

    To guarantee the permanence of public data, it is necessary that the usability and maintenance of the software does not depend on the goodwill of the suppliers, or on the monopoly conditions imposed by them. For this reason the State needs systems the development of which can be guaranteed due to the availability of the source code.

    The letter is a great document, but the bit that am interested in is the bit about open standards.

    Using Open Standards to Promote Open Source

    Open standards and the need for public access to information was a strong message. This became a key component of promoting open office, and open source software. This posed two problems:

    First, those promoting open standards did not stress the importance of having a fully open source implementation of an office suite.

    Second, it assumed that Microsoft would stand still and would not react to this new change in the market.

    And that is where the strategy to promote the open source office suite is running into problems. Microsoft did not stand still. It reacted to this new requirement by creating a file format of its own, the OOXML.

    Technical Merits of OOXML and ODF

    Unlike the XML Schema vs Relax NG discussion where the advantages of one system over the other are very clear, the quality differences between the OOXML and ODF markup are hard to articulate.

    The high-level comparisons so far have focused on tiny details (encoding, model used for the XML). There is nothing fundamentally better or worse in those standards like there is between XML Schema and Relax NG.

    ODF grew out of OpenOffice.org and is influenced by its internal design. OOXML grew out of Microsoft Office and it is influenced by its internal design. No real surprises there.

    The Size of OOXML

    A common objection to OOXML is that the specification is "too big", that 6,000 pages is a bit too much for a specification and that this would prevent third parties from implementing support for the standard.

    Considering that for years we, the open source community, have been trying to extract as much information about protocols and file formats from Microsoft, this is actually a good thing.

    For example, many years ago, when I was working on Gnumeric, one of the issues that we ran into was that the actual descriptions for functions and formulas in Excel was not entirely accurate from the public books you could buy.

    OOXML devotes 324 pages of the standard to document the formulas and functions.

    The original submission to the ECMA TC45 working group did not have any of this information. Jody Goldberg and Michael Meeks that represented Novell at the TC45 requested the information and it eventually made it into the standards. I consider this a win, and I consider those 324 extra pages a win for everyone (almost half the size of the ODF standard).

    Depending on how you count, ODF has 4 to 10 pages devoted to it. There is no way you could build a spreadsheet software based on this specification.

    To build a spreadsheet program based on ODF you would have to resort to an existing implementation source code (OpenOffice.org, Gnumeric) or you would have to resort to Microsoft's public documentation or ironically to the OOXML specification.

    The ODF Alliance in their OOXML Fact Sheet conveniently ignores this issue.

    I guess the fairest thing that can be said about a spec that is 6,000 pages long is that printing it out kills too many trees.

    Individual Problems

    There is a compilation being tracked in here, but some of the objections there show that the people writing those objections do not understand the issues involved.

    Do as I say, not as I do

    Some folks have been using a Wiki to keep track of the issues with OOXML. The motivation for tracking these issues seems to be politically inclined, but it manages to pack some important technical issues.

    The site is worth exploring and some of the bits there are solid, but there are also some flaky cases.

    Some of the objections over OOXML are based around the fact that it does not use existing ISO standards for some of the bits in it. They list 7 ISO standards that OOXML does not use: 8601 dates and times; 639 names and languages; 8632 computer graphics and metafiles; 10118-3 cryptography as well as a handful of W3C standards.

    By comparison, ODF only references three ISO standards: Relax NG (OOXML also references this one), 639 (language codes) and 3166 (country codes).

    Not only it is demanded that OOXML abide by more standards than ISO's own ODF does, but also that the format used for metafiles from 1999 be used. It seems like it would prevent some nice features developed in the last 8 years for no other reason than "there was a standard for it".

    ODF uses SMIL and SVG, but if you save a drawing done in a spreadsheet it is not saved as SVG, it is saved using its own format (Chapter 9) and sprinkles a handful of SVG attributes to store some information (x, y, width, height).

    There is an important-sounding "Ecma 376 relies on undisclosed information" section, but it is a weak case: The case is that Windows Metafiles are not specified.

    It is weak because the complaint is that Windows Metafiles are not specified. It is certainly not in the standard, but the information is publicly available and is hardly "undisclosed information". I would vote to add the information to the standard.

    More on the Size of the Spec

    A rough breakdown of OOXML:

    • ~100 page "Fundamentals" document;
    • ~200 page "Packaging Conventions" document;
    • ~450 page "Primer" document (a tutorial);
    • ~1850 page Word Processing reference document;
    • ~1090 page Spreadsheet Processing reference document;
    • ~270 page Presentation Processing reference document;
    • ~1140 page Drawing Processing reference document;
    • ~900 pages for other references (VML, SharedML)
    • ~42 future extensibility document.

    I have obviously not read the entire specification, and am biased towards what I have seen in the spreadsheet angle. But considering that it is impossible to implement a spreadsheet program based on ODF, am convinced that the analysis done by those opposing OOXML is incredibly shallow, the burden is on them to prove that ODF is "enough" to implement from scratch alternative applications.

    If Microsoft had produced 760 pages (the size of ODF) as the documentation for the ".doc", ".xls" and ".ppt" that lacked for example the formula specification, wouldn't people justly complain that the specification was incomplete and was useless?

    I would have to agree at that point with the EU that not enough information was available to interoperate with Microsoft Office.

    If anything, if I was trying to interoperate with Microsoft products, I would request more, not less.

    SVG

    Then there is the charge about not using SVG in OOXML. There are a few things to point out about SVG.

    Referencing SVG would pull virtually every spec that the W3C has produced (Javascript, check; CSS, check; DOM, check).

    This can be deceptive in terms of the "size" of the specification, but also makes it incredibly complex to support. To this date am not aware of a complete open source SVG implementation (and Gnome has been at the forefront of trying out SVG, going back to 1999).

    But to make things worse, OpenOffice does not support SVG today, and interop in the SVG land leaves a lot to be desired.

    Some of my friends that have had to work with SVG have complained extensively to me in the past about it. One friend said "Adobe has completely hijacked it" referring to the bloatedness of SVG and how hard it is to implement it today.

    At the time of this comment, Adobe had not yet purchased Macromedia, and it seemed like Adobe was using the standards group and SVG to compete against Flash, making SVG unnecessarily complicated.

    Which is why open source applications only support a subset of SVG, a sensible subset.

    ISO Standarization

    ODF is today an ISO standard. It spent some time in the public before it was given its stamp of approval.

    There is a good case to be made for OOXML to be further fine-tuned before it becomes an ISO standard. But considering that Office 2007 has shipped, I doubt that any significant changes to the file format would be implemented in the short or medium term.

    The best possible outcome in delaying the stamp of approval for OOXML would be to get further clarifications on the standard. Delaying it on the grounds of technical limitations is not going to help much.

    Considering that ODF spent a year receiving public scrutiny and it has holes the size of the Gulf of Mexico, it seems that the call for delaying its adoption is politically based and not technically based.

    XAML and .NET 3.0

    From another press release from the group:

    "Vista is the first step in Microsoft‘s strategy to extend its market dominance to the Internet," Awde stressed. For example, Microsoft's "XAML" markup language, positioned to replace HTML (the current industry standard for publishing language on the Internet), is designed from the ground up to be dependent on Windows, and thus is not cross-platform by nature.

    ...

    "With XAML and OOXML Microsoft seeks to impose its own Windows-dependent standards and displace existing open cross-platform standards which have wide industry acceptance, permit open competition and promote competition-driven innovation. The end result will be the continued absence of any real consumer choice, years of waiting for Microsoft to improve - or even debug - its monopoly products, and of course high prices," said Thomas Vinje, counsel to ECIS and spokesman on the issue.

    He is correct that XAML/WPF will likely be adopted by many developers and probably some developers will pick it over HTML development.

    I would support and applaud his efforts to require the licensing of the XAML/WPF specification under the Microsoft Open Specification Promise.

    But he is wrong about XAML/WPF being inherently tied to Windows. XAML/WPF are large bodies of code, but they expose fewer dependencies on the underlying operating system than .NET 2.0's Windows.Forms API does. It is within our reach to bring to Linux and MacOS.

    We should be able to compete on technical grounds with Microsoft's offerings. Developers interested in bringing XAML/WPF can join the Mono project, we have some bits and pieces implemented as part of our Olive sub project.

    I do not know how fast the adoption of XAML/WPF will be, considering that unlike previous iterations of .NET, gradual adoption of WPF is not possible. Unlike .NET 2.0 which was an incremental upgrade for developers, XAML/WPF requires software to be rewritten to take advantage of it.

    The Real Problem

    The real challenge today that open source faces in the office space is that some administrations might choose to move from the binary office formats to the OOXML formats and that "open standards" will not play a role in promoting OpenOffice.org nor open source.

    What is worse is that even if people manage to stop OOXML from becoming an ISO standard it will be an ephemeral victory.

    We need to recognize that this is the problem. Instead of trying to bury OOXML, which amounts to covering the sun with your finger.

    We need to make sure that OpenOffice.org can thrive on its technical grounds.

    In Closing

    This is not a complete study of the problems that OOXML has, as I said, it has its share of issues. But it has its share of issues just like the current ODF standard has.

    To make ODF successful, we need to make OpenOffice.org a better product, and we need to keep improving it. It is very easy to nitpick a standard, specially one that is as big as OOXML. But it is a lot harder to actually improve OpenOffice.org.

    If everyone complaining about OOXML was actually hacking on improving OpenOffice.org to make it a technically superior product in every sense we would not have to resort, as a community, to play a political case on weak grounds.

    I also plan on updating this blog entry as people correct me (unlike ODF, my blog entries actually contain mistakes ;-)

    Updates -- February 1st

    There are a few extra points that I was made aware of after I posted this blog entry.

    Standard Size

    Christian Stefan wrote me to point out that the OOXML specification published by ECMA uses 1.5 line spacing, while OASIS uses single spacing. I quote from his message:

    ODF             722 pages
    SVG             719
    MathML		665
    XForms          152     (converted from html using winword, ymmv)
    XLink            36     (converted from html using winword, ymmv)
    SMIL            537     (converted from html using winword, ymmv)
    OpenFormula     371
                    ----
                  3,202
    
    Now I'm still missing some standards that would add severall hundred
    pages and changing line spacing to 1.5 will bring me near the 6000
    pages mark I guess. This is not very surprising (at least for me)
    since both standards try to solve very similar problems with nearly
    equal complexity.
    

    Review Time

    The "one month to review OOXML" meme that has been going around the net turns out to be false. It is unclear where it originated. Brian Jones from Microsoft has a complete explanation. For OOXML to become a standard it is going to take sevent months at least.

    Posted on 30 Jan 2007 by Miguel de Icaza

    OpenSUSE Build System

    For the last couple of years the folks at SUSE have been building a new build system that could help us make packages for multiple distributions from the same source code.

    Yesterday, Andreas Jaeger announced the open sourcing of the Open SUSE Build Service