[Haskell-cafe] Compiler's bane

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Wed Sep 3 18:25:10 EDT 2008

On 2008 Sep 3, at 14:34, Andrew Coppin wrote:
> Brandon S. Allbery KF8NH wrote:
>> You can define a set of valid transformations, have the interpreter  
>> log each transformation, and verify that all are correct (that is,  
>> that both the transformation and the logged result are correct.
>> This assumes the interpreter can be resolved down to a sufficiently  
>> simple set of transformations; if not, you're right back at having  
>> the tester being the interpreter itself.  Note that you don't check  
>> if the transformation plan for the program matches a specified  
>> list, just that all transformations are correct.  (Just remember  
>> that "logic is an organized way of going wrong with confidence.")
> The amusing (?) part is that the interpretter itself is essentially  
> quite simple. I've implemented it several times before now. But what  
> I'm trying to do it make it print out elaborately formatted  
> execution traces so that a human user can observe how execution  
> proceeds. This transforms an essentially simple algorithm into  
> something quite nausiatingly complex, with many subtle bugs and  
> issues.

This seems odd to me:  I would expect to wrap a WriterT around it, log  
unformatted actions there, and dump it to a file at the end to be read  
by an analyzer tool which can optionally reformat the log to be human- 

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

More information about the Haskell-Cafe mailing list