In my ideal world, browsers are spec'd in a functional language, and optimized mechanically (perhaps based on ad-hoc human guidelines).