[Haskell-cafe] Current status of Mavericks CPP

Brandon Allbery allbery.b at gmail.com
Wed Apr 16 06:49:00 UTC 2014


On Wed, Apr 16, 2014 at 2:42 AM, Kazu Yamamoto <kazu at iij.ad.jp> wrote:

> >> If ghc-clang-wrapper causes problems with your code, I'd suggest to
> >> fix your code. I'm not sure this actually happens.
> >
> > It does. See my previous messages. Haskell is not C, and some Haskell
> > constructs simply will not work with a program that must lex (and, for
> > ANSI, parse) C code.
>
> I agree that ghc-clang-wrapper can cause problems and GHC should
> provide its own CPP. But have you ever experienced such problems
> actually?
>

I personally have not, but that's largely because I haven't really ever
needed to use -XCPP. I did earlier today talk with someone on IRC who was
running into one lexical incompatibility (Haskell's allowing ' to be an
identifier character), and have in the past helped diagnose issues with the
clang wrapper not working with some programs on Hackage which are
incompatible with ANSI C (that ' issue, plus the use of # and ##).

And I consider it nonsensical that people who need to use -XCPP to deal
with different library versions or language extensions are restricted to
that subset of Haskell which is lexically compatible with C. The problem
here is not those people's code; it is that we are relying on a tool which
by its nature lexes C code, and using it on Haskell code.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/96111143/attachment.html>


More information about the Haskell-Cafe mailing list