
Hi, I would like to parse GHC Core to an abstract syntax tree, as the old GHC Core library used to allow the user to do. I do not want to depend on the GHC API (too big), but don't mind depending on a small and separately available .cabal'd package. I also don't mind copying a few modules into my program. The types are of no interest to me, if that makes it any easier Does anyone have the code/library to do this sitting around? Thanks Neil

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Neil Mitchell wrote:
Hi,
I would like to parse GHC Core to an abstract syntax tree, as the old GHC Core library used to allow the user to do. I do not want to depend on the GHC API (too big), but don't mind depending on a small and separately available .cabal'd package. I also don't mind copying a few modules into my program. The types are of no interest to me, if that makes it any easier
Does anyone have the code/library to do this sitting around?
I belive Aarne Ranta wrote a parser for some Core language of GHC 5 a couple of years ago. Um... 2003. It seems to be part of the bnfc[1] tarball as an example. Perhaps you can use that somehow? [1] http://www.cs.chalmers.se/~markus/BNFC/ Cheers, Lennart Kolmodin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF8ET04txYG4KUCuERAmmoAJ4jto4N+d9uEBhE7Z/+fofhTqGePwCgm023 dpCTk9bHmGIXVm5xYuiDQDc= =XEXw -----END PGP SIGNATURE-----

Hello, The GHC repository ghc/utils/ext-core contains a parser and an (incomplete?) interpreter, apparently for some earlier version of GHC core. Best regards Thorkil On Thursday 08 March 2007 15:58, Neil Mitchell wrote:
Hi,
I would like to parse GHC Core to an abstract syntax tree, as the old GHC Core library used to allow the user to do. I do not want to depend on the GHC API (too big), but don't mind depending on a small and separately available .cabal'd package. I also don't mind copying a few modules into my program. The types are of no interest to me, if that makes it any easier
Does anyone have the code/library to do this sitting around?
Thanks
Neil _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On 3/8/07, Neil Mitchell
Hi,
I would like to parse GHC Core to an abstract syntax tree, as the old GHC Core library used to allow the user to do. I do not want to depend on the GHC API (too big), but don't mind depending on a small and separately available .cabal'd package. I also don't mind copying a few modules into my program. The types are of no interest to me, if that makes it any easier
Does anyone have the code/library to do this sitting around?
Does it matter which version of GHC? As far as I know, there's no External Core parser that will work with the code emitted by -fext-core in 6.6. (Aaron Tomb and I (mostly Aaron) have been working on getting that working again.) I have a parser that works with (IIRC) GHC 6.0 somewhere, though it would take a little bit of finding. If that would be useful for you, let me know. Cheers, Kirsten -- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "In a land of quince jelly, apple butter, apricot jam, blueberry preserves, pear conserves, and lemon marmalade, you always get grape jelly." --William Least Heat-Moon

Hi
Does it matter which version of GHC?
Yes, 6.6 or nothing, I'm afraid. GHC 6.6 is already a dependency for another part of the tool chain, so demanding more than one GHC version is not feasible.
As far as I know, there's no External Core parser that will work with the code emitted by -fext-core in 6.6.
That's what I thought, but I was hoping to be proven wrong.
on getting that working again.) I have a parser that works with (IIRC) GHC 6.0 somewhere, though it would take a little bit of finding. If that would be useful for you, let me know.
I have one sitting around somewhere that works with 6.4, I think. Nothing I wrote myself, just something I managed to find online - if you want a copy I'll see if I can dig it out (it was from a while ago). Having a 6.0 parser is not much use to me, but the second you've got a 6.6 parser I'd love to hear from you! Thanks Neil

| > on getting that working again.) I have a parser that works with (IIRC) | > GHC 6.0 somewhere, though it would take a little bit of finding. If | > that would be useful for you, let me know. | | I have one sitting around somewhere that works with 6.4, I think. | Nothing I wrote myself, just something I managed to find online - if | you want a copy I'll see if I can dig it out (it was from a while | ago). | | Having a 6.0 parser is not much use to me, but the second you've got a | 6.6 parser I'd love to hear from you! Yes, it'll be great to have External Core working again. Thanks to Kirsten and Peter for picking it up. (Peter, Kirsten, if you get stuck, I'm happy to help.) Simon

On 3/8/07, Simon Peyton-Jones
Yes, it'll be great to have External Core working again. Thanks to Kirsten and Peter for picking it up.
(Peter, Kirsten, if you get stuck, I'm happy to help.)
Correction -- that's Aaron, not Peter :-) At the moment we're not stuck, it's just a matter of finding time to work on it. We won't hesitate to ask if something comes up, though. Cheers, Kirsten -- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "Who needs reasons when you've got the root password?"--fjw2@lehigh.edu

Hopefully it will be coming together soon. The last couple of weeks have been pretty hectic for me, but most of it ends tomorrow. I'm hoping to put some time into getting the code into shape this weekend. Aaron On Mar 8, 2007, at 4:34 PM, Kirsten Chevalier wrote:
On 3/8/07, Neil Mitchell
wrote: Hi,
I would like to parse GHC Core to an abstract syntax tree, as the old GHC Core library used to allow the user to do. I do not want to depend on the GHC API (too big), but don't mind depending on a small and separately available .cabal'd package. I also don't mind copying a few modules into my program. The types are of no interest to me, if that makes it any easier
Does anyone have the code/library to do this sitting around?
Does it matter which version of GHC? As far as I know, there's no External Core parser that will work with the code emitted by -fext-core in 6.6. (Aaron Tomb and I (mostly Aaron) have been working on getting that working again.) I have a parser that works with (IIRC) GHC 6.0 somewhere, though it would take a little bit of finding. If that would be useful for you, let me know.
Cheers, Kirsten
-- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "In a land of quince jelly, apple butter, apricot jam, blueberry preserves, pear conserves, and lemon marmalade, you always get grape jelly." --William Least Heat-Moon _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (6)
-
Aaron Tomb
-
Kirsten Chevalier
-
Lennart Kolmodin
-
Neil Mitchell
-
Simon Peyton-Jones
-
Thorkil Naur