Re: Client-Side Scripts

Dave Raggett (
Tue, 7 Mar 95 12:16:17 EST

Noam Fraenkel writes:

> Dave, I'm quite interested in Client-Side scripts and better form handling,
> and I'd like to start working on it. Could you please post here, or send to
> my email address, any pointers that you have. I'd like to start rolling this
> this side of the Clients world.

Some people have suggested Safe-TCL but I advocate a way that lets us duck
choosing a single scripting language by instead defining a portable virtual
machine (vm) that the scripts are dynamically compiled into. For much of what
we need, a simple stack based machine similar to Forth is fine, when combined
with automatic memory management and garbage collection. The vm can also
support inheritance nicely. An alternative is to go for a risc vm offering
higher performance but requiring more complex compilation. This would be
better for graphics intensive code. Some work is being done on this second
approach at MIT-LCS.

The basic idea is to look at the API between the browser and the script
interpreter. Events such as: mouse clicks, moving into/out of a field,
gaining/losing the focus, keyboard input, enter/leave form are passed
to the script. There are default handlers, which can be overridden by
message handlers for the form and more specifically by message handlers
for each field on the form. Additional objects and handlers can be
created as needed.

Handlers can examine and alter field values and parameters, e.g. the
insertion point in a text field, error and disable flags. Also to be
able to set read only form fields for message display. handlers can also
examine a set of well defined browser parameters, e.g. the window size
the current date/time, the user's name etc.

Handlers can't send email or http messages etc. which would allow
a script to send a damaging message without the user knowing!

I like the idea of being able to define new kinds of widgets within
scripts. This requires a Toolbook/HyperCard like set of objects that
can be assembled to define new widgets. This is second generation
stuff though!

I hope the above gives you the flavour of what is required. If you
can come up with a portable vm for this, I would be interested in
including it as part of the componentware browser for HTML 3.0 that
I'm just starting on as a successor to Arena.

Best wishes and keep in touch.

-- Dave Raggett <> tel: +44 117 922 8046 fax: +44 117 922 8924
Hewlett Packard Laboratories, Filton Road, Bristol BS12 6QZ, United Kingdom