Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!unmvax!ncar!gatech!hubcap!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.parallel Subject: Re: Exception Handling in Dataflow Languages? Message-ID: <3945@hubcap.UUCP> Date: 19 Dec 88 19:53:20 GMT Sender: fpst@hubcap.UUCP Lines: 57 Approved: parallel@hubcap.clemson.edu >In article <3883@hubcap.UUCP>, jwb@cive.ri.cmu.edu (John Baugh) writes: >> Do dataflow (and/or functional) languages provide exception >> handling mechanisms, or is this considered a no-no? encore!cloud9!cme@seismo.css.gov (Carl Ellison) writes: >[``Exception'' exists to talk about things that happen async.] >[therefore not in normal flow of single-thread program.] >[``exception'' is the arrival of dataflow datum at a VNeumann proc.] I've been taught a different usage of ``exception''. An exception is an unusual event. Often times exceptions are synchronous and they need not involve the hardware in any particular way. Consider adding two non-negative numbers: c := a + b; if c < 0 then (* overflow *) return (OVERFLOW); endif; d := sin (theta); if d = NaN then (* overflow *) return (OVERFOW); endif; : : Doing this all the time as inline code is (a) bothersome and (b) tiresome and thus (c) error prone. It *may* also be less efficient. (It may be possible to build an exception mechanism that is expensive only when it is used, and does not, in fact, require inlining all the explicit tests). The language supports two return mechanism -- normal and exception. The interface to a routine includes the arguments, the return values, and the first-level exceptions: function sin (double angle) returns double except OVERFLOW; And you code without all the explicit error checks. c := a + b; d := sin (theta); : : return (result); except: OVERFLOW: raise (OVERFLOW); In this case, I think that ``exception'' is perfectly well-defined for dataflow languages. ;-D on ( Just noise on the sine wave of life ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo