
Dear All, For the last year I've been working on a program to translate between Haskell and Java. Originally this was for my third year dissertation to contribute towards my Masters in computer science at Sheffield University, UK. I have been given the opportunity to continue this project and have become interested in using the Core representation as an intermediary language. I understand that GHC can produce 'hcr' files which are specified in "An external representation for the ghc core language" 2001 and to this point I have been successful. I have also downloaded the tools for manipulating Core available from http://darcs.haskell.org/ghc/utils/ext-core/ I've tried running Happy on these files but get the error `Not enough type arguments for the type synonym "P"' when I try to run the resultant Parser.hs in Hugs and similar errors when run in GHC. What I'm trying to achieve is to read the hcr files into a Haskell data type which I could work with, if anyone could give me any help with using the files for manipulating Core I would be very grateful. Many Thanks, Ricky Barefield 4th Yr Undergraduate University of Sheffield

Hi Ricky,
For the last year I've been working on a program to translate between Haskell and Java. Originally this was for my third year dissertation to contribute towards my Masters in computer science at Sheffield University, UK.
I have been given the opportunity to continue this project and have become interested in using the Core representation as an intermediary language.
You might be interested in Yhc.Core - its like GHC's Core, but is simpler, untyped and (in my opinion) better supported. http://haskell.org/haskellwiki/Yhc/API/Core We already have a Haskell -> Javascript convertor written using this, so your type of application is certainly doable using what we have already. There are quite a few users of Yhc.Core already, and everyone has had nice things to say about it :) If you have any specific Yhc.Core questions feel free to ask away Thanks Neil

On 2/6/07, Ricky Barefield
I've tried running Happy on these files but get the error `Not enough type arguments for the type synonym "P"' when I try to run the resultant Parser.hs in Hugs and similar errors when run in GHC.
What I'm trying to achieve is to read the hcr files into a Haskell data type which I could work with, if anyone could give me any help with using the files for manipulating Core I would be very grateful.
External Core isn't currently working correctly in the HEAD. Aaron Tomb was working on this, I know (as per mailing lists posts on cvs-ghc from November and December), but I don't know if he still is. glasgow-haskell-users is a better place to discuss this. Your best bet if you want to be able to use External Core may be to fix it yourself. I know that's what I had to do! But, people on glasgow-haskell-users and cvs-ghc will probably be happy to discuss it with you. Cheers, Kirsten -- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "I saw no reason then why hell should not have, so to speak, visible branch establishments throughout the earth, and I have visited quite a few of them since."--Robertson Davies

I am still working on it. Some external events have slowed me down a little (research, classes, appendicitis), and it has involved more changes to the innards of GHC than anticipated, but it is still moving along. If you can wait a little while, it should be possible to use GHC. A slight extension of what I'm doing, which would probably be very useful, would be to export functions for working with external core from the GHC API. Aaron On Feb 6, 2007, at 11:09 AM, Kirsten Chevalier wrote:
On 2/6/07, Ricky Barefield
wrote: I've tried running Happy on these files but get the error `Not enough type arguments for the type synonym "P"' when I try to run the resultant Parser.hs in Hugs and similar errors when run in GHC.
What I'm trying to achieve is to read the hcr files into a Haskell data type which I could work with, if anyone could give me any help with using the files for manipulating Core I would be very grateful.
External Core isn't currently working correctly in the HEAD. Aaron Tomb was working on this, I know (as per mailing lists posts on cvs-ghc from November and December), but I don't know if he still is.
glasgow-haskell-users is a better place to discuss this.
Your best bet if you want to be able to use External Core may be to fix it yourself. I know that's what I had to do! But, people on glasgow-haskell-users and cvs-ghc will probably be happy to discuss it with you.
Cheers, Kirsten
-- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "I saw no reason then why hell should not have, so to speak, visible branch establishments throughout the earth, and I have visited quite a few of them since."--Robertson Davies _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

| I am still working on it. Some external events have slowed me down a | little (research, classes, appendicitis), and it has involved more | changes to the innards of GHC than anticipated, but it is still | moving along. If you can wait a little while, it should be possible | to use GHC. I'm delighted to hear it; thank you. Maybe there are others who'd like to join in? Keep me posted about those "changes to the innards" you mention! | A slight extension of what I'm doing, which would probably be very | useful, would be to export functions for working with external core | from the GHC API. Indeed, that'd be a fine thing. Simon
participants (5)
-
Aaron Tomb
-
Kirsten Chevalier
-
Neil Mitchell
-
Ricky Barefield
-
Simon Peyton-Jones