On Mon, 16 Mar 1998, Jerzy Karczmarczuk wrote:

> -- Would it be possible to add to Haskell a *macro-preprocessor*?
> Source->source transformations are there everywhere. Why everything
> should be hidden inside the compiler?

Isn't this two separate things? Macro processors are useful for hiding
away nasty things which enable portability between systems, e.g., the use
of macros to enable programs compiled under GHC to use unboxed types in
some places whilst using standard types everywhere when run under hugs.

Source-to-source translators are much more than macro processors, allowing
the transformation at the source level from one program to another,
perhaps under human guidance and with hints about when transformations are
`safe'. There's such a system being converted to Haskell at York at the
moment (I think). But they are much more `Haskell specific' programs than
macro processors.

What would be a shame would be a situation where a macro processor is used
to produce macros as complicated as those described in many C programs,
and as terribly confusing to someone trying to read the code. This would
probably be the case if they were complicated enough to rewrite list
comprehensions. To paraphrase Stroustrup, almost every situation where a
macro is used highlights a deficiency in the language, the program design
or the programmer's skill. Non-automatically deducable optimisations like
unboxed types are currently a language deficiency which will be clarified
in time, but the other things are surely much more `matters of taste'
which are best dealt with by individuals using source to source
transformation systems.

cheers, dave
-------------------------------------------------------------------------
email reply: [EMAIL PROTECTED]    "Life is good for only two things,
www.cs.bris.ac.uk/~tweed/pi.htm      discovering mathematics and teaching
work tel: (0117) 9545104             mathematics" -- Simeon Poisson



Reply via email to