[Haskell-cafe] generic preprocessor for haskell
Jon Fairbairn
Jon.Fairbairn at cl.cam.ac.uk
Mon May 17 15:02:47 EDT 2004
On 2004-05-17 at 09:43BST Graham Klyne wrote:
> I guess that extensible syntax is great for language experiments, but I'd
> be concerned about it becoming a common feature of production
> programming.
I (the design of Ponder notwithstanding) think that too.
> I have found that even the simple facility of user-defined
> operators (not including the `name` form) leads to code
> that is far harder to pick up and understand.
That's probably true. I've often wondered if there was a way
of restricting parts of the language to use within widely
available libraries (as opposed to user-defined
modules). For a user to add an instance of a class, and so
change the meaning of '+' is not unreasonable, but more than
slight use of weird combinations of symbols surely increases
the overhead when reading code.
> I hypothesize (based on my own experience) that when
> picking up some new code, a programmer relies to a
> considerable extent on the mnemonic significance of the
> names used in the code. Non-mnemonic elements of the code
> must be learned and committed to memory before they can be
> read with any facility. This suggests that user-defined
> syntax (and operators) run the risk of making the task of
> understanding a new program more akin to learning a new
> programing language.
I concur. My desire to have a language with extensible
syntax derives from a desire to impose some sort of
consistency on additions to the language, which makes them
easier to absorb when they do arrive, but it's tempered with
a wish to limit the use of such facilities to places where
it's really necessary. The addition of regular expressions
might well be a suitable case for treatment and an argument
that the current extension facilities aren't quite enough,
but I wouldn't want to see too general a mechanism for the
reasons you give.
Jón
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
More information about the Haskell-Cafe
mailing list