No exceptions?



This little puzzle is prompted by my distaste for exceptions. In a language such as TTM Algebra, I wonder if they can be avoided in theory. By 'avoided' I mean in the sense of avoiding direct language support for them - an implementation might prefer to give ways to detect them outside of specific language syntax. (Whether one wants to avoid exceptions is a different question than whether one can avoid them.) To put it another way, once we have whatever superstructure is needed to give us domains and relations, can operational results be


1) Syntax exceptions - An expression "x join y" might be a valid syntax but one such as "x y" might not. An implementation could stipulate that the reason it's not is because it is not an element of the domain for expressions in the chosen language given a particular syntax. If we have a way to test membership of such a domain, the syntax error could be indicated by the value "false" given by a boolean function. (One such way might be for all statements in a language to be treated as propositions of a relation that describes some program unit.)

2) Semantic exceptions - "x join y" might be valid syntax but "x" might be undefined, eg., there is no relation named "x".

However, the interpretation of a language could be defined such that the mention of "x" without any collateral description stands for a relation with no attributes. According to Hugh Darwen, there are (only) two such relations, aka DEE and DUM and each must have a value (since each is a relation). Although their values are hard to write down, he does say (eg., at http://www.dbdebunk.com/page/page/1043196.htm) that DEE has one tuple.

Within the TTM logical framework (and others), the Closed World Assumption is a convention that says an unmentioned fact is false, ie., if the extension of a relation has no tuples, there are no propositions that satisfy that relation's predicate. This seems to me to provide a way around the non-determinism of "x join y" in isolation. Is it reasonable for a language (again, in theory) to interpret the lack of an extension for "x" as standing for DUM?

There could be operational exceptions such as "out of memory" but before examining them, I'd appreciate comments on the above, especially as to whether I'm not applying the CWA correctly.

p
.



Relevant Pages

  • Re: performance
    ... efficient language and still have an inefficient system. ... > Even on these super performant silicons, some kernel code and device drivers ... > exceptions. ... > relates to the efficiency/performance of the libraries ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Please explain the meaning of stealing a ref
    ... points of connotation as well as denotation in phrasing, and language ... clearer to _other_ readers, ... No, the use of the word 'exceptions' is anything but unreasonable, ... "Owning a reference" means being ...
    (comp.lang.python)
  • Re: performance
    ... > for kernel mode device drivers, while it's much easier to use C++ they ... > exceptions. ... ** I don't confuse language and policies, ... template libraries and no C++ exceptions. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: No exceptions?
    ... categorize what kind of exceptions a language should support in order ... to allow more adequate relvar manipulation such as union inter relvar ... I personally believe that listing the number of exceptions ... Syntax exceptions involving 2 relvars should be determined at compile ...
    (comp.databases.theory)
  • Re: Microsoft.VisualBasic.Strings.Len() works, but Len() does not
    ... syntax and programming style as you move into .NET. ... The problem is that a lot of the VB functions that have dotNET equivalents are actually a lot smarter than the dotNET versions in that instead of throwing exceptions, they return something that make sense in the context of the language. ...
    (microsoft.public.dotnet.languages.vb)