[r6rs-discuss] [Formal] Allow compilers to reject obvious
shiro at lava.net
Sat Feb 24 21:27:10 EST 2007
From: Per Bothner <per at bothner.com>
Subject: Re: [r6rs-discuss] [Formal] Allow compilers to reject obvious violations
Date: Sat, 24 Feb 2007 18:03:31 -0800
> Arthur A. Gleckler wrote:
> > My only concern is that an error in one part of my program should not
> > prevent me from running another part of the program. The thing I most
> > dislike about most statically typed language implementations is that
> > they prevent me from testing a program that isn't yet completely
> > type-correct when I'm not even planning to invoke the broken part of the
> > program. I suppose that this suggestion only allows, but doesn't
> > require, compiler writers to signal errors it can detect at compile
> > time. Still, I'd rather not encourage this behavior if it makes it
> > impossible to run programs that are not yet completely correct.
> I really don't understand this point of view. We know that it is
> *much* easier to find and fix a bug the earlier it is caught. If a
> compiler can automatically find a bug right after you write it,
> and you don't have to write any extra code or do any extra work,
> then it seems silly to not take advantage of this help.
I think Arthur's concern is for the cases when you are
changing your program; say, you got an idea of changing
interface of a library funtion, and want to try it to
see how it works in one component of your software, while the
function is also called from other components. If the compiler
requires everthing to be consistent, it mandates you to change
all the call sites in other components, even if you know you
won't run those components for the test.
However, I think the original argument is whether to allow
earlier checks or not, and not to require them. I second
for having optional capability to catch such errors statically.
More information about the r6rs-discuss