Wednesday, January 26, 2011

self-hosting dilemma

I have nearly the whole compiler rewritten in itself.  I've saved one of the nastiest bits for last, the inliner.  I've been planning on a new design for the inliner - rather than just copying the Python code.  So of course, what happens in this late stage?  A bug in the inliner!

The program types correctly if inlining is turned off, but fails if it's turned on.  This is a great example of the gains to be had by typing both before and after phases of the compiler - but unfortunately in this case it means I have to fix a bug in some code that I intend to throw away as soon as it works!

Theoretically I could just turn off inlining until I'm done, and then write the new inliner in the self-hosted environment - but I can't be absolutely sure that it's not a more complex interaction between the typer and the inliner.

No comments:

Post a Comment