On 02-May-2002, Ken Alverson <[EMAIL PROTECTED]> wrote:
> > From: Cristian Diaconu [mailto:[EMAIL PROTECTED]]
> > Posted At: Thursday, May 02, 2002 11:18 PM
> > Subject: [OT] double-pass exception semantic - Why?
> >
> > Against 1. The cost of handling every exception is *in theory* twice the
> > cost it would have been if filters would not have existed. It is important
> > to emphasize the difference between theory and practice and I'll get
> > back to that in a second.
>
> The point of exceptions is they are only supposed to happen in
> exceptional conditions.  This means the speed of the exceptional case
> should not be important as long as the common case (non-exceptional) is
> fast.

Since the CLR lacks any direct support for Prolog-style backtracking,
logic programming language implementations for the CLR need to emulate
it somehow.  The best way to do this, IMHO, is to generate code that
uses a continuation-passing style, as explained in the two papers that
I posted references to earlier.  In particular, this means using the
CLR's exception-handling support to implement commits ("cuts", in Prolog
terminology).  Commits are not exceptional, and may occur with reasonably
high frequency for certain styles of logic programming.

If you know of an efficient way to implement Prolog-style backtracking
and commits on the CLR, without using exception handling, then I would
very much like to know about it.

If you do not, then I hope you would concede that the design of a
virtual machine which aims to efficiently support a wide variety
of languages should not ignore the efficiency of throwing exceptions.

--
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

Reply via email to