
As far as functionality goes, I think, the simplest approach would be to use the language-c-quote parser inside language-c — i.e., parse with language-c-quote, and then, convert the language-c-quote AST to the language-c AST. This is as language-c contains quite a bit of functionality to analyse the C AST and c2hs needs that functionality. Rewriting it all in terms of the language-c-quote AST (which is quite different) would be a lot of (and pretty boring) work. Writing an AST to AST conversion should be quite straight forward and much less work.
Concerning performance, I assume that the main difference is that language-c uses ’ByteString’s whereas language-c-quote uses ’String’s for parsing. Using ’ByteString’ in language-c-quote would be a good move anyway and shouldn’t be much work. (It’s also something, I might be able to help with.)
Manuel
Geoffrey Mainland
I'm interested in merging language-c and language-c-quote, but I don't really have time to work on it at the moment. The two issues are performance and functionality; it is not clear to me what would need to be added to language-c-quote to make it as functional as language-c, and I don't know how much worse language-c-quote performs. Regardless, I think the chances of making language-c-quote API compatible with language-c are approximately nil.
Geoff
On 02/14/2014 03:27 AM, Ian Ross wrote:
Benedikt Huber is maintaining language-c -- he's pushed minor changes to the darcs repo recently, so I'm guessing he could also make a new release. I'd be happy to take over maintainership of language-c (I'm doing some things to c2hs and language-c is one of the main dependencies of that), though on the understanding that it would just be for minor maintenance tasks.
There is a broader question about language-c (https://github.com/haskell/c2hs/issues/57#issuecomment-27450437): there have been various requests to support the most recent C standard as well as C99, which would be a big job, but Geoffrey Mainland has another package (http://hackage.haskell.org/package/language-c-quote) that supports the latest standards, although with less analysis than language-c and probably less extensively tested than language-c (just because it's newer). Manuel has suggested that merging the two efforts would be a good idea. I don't know how keen Geoffrey would be on that, I don't know how much work it would be, and I don't know how much work it would be to update the reverse dependencies of the two existing packages (language-c has 13, language-c-quote has 2) to use a new merged package.
If we could get some agreement on a way forward, I'd be open to working on producing a merged language-c and updating c2hs to use the new merged version as a test case. (Of course, I don't want to do this in a way that results in a third C language package that needs to be supported!)
Cheers,
Ian.
On 14 February 2014 09:10, Carter Schonwald
mailto:carter.schonwald@gmail.com> wrote: Hey all, someone needs to help take over language C maintainer ship, because its going to be broken on 7.8 unless someone pushes a sdist'd with a new happy/ alex to hackage (see https://github.com/haskell/c2hs/issues/64 for an example issue)
I know Anthony and Jason have at points patched language-c for their respective needs, so i'm cc'ing em :)
-Carter
_______________________________________________ Libraries mailing list Libraries@haskell.org mailto:Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- Ian Ross Tel: +43(0)6804451378 ian@skybluetrades.net mailto:ian@skybluetrades.net www.skybluetrades.net http://www.skybluetrades.net