Author Archives: bhyde

Diagnostic Typing

One of the dialectics in computer science is between dynamic and static typing. Dialectics are like professional wrestling. Cheap fun. But, they leads to category blindness. So let me blather a bit about a “third way” that I call diagnostic typing.

At one point in my career I spent a few years deeply committed to the static typing camp. The height of that experience was an amazing day when we successfully linked, for the first time, a huge complex program. It consisted of hundreds of thousands of parts written by numerous authors and code generators. It worked! First time! Getting to that point had required tremendous labor, since the static type checking demanded by the language we were using had forced us to fix lots of stuff that might have been left for latter. At that moment it seemed worth while that we had deferred so much immediate gratification for so long.

Late in the project we had some really amazing bugs. Bugs that took weeks and teams to fix. Fun bugs with long interesting stories to tell about each of them.

During that later period I found my self writing what I came to call diagnostic typing code. This code would work to prove a complex declaration about the nature of a data structure. These declarations were put forward by the team members. For example somebody might say “All the records of type A are in the dictionary D.” and then somebody else would say “Ah, I thought the core set of those aren’t in the dictionary.” At that point I’d go off and write some code to to check if these declarations were true. It was fun because the truth was almost always much more complex than anybody thought. The bugs were all around the edges of these.

So the dialectic between dynamic and static typing is actually a kind of layered thing; with at least with three layers. Static, Dynamic, and Diagnostic. Static type checking is done at compile time. Dynamic type checking and dispatching is done at runtime. Diagnostic type checking is done intermittently; usually in response to a demand or a fear. It was extremely valuable to become explicit about some of the declarations that had been implicit.

Diagnostic type checking can be very very expensive. That makes it a lot of fun! It lets you can write all kinds of assertions about your program that would never be practical to check or enforce at the compile or runtime. You can get out the big guns: graph theory, statistics, coverage, grammars, budgets, spelling correctors. For example: all the window components form a strongly connected component via their child/parent arcs. For example: the elements of this hash table are uniformly distributed. (As an aside I don’t think I have every found a hash table that was well behaved in the wild.)

One of my favorite examples. This isn’t just for data structures you can do this on program traces too. Back in the 1970s somebody at CMU wrote a paper about using the ideas from language grammars to declare the patterns over calls on class instances. Things like: x:foo<-create(x); {open(x); {update(x)}+; close(x)}+; destroy(x)}*. In a later life I would sometimes write code to diagnostically check statements like that by using the tracing facilities in Common Lisp.

I wrote a lot of this diagnostic typing code for the persistent store using prolog. I would dump the entire persistent store into a suite of prolog assertions and then write the diagnostic typing declaration as small prolog programs who’s execution would prove or disprove these declarations. While that found a lot of very very subtle bugs I found it more fascinating how it raised raised the level of discussion about the work.

This kind of approach will, I suspect, become more common real soon now. So much of the data sloshing around on the net is full of surprises that diagnostic typing declarations would reveal. Moving the data across organizational boundaries creates a demand for tools that can frame the discussion between the parties.

One of the reasons I’m suffering a fit of enthusiasm for RDF is how it appears to offer a normal form, much as prolog assertions did for me in my previous experience, for just this kind of problem solving.

This trio: static/dynamic/diagnostic typing are all about shifting around the work, the trust, and the gratification. Don’t overlook the gratification. There is a lot of fun to be had in diagnostic typing approaches. I doubt you can write down all the declarations about the data before it starts flowing. Why defer the fun of flow?

Tree of Life

Evolutionary tree of life
The drawing above shows three thousand species arranged around the perimeter. The arcs in the interior are the result of pattern matching on the rRNA of those species, and show an estimate of what evolved from what. So at about 5Pm on the clock we have the Archaea which were discovered only recently hot springs, and other exceptionally hostile environments. Running counter clockwise from there we have the Bacteria, the Protoists, the Plants. At 12 pm we have an assortment of things between plants and animals. Then the Animals (including a mark reading ‘You are here” for we homo spaiens). Finally the Fungi. You can down load this chart as a PDF off this page. It really makes your PDF viewer work hard!

Comic Genius

Benziono NapaloniI think I’ll try out the Brad DeLong technique and bring your attention to something by quoting the entire article. Let’s see if I get this right.

In the royal court of the shrill the Third Assistant to the Second Vice Jester innovates new modalities of shrill giggling.

It’s debatable

Now, I had never seen George Bush speak for any length of time before watching the three presidential debates.

I had no idea.

The man is a comic genius.

The sheer breadth of his repertoire, the winks, the allusions, the outright mimics of so many comedy greats, it’s astounding, exhilarating, it’s

Oh, where to begin?

It’s the ongoing homage to the old Mack Sennett zanies: Too Many Highballs, The loud mouth, The bluffer, A close shave, Hubby’s latest alibi, Daddy boy, The beloved bozo, Remember when? the list just goes on and on.

He’s nailed, I mean nail-ed, the Emmett Kelly frown, Harry Langdon’s blank stare, Sam Kinison’s delivery, Judy Holliday’s incredulity, Jack Benny’s shrug, Harold Lloyd’s eye shifts, Jack Oakie’s Benzino Napaloni pout, Don Knott’s indignation, Bill and Ted’s memory lapses, Shirley Temple’s lemon-squeezed determination, Lucy’s look when caught by Desi and that thing, that thing he does when he gets all riled up by something Kerry said and, when given the chance to respond, just freezes.

Man, that’s good television.

As a leitmotif, I sensed a grand homage to Gilda Radner’s Miss Emily Litella character in all those instances where he was asked a question, and responded with a fully off-topic descent into nonsense.

Actually, Mitch McConnell had a minimum wage plan that I supported that would have increased the minimum wage. But let me talk about what’s really important for the worker you’re referring to

And, let’s be frank, who but the most avant-garde comedian would maintain a lump of white spittle on the right-hand corner of their mouth for the entire first half of a “serious debate” if they had no ulterior vision in mind?

(A coincidence that Derrida had just died, and a new era of perception had dawned? I think not. The man knows his audience.)

Gosh, there are so many to choose from, but I really think the defining moment came in the second debate, when discussing the issue of Supreme Court appointments:

That’s not what the Constitution says. The Constitution of the United States says we’re all-you know, it doesn’t say that. It doesn’t speak to the equality of America.

That, my friends, is comedy gold.

Is he wired?

Well, let me just ask you this: would you expect Letterman or Leno to perform their monologues without cue cards?

Let’s be honest, now.

Standardizing Social Networks

Standard bar code for a relationshipIf I had a EAN.UCC Company Prefix of my very own (only $750 dollars!) then I could assign all my relationship partners a unique GSRN or Global Service Relationship Number (pdf). This would be very useful when I need to quickly retrieve the details of any given relationship. In some cases I might want to hand out multiple GSRN to the same person, since our relationship is framed in different modalities; friend/coworker, wife/mother/helpmate. I could then mark up all my correspondence so it might be quickly associated with other aspects of the relationship. Membership cards! Better yet jewelry with RFID chips embedded. Then when they drop by the house I could dynamically customize their visit to my home.

Bar codes? Not just for tangible items anymore! Label the intangible. This is going to be big!

Collaboration is better even than nice!

These results are just delightful! Twenty years ago people started running a tournaments to find the best algorithm for playing a repeated prisoner dilemma game of random length. Pretty quickly the winning strategy (nice is better than mean) emerged and nothing much has changed since them.

This year one of the entrants found a new approach!

Instead of entering one algorithm they entered 60. In the metaphor of they game they didn’t send one criminal to be repeatedly arrested; they sent a gang. Members of this mafia were very loyal to each other and they methodically ganged up on the other players and the police. When matched with an opponent in the game these gang members would try to puzzle out if they were playing against one of their own or not. In the real world you identify others of your kind with various signalling devices: secret handshakes, gang tags, etc.

In this game they can only signal to each other via the game. Using patterns in their game play mafia members recognize each other. At that point they can game the police in ways that to raises the gang’s overall score.

It’s just wonderful. This is the classic model of all game theory! And even in this tiny little dishpan model collaborative groups form and once they form they out compete the players that fail to collaborate. As Dave Weinberger once pointed out, we are a species that will form communities even if it means tapping out the alphabet on the wall of our cell.

Make less, make more!

Many years ago my father advised me to avoid antenna design – “Too much black magic.” I took that advice; but I seem to have fallen into a similar trap, i.e. pricing.

Consider this pricing problem. You sell a product which two classes of people. One class, 10 people, would be willing to pay 100$ a unit. A second class with 90 people in it are willing to pay 10$ a unit. So if the vendor charges 100$ he will make $1,000; if he charges 10$ then he will also make a $1,000. If the the first class is willing pay a bit more or the second class is willing play a bit less then the vendor will profit if he makes only 10 units.

That story is a bit bloodless so let’s put some adjectives on these classes. The first class is desperate if they are willing to pay so much. We might say the first class is very loyal to the vendor’s product and nothing else will do. We might say the first class is locked in.

Early in the Bush administration a handful of electricity vendors in California realized they were in exactly this situation. They could make money if they sold less electricity. So they shut down some generating plants. They called it maintenance and complained about excess regulation. The first class of buyers, unable to switch, locked in, and addicted to electricity then drove up the price to amazing heights. At the time experts knew exactly what what was going on but the regulatory organization had been entirely cooped by the industry and so nothing was done. Amusingly the Bush folks talked about how we needed more supply which was true, and suggested we should open up new oil fields which was irrelevant.

There is a picture in my local paper of a long line in front of a pharmacy down the street from me. Long lines are a symptom of a group of folks in the first. They were queued up to get flu shots. The supply of flu shots has fallen sharply. The price is up. Clearly this market is just like the one in the model above. There is a core of desperate buyers willing to pay a lot; as demonstrated by their willingness to wait in extremely long lines. I’m suspicious that it’s also an example of the kind of story shown above.

What’s fascinating about some of these scenarios is how the trigger of the mode switch could come from anywhere. For example an investor in firm A might strive to get firm B shutdown; say by reporting safety violations to a regulator. Then when the firm B gets shutdown and the large class of low price buyers go looking for an explanation the regulator gets blamed.

The California electricity debacle shown how deeply the pro-business Republicans have undermined the regulatory systems in this country and sadly it makes me terribly suspicious about the current flu vaccine situation.


Meanwhile the Bush administration thinks scientific fact is a special interest group, and certainly not part of their base.

Could your phone number be identity?

Interesting post on identity, phone numbers, etc. over at the most excellent Telepocalypse.

It includes the delightful paragraph that I will have to work into a blog posting some day:

Now, the following is so vital, I’m going to put it in large red bold. It’s the only large red bold ever posted on Telepocalypse, and I promise not to do it again unless something even larger, redder and bolder is being said. Which isn’t likely.

What comes next? Well this (emphasis removed):

What’s the core purpose of a telco? A telco joins the physical world to the virtual world.

My first thought after reading that was: “Hm: so Orange isn’t really a color or a fruit, it’s just the peel.” (Orange is a telecom company in Europe).

It’s hard when talking about the architecture of the net to decide what to emphasis. I, for example, tend to emphasis the how exchange becomes standardized and that leads to consolidation of power in the hands of middlemen. Other people emphasis empowering the ends; or advancing the client; or toolkits for distributed apps; or distributed data models.

Martin’s bold red words insist that we take note of another thing. The telcom industry has a lot of control over the border crossings.

The first time I ever say the “cloud” drawing was in a phone company document. You know the cloud drawing right? It shows mom on the phone, and the butcher on another phone. Little lines run from their phones over little telephone polls and then disappear into a fluffy cloud. Sometimes that cloud is labeled “the phone company.” These days the drawing shows mom’s browser on one side and eBay’s servers on the other side; and the cloud is labeled the net.

The cloud drawing implicitly says – “Don’t worry your pretty head about what’s inside this ball of fog. We will take care of it.”

Martian’s bold red word? Yeah the phone companies lost control of the cloud; now all they have is the rine. Of course, controlling the border can be a very profitable place to be.

Collectively the telecom industry is a fascinating beast. Historically the industry was very granular; each major player existed inside a safe geographic bubble where they had captured the regulator. Set aside how that empowered them to frustrate progress for so long that now that the damn has burst all hell broken loose. The granular structure created a set of peers who didn’t threaten each other. Those peers could then work collaboratively to look for joint gains. One of the forums for that was the International Telecommunications Union. The ITU of the old gorillas in the standards setting world.

When big disruptive change washes over an industry they can existing players can only fight back with the muscles they already have. Martin is arguing that if the telecom industry knew what they were doing they would be using their standardization muscles to get a handle on the identity standard – possibly by evolving the phone number.

It’s an interesting thought. They industry has fought so hard to avoid number portability. A fight that is all about defending the old obsolete granularity of the industry. Now just maybe they need to turn around and strive to make the numbers even more pliable.

Consider this concrete example. I’ve been forwarding a VOIP number to assorted phones; and I give it out as my “mobile” number. This causes a bit of trouble when I call from one or another cell phone – the guy on the other end doesn’t know it’s me because I can’t annotate my outgoing phone calls with my “mobile number” persona. (Well at least not until I absorb even more of the functions the phone company provides.) This trick as tree advantages. I can use a real phone for more calls. I can avoid cell minute costs on some calls. I can grab the cheapest mobile service and switching carriers when ever the sign up incentives of the last carrier run out.

In any case; Martin’s post is an it’s an interesting view of the identity problem from the point of view of just one industry. It suffers a bit from failing to admit how many other industries are similarly waking up to the value of their “relationship asset.”

Hording and Exploiting

Tilly’s book “Durible Inequality” argues that the group forming emerges almost entirely because the creation of a group boundry helps to lower the transactions costs of inside the organizational activity.

It is easier on a moment to moment basis to use existing catagory boundaries to quickly solve organizational problems. For example answer the question “What search engine will I use to look up X.” with the reply “Google” than it is to pause and select from Google, AllTheWeb, A9, or Ebay. It is a time saver to join the Google club, to shun the other search engines. Club loyalty.

But wait. Tilly is writing a book about inequality. Casual use of category boundaries has another name – prejudice. He is interested in the cases where this process goes both bad and becomes rigid.

He states that groups capture two powers which may lead to abuse.

  • The ability to engage in Opportunity Hording.
  • The power to Exploit others.

Efficiency isn’t on that list. Efficiency isn’t about the abuses that may occur. The abuse doesn’t arise from one group out performing another.

Hording opportunities is a game all groups can and do play. Even very weak groups. One of his examples is immigrant cleaning ladies. When knowledge of job opportunities arise they tend to pass then along the social networks of their immigrant community. That alone, tends to lead to each city having one ethic group that is renown as having the knack for house cleaning. Polish ladies in Chicago; Brazilians in Boston.

Exploitation is the means of the powerful. The powerful can force it’s will on other (by definition subordinate) groups. Exploitation is not limited to opportunity hoarding. It is the use of force to actively deny the options to other groups. To force their choices.

Consider the classic scenario where 90% of a town’s business deals are made is the all while, all male, golf club. Is that opportunity hoarding or exploitation?

Just insert a translator

Distribution of the top 80 languageThe chart at the right shows has a dot for each of the most popular languages spoken on the planet. It’s plotted on a log-log graph; the vertical axis is millions, the horizontal is rank. The top language is Mandarin, though there are seven other Chinese langages in the top 30. English and Spanish are neck and neck for second place. The data is from here, though originally from here.

This posting is the complement to the posting on the cost of free trade born by the subordinate culture using which side of the road you drive on as well as the argument being made in my recent advocacy posting regarding RDF/N3 v.s. XML that translators can gloss over the difference.

As global barriers fall this distribution will grow more severe. Like an industry condensing toward a monopoly. Smaller languages will expire; larger languages will thrive. Rankings will shift because there are other forces in play; like control over economic exchanges. Anybody got a babble fish?