[R6RS] Safe/unsafe mode

William D Clinger will at ccs.neu.edu
Thu Jul 13 16:47:52 EDT 2006

Kent wrote:
> Ack, more unsupported claims.

Sorry, I thought they were obvious.

> > > Since the only purpose for using unsafe code is to increase efficiency, I
> > > imagine I wouldn't be the only one upset to learn that unsafe declarations
> > > effectively disable some optimizations.
> >
> > Well, that's going to be the case with any proposal
> > that has been advanced so far, and with any I can
> > conceive.
> I don't believe this is true.  Can you describe an optimization that can
> be done on code that is entirely safe that cannot be done on code
> containing unsafe declarations in my model?

Yes, I believe so.  The "optimization" to which you
were referring in the text quoted above was the
transformation from

   (let ((f (lambda (x) (- x))))
     (declare unsafe)
     (f '(a)))


   (let ()
     (declare unsafe)
     (- '(a)))

That particular transformation is not legal under my
preferred semantics, and you seem to regard that fact
as an argument against my semantics.  Are you claiming
that this particular transformation would be legal
under your preferred semantics?

> > Kent's preferred semantics, which I call Proposal 3,
> > inserts the largest number of boundary crossings
> Would you care to prove this claim?  I don't see why this is necessarily
> the case or will even typically be the case in practice.

If my understanding of your semantics is correct, then
a proof should be possible.  If you desire such a proof,
then I suggest you provide a formal description of your
semantics, of the kind that could support a rigorous
proof, and then I shall see what I can do for you.


More information about the R6RS mailing list