Living web pages vie with desktop as location for computer programs

Wired on Friday: When is a page not a page? On the web, it's when it's a program

Wired on Friday:When is a page not a page? On the web, it's when it's a program. When users load up a webmail reader like Hotmail, or play a Flash game, or use an online word process like Writely (at http://docs.google.com/) or Visio clone Gliffy (at http://www.gliffy.com), viewing so-called "web pages" is far more like running a desktop application than reading a page of text and graphics.

It's hard to remember the reason why the web looks like it does - or why those things we stare at are called web pages.

The original plan of Tim Berners-Lee was to create a giant, endless book, a book with a rather academic bent, as the web was designed by and for academics. But from the moment that HTML, the language that the pages of those books were written in, added features that allowed for fillable forms, the nature of those pages changed forever.

In the pre-history of hypertext, that's not too surprising. Anyone imagining the future of media (and dozens did before Tim Berners-Lee implemented it) had already envisaged that a page viewed on a computer screen had greater possibilities than staid rows of print.

READ MORE

One of the first prototypes of a laptop computer, Alan Kay's Dynabook, imagined the interface as a series of pages, each one displaying not text, but a living, running program all of its own.

The explosion of sites that created the early web was far from that dream of a program on every page, and deliberately so. Tim Berners-Lee wanted software so simple, academics could use it. The web's explosion came out because, while few of us can write a program, almost all of us can write a web page that says: "Hi, Mum!"

But web pages can and do run programs. Embedded in many are small programs written in JavaScript, which sit quietly in the background, executing code while you scroll around them, tending to small housekeeping functions like making sure you don't put letters in a spot reserved for typing your credit card number.

Flash movies and Java applets are self-contained programs that can be dropped into a web page, like sticking a clockwork mechanism into the pages of a book.

Flash and Java are added extras to the web, but JavaScript is tightly wired into the idea of a web page as a document. If you were ever to study how a web page is constructed (and I recommend it as an occasional exercise in intellectual curiosity - just choose "view" and then "source" from your browser's menu bar), you'll see that the words of text on a page are often mixed with small programs written in JavaScript.

As time has gone on, JavaScript has become more complex, and programmers' ability to exploit it has grown.

We've now reached the point where it's possible to write a whole word processor in JavaScript, a curious situation that's akin to writing a Word document that can edit itself.

But are we hitting the limits of what the web's page metaphor can really do? There's been somewhat of a rebellion among programmers who are accustomed to working within the metaphor of the desktop application - like Word, Excel, and the other stalwarts of the PC age - to rethink what a browser should actually do.

If users are increasingly expecting web pages to act like programs, they say, shouldn't we have the tools to create them like programs, rather than as jumped-up pieces of text? "We need to replace the document browser with an application browser," is how one commentator on popular geek site Slashdot put it.

You can feel their pain. Developing computer programs has always been hard, but developing programs for the web is like writing them with one arm tied behind your back.

A program written and running under Windows is usually developed with debuggers and development tools backed by millions of dollars of research and support. It has access, more or less, to every trick that the machine can do, from high-speed 3D graphics to speech, to near-instant hard drive access; it runs fast and it's relatively self-contained.

Creating a web application, which is what much of the "Web 2.0" boom requires from coders, means working in a slow environment, with limited tools to debug.

Web programs operate - or should - in a security "sandbox", a fenced-off part of a computer that prevents third parties from accessing private information or taking over the computer - and a dynamic web page generally needs access to the web server that it came from. Lose your internet connection and your clever web application is like a car that's out of petrol.

And yet, even as those programmers look back to the glory days of the desktop, so web pages grow more and more interactive. Despite its limitations, the web page is not a lesser metaphor for a computer program than the desktop, and in many ways, it's a better one.

As web thinker Kragen Sitaker has noted, web pages support sharing and co-operation. You can share a web page and point others to it in a way that you can't point them to something running on your home computer.

They give you independence from a single machine, so you can access the same data wherever you are, and they give you freedom from a single vendor, so that Microsoft, or Apple, or Linux developers can't boss you around.

Programmers have it hard right now: the web page wasn't written for them. The tools to create dynamic web pages will get better. The browsers will get quicker, and the power and expressivity of the language coders write their programs in will grow. Desktop programs and living web pages will live side by side for some time yet.