2

I am trying to parse some GHC Core to extract name information and other bits needed.

I am currently using the GHC API given that I haven't found other useful packages help with it.

I've looked through some packages like ghc-core, ghc-core-html and extcore but they seem slightly outdated and I haven't managed to use extcore with ghc-7.10.3.

I have also tried to look for up to date documentation on Core without luck. The best post I've come across is this one, but the discussion is slightly outdated (e.g. compiling the example from these slides, gives a different core dump using the latest ghc.

The question

Having said all this, do you guys know of any recent package that can help in parsing Core? Is there any new documentation regarding CORE manipulation?

Thanks!

Community
  • 1
  • 1
aesadde
  • 439
  • 3
  • 9

1 Answers1

3

The external core feature was removed because it was buggy and a hassle to maintain and if people were using it they didn't speak up. So there is no longer any textual representation of Core intended for machine consumption. Only the internal (AST) representation is available. Of course, I'm sure you'd be welcome to revive the external representation if you want to maintain it.

dfeuer
  • 48,079
  • 5
  • 63
  • 167
  • Thanks for the answer. I'm not sure I have the time to maintain it but I am indeed interested in being able to use some textual representation of Core. Do you know where this code was left at so I can have a look? – aesadde May 19 '16 at 13:05
  • I don't know. You can always dig through git, but if you're even thinking about this sort of thing you should probably email ghc-devs explaining what you want it for to ask where the pieces are. – dfeuer May 19 '16 at 13:15
  • You should be aware that the answer you will likely receive is "use the GHC API". – Reid Barton May 19 '16 at 15:23
  • I'm already working my way throught the API to see if I can make something work. Thanks for the help!! – aesadde May 23 '16 at 09:01