Benjamin Wootton has been working on Mono's Code Access Security (CAS) support. CAS is a way of creating arbitrary "sandboxes" in the .NET environment. The idea here is to load and execute untrusted side-by-side with your trusted code code without compromising your application. Similar in spirit to Java's security model.
CAS is needed for the various "click-once" setups for downloading, running and updating applications over the web, but more advanced uses enable scenarios like running untrusted plugins in a trusted application (for instance, a file format importer downloaded from the network, or plugins for your application which you do not necessarily want to trust).
You can read his list of requirements here; The project status page (with all his patches to add CAS to Mono) and a screenshot of his Mono CAS Configuration tool.
I have been working on anonymous method support for the compiler in stages. My latest patch for the curious lives here.
The first one was to implement the implicit method group conversions to delegates, that one allows you to write things like:
void Method () { button.Clicked += clicked_handler; ... } void clicked_handler () { }
The second stage was to handle anonymous method declarations inline, and move the body of the code into an helper method in a chunk like this:
void Method () { button.Clicked += delegate { Console.WriteLine ("hello"); } }
Until that point things were relatively simple, the next step was a lot more tricky, and it involved capturing local variables:
void Method () { int i = 0; button.Clicked += delegate { Console.WriteLine (i); } }
The above code needs to be compiled into something like:
void Method () { Locals1 __locals = new Locals1 (); locals1.i = 0; button.Clicked += locals1.__AnonymousMethod1; } class Locals1 { int i; void _AnonymousMethod () { Console.WriteLine (i); } }
Things get more complicated when you add multiple levels of scopes to variables:
void Method () { for (int i = 0; i < 10; i++){ int j = 0; button.Clicked += delegate { Console.WriteLine (i + j); } int z = i + j; } }
The above needs to generate roughly this:
void Method () { Local1 locals1 = new Locals1 (); locals1.i = i; for (int i = 0; i < 10; i++){ Locals2 locals2 = new Locals2 (); locals2.locals1 = locals1; locals2.j = 0; button.Clicked += locals2.AnonymousMethod1; z = locals2.locals1.i + locals2.j; } } class Locals1 { int i; } class Locals2 { Locals1 locals1; int j; void AnonymousMethod () { Console.WriteLine (locals1.i, j); } }
So fairly tricky: the variable can be accessed from the method containing the anonymous method.
One of the trickiest parts is the process that guesses the return value for the anonymous method: it might seem like inference is at work, but in fact during the resolution process we know the type we requiere, so the compiler triggers the resolution of the inner block when it gets this information.
Another complex bit was that the resolution/emit phases of the compiler had to be completely decoupled (they were already partially decoupled) because it is necessary to identify any variables that might be captured before we can even generate the first line of the block.
The patch is my work-in-progress code, it can not be checked into CVS just yet, since it breaks the iterator support in the compiler, so that must be fixed first.
I need to finish my write up and post the pictures of the event, but that will come later ;-)
Posted on 10 Mar 2004
Posted on 08 Mar 2004
This week the Mono Novell hackers have met for the first time in Boston, and we have been discussing the various tasks that need to be completed for Mono 1.0 and 1.2. IRC has been relatively quiet, and the exchange of ideas and discussions in town have been great.
The good news: we are on schedule for the 1.0 release, with a very nice cushion to test things. The only areas that are going to be very close to the deadline are System.Data and System.Drawing.
We got a few folks explain their areas of work to the others (so far I attended the meetings on security, remoting and the debugging session).
Duncan has been leading the release engineering meetings and laying down a process for the ongoing builds, and the 1.0 release packages.
Martin, Mike, Todd and Daniel are busy working on a small surprise for MonoDevelop, that they are hoping to demostrate on the open house this Friday/Saturday.
Windows.Forms is alive again! Peter Bartok demostrated various applications working with the new Wine, and together with Jordi Mas, they are resolving the various rendering integration issues between Libgdiplus (cairo) and WineLib (Wine turned into a library).
I read with interest Edd's thoughts on XAML and a new UI for GNOME. I have been doing some small XAML tests recently, and it is a very easy markup to generate. As I mentioned before the issue with XAML is that it will be very attractive to developers to move from HTML to XAML, as it provides more control, more widgetry and is an extensible system.
The future of Linux on the desktop is in fact on the line: if enterprise developers and IT developers fall in love with Xaml for building their in-house applications it will marginalize again Linux on the desktop.
There are two views of how to solve this problem. The Nat Friedman view of building a matching system in the meantime: leveraging our existing technologies, or the Miggy-view, which is lets implement the Avalon/XAML API. I think we should pursue both paths.
Posted on 03 Mar 2004
New article on the Israeli wall.
Posted on 27 Feb 2004
Monday flew in-and-out of Denver; Followed by XML Edge panel yesterday in Boston, where I had a chance to meet again Margo from Sleepycat.
Next week will be twice as crazy: all of the Novell Mono Developers are descending into Boston for a whole week of meetings and working together. This is a historical event, since the team has never met before face to face (only a few of them have met).
On Friday and Saturday we are hosting an open house event for folks to come and meet with the team and learn a bit about Mono. We have now an agenda for the meeting.
Duncan shared a few links with me today Rumsfeld Fighting Technique and this. From Dare, I found a nice post from Aaron: How Stating the False Hides The True
Posted on 26 Feb 2004
Am in the international Open Source Conference held in Malaga in Andalucia. Andalucia and Extremadura are the two states that have adopted Gnome across the board: education and government. There are 400,000 users in these two areas (20% of the Extremadura population are Gnome users) and have around 100,000 Gnome desktops deployed.
This is a very big number of Gnome desktops deployed. This might be the largest Linux desktop deployment in the world (China will follow later with the Gnome-based JDS system next year).
This is entirely a Debian/GNOME setup, and there is a local industry that has emerged out of this: various small companies here are providing the support to the governments of Andalucia and Extremadura (Will get the name of the consortium of open source companies tomorrow, because right now I forgot).
They have developed quite a set of interesting tools: from back-porting changes to the stable version of Debian (addressing one of Debian's weaknesses) to developing tools to manage large network deployments (similar to Red Carpet's enterprise features, but for Debian) and a nifty tool to create bootable distributions and turn them into CDs that people can carry around (metadistros).
There are tons of stories floating around, and people very excited about this technology. From the kids that after doing their work in school ask the teacher for permission to use the "Guadalinux" (this is the name they use to refer to the Linux machine, based on the distribution name) to the class rooms that are now entirely quiet due to the kids playing with the "Guadalinux" systems.
Also grandmothers refer to the web as "mozilla" they pronounce it "mo-ci-yha", as in `I found in mo-ci-ya that you can do this and that'. Very interesting stuff.
During a few conversations with the various officials and engineers that work on this project, I have mentioned that they should probably should join the Gnome Foundation's Advisory Board, something that I think we should fast track. I asked the education secretary if they had any issues with Gnome, and if there was something we could fix, or improve for them, and they said `So far we have not had problems with the teachers'. A good perception.
The technical guys on the other hand had a few requests: from Evolution failing to send SMTP mails in some occasions (we should investigate this) to better integration with the braille stack in the accessibility framework (accessibility here is very important due to a fairly strong Spaniard organization called "La Once").
My friend Charles Curran from the UK Linux Users group is also in town, he is now living in Sevilla, and came to the meeting. It was very nice to see him again.
Lastly, about 30 Gnome Developers from the "Gnome Hispano" got together in the afternoon to meet and discuss. I learned that a "GUADEC Hispano" is being planned for May in Extremadura.
The Mono presentation went fairly well, I was still a bit tired from the jetlag, but it came out OK. I updated MonoDevelop from CVS, and things worked out of the box: I demoed the intellisense feature which is just a great way of developing Gtk# apps.
While jetlagged and unable to sleep, am checking out the Nemerle language. A functional language designed by Michal Moskal for the .NET Framework that works out of the box in Mono.
This compiler is self-hosting, which is fascinating. Worked out of the box on Mono 0.30
Posted on 19 Feb 2004
A fascinating product from Mainsoft has been released: Visual MainWin for J2EE.
This product lets you run your ASP.NET applications written in C# or VB.NET inside a J2EE application server and integrates beautifully with Visual Studio.NET. All .NET applications can also use EJBs and reference Java classes, you can see a live Flash demo of it.
Mainsoft has been using Mono's class libraries to deliver the functionality and they are regular contributors to the code base. We wish them much luck with their new product.
Posted on 17 Feb 2004
I will be in Madrid on Monday and Tuesday (busy all day until dinner-time).
Cena el Lunes, Comida el martes: Si est�n en Madrid, por favor p�nganse en contacto con Juantom�s o Roberto Santos para que nos juntemos para una cena el Lunes o desayuno/comida el Martes.
Jon Perr who used to work for us at Ximian has launched a new web site.
Posted on 14 Feb 2004
Been doing good progress with anonymous methods, but last night on the plane on the way back home, I discovered a big problem with my design (I had a fairly clever way of computing the right return type in an anonymous method).
My clever hack was to hook up to the standard conversion code: anonymous methods are generated during the implicit conversion code. The problem with this approach is that it was too late to capture variables.
Am right now toying with overloading the implementation of Field expressions and LocalVariableReference expressions to handle the lifting, rather than the clever CapturedVariable expression which I was using before.
Marek has been cleaning up the compiler internals to turn our compiler into a CLS-aware compiler, now we will be able to flag CLS violation errors. His fixes includes long-standing wishlist items to refactor the interface members to become regular MemberCores (which they do now) and refactoring some of the attribute emission and gratuitous differences in constants and fields that we had in the code.
Posted on 11 Feb 2004
Am visiting Novell's main development offices for the next two days. If you are here and want to talk about Mono, drop me an email.
Posted on 09 Feb 2004