Re: Scripting


Subject: Re: Scripting
From: Mike Meyer (mwm@mired.org)
Date: Mon Jun 26 2000 - 01:22:31 CDT


sam th writes:
> But really, why does this need to be part of the scripting language at
> all? Exposing AbiWord methods throught an object broker ala CORBA is
> complicated, and uneccessary for the Church Secretary. Macros (which is
> what real people call them) are useful for writing short scripts, which do
> small repetive tasks. We should choose a language or technology that will
> make that easy for people.

The implementation technology has little to do with how easy writing
macros is for a user. What makes that easy is first the UI, and second
the API that winds up available to the scripting language. The
technology has nothing to do with the UI, and only serves to limit the
API. Inside those limits, you can make them identical.

In particular, anything beyond "record what I do" and "playback what I
do" is probably useless to the church secretary. Given that someone
implements those two, the underlying technology is immaterial. If
that's all you want, everything we've talked about is overkill. You
don't need any programming constructs at all; a linear stream of
events will do the trick. If that's the goal, the the I'd recommend
writing your own, as it'll be much smaller than the other options, and
about the same level of difficulty.

Real scripting technologies aren't aimed at the church
secretary. They're aimed at her geek nephew, the same one who would
set up the templates for the weekly newsletter so she doesn't have to
carefully delete the text from last weeks newsletter before starting
on the new one.

> Personally, Scheme is my favorite language. But it might be tough on new
> users. So my second choice would be Python.

I've done extension languages in Scheme, Python, and CORBA (among
others). They look amazingly similar. Scheme is odd (unless you use
SCOOPS) because instead of defining methods to query and manipulate
objects, you define functions to query and manipulate program
state. So instead of having the Geometry attribute of the Window
object, you have a Get-Window-Geometry function.

For all these choices - and for the event stream recorder/player - you
need to decide what the actions are, then write code to implement
those actions inside AbiWord. The amount of work to implement the
actions is pretty much constant, whether the invoking technology is a
byte-code in an event stream, a method of a wrapper object for Python
or CORBA, or a function made visible in scheme.

The recorder is nearly identical for them all. The only thing that
changes is the stream of bytes you write out for various user actions.

Implementing a real scripting language makes it possible to create the
recorder/player you want for the church secretary. It also makes it
possible for her geek nephew to use the language to do things that are
beyond the recorder/player, like "do this on each line until we've
reached the end of the file."

Or do you have a proposal that makes it possible for the church
secretary to do repetive things? Say generating thank-you letters for
everyone in the top tenth percentile of donations for the year, for
instance?

        <mike



This archive was generated by hypermail 2b25 : Mon Jun 26 2000 - 04:09:54 CDT