Dec 31

Gears Future APIs: Blob API

Gears, Google, Tech 2 Comments »

Now, the Blob API isn’t going to be something that you will use often, if ever. It is an internal-ish API that other APIs such as the Image Manipulation API will use.

A blob is an object representing file data. It is retrievable, for example, from a resource store or from a HttpRequest or some other source of file data. It can be saved back to a resource store or to a POST request via HttpRequest.

Blob data cannot be accessed from Javascript. Only metadata can be read. Blobs can only be created and modified by other modules.

The external view is simply:

interface Blob {
  readonly attribute int size;
  readonly attribute string contentType;
}

Whereas any Gears module can blob.SetData(otherdata);.

Other Future APIs

Disclaimer: This is early days, and who knows what the final API will look like, or if it will even make it. Do you have ideas for cool Gears that make the Web better? Let us know!.

Dec 30

Steve Souders is no longer Chief Performance Yahoo! Instead, a Googler

Google, Tech with tags: , 1 Comment »

Steve Souders is known for:

The last point is the most important of course. Although it must be fun to say that you are Chief Performance Yahoo! to non-geeks at parties, he has left Sunnyvale, and has head a touch North to Mountain View.

I am very excited indeed to say that he is going to be starting at Google on January 7th, as you can see from the top of his site:

I’m at Google as of January 7, 2008.

I am glad he put a link to Google in there, so we can get the Guice.

It will be great to start working with Steve, even if we differ on some points. For example, he prefers the non-Ajax versions of maps as he thinks they are too slow. Are you kidding me? Do you never move around in the map then?

Lunch is on me on the 7th, Steve :)

Dec 29

Facebook finally giving me my messages where I want them

Tech with tags: , 1 Comment »

People are keen to jump on Facebook whenever they do something “wrong” (e.g. the Facebook Beacon debacle). Companies are going to make mistakes, especially when they are finding their way in a slightly new world, and are trying to work out the boundaries, and how to make money.

It is good that the community keeps a watchful eye, just as people are ready to pounce on Microsoft over IE and monopoly-type things, and even my company, Google. These companies have a lot of power, and a watchful eye can be a very good thing.

There are certain features that users have been glamouring for, and it appears that Facebook is slowly adding them in.

One of my pain points has been a simple feature. It drives me nuts to get emails like this from services:

“Dion, someone left you a message. click here to get it”

Just show me the freaking message. Some claim that it is smart to do this for page view purposes, but that smells bogus to me. Do what the users want, and it will be better for you. In this case, it has already been better for Facebook that they changed this, and I now see my Wall and Fmail messages:

Facebook Messages

Why has it been good for them? As I now respond! I participate more! Next, they need to let me reply to the darn email to write back instead of going through FB again. Forget about forcing me onto facebook.com and let me use you as a real platform. With the Bebo announcement, it seems like they are getting it, and doing good things. I hope that 2008 will have a very different look to social networks, and we will move to the hard part of getting data portability in a way that makes sense for users.

I never want to have to enter contact/friend information again.

Dec 29

Move over Jobs, we Geared you up! :)

Gears, Google, Tech 2 Comments »

I was a touch surprised to read that Gears came in as #1 in the 25 most innovative products of the year.

Even more surprising was the fact that we pushed the iPhone down to number 2. Really? The phone that everyone is raving about? that is “changing the industry”? vs. a browser plugin?

Well, on the one hand, these top ten lists are a load of crap of course, and don’t mean much at all.

On the other hand, maybe they saw the potential for upgrading the Web. The potential is really what I see when I look at Gears. The hope for a better Web. We need help from the entire Web developer community, and beyond.

It turns out they really just saw “offline” == Gears, but that will change in 2008. Here is to the future.

Congrats to Aaron, Chris, Scott, Mike, Othman, and the entire Gears team.

Dec 28

Gears Future APIs: Logging API

Gears, Google, Tech 3 Comments »

Logging is famously over engineered in Java, with huge abstractions. In JavaScript, the majority of folk still use alert() or write out to the Error Console. Of course, those that know, use Firebug and such.

It would be nice to be able to debug throughout the browsers, and inside of WorkerPools in the Gears world. Rather than reinvent the wheel, our Logging module should be as close to the Firebug API as possible:

class GearsLogger {
  // All these methods interpolate _args_ into _message_, replacing occurrences of _%s_.
  debug(String message, Object[] args);
  info(String message, Object[] args);
  warn(String message, Object[] args);
  error(String message, Object[] args);
}

As we see more of these get out there, I hope that we come together and define some simple logging that developers can be assured of. Having to always use Firebug Lite, or define window.console if the object isn’t there, is a pain.

Other Future APIs

Disclaimer: This is early days, and who knows what the final API will look like, or if it will even make it. Do you have ideas for cool Gears that make the Web better? Let us know!.

Dec 27

Gears Future APIs: Messaging API

Ajax, Gears, Google, Tech with tags: , , 2 Comments »

Once you start delving into the WorkerPool API, you quickly see how a common pattern would be using it as a messaging system. As it stands, it looks like an Open Web version of Erlang processes.

Scott Hess wrote up his thoughts on a more formal Messaging API based on WorkerPool:

Gears WorkerPool has two pieces, the part about running a bit of JS asynchronously, and the part about trading messages with that JS. This API may be composable from more basic bits. The messaging bit could be used in other contexts, such as implementing something like WhatWG’s postMessage().

Aside: What is WhatWG’s postMessage?

postMessage is “a messaging system that allows documents to communicate with each other regardless of their source domain, in a way designed to not enable cross-site scripting attacks.”

Here is an example:

For example, if document A contains an object element that contains document B, and
script in document A calls postMessage() on document B, then a
message event will be fired on that element, marked as originating from
document A. The script in document A might look like:

var o = document.getElementsByTagName('object')[0];
o.contentWindow.postMessage('Hello world');

To register an event handler for incoming events, the script would use
addEventListener() (or similar mechanisms). For
example, the script in document B might look like:

document.addEventListener('message', receiver, false);
function receiver(e) {
  if (e.domain == 'example.com') {
    if (e.data == 'Hello world') {
      e.source.postMessage('Hello');
    } else {
      alert(e.data);
    }
  }
}

This script first checks the domain is the expected domain, and then
looks at the message, which it either displays to the user, or responds
to by sending a message back to the document which sent the message in
the first place.

Back to the Gears Messaging API

Scott gives an example of the messaging API, starting with an end point:

var port = google.gears.factory.create('beta.messageport', '1.0');
port.onmessage = function(port, msg, sender) {
  alert("message: " + msg);
};
port.listen("name");   // Omit for anonymous listener.

and having a way to send it a message:

var port = google.gears.factory.create('beta.messageport', '1.0');
port.open("name");
port.sendMessage("hello there");

To enable cross domain, you can post.open(name, domain), and on the other side, you have to allow it via something like port.allowCrossOrigin(["www.good.com", "www.angelic.com"]);.

I am excited about a messaging API, as I think that it fits into the way in which we are developing new Web applications. Having an asynchronous queue that allows me to replay work (e.g. offline), and work nicely with Comet based interactions, would be great. We can reuse all that we have learned from other event based systems, and Gregor can rename his book and be happy!

Other Future APIs

Disclaimer: This is early days, and who knows what the final API will look like, or if it will even make it. Do you have ideas for cool Gears that make the Web better? Let us know!.

Dec 27

Japanese Gears

Gears, Google, Tech with tags: No Comments »

Gregor Hohpe gave a nice report on Google Gears Live From Japan, at a “Google Developer Roundtable” event. Gregor was at the event focusing on Gears and gave a presentation on the topic:

When giving a presentation about Google Gears, what would be better than actually making a Gears application that renders the presentation? That’s what the sample application, that comes with Google Gears, does. It reads a text file into the local SQLite database and renders the presentation from the database records. On slide 10 of my updated presentation you can cache all application resources (e.g., images, JavaScript files, CSS files, etc) in the resource manager and run the presentation offline (naturally, following this link requires Gears). I demonstrated that feature during the talk by pulling the network cable right after synchronizing. Thank god it worked. I hope it shows on the video! I uploaded the presentation application with all supporting files to the code.google.com subversion repository.

He also had some pointers for the future, with a good link to an architecture doc:

Developers also pointed out that the Gears API’s are relatively low level building blocks, making more guidance and advice from Google essential. A recent article on the Gears Architecture clearly points this direction. This is a topic close to my heart. I want to make sure that developing rich and responsive browser apps is not reserved for hard core hackers and JavaScript junkies. While the “competition” (a good friend of mine, actually) has been getting a lot of air time regarding Democratizing the Cloud, it’s equally important for Google to bring Web development to the masses. A little voice in my head tells me that there may be some interesting design patterns for these types of applications waiting to be documented. AJAX Design Patterns is a good step into that direction, but Gears has fundamentally changed the landscape for AJAX development.

Dec 26

Interviewed on GWT, Gears, Java, and JavaScript

Ajax, Gears, Google, Tech with tags: , 1 Comment »

I had the pleasure of finally meeting Didier Girard. I seem to run across Didier’s work every week or so, but for some reason we haven’t had a chance to meet face to face, until JavaPolis.

Didier sat down with me to talk about GWT, Gears, Java, and JavaScript, and I gave my honest opinions.

You can listen to my ramblings below. Let me know if you have any thoughts on opinions!

Dec 24

Interviewing Brian McCallister on Ning, OpenSocial, and Apache Shindig

Google, Tech with tags: , , , , 1 Comment »

Steve Yegge just talked about X programmers in his latest rant:

But you should take anything a “Java programmer” tells you with a hefty grain of salt, because an “X programmer”, for any value of X, is a weak player. You have to cross-train to be a decent athlete these days. Programmers need to be fluent in multiple languages with fundamentally different “character” before they can make truly informed design decisions.

When I think about the opposite of the weak player, I think of Brian McCallister. He seems to thrive in many languages. He tinkers in Ruby. Builds a platform in Java. And, even plays a little with PHP. And then he is off playing with Scala, Erlang, LISP, Haskell, etc etc etc.

I always enjoy meeting up at a conference, and now that we live in the same hood, I feel like we should get together more. It is fun to run into each other at the Palo Alto farmers market after all :)

Anyway, when I saw that Brian had proposed Apache Shindig as an open source OpenSocial incubator, I knew that I should get together and have a chat with him.

This interview is the result of that conversation:

Dec 21

The Point: Social networking to do something better than bite people

Tech with tags: , , , , 1 Comment »

The Point

I met Andrew Mason of the new website, The Point, which is a Rails based application that is trying to bring the people together to make a difference. When people organize in huge numbers, they can change the world, and this site enables you to do that, or something much smaller.

I just saw that Mashable had a chat with Andrew, so I thought I should post a little walk through that I did of the site.

I think they did a great job at creating a simple to use experience, and it has Ajax in all of the right places, and not in your face. You see the usual suspects such as a nice and simple signup system. You know it is Web 2.0 when you see the tag cloud too (although I am not a fan of tag clouds).

I really like the idea of creating contracts around actions. As I talk about in the video below, this can range from the small:

  • “If 20 of us get together Bob can get some time to record his kick arse new song in a studio”
  • “Let’s get a Wii for the office”
  • “We will do a conference in Ajax, Ontario, if 100 people pledge to go”

to the large:

  • “Sprint has even fake taxes that they put on your bill. If 1MM of us signup, we will refuse to pay our next bill until they fix this”
  • “Let’s boycott Wal-mart until they give people healthcare”

And, everything in between. I am excited to see how this takes off, and if people really see this as a community where they can get together, make something happen, and most of all… see HOPE. It is hard for one person to make a change, but if we get together, anything can happen.