April 30, 2007

MIX '07 (and Silverlight)

I'm at MIX '07 in Las Vegas. Come find me if you're there (here).

Also, I should note (based on surprisingly copious amounts of e-mail I received) that I didn't comment on Microsoft's "announcement" of Silverlight at NAB because, well, there's no there there. Silverlight is the new name for what used to be called WPF/e - and the news at NAB was just that: a name change.

The actual technology available was the same February Community Technology Preview that had been available for months. I expect that will change this week, but I was impressed with the vortex of press MS was able to create for their naming ceremony :)

As an aside BubbleMark presents a very simple, very basic, and very artificial performance test (that is, I think the results are STRONGLY un-correlatable to any real world application), but its fun to look at the code for each version.

Updated: Yep - here's the new "1.1" Silverlight build, which includes the cross-platform mini CLR (essentially dot NET lite for Windows and OS X). The distribution size went from 1.1MB to 4.2MB (just a developer build - so no judgement yet). It will be interesting to see what the final size is once Silverlight approaches functional usefulness (its not there yet).

April 26, 2007

Adobe Flex Open Sourced

Adobe announced today that they're open sourcing the Flex SDK (which includes the compiler, debugger, and Flex ActionScript libraries). It shouldn't come as too big a surprise, considering the recent MPL release of their ActionScript 3 VM to the Mozilla Foundation, Tamarin.

The model, as with Postscript, and, quite frankly, Windows, is the "Platform Effect" - monetizing both the runtime (Postscript/Windows/Flash) and providing rich(er) enterprise level authoring tools and functions (Authoring tools, servers, etc.). Releasing the specifications and "core" tools creates the illusion of freedom in tool chain, while actually delivering vendor lock-in - which isn't necessarily a bad thing for developers if (a) there's runtime ubiquity, and (b) the developer's not on the hook for distribution costs.

And getting developer buy-in (lock-in?) creates a "virtuous cycle" of scale for the platform provider... ultimately why API and specification ownership is so critical in the technology business cycle.

Although I think Adobe's Apollo (which is Flex driven) is still slightly off in its execution of product distribution, overall the company is doing a good job driving a giant truck over the ongoing bungling that is WPF (I mean... Silverlight).

And (naturally) this will impact (squeeze out) smaller players like Laszlo, Haxe, and mtasc more than affect the big players...

April 18, 2007

You know you're a geek when...

So... I got a package in the mail yesterday, but rather than getting the scissors from the kitchen, or (god forbid!) just using my hands to open the package, I just flipped open my laptop, and went to Amazon to see what I had ordered....

April 10, 2007

Shift Registers and De Bruijn Sequences

I tell ya' - everything time you think you've got a novel idea, turns out somebody's been there already... doesn't even seem to matter how small it might be.

For example: I have this minor function I wrote ages ago, which I had recently rewritten/had to re-derive. Its purpose was fairly mundane - I wanted to compute the (integer) log base 2 for a power of 2 integer value. Pretty simple and esoteric problem, but it pops up fairly often in graphics/sound programming (especially 3d stuff).

There are lots of solutions, and its not really a significant performance bottleneck or anything, but I always thought my solution was rather novel. The code looks like this : (link)


The idea is pretty simple, but clever (er... if I do say so myself, I suppose :)).

Very (very) briefly: multiplying by a power of 2 is the same as left-shifting by that power (determining that power being the log we're looking for). Therefore, we can construct a bit pattern that uniquely encodes the possible patterns sequence 0 - 31, such that any 5 bit sequence is uniquely of that range. Then multiplying by a power of two number puts a unique sequence into the top 5 bits of the result, which we can then shift down and use a table to "reverse" into our result. We need the table, because of course the encoding isn't linear with respect to the domain.

There are a number of constants you could use to fulfill this criteria, and I always thought of it as a compression/huffman tree encoding problem. The current constant I computed is 0x04ad19df.

Turns out not only is this a well known idea, but, further, its actually a special class of space filling curves (amongst other things) know as De Bruijn sequences. See the great "Bit Twiddling Hacks" page by Sean Eron Anderson for more information. The constant they computed, which of course also uses a different table, is 0x077CB531.

Results are the same.

Ah, well. Time to move on, I think..... :)

April 3, 2007