[gclist] Is there a programmer aboard the aircraft?

Charles Fiterman cef@geodesic.com
Thu, 03 Apr 1997 14:08:37 -0600


At 07:26 PM 4/1/97 -0800, you wrote:

>Impossible, in general.  Variable 'typing' is essentially producing a
>homomorphic image of a program, and trying to make sense of the image.
>You could do some of the same thing with computer time & space, but
>the halting problem guarantees that a _decidable_ typing scheme will
>be very 'loose'.  Look at the tremendous pressure on computer
>architects to make machines 'fast' rather than 'predictable'.  I
>suspect you will eventually find the same pressures to make programs
>'small' rather than 'predictable'.

I have another view of typing. Typing is partial evaluation on the
type system. It is part of a larger class of optimization.

Let us assume there are functions, having logical referential 
transparency, and procedures, lacking logical referential transparency.
The compiler should know it can execute functions where their parameters
are known at compile time and code lift their calls out of loops if
their parameters are known at entry to the loop. In this case a little
good organization allows the type system to be partially evaluated
and warnings or errors produced where it cannot be proved safe.

The fact that we are dealing with logical referential transparency
means the programmer needs a way to declare things as functions or
procedures over the compilers view of this. The first example is
a looping delay function, the compiler can see this is referentially
transparent and run it at compile time which is wrong and needs to
be overridden.

The second example is more useful, a real square root function that
puts out an error message for negative input. This is obviously not
transparent, but getting that error message at compile time not run
time is an improvement, so is lifting it out of a loop. The square
root function can be declared a function because it is logically
transparent.

Now back to typing, we regard type errors as so serious that we
have the compiler tell us about them if they are possible not only
where they are sure. There are really a lot of errors like that
"Is there a programmer aboard the aircraft? I'm getting a divide
by zero error." Is not acceptable and we would like a partial
evaluator to warn us of such possibilities in mission critical 
systems. Since the people who build such systems have lots of time
and money this makes sense.


			-  
Charles Fiterman		Geodesic Systems
414 North Orleans Suite 410	Phone 312 832 1221 x223
Chicago IL 60610-4418		FAX   312 832 1230
				http://www.geodesic.com

A computer language without garbage collection
  is like a city without garbage collection.