[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trace



  TRACE cleary implies a side effect since the behaviour
  of some procedure changes.  

This is not obvious to me.  TRACE reports on an activity in the
system.  The action of the traced procedure is unchanged.  Just to
be extreme,  TRACE might be implemented with external hardware, 
something like a really smart logic analyzer. 

I think we can understand the meaning of the phrases "trace the
variable," "trace the closure," and "trace the code" independent of the
particular implementations.  Is there some concurrence about what an
unsophisticated user expects when he or she writes (TRACE FOO)?  I think
it is undesirable that the effect depends on the form of the DEFINE.  I
also think it is confusing to have indirect recursions appear in the
TRACE output, when the self recursions are ommitted.  

I guess this is a result of (define (v0 v1...) ...)  being subtley
different than (define v0 (lambda (v1 ...) ...))  in the treatment of
v0.  I don't see any advantage to having this difference, aside from
possible runtime efficiency.

   In the presence of "hairy" enough compilers all implementations lose.

Given that we know the desired effect of TRACE in terms of the language,
the implementor of an optimizing compiler can choose to support TRACE or
provide some coherent preemption of it.  In the presence of an
optimizing compiler, I don't see how to make trace independent of the
compiler without preemting either the compiler or the TRACE facility.

-Norman Adams