[Haskell-cafe] RFC: "Native -XCPP" Proposal

Sven Panne svenpanne at gmail.com
Wed May 6 21:07:42 UTC 2015


2015-05-06 22:18 GMT+02:00 Johannes Waldmann
<johannes.waldmann at htwk-leipzig.de>:
> There is maybe another option: do what csharp does.
>
> Define a reduced "preprocessor" (for conditional compilation,
> but without macro expansion) as part of the language.
> (cf. https://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx )

I'd like to repeat that this is *not* a full solution IMHO, everybody
doing cross-platform FFI bindings needs macro expansion to handle the
differences in calling conventions. Of course this can be done by
duplicating all "foreign imports" etc. for every calling convention
involved, but this is not really a solution to actual needs.

> They must have have had good reasons for doing it this way.

"Doing things differently" has always been a tradition for certain
companies... ;-)

More seriously: We don't want to break hundreds of packages on
Hackage, the only thing we really need is a well-defined CPP-like
preprocessor, so integrating e.g. cpphs somehow seems to be the right
way IMHO. If it's not cpphs, I wouldn't mind, the main point is that
it's the same on all platforms and handles basically *all* things CPP
can.

TH is nice, but I'm not sure if it can handle 100% of the CPP use
cases, and remember: There are Haskell implementations out there which
don't support TH.


More information about the Haskell-Cafe mailing list