ANN: `dump-core` a prettier GHC core viewer

Hello, Over the holidays I wrote a small GHC plugin to help me do some low-level optimizations of Haskell code. I thought it might be of use to other people too, so please try it out! When enabled, the plugin will save the Core generated by GHC in JSON format, and also render it in HTML for human inspection. The plugin is available on Hackage: http://hackage.haskell.org/package/dump-core The instructions on how to use it are in the README file. You may also read about it at the github page: http://hackage.haskell.org/package/dump-core There are many things that could probably be improved, just let me know. Also, if you are good at design, I could use some help making things look prettier :) Happy hacking, -Iavor

On January 12, 2017 1:36:12 PM EST, Iavor Diatchki
Hello,
Over the holidays I wrote a small GHC plugin to help me do some low-level optimizations of Haskell code. I thought it might be of use to other people too, so please try it out!
When enabled, the plugin will save the Core generated by GHC in JSON format, and also render it in HTML for human inspection.
The plugin is available on Hackage: http://hackage.haskell.org/package/dump-core
The instructions on how to use it are in the README file. You may also read about it at the github page: http://hackage.haskell.org/package/dump-core
There are many things that could probably be improved, just let me know. Also, if you are good at design, I could use some help making things look prettier :)
Happy hacking, -Iavor
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
This looks fantastic, Iavor. I have often wanted something like this. It would be nice if the package would also expose a library providing the types along with FromJson instances so one can load a dump into ghci for further inspection. I've also long wanted a tool to easily fuzzily compare pairs of core dumps. This could be a great tool for enabling this. Cheers, - Ben

Wow, this looks great!
Do you think you could write a very short tutorial on how to use this
plugin in a stack project? A good example project might be Chris
Done's "xeno" which raised a lot of interest in generating fast Core:
https://www.reddit.com/r/haskell/comments/5ng8ov/fast_haskell_competing_with...
Regarding the example output at
http://yav.github.io/dump-core/example-output/Galua.OpcodeInterpreter.html:
Is it intended that the variables in "$wsetStackSize" are (nearly) all
named "ww"? I think it would be more readable if I didn't have to
hover the cursor over a variable to tell which is which.
Lastly, could you please include the README in the extra-source-files,
so it's rendered on Hackage?
Thanks,
Simon
2017-01-12 19:36 GMT+01:00 Iavor Diatchki
Hello,
Over the holidays I wrote a small GHC plugin to help me do some low-level optimizations of Haskell code. I thought it might be of use to other people too, so please try it out!
When enabled, the plugin will save the Core generated by GHC in JSON format, and also render it in HTML for human inspection.
The plugin is available on Hackage: http://hackage.haskell.org/package/dump-core
The instructions on how to use it are in the README file. You may also read about it at the github page: http://hackage.haskell.org/package/dump-core
There are many things that could probably be improved, just let me know. Also, if you are good at design, I could use some help making things look prettier :)
Happy hacking, -Iavor
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Hi, Am Freitag, den 13.01.2017, 06:41 +0100 schrieb Simon Jakobi via Haskell-Cafe:
Is it intended that the variables in "$wsetStackSize" are (nearly) all named "ww"? I think it would be more readable if I didn't have to hover the cursor over a variable to tell which is which.
this might be a good motivation to maybe have more speaking names already generated by GHC ;-) Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
participants (5)
-
Ben Gamari
-
Iavor Diatchki
-
Joachim Breitner
-
Simon Jakobi
-
William Yager