putting money where the moon is

toshok | moonlight, mono, geek | Friday, June 22nd, 2007

Turns out it was easy.

go here to check out the moon display program that uses gnome-vfs to download its content.

if you follow the steps and get everything built, you can run it thusly and see the same animation I screenshotted in my last post:

$ gnomoon http://silverlight.net/Themes/silverlight/xaml/subscribe.xaml

3 visions of moonlight

toshok | geek | Thursday, June 21st, 2007

as a kind of addendum to my previous moonlight post, here are 3 screenshots, showing the 3 possible ways of using moonlight.

This particular piece of xaml doesn’t use any custom namespaces, and there’s no C# code to execute. It’s also an animation, but until I get ffmpeg set up to do screen captures again, the stills will have to suffice.


Unmanaged, C++ only, using gtk and the braindead downloader


Managed C#, using gtk# and the managed downloader


Browser plugin, using the plugin stream downloader

I’m Mr. Fucking Miyagi

toshok | journal | Thursday, June 21st, 2007

It was a few days ago. I’d just had a huge amount of coffee to shake off the grogginess of another night spent working until 4am.

There were a few flies buzzing around my kitchen. One got close enough to bother me as I was pouring myself some water. I set down the jug, quickly reached out my hand, closed it tight. Opening it again, I saw a smashed fly. “Cool, ” I thought.

Then it happened again. As I was getting out of the shower, a mosquito. *Smash* A little blood on my palm.

And again a little later. This time a mothy thing.

I chalked it up to my hyper-caffeinated twitchiness. I bet in that state I would have stomped even the most talented Korean Starcraft player.

Then yesterday (or was it the day before?) I was washing dishes. I knew there was a fly somewhere around, I could catch glimpses of it, but at this point I could barely see it. My eyes have gotten progressively worse over the past 21 days due to the ~16 hours a day sitting in front of a laptop, and it was just a hint of a blur. I saw it again, then lost sight of it. I don’t know if I’d really reached a zen-like state or what, but I reached my hand out to where I thought (felt? hah) it should be, and closed it hard. I brought my dripping hand closer to my face and opened it slowly. There on my palm, another smashed fly.

Wax on, mutherfucker.

moonlight

toshok | moonlight, mono, geek | Thursday, June 21st, 2007

By now all my friends have heard of the late nights, the lack of sleep, my increasingly blurry vision, and the amount of coffee I’ve been ingesting. The past three weeks have been the closest to the energy and enthusiam of a team for a project that I’ve experienced since my early time at Netscape. We had maybe 10 people (sorry, I’m fuzzy from lack of sleep) working almost entirely remotely (3 people worked out of the Boston office), with people in Spain, Brazil, Canada, Japan, and various places around the continental US. Everyone working insane hours, all on the same ~30 source files, in 2 languages. In some ways I’m surprised it works at all, let alone so well.

Miguel received a warm response when he demoed our stuff in Paris earlier today, and crafted this post on the plane over the Atlantic on his way there.

Unfortunately some people in the gnome/kde/linux/whatever community have blinders on when it comes to anything either produced by the mono team or attached in some fashion to mono. In an attempt to address the issues those people bring, I want to make something very clear.

You don’t need mono to use moonlight

That’s right. You don’t need mono to use moonlight. You don’t need to include the runtime. You don’t need any managed code, or a bundled VM to use it.

It’s pluggable in 2 important ways that make it useful (and still just as exciting) completely outside the managed space.

The parser

Custom namespaces can be resolved in any fashion you want. We use this functionality on the managed side to load assemblies and create managed objects, but there’s nothing forcing you to do that.

For example, in managed land you could use:

<Canvas …
xmlns:foo=”clr-namespace:MyNamespace;assembly=foo.dll”

> <foo:MyCustomClass … />

which would instantiate the managed object MyNamespace.MyCustomClass, found in foo.dll, and insert it as a child of the Canvas object.

In unmanaged land you could easily write a parser callback that allows you to do:

<Canvas …
xmlns:foo=”native-handler:create_native_object;dso=foo.so”

><foo:MyCustomClass … />

which would dlopen foo.so, and invoke create_native_object (”MyCustomClass”);, adding the return value as a child of the Canvas. Just like glade, or heaps of other GUI builders that permit custom widget types.

The downloader

Right now there are three separate downloader implementations in our tree.

  1. A braindead implementation that just loads files off the filesystem for use in testing.
  2. A managed implementation that uses the .net classes and provides a means for actually downloading things.
  3. A browser plugin stream implementation, which lets mozilla take care of the heavy lifting (and caching) of downloadable content.

It would be trivial in the extreme to add a gnome-vfs (or any other io layer) downloader, and use it to load xaml content, jpgs, etc, from any of its supported url schemes.

In some ways moonlight is *more* exciting outside the managed space, just because there are so many other interesting integration points. How about a mozilla extension using nothing but C++ and javascript and allowing xaml to be rendered/interacted with directly in the browser, with custom objects written in javascript and/or c++ and downloadable from other websites?

At its heart, moonlight is a C++-based compositing system with support for animation and events. Given how excited everyone is about the various “canvas” implementations cropping up around, they would be well served to see if moonlight couldn’t handle what they need.

I for one am excited to start writing apps using it.

brunchtime is good time

toshok | journal | Monday, June 11th, 2007

turns out I look kinda bug-eyed after drinking 6 or 7 mimosas:

Powered by WordPress | Theme by Roy Tanck