2 points on language. Continuing
Johannes Waldmann
joe@isun.informatik.uni-leipzig.de
Fri, 24 Aug 2001 09:03:02 +0200 (MET DST)
Sergey:
> Anyway, if a compiler `knows' the word CommutativeRing,
> knows that by definition, CommutativeRing requires ...
I think this is too much to ask from a compiler.
You quickly run into all sorts of undecidable problems
when you want to do term rewriting,
and even more so if you rewrite modulo associativity and so on.
Of course program transformations would be nice,
for the reasons you mentioned.
But this would definitely require a dedicated toolset,
separate from the compiler itself.
Remember, the compiler needs to prove, for each transformationen
a) that it preserves meaning (semantics)
b) it increases efficiency
b) the transformation itself terminates quickly
Of course this impossible to do in general.
On the other hand there *is* quite a bit of research
(for instance, by the term rewriting community, http://rewriting.org)
into special methods that work in special cases.
What a (Haskell) compiler could provide is a nice interface
(to its internal code representation)
where external program analysis and transformation tools could be plugged in.
This would also add a more "pratical" drive to the research mentioned above.
I'd definitely love to see this.
Best regards,
--
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --