Fascinated by the JIT

by Miguel de Icaza

Some people think that I wrote the Mono JIT. I did not. Dietmar, Paolo, Zoltan and Martin are the people who have hacked on the JIT engine in Mono.

Recently, as a side project, I have been playing with the JIT a bit to improve some code generation here and there, and together with Ben we are learning how it works internally, it is fascinating to watch it in action.

We have been using a simple example: String.GetHashCode hoping to get things to the point where the JIT output matches GCC -O3. The code is slightly smaller than GCC, but it is wasting two registers, so in a tight loop it ends up placing a local variable on the stack which has a high impact on a tight loop.

Managed C++ and Mono

Someone on IRC pointed me a few days ago to Open64. A compiler suite that includes C, C++ and Fortrans that generate a new intermediate representation called `WHIRL'.

Some of the compiler front-ends are the GNU compiler front ends that have been re-targeted to generate WHIRL instead of RTL. This is fascinating because it means we can now seriously consider implementing the ECMA managed extensions to C++ (the job of moving to a non-RTL IR was done by SGI).

It also means that any compiler that is moved to generate WHIRL could run on any ECMA VM.

You can get the WHIRL IR documentation from here

CIL image manipulation

This topic keeps coming up: are there tools to manipulate CIL images (instrument code: pre- and post- processing, add classes, remove classes, trim methods, replace methods, append instructions) and sometime ago the fine folks at the University of Coimbra have implemented such a tool: Runtime Assembly Instrumentation Library

In Chicago

The other day Nat and I met David Vaskevitch, Microsoft's CTO. We went dancing.

Posted on 12 Apr 2004

Blogs are the TV of the Internet

by Miguel de Icaza

Blogs are the TV of the Internet. Reading them is fun, but they are not particularly challenging.

Plenty of channels to choose from though.

Posted on 10 Apr 2004


by Miguel de Icaza

My e-mail now consists of 40% of spam after it has gone through SpamAssassin, in the mornings or weekends it is 50% of it.

These days I use Mutt to manually remove the spam before I incorporate my e-mail into Evolution where the mail gets split in plenty of folders (and would make spam removal harder).

Is everyone else getting this same volume of trash?

Big News of the Day

Of course, the big news is that Microsoft has released an internal project called "WiX" as open source and is being hosted in SourceForge. A good move, since it gives a lot of people confidence that the license used is an open source license, without having to spend some quality time reading every sentence of a new license.

From the blog entry from one of the authors you can see that Stephen Walli was behind making this happen. I first saw Stephen doing a talk on startups and VCs at Usenix, on the early days of Ximian, and I remember taking notes frantically. Later I had a chance to meet him at OSCON in Portland.

Posted on 05 Apr 2004

C# Compiler

by Miguel de Icaza

As I make slow progress on Anonymous Methods on the C# compiler -due to some very embarassing assumption on my part- but most issues have been solved now. Am now implementing parameter capturing and must finish the field access reference from an anonymous method, fix a couple of regressions with iterators and commit quickly to CVS. Martin Baulig has been going through the C# generics spec item by item double-checking that his compiler has everything that we are supposed to have (Generic tests today amount to 20% of our positive tests, and 10% of our negative tests). He has finished with the generics spec as far as the ECMA working draft is concerned, but its lacking some of the latest additions that were freshly submitted in January.

Martin also worked on the new alias features in C# 2.0 and some of that code is already on the CVS tree.

Reflection.Emit is sadly not complete enough to build our generics C# compiler (even with the recently released .NET Framework 2.0 preview) so we had to resort to more hidden methods in our Reflection.Emit API which are only available to our compiler. We hope to post the list of our API needs in case Microsoft is interested in exposing these kind of changes in their implementation.

At the PDC in one of the compiler BOFs, Brad Abrams asked if people had written a compiler that followed the Common Language Specification (CLS) rules and very few people actually said they had. Although we had a C# compiler, we had not implemented the CLS rules for it.

Marek Safar recently contributed the CLS support for our C# compiler. The initial patch is about two months old, we went through various code reviews before the code could land on CVS: the traidional review for maintanability, style and performance was done before we could take his patch. Marek did a fantastic job addressing every concern that Martin and myself had. It turned out that the CLS tests have a minimal impact on compilation time.

Partial Classes is another feature that more and more people are asking about. On the surface you would think its trivial to implement it. And in fact most of it is trivial to implement, except that there is a tiny little clause in the spec that states that type lookup must be performed using the current list of using declarations. The problem is that the list of using declarations might be different from file to file, so in two different pieces of a partial class "MyType" might have a different meaning.

Partial classes are debatable an ugly hack, but at least this rules make sense in terms of doing what the programmer expects.

Implementation wise, it means that we need to do a lot of code shuffling to implement it, and it is not something that we are likely going to have by Mono 1.0.

Posted on 04 Apr 2004

Nice Gnome writeup

by Miguel de Icaza

Erik pointed me to this nice writeup on the usability of Gnome given recent debates on the topic.

Posted on 03 Apr 2004

Now that Sun and Microsoft are buddies

by Miguel de Icaza

I am counting the minutes for Sun to ship our Mono implementation for Solaris. Maybe we can still make it to the Solaris 10 release.

Just picture the benefits, out of the box free C# compiler on Solaris SPARC and Solaris Intel. Out of the box ASP.NET and ADO.NET on SPARC, and the Gtk# bindings for writing applications for the Java Desktop System.

Not to mention that they get the industry's most sexy JIT compiler for free.

I am walking with an extra cell phone battery in case McNealy or Schwartz decide to call me up over the weekend to discuss potential agreements (if I dont pick up, please leave a message, the wonders of ATT wireless).

Posted on 02 Apr 2004

Mono Brainshare Presentations

by Miguel de Icaza

Thanks to Pedro Santos I got a full list of the Mono Brainshare PPT files:

  • Introducing Mono for Developers [ppt];
  • Advanced Mono Development: Best Practices [ppt];
  • Mono: Developing and Deploying .NET Applications for Linux [ppt];
  • Mono: Rapid GUI Application Development on Linux [ppt];
  • Developing ASP .NET on Linux with Mono - ainda n�o h� o ppt dispon�vel
  • Using Mono to Develop the Next Version of Novell iFolder [ppt];
  • Developing with the System.DirectoryServices Namespace API for Mono [ppt].

Notice that the slides that Erik and myself used were slightly different than those that we published for the event, as we continue the long tradition of `Redo your presentation the night before'.

Posted on 30 Mar 2004

On Novell and Toolkits

by Miguel de Icaza

Nat just posted the official Novell position on the toolkits

I just posted this to Slashdot:

As Nat has posted elsewhere, the Heise article is wrong.

My team and other teams within Novell continue to develop and use Gtk as their toolkit (recently open sourced Simias/iFolder for instance) and all of the Mono GUI development tools.

The only use of Qt that am aware of today is SUSE's recently open sourced YAST.

Btw, if you have been following my posts on my blog and on the desktop-devel-list, you will know that my feeling is that all of the existing toolkits today (Gtk, Qt, XUL and VCL) will become obsolete and we need to start looking at the next generation toolkit system.

Next Generation Toolkits

One of the interesting aspects of Avalon is that they built the widget set on the equivalent of Gnome's AA canvas. Canvas and Canvas items. They call them `FrameworkElements', but it is the same model: once you "paint" something, it stays there (link)

Nautilus had a branch that had some more advanced canvas items than the ones we ship in libgnomecanvas: Andy had written some canvas items that rendered tiny visualizations of a web page, so "web page" links would update live.

Novell LDAP for Mono

Sunil has an amazing tutorial on using the Novell.LDAP library for Mono. To find, go here and search for "DirectoryServices" on the Title. Sorry, the direct link fails.

Posted on 29 Mar 2004

Keynote at Brainshare

by Miguel de Icaza

In a few more hours Erik and myself will be doing the Mono components of the Friday keynote at Novell's Brainshare event.

In spite of his race, that man is extremely valuable to me. He is not some random dingbat I found on the Strip.

You can watch the keynote live tomorrow at 9am MST or you can wait and get the archive.

We'd be fools not to ride this strange torpedo all the way to the end.

Posted on 26 Mar 2004

Gnome Users Conference in Spain

by Miguel de Icaza

The Gnome Users in Spain (host of the largest Linux deployment today) are having the "GUADEC Hispana", their Gnome Users and Developers Conference for the Spanish speaking developers on the 21-23 of May in Almedralejo, Spain.

Posted on 23 Mar 2004

« Newer entries | Older entries »