ietf-mta-filters
[Top] [All Lists]

Re: General thoughts on variables

2004-10-23 07:38:22

On fre, 2004-10-22 at 16:04 -0400, Mark E. Mallett wrote:
The bottom line is that if we're going to put variables into the
language, I'd like to see it done in a fundamental, fully integrated
way, while allowing for easy improvement and enhancement.  RFC3028 made
this statement:

   The language is not Turing-complete: it provides no way to write a
   loop or a function and variables are not provided.

Yet all of those things have been put on the table in one form or
another (and I doubt that anyone is really surprised that they'd come
up).  Once you've crossed the line to where you want something like
variables, you're going to want more and more out of them.

since the proposals are extensions, a system administrator is free to
support them or not.  there is no doubt that Sieve scripts with
"variables" enabled can use more resources than scripts without them.
on the other hand, a very complex set of simple rules can be a burden on
the system, too.  managesieve allows the administrator to set limits on
the size of the filter file, so the administrator can control that
complexity.  (we have had complaints from users that the default limit
of 32 KiB in Cyrus is too low.)

"variables" can reduce load, too, if the user is able to simplify
hundred rules into a handful.  this probably will only happen if your
users are predominantly tech savvy, so again, leave the choice to the
administrator.

Things I would want to see out of the addition of variables to the
language include:

 - Integration into the language syntax (e.g. not names enclosed in quotes,
   not side-effects of referencing strings);

I agree with the first, but I don't know what other extensions would
have use for bare identifiers as arguments.  regarding the second,
"$foo" is optimised into $foo by Perl's byte code compiler, and probably
by just about all other script languages.

 - Provision for multiple data types (even if only one is initially
   specified);

better support for numeric types would be nice, but Tcl has managed just
fine with their "everything is a string" approach.  extra actions for
doing arithmetic on strings can be added later.

example: result = count * 2 + 1
CALC "result" ["1", "$count", "2", "*", "+"]

(no discussions on the merits of RPN, please :-)

 - Operations on variables including expressions and comparisons.

we have comparisons, although the comparator name is long and awkward.

if not:

 - Compound/complex types;

hmm.

 - scoping.

can be added later if needed.

i.e., things that one would expect of variables in a language.

PS/Disclaimer: not that a disclaimer is needed, but I have an
implementation that includes typed variables, compound structures,
expressions, functions, etc.

sounds nice, but what do you actually use these for in your Sieve
scripts?
-- 
Kjetil T.


<Prev in Thread] Current Thread [Next in Thread>