On 07-May-99 David Barton wrote: > Jerzy Karczmarczuk writes: > > I am afraid that Sergey is dreaming of transforming Haskell into a > universal Computer Algebra system. We know for more than 30 years > that the general problem of algebraic simplification is a mess. OK, > some polynomial transformations can be done, but I suspect that > enhancing a parser with such rule recognition system containing > obviously the non-linear pattern matching (if not a full > unifier...) seems a deadly idea. It depends of the particular application which kind of reductions in the compiler are great and which aren't. > What began with a fairly limited, and practical, suggestion on Simon's > part to assist the compiler with optimizations and transformations > that are valid in some cases and not in others has blossomed into a > search for a full logical language, with inference, proof checking, > and all the rest. > Please, let's not try to twist Haskell into something it's not, and > was not designed to be. I have always loved languages which have the feature of controled compile-time behavior (like FORTH or Lisp). I am not so familiar with TRS and Haskell compiler internas, but it seems to me, that all mentioned problems are a facette of this: controlled compile-time behavior. Isn't this a more general question: what about "constant folding" (that is the term the Sather people used when I asked about it). Say, in your program there is a complicated (total) function which is used in some place only with constant (literal) parameters. Than it can be an option for the compiler (not just haskell) to precalculate this function and put it into the resulting program saving the function call during run-time. This is nice, especially if the affected code is run frequently. (I am not sure whether lazy evaluation would totaly eliminate the repeated execution or whether Haskell systems have an "expression cache". I guess the Gurus in the list will be able to construct cases where this is not the case). However a lot of my programs are just this: compute the result of a function with constant parameters. Thus a consequent compiler would have to execute the program immediately. Therefore I think we need a statement which allows the compiler to execute "Metacode" (like the === rewrite rules) for optimizations if we tell it to do so. Whether it is better to write down the orders or the prohibitions is due to experimentation. Andreas --------------------------------------------------------------- Andreas C. Doering Medizinische Universitaet zu Luebeck Institut fuer Technische Informatik Ratzeburger Allee 160 D-23538 Luebeck Germany Tel.: +49 451 500-3741, Fax: -3687 Email: [EMAIL PROTECTED] Home: http://www.iti.mu-luebeck.de/~doering quiz, papers, VHDL, music "The fear of the LORD is the beginning of ... science" (Proverbs 1.7) ----------------------------------------------------------------