spout

June 22, 2002 spout

Object vs. XML

I was watching a group of folks present a new XML standard the other day and I realized something for the first time: to XML folk, OO languages are just script-like glue” for connecting XML processing steps, the Unix pipe” of the new millennium, if you will. Integration with OO languages is necessary to enable XML dominance, but that’s an accident of history. In the view of the XML zealot, OO will eventually fall away and only pure, clean XML will be left in its place.

As an OO guy, I find this view disturbing. As a general technology wonk who sees the value of XML, I find this view unrealistic. Just so you XML folks know, OO guys look at XML as a data transfer syntax and that’s all. OO guys are happy that XML is there, but they prefer to stay away from it in favor of their nice, familiar OO environment.

The problem, of course, is that many XML guys are so steeped in the new world that they forget where they came from. To paraphrase the Matrix, XML guys don’t even see the angle brackets anymore — they just see blonde, brunette, redhead. OO guys, of course, *only* see the angle brackets and prefer their artificial world-like simulation.

The result of this massive gap between XML and OO folks is that the great thing that the XML guys are building, i.e. a general-purpose hierarchical data manipulation, transformation and interoperation infrastructure, something that OO guys desperately need, is being lost because the two groups don’t know how to communicate with each other.

So, to enable XML to dominate, XML folks have to be sneaky. Just like OO finally took off in C++ when it provided a super-set of the procedural programming in C, XML has to provide a super-set of OO programming, down to the easy syntax and the compile-time type checking. Only when you give the OO guys exactly what they already have can they begin to see what new things you’ve given them.

June 12, 2002 spout

Karma

While I definitely do have faith that there is a higher power in the universe (although I haven’t yet decided if the universe is a good place to be or if it’s just a simulation solving some higher level non-deterministic finite state automata), I’m not a religious man. If fact, I consider myself a completely recovered Catholic (I’ve been clean and sober for more than a decade and I never feel the need to go back for another hit off the body of Christ) [1].

Likewise, I’m not a superstitious man. I understand that going under a ladder may cause pain if something drops on me, but not for some other mystical reason. Similarly, breaking mirrors could cut you, but only the most serious of cuts could last for 7 years.

Still and all, I do believe in karma, otherwise stated as what goes around, comes around.” It’s happened many times in my life that a lot of bad luck eventually yields to a lot of good luck. Likewise, when you do bad, bad comes back at you and when you do good, good comes back. Of course, these phenomenon can be explained by statistics and human nature respectively, but I prefer to think of a giant celestial scoreboard that I can affect by doing good for people. Or, and this happened just today, if I do something to cause harm, even if there’s nothing I can do to make it up to the person involved, I often find myself feeling better if I do something good for someone completely different. Oh, wait, maybe I am superstitious… Still, I find it a comforting way to run my life, so I’m going to stick with it. : )

[1] I’ve known practicing Catholics that are offended by the idea that Catholicism is a disease to be recovered from. Sorry.

June 11, 2002 spout

Adding Ref-Counting to Rotor

Microsoft has granted Sells Brothers, Inc. a research grant to add ref-counting to Rotor and to study the performance effects. The proposal that lead to that grant is available here. There’s been a lot of speculation about just how we’re planning to add ref-counting to Rotor. Here are the highlights:

  • It’s not just me,” it’s we.” I’ve already have very useful input from several folks, including Jason Whittington, Ted Neward, Ian Griffiths, Serge Lidin, Craig Andera and Bill Conroy. Also, Chris Tavares will be spending most of July doing the actual implementation. If anyone else wants to dig in, feel free! I’m happy for the help and anyone that provides insight will get credit.
     
  • The goal of adding ref-counting to Rotor is to measure the performance effects of a deterministic finalization-like model that we gave up when moving from COM/C++/VB6 to .NET. I say DF-like” because we’re not getting DF, because the price of determinism is that sometimes an object is never finalized, e.g. cycles. We can do better.
     
  • We will not be replacing the existing GCs ref-tracking. It does a fabulous job managing memory and managing cycles and we won’t touch that.
     
  • The ref-counting implementation’s sole job will be to call an object’s finalizer ASAP. Note that this is in no way deterministic.” Plain ref-counting is deterministic in that it calls an object’s finalizer just as soon as there were no more outstanding object references. Cycles meant that this would never happen (deterministically). A hybrid ref-counting/ref-tracking system improves never” to eventually” in the case of a cycle and maintains the ref-counting’s guarantee for ASAP in their absence.
     
  • Even objects that don’t have finalizers will need ref-counts, as they maintain references to objects that have finalizers (and so on).
     
  • Value types will not need reference counts, but when they go out of scope, there will need to be a Release on any object references the value objects contain.
     
  • When the GC kicks in and finally breaks a cycle, it would be nice to release all objects held by the cyclic objects so that they could return to normal ref-counting determinism. However, since we’ve already blown determinism by being in a cycle, this seems unlikely to be very helpful. Also, by skipping this we can keep all of our changes in the JITter and out of the GC, which simplifies the initial implementation.
     
  • We’d plan on adding ref-counting at the runtime level in the JITter so that all languages gain the benefits w/o updating the compilers (or mandating anything special in any language). The real work is figuring out which IL instructions require AddRef/Release calls and getting those calls into the instruction stream. Because of this, we’re not likely to be able to handle tail calls (at least, initially). Anyone with advise in this area would be welcomed with open arms.
     
  • We plan on working nicely with existing IDispose-based code. Since our ref-counting is all about calling the finalizer, if the ref-count gets to zero and there is no finalizer to call, no finalizer will be called. That means that Dispose implementations that call GC.SuppressFinalize will not cause any problems with the ref-counter. Of course, the goal is that the IDisposable.Dispose protocol is not necessary at all.
     
  • As a potential optimization, I have found a nice place to store a 7-bit ref-count in the existing space allocated to every object, so there will be no space overhead, only CPU overhead. However, this narrows the number of objects per  process with synch blocks and/or hash values from 134 million to 1 million. It also narrows the number of referencing objects from the traditional 4 billion to 127. Anecdotally, 127 seems like enough, but it will necessitate the need to abandon ref-counting on any object that reaches 127 extent references. Since most data structures where more than 127 references could happen are parent-child, e.g. every child in a tree with a reference to the root, and this indicates a cycle that can’t be handled by the ref-counting anyway, turning these objects over to the ref-tracking portion of the algorithm seems reasonable. However, we won’t know til we look how many object references an object is going to have, so we’ll track maximum reference counts during our tests to see if this optimization makes sense at all.
May 26, 2002 spout

The Truth Is Not Enough

Watching the final episode of the X-Files, I realized why I don’t like that show. Mulder spends all his time searching for the truth, but even when he finds the date of the planned alien invasion, he doesn’t do anything with it! They’ve spent the last nine years discovering the truth and not doing anything to change it (or, if they do try, they fail miserably). Of course, that’s not the only problem with the show (e.g. why would an alien race powerful enough to do generic engineering to produce the miracle child” or to create super soldiers” or to create the virus in the first place, needs to bother with setting up a shadow government), but it’s the one that bothers me the most.

Just knowing the truth is not enough. You need to act on it.

I don’t really know what that’s got to do with the price of tea in China, but hey, you get what you pay for. : )

May 10, 2002 spout

Now the Fun Begins

Last night at 4:46pm, Sara Williams announced the availability of Microsoft’s 4+ years of labor: the Microsoft .NET Framework, v1.0. And then, at 5:59pm, the great land rush to download the matching VS.NET bits began. Here are some links you may find interesting as you move to the RTM of  .NET and VS.NET:

Here are some fun facts for you:

  • The compressed VS.NET Enterprise Architect download is 1.8GB and it took my puny cable model 4+ hours to download.
  • It took my laptop (574MHz, 512MB RAM) 30+ minutes to unzip.
  • The resulting pre-installed folder was 2.45GB.
  • The .NET runtime build number is 3705.
  • The VS.NET build number is 9466.
  • The codename for .NET was Lightning” (hence the ildasm icon).
  • The codename for C# was Cool” (hence the C# is Cool” t-shirt).
  • Mike Woodring’s most excellent asmstats tool reveals the following:

    Done processing c:\windows\microsoft.net\Framework\v1.0.3705.
    Processed 69 assemblies comprising 70 modules.

    Types: 8,866 (of any kind)
    Classes: 5,602 (2,183 public)
    Attributes: 297 (257 public)
    Delegates: 334 (213 public)
    Interfaces: 983 (659 public)
    Enums: 1,085 (710 public)
    Value types: 565 (121 public)

    Members: 414,990 (of any kind, instance and static)
    Methods: 281,630 instance, 12,797 static
    Events: 13,160 instance, 24 static
    Properties: 44,689 instance, 1,233 static
    Fields: 28,478 instance, 32,979 static

Congrats to the Microsoft .NET team for a job well done!

May 9, 2002 spout

For the Love of the Story

It’s only happened a few times in my entire life, but I want it to happen more. It’s that feeling you get when you’re telling a story, trying to describe a scene or a technology or a something and, suddenly, without warning, it starts to tell you. It happened twice in college in a creative writing assignment: one of those times it actually gripped me from the moment I started writing my life story on a 3x5 card (I remember it started I was an accident.” : ). It happened once while writing ATL Internals: Chapter 7, Collections and Enumerations. And it just happened again while finishing up a writer’s journal entry I started yesterday:

Whack-thump-thump. Whack-thump-thump. The sound filled the first floor. Whack-thump-thump. Tom knew he wasnt supposed to play ball in the house. Whack-thump-thump. His father, watching from the kitchen, had laid down that law several times when things had gotten out of hand. Whack-thump-thump. The ball continued hitting his hand, the floor and the door in the never-never land between the kitchen and the front entry. Whack-thump-thump. Tom, at 6, seemed to be using the mesmeric sounds to enter another place, somewhere regular, somewhere safe, somewhere comfortable. He had always been able to enter that place, whether he was playing with action figures, with clay or even with ordinary items like pencils or popsicle sticks, using them in the theater taking place in his head. Whack-thump-thump. Whack-thump-thump. His father was a much more literal thinker. He was creative, but creative in an engineering/problem-solving way and he envied his sons ability to enter this world seemingly effortlessly, never getting bored when the ordinary world around him failed to offer what was safe and regular and comfortable. Whack-thump-thump. Whack-thump-thump.

I started writing this to describe what my son Tom was doing yesterday morning just before school and it turned into a look into how much I loved and admired my 6-year-old son. He’s so much different than me, but just like his mother and looking at him makes me realize just how much I love my wife. That’s what writing is supposed to do. It’s supposed to help you reach into your self and share what you’ve got with others. That’s what this blog is all about and I appreciate you being here to listen.

March 13, 2002 spout

This is Not a Blog

Web Logging (blogging) is the wave of the future. Blogging is re-making the internet. Blogging is journalism where everyone is the journalist. Blogging is all that and a bag of donuts.

OK. I guess so. I like blogs. I read a bunch of blogs. But most bloggers feel like they have to update their site at least once/day and most do it far more than that. Because of this, their blog entries end up looking like this:

[burb] Excuse me.

[google this!] [comment on this! (0 comments so far)]

It’s not that I don’t love to read a daily blow-by-blow of these peoples’ lives… oh, wait, no, it is that. Maybe a little filtering would be handy?

And while we’re on to the filtering thing, maybe we could drop the meta-comments about blogging itself? How cool could blogging really be if every other entry is about the power of blogging itself or, even worse, a link to somebody who linked to your cool description of the power of blogging?!?

Anyway, the spout is not a blog. I only update it when I think I’ve got something interesting to say (even if it’s something that only I’m likely to think is interesting), I don’t use any content management software (unless you count ASP.NET and FrontPage : ) and, except for this entry, I don’t spend any time talking about the wonder of blogging itself.

February 27, 2002 spout

Please Say “Why”

As .NET demands new books and articles and the economy has given a lot of smart folk free time, the world is becoming inundated in .NET books, articles, talks and courses, many of which I am tapped to review. Some are wonderful. Some are awful. Most, however are *almost* good, the path to goodness well within the author’s reach but for the answer to one question: why?”

Most of my feedback is riddled with questions that start with why: Why was it built this way?” Why are there three choices and how do I choose?” Why should I care?” Please, when you write, remember this question and answer it thoroughly and well. The why is *so* much more important than the how. The online documentation for .NET is fabulous for describing the how, once you understand the motivation for this class, that method or the other namespace.

Prose that provides the how is transient, but prose that provides the why becomes classic because the why itself is surprisingly applicable between technologies. At the very least, if you answer the why, it will save me work if I’m to review your prose.