Wednesday, February 13, 2008

Samsara in your browser

Back in the olden days, a web browser was a simple thing. There was one window. There was one thread of execution. It went
  • Get a URL, either typed in or from clicking on a link
  • Fetch whatever's there
  • Display it
in a single happy loop.

The browser ran on top of the native operating system and its window was managed by the native window manager.

I forget exactly in what order, but over time the features crept in, as features are wont to do:
  • It's nice to have more than one window up at one time without having to fire up a second instance of the browser.
  • Those windows take up a lot of space and have a way of getting lost if there are lots of other, unrelated windows on the screen. Tabs are more compact and are easy to find and switch between.
  • Pop-up windows can be a pain, but they can also be very helpful when used responsibly.
  • HTTP has no memory of past requests, so servers need some other way of remembering what has happened so far. Cookies allow the server to store small pieces of information on the client machine and have the browser send them back in later requests.  Generally, cookies are used as reference keys to whatever information you really want to persist.
  • Old-school HTML forms require every action to go through the server. This is particularly annoying when you've made one silly typo in the middle of a large form, but you don't find out about it until the server processes the whole thing. If the browser could keep track of what you've already entered and perform simple checks itself, everything would run more smoothly.
  • HTML is nice, but there are all sorts of things it doesn't support. Enter ECMAscript, Flash other programming platforms. These also allow the browser to handle forms more smoothly (see previous item).
  • There are more different kinds of document than just HTML. Not everyone wants everything, so it would be great if any third party that felt the need could add support for a new format. Modern browsers have a plug-in facility allowing new features to be added (via a URL, of course).
  • With multiple tabs or windows open at one time, the browser should be able to do more than one thing at once. Otherwise a slow response on one page grinds everything to a halt.
The result is a system (the browser) that can run arbitrary applications, control multiple windows and multitask [Actually, the OS is providing the multitasking, but as far as I can tell there's no equivalent of a task manager that will let me kill runaway scripts or plug-in code, or even see what's running.]. It can be extended by adding new applications or even new languages via plug-ins.

In short, it looks a lot like an operating system. This is good, because it means browsers are powerful, but also not so good, because it means that the browser is doing many of the same things the operating system is doing, but slightly differently and with a completely separate code base.

Generally when this happens, pressure builds for consolidation. Whether this will happen in the present case is anyone's guess, but I wouldn't be shocked if someone started touting (or is already touting) a system in which the window management, plug-in handling and other such advanced browser features migrate back to the operating system.

Leaving the browser as a simple, lightweight mini-application which gets a URL, loads it, and displays it.

1 comment:

David Hull said...

Note to self: typo, also ChromeOS