Kurt Vonnegut's New Book.

by Miguel de Icaza

I enjoyed tremendously reading Kurt Vonnegut's latest book "A Man Without a Country" which recently came out.

The theme is very personal, Vonnegut's view on the current state of affairs on the world. Unlike his fiction books on "A Man Without a Country" Vonnegut explicitly states what he believes is wrong, what must be fixed and identifies the crookitude by name.

Posted on 27 Sep 2005


Viggo Mortensen

by Miguel de Icaza

Crooks and Liars has the video of Viggo Mortensen amazing interview on Charlie Rose's show.

I admire the man. He shows up with a gift for the host, a copy of Howard Zinn's Voices of A People's History of the United States. One of my favorite books and is followed by a brilliant presentation on the state of the country in a calm and articulate way.

And on his web site I find a quote from another favorite author of mine, Gore Vidal and plenty of articles from authors that I like.

Posted on 25 Sep 2005


C# 3.0 Q&A

by Miguel de Icaza

A C# 3.0 Q&A, a lot of folks have been asking about these and other questions. Find it here

People have been asking me when are we going to support C# 3.0.

Our current focus is on delivering a very stable platform, so we are trying to fix the bugs that people are reporting and give developers a great experience with their existing code base. This is just a basic Joel principle: fix bugs before you write new code.

Considering that C# 3.0 is still a year or two away from shipping and the specification will likely change it is best for us to polish our C# 2.0 compiler and our runtime classes than to start work on C# 3.0 right now.

The good news is that all of the new C# 3.0 features are relatively simple and it builds on existing C# 2.0 features. The specification so far is 26 pages long. It is probably one third of the effort that it took to implement generics on the compiler and the runtime.

We are as excited as everyone else about the language and can not wait to try to implement some of those features and provide feedback about it to the language architects, but this work will have to wait a few months. This is definitely not part of our Mono 1.2 release needs (that being said, if one of the contributors sends code for it, we will very likely integrate it).

XLinq

In the meantime, Atsushi has checked some early work on XLinq to our repository. It has only enough code to run Microsoft's XlinqIntro sample.

Posted on 25 Sep 2005


Mono on ARM

by Miguel de Icaza

Mono 1.1.9 shipped with a port of the JIT engine to the ARM processor and it currently supports the Linux operating system. A few days ago Paolo received his Nokia 770 which is a Linux/Gtk-based PDA. Mono and Gtk# work out of the box on it.

Paolo reports:

After the Mono JIT port was done using a desktop little-endian ARM computer, Geoff just recompiled it and run it on a Linksys NSLU2 (which runs a ARM processor in big-endian mode). That was pretty cool. I wonder if it is as cool as running mono on a Nokia 770 (no recompilation necessary, just copied the binary from my Debian box). Here it is running our hello world app. Many thanks to the fine folks at Nokia for sending me a prototype so quickly.

...

I made tarballs of binaries for use on Linux/ARM systems, including the Nokia 770. And, yes, Gtk# apps work fine on it:-). Happy hacking, you'll find them here.

I added a few links and updated some on the quoted text above.

In addition Paolo made a small video of Gtk# starting up on the Nokia, notice that it starts up very fast.

The NSLU2 has an ARM processor running at 130Mhz. At USD 78.84 it is probably the cheapest machine to run Mono. Geoff boostrapped Mono in about 10 hours on this little machine.

Update: Geoff reports that he un-underclocked his Linksys machine so instead of being a running at 133Mhz he is running it at 266Mhz.

With the machine at 266Mhz compiling Mono 1.1.9 (which includes building the C runtime with gcc and compiling the C# code for the 1.x and 2.x profiles) takes about 9 hours.

Posted on 20 Sep 2005


Must-own book

by Miguel de Icaza

The new book from Brad Abrams and Krzysztof Cwalina: Framework Design Guidelines : Conventions, Idioms, and Patterns for Reusable .NET Libraries is a must-have book for anyone writing .NET and Mono code.

I got my copy at the PDC this week and it is a wonderful book. The book includes many of the design guidelines that Brad's blog is famous for. The book is not just a collection of rules, but it also includes the rationale for some of the design decisions and what really makes the book interesting are the commentaries from other developers and architects involved in .NET.

This book is packed with gems. I hope we can start using these more in our own code

Oh, and I also got my copy autographed by Brad himself.

There are slides from his session posted here. Another set of must-read slides for any developer.

More PDC

Am working on a larger post with all-things PDC and the Mono meeting, but it is taking me some time to digest everything I learned this week.

Posted on 18 Sep 2005


Mono Meeting at the PDC: Reminder

by Miguel de Icaza

If you are attending the PDC or you live nearby, remember that today at 6pm we are having a Mono Users Meeting a the Sheraton Downtown Hotel in LA.

Details on the meeting are here.

We have a few fun stories to share about the PDC, I will try to blog them later this week.

Posted on 13 Sep 2005


Mono Meeting at the Microsoft PDC

by Miguel de Icaza

Update: We had a hugely successful meeting during the PDC. I will post details after I decompress from a great week at the event.

Mono users meeting at the Microsoft PDC.

Date: Tuesday September 13th.

Location: Sheraton Downtown LA hotel, a short walk (map) from the Staples Conventions Center.

Room: Santa Monica Room.

Time:The meeting will start at 6pm and will go until 9:30pm.

Open to the public

Pass the word to other fellow .NET developers.

At the meeting we will talk about the Mono Project's current state, milestones, new developments, platform support and upcoming releases. Various Mono developers will be there to answer your questions both members of the community and Novell employees working on Mono.

The evening surprise is the unveiling of the new Mono T-Shirts design by Finnish artist Tuomas Kuosmanen. We will be giving out t-shirts to the attendees.

We will showcase some of the Mono-based applications we have built for Linux:

We will also showcase the new vector-based rendering APIs available for developers (completely cross-platform) as well as the new OpenGL-based windowing system.

We will answer your questions on how to bring your .NET applications to Linux, MacOS X and Solaris and how to take advantage of the Mono and Linux-specific APIs.

Finally, we will demo some of the the new Mono software funded by Google's Summer of Code:

  • XBuild: the open source msbuild implementation for assisting you in rebuilding your new projects on Mono.
  • Ruby.NET and PHP.NET compilers.
  • The DIVA Movie editor.
  • The new ASP.NET editor.
  • The .NET bug finder.
  • The Cecil libraries for reading and writing CIL images.
  • Mono's XAML compiler.

Background for the Mono Meeting

Background: As some of you know, Microsoft for the second time in a row blocked the Mono Birds-of-a-feathers (BOF) meeting from being held at their Professional Developers Conference. It is their conference, and I understand that a cross-platform .NET implementation might make them nervous (we are creating lots of new applications with it, and we are helping people reuse their existing skills on Linux).

It is their conference, and they have every right to control what they will allow to be shown there, but they actively have misrepresented things. On the PDC web site they claim that the BOF selection is up to INETA ( apparently an independent non-profit organization). Here is what the BOF selection process was advertised (you must have an MS Passport to read this):

The Birds of a Feather sessions at the Microsoft PDC05 are chaired by INETA (International .NET Association), the premier .NET developer user group associations.

[..]

Final selection and scheduling of the sessions will be performed by INETA based on popularity: all decisions are final. Submitters will be notified by Friday September 2, 2005 whether their session was accepted or declined.

What they failed to mention is that the Mono BOF was never listed for voting, and hence it never received a single vote. My submission was confirmed as I exchanged two emails with Stuart Celarier at Corillian, but the BOF was never listed and further emails to Stuart went unanswered, he wrote on INETA'S web site:

INETA is chairing the Birds of a Feather track at PDC 2005. This community-driven activity brings together conference attendees for open, moderated discussions on topics of shared professional or community interest.
[..]

Birds of a Feather really do flock together!

Stuart probably did not get the memo.

My guess is that it is best not to list the BOF than have to answer obnoxious questions about why the top-voted BOF had not been accepted (this year they also removed vote count display from the BOF listing).

So much for the independent INETA chairing the BOF process. On Friday, I was notified that my BOF proposal was not accepted.

I believe this is at the core on what is wrong in the way that Microsoft treats its users and developers and why people consider alternatives in the first place.

BOF sessions in every conference I have attended in the past ten years is usually an event that happens after hours and is organized by the attendees in an organic way: a white board is left open for groups to allocate an hour or two for what they consider an interesting topic. Conference organizers never have any editorial control over them, they basically give out the rooms for the various communities to get together.

At Stephen Walli's urging we put together Mono meeting on a nearby hotel and Tuomas designed a beautiful new T-Shirt (Thanks!). It will be fun, and I will probably wear my large foam red cowboy hat.

Anyways, its important to separate the great and amazing developers, testers and architects working on .NET from the marketing and management people. I look forward to a great time at the PDC. See you there!

Stickers

We want to distribute some cute stickers, an idea courtesy of Mike Shaver's: something like this:

"[Logo] using Mono;"

Picture this with me: Black background, yellow letters, nice cute Mono logo outline. I think it will look lovely.

Small stickers to put on badges and medium size for laptops. If you know someone in LA or Boston that can get this done quickly and before the PDC, let me know

Posted on 06 Sep 2005


Policies and Katrina

by Miguel de Icaza

A collection of various articles that in my opinion are relevant about policy making and the Katrina effect on New Orleans.

First some background: The president finished his five week vacaction and went on a fundraising tour to Arizona and the west coast. He likes to keep a balanced life.

In the meantime, as the vice president continued to enjoy his holidays the Secretary of State was spotted in New York City attending a Broadway show and going on a shopping spree:

On Wednesday night, Secretary Rice was booed by some audience members at "Spamalot!," the Monty Python musical at the Shubert, when the lights went up after the performance.

Yesterday, Rice went shopping at Ferragamo on Fifth Ave. According to the Web site www.Gawker.com, the 50-year-old bought "several thousand dollars' worth of shoes" at the pricey leather-goods boutique.

A fellow shopper shouted, "How dare you shop for shoes while thousands are dying and homeless!" - presumably referring to Louisiana and Mississippi.

The woman expressing her First Amendment rights was promptly removed from the store.

Billmon:

Paul Krugman's column in yesterday's New York Times argues that the Cheney administration's lackadaisical response to Hurricane Katrina is a symptom of a much larger problem -- the GOP contempt for government:

At a fundamental level, I'd argue, our current leaders just aren't serious about some of the essential functions of government. They like waging war, but they don't like providing security, rescuing those in need or spending on preventive measures.

I was thinking about posting something along those same lines -- along with a modest proposal to chaingang all the conservative pundits and politicians who've spent the past twenty five years trashing the federal government, and put them to work stacking sandbags down in Louisiana. And while we're at it, we could take all the think-tank libertarians and corporate bunko artists who promised us their blessed free market could and would solve all human problems, and use them as filler for the sandbags.

Two Americas:

Local National Guard are serving in a President's war of choice. People in trouble need them here.

Molly Ivins states:

Just plain political bad luck that, in June, Bush took his little ax and chopped $71.2 million from the budget of the New Orleans Corps of Engineers, a 44 percent reduction. As was reported in New Orleans CityBusiness at the time, that meant "major hurricane and flood projects will not be awarded to local engineering firms. Also, a study to determine ways to protect the region from a Category 5 hurricane has been shelved for now."

Dave Winer:

Comment: The writer above is absolutely correct that, if we were prepared, the response to the aftermath of Katrina would be further along by now. Responsibility however is not with the administration, it lies with the electorate. We had a chance to make last year's election a referendum on the politics of terrorism, to seriously evaluate our preparedness, if we really cared.

If anything is learned from this, we have to think, we can't delegate. We need leadership that cares, not in a superficial way. That leadership must come from us. We have some very huge decisions to make right now, and many thousands of lives depend on how well we do. That said, I have few ideas of things we can do other than give money to relief agencies, which of course, we are doing.

Molly Ivins echoes the need to care about politics:

To use a fine Southern word, it's tacky to start playing the blame game before the dead are even counted. It is not too soon, however, to make a point that needs to be hammered home again and again, and that is that government policies have real consequences in people's lives.

This is not "just politics" or blaming for political advantage. This is about the real consequences of what governments do and do not do about their responsibilities. And about who winds up paying the price for those policies.

Maureen Dowd says:

Stuff happens.

And when you combine limited government with incompetent government, lethal stuff happens.

Others are a bit harsher, but still correct.

An open letter to the president:

Any idea where all our helicopters are? It's Day 5 of Hurricane Katrina and thousands remain stranded in New Orleans and need to be airlifted. Where on earth could you have misplaced all our military choppers? Do you need help finding them? I once lost my car in a Sears parking lot. Man, was that a drag.

Also, any idea where all our national guard soldiers are?

[...]

And don't listen to those who, in the coming days, will reveal how you specifically reduced the Army Corps of Engineers' budget for New Orleans this summer for the third year in a row. You just tell them that even if you hadn't cut the money to fix those levees, there weren't going to be any Army engineers to fix them anyway because you had a much more important construction job for them -- BUILDING DEMOCRACY IN IRAQ!

The president tried to use the "nobody expected this" excuse. Dave Winer has collected some evidence that the problems in New Orleans were well known.

CNN ripped each one of the excuses from the Homeland Security Secretary.

In the meantime, operation scapegoat is in full swing. Joshua explains this succinctly:

Now at least we have the storyline. The Bush administration wasn't caught sleeping on the job while New Orleans went under with a gutted FEMA run by a guy who got fired from his last job policing horse shows. In fact, according to the new White House storyline, the governor of Louisiana and the mayor of New Orleans didn't ask for help quickly enough. And the White House was powerless to act until they did. Apparently they couldn't even reschedule the president's vacation until the locals got the right forms signed.

The Independent hosts some questions and answers:

Why has it taken George Bush five days to get to New Orleans?

How could the world's only superpower be so slow in rescuing its own people?

Why did he cut funding for flood control and emergency management?

Why did it take so long to send adequate National Guard forces to keep law and order?

How can the US take Iraq, a country of £25m people, in three weeks but fail to rescue 25,000 of its own citizens from a sports arena in a big American city?

Click for the answers

Billmon points out that this disaster is similar to the 1927 flood of New Orleans and quotes some 1927 newspapers and photographs

Greg Palast on the 1927 floods and the rise of the government for the people:

There is nothing new under the sun. In 1927, a Republican President had his photo taken as the Mississippi rolled over New Orleans. Calvin Coolidge, "a little fat man with a notebook in his hand," promised to rebuild the state. He didn't. Instead, he left to play golf with Ken Lay or the Ken Lay railroad baron equivalent of his day.

In 1927, the Democratic Party had died and was awaiting burial. As depression approached, the coma-Dems, like Franklin Roosevelt, called for balancing the budget.

Then, as the waters rose, one politician finally said, roughly, "Screw this! They're lying! The President's lying! The rich fat cats that are drowning you will do it again and again and again. They lead you into imperialist wars for profit, they take away your schools and your hope and when you complain, they blame Blacks and Jews and immigrants. Then they push your kids under. I say, Kick'm in the ass and take your rightful share!"

Huey Long laid out a plan: a progressive income tax, real money for education, public works to rebuild Louisiana and America, an end to wars for empire, and an end to financial oligarchy. The waters receded, the anger did not, and Huey "Kingfish" Long was elected Governor of Louisiana in 1928.

At the time, Louisiana schools were free, but not the textbooks. Governor Long taxed Big Oil to pay for the books. Rockefeller's oil companies refused pay the textbook tax, so Long ordered the National Guard to seize Standard Oil's fields in the Delta.

Billmon points out that the US is capable of deliverig efficient relief efforts Where there's a Will. He presents various newspapers quotes from 2004 and Florida:

So you can see that when the chips are down, and the need is absolutely dire, this administration can still deliver the kind of coordinated emergency response that once made the U.S. government the envy of the world -- just as it cooly and capably protected the Iraqi Oil Ministry from the chaos and looting that trashed every other government office in post-invasion Baghdad. As is usually the case in public service, it's just a matter of having the right incentives.

The comparison between the TLC showered on Florida last year and Bush's initial "What, me worry?" response to this year's disaster no doubt will go unnoticed by the amnesia patients in the corporate media. And since I'm lucky enough to live in a swing state that is also coveted by GOP political strategists, I probably don't have to worry about it either -- that is, as long as any future disasters around my neck of the woods happen in one of those years divisible by two.

But for the citizens of staunch, deep red Mississippi and slightly less staunch but still red Louisiana, the lessons are painfully obvious. If you're going to insist on living in a hurricane alley, then you need to take personal responsibility for your own actions, stop whining about government incompetence, and embrace the free market solution to your problems -- by moving to Florida.

On Rebuliding New Orleans:

Long before Katrina, New Orleans was hit by a hurricane of poverty, racism, disinvestment, deindustrialization and corruption. Simply the damage from this pre-Katrina hurricane will take billions to repair.

Now that the money is flowing in, and the world's eyes are focused on Katrina, its vital that progressive-minded people take this opportunity to fight for a rebuilding with justice. New Orleans is a special place, and we need to fight for its rebirth.

[..]

No sane person should classify someone who takes food from indefinitely closed stores in a desperate, starving city as a "looter," but that's just what the media did over and over again. Sheriffs and politicians talked of having troops protect stores instead of perform rescue operations.

Images of New Orleans' hurricane-ravaged population were transformed into black, out-of-control, criminals. As if taking a stereo from a store that will clearly be insured against loss is a greater crime than the governmental neglect and incompetence that did billions of dollars of damage and destroyed a city.

The press has not noticed where the real looting is going on:

President Bush yesterday told ABC-TV, ''there ought to be zero tolerance of people breaking the law during an emergency such as this, whether it be looting or price-gouging at the gasoline pump or taking advantage of charitable giving or insurance fraud.''

[..]

In a thinly disguised attempt to act as if it cared about the people wading in the water, Chevron has pledged $5 million to relief efforts. ExxonMobil and Shell have pledged $2 million apiece. British Petroleum and Citgo have pledged $1 million each.

Those disciplined operating practices are hardly confined to the oil fields. Everyone knows that Bush does not really mean what he says about price-gouging at the pump, since he just gave energy companies the bulk of $14.5 billion in tax breaks in the new energy bill. Surprise, surprise. In Bush's two elections, oil and gas companies gave Republicans 79 percent of their $61.5 million in campaign contributions, according to the Center for Responsive Politics.

If Bush really meant what he said, he would call for a freeze or cap on gasoline prices, especially in the regions affected most dramatically by Katrina. He would challenge big oil to come up with a much more meaningful contribution to relief efforts.

Insurance companies are expecting up to $25 billion in claims from Katrina. For ExxonMobil, which is headed to $30 billion in profits, to jack up prices at the pump and then only throw $2 million at relief efforts is unconscionable.

Jamie has several other updates.

Posted on 04 Sep 2005


Building a new Arc

by Miguel de Icaza

The Jesus General makes an appeal to the Gates Foundation to rebuild Noah's Arc given that the Foundation is funding the Discovery Institute to promote ``intelligent design'' (through CrooksAndLiars).

Update: A reader comments that the funding to the Discovery Institute is for project Cascadia for transportation alternatives in the Northwest. Seems like that ruins the fun of the Jesus General post.

I enjoy reading the Jesus General: `An 11 on the Manly Scale of Absolute Gender'.

In the meantime, one of my favorite BillMon's is his post: "Bring Me the Head of Hugo Chavez".

Airlines

I just got an email from one of the Airlines I fly on notifying me of a terrific opportunity: they will now have more seats in coach. In the email they seemed to be pretty psyched about it. I mean, really excited about it they even mention that they will continue to provide snacks.

Meanwhile I was thinking `There goes the legroom'.

Posted on 30 Aug 2005


Iterators and Efficient Use of the Thread Pool

by Miguel de Icaza

The new HTTP application pipeline in Mono is in my opinion a beautiful work of art. Let me explain.

The HTTP application pipeline processes an incoming HTTP request. When the request comes in it has to go through a number of steps before the request is actually handed over to the developer code: authentication, authorization, cache lookup, session state acquisition. There are a similar set of steps processed after your code is complete.

The runtime by default provides a few modules. These are listed in the machine.config file in the <httpModules> section. Mono by default includes: FormsAuthentication, UrlAuthorization, Session and the OutputCache modules. These hook up to one or more of the stages in the application pipeline.

These stages are part of the HttpApplication class. You typically have one of these per "directory" where you have deployed an ASP.NET application. As a developer, you can hook up to various points in the processing pipeline. For example, you could add your own authentication system by listing a dynamic module in the web.config file, and then hooking up to the processing pipeline:

	app.AuthenticateRequest += my_authenticator;

Now, typically when processing a request the various hooks are invoked synchronously: one after another. But in some cases your hook code might want to perform a lengthy operation, for example contacting a remote authentication server. Instead of blocking the executing thread, you want to queue the work using the CIL asynchronous framework and release the current thread from its duties so it can be used to process another request. To do this, you must register your hook using a different API:

	app.AddOnAuthenticateRequestAsync (begin_authentication, end_authentication);

Where begin_authentication is the method that will initiate the authentication asynchronously and end_authentication is the method that will be invoked when the asynchronous operation has completed. As I said before, while the asynchronous operation is pending the thread should be returned to the threadpool so it can handle the next request. When the asynchronous operation is completed it will be queued for execution again and when a thread becomes available it will execute the completion routine and resume execution.

The challenge is that you might have both synchronous and asynchronous hooks in a given application and also that at any stage the pipeline can be stopped (for example if authorization failed).

Now the challenge was to come up with a maintainable and clean design for the application pipeline. Here is where iterators came into play. The first step to make this simple was to treat all asynchronous registrations as synchronous at the event layer:

	//
	// AsyncInvoker is merely a wrapper class to hold the `b' and
	// `e' events, it does not actually invoke anything.
	// 
	public void AddAsync (BeginEventHandler b, EndEventHandler e)
	{
		AsyncInvoker invoker = new AsyncInvoker (b, e);
		Hook += new EventHandler (invoker.Invoke);
	}

The Pipeline is written like this:

	IEnumerator Pipeline ()
	{
		if (Authentication != null)
			foreach (bool stop in RunHooks (Authentication))
				yield return stop;

		if (Authorization != null)
			foreach (bool stop in RunHooks (Authorization))
				yield return stop;

		[...]
		
		done.Set ();
	}

Now the trick is how to implement RunHooks which takes a list of events, here it is:

	IEnumerable RunHooks (string stage, Delegate list)
	{
		Delegate [] delegates = list.GetInvocationList ();

		foreach (EventHandler d in delegates){
			if (d.Target != null && d.Target.GetType () is AsyncInvoker){
				AsyncInvoker ai = (AsyncInvoker) d.Target;

				ai.begin (this, EventArgs.Empty, resume, ai);
				yield return false;
			} else 
				d (this, EventArgs.Empty);

			if (stop_processing)
				yield return true;
		}
	}

Notice that we basically are using nested yield-based enumerators. The return value from "RunHooks" indicates whether the pipeline must be stopped (true) or not (false). RunHooks will execute as many synchronous operations as it can in order until it finds an asynchronous operation. At that point it initiates the operation calling the "begin" method and then it yields the control. The control is transfered to the Pipeline method which also yields and returns control to the caller.

The pipeline is kicked into action by:

	void Start (object callback)
	{
		done.Reset ();
		pipeline = Pipeline ();

		Execute ();
	}

Now the actual processing engine lives in the "Execute" method:

	void Execute ()
	{
		if (pipeline.MoveNext ())
			if ((bool)pipeline.Current){
				Console.WriteLine (prefix + "Stop requested");
				done.Set ();
			}
	}

	// This restarts the pipeline after an async call completes.
	void resume (IAsyncResult ar)
	{
		AsyncInvoker ai = (AsyncInvoker) ar.AsyncState;
		if (ai.end != null)
			ai.end (ar);

		Console.WriteLine (prefix + "Completed async operation: {0}", ar.GetType ());
		Execute ();
	}

Execute is basically using the IEnumerator interface directly while the Pipeline method uses the conveniece foreach method that iterates over every step.

The complete sample can be obtained here. This is the prototype I used as a proof of concept. The actual implementation (with different routine names) that we landed on System.Web is more complete is available here (you must scroll down).

At 1000 lines of code for the full file its one of the clean and small hacks that am most proud of.

Posted on 28 Aug 2005


« Newer entries | Older entries »