Intstead, alert() writes out to the console, and you can enable Dashboard development mode so you can drag the widget out onto the desktop. So open console and turn on dev mode if you're writing widgets.
That said, here's my first dashboard widget, front and back.
Oh yeah, what does it do? Well, you put in your 43 Things API key and a username, and it tells you how many goals that person has. But, having to apply for an API key rather sucks, and so does pulling the data out of an XML response. So instead, maybe I'll make a DashboardController that zips out text/plain, that way you only have to fill in a username.