Tricks for making low level haskell hacking easier

For those of you who like your Haskell code fast, then, if you're like me, reading Core output all day can give you headaches. Here's a couple of tricks I use to make optimising low level stuff easier. 1) Use Hscolour to pretty-ifiy the Core so its more parsable: ghc -O Foo.hs -ddump-simpl | HsColour -tty | less -r will colourise the Core, and pipe it into less (which will display the metachars). A screenshot: http://www.cse.unsw.edu.au/~dons/tmp/screen-core.png 2) Use vimdiff on asm output, checking the results for different ghc / gcc flags. Yes, sometimes you get down to the asm level, and it can make all the difference. It is useful when writing (*cough*) entries for the great language shootout, to compare the asm output. Currently I do this by compiling a program with different flags, or slightly different code, with -keep-tmp-files -no-recomp set, and then vimdiff the resulting asm files: http://www.cse.unsw.edu.au/~dons/tmp/asm-diff.png (before on the left, after generating pentium4 instructions on the right). Do people have any other tricks for making the tweaking of low level ghc output easier (that we should incorporate into vim/emacs support)? -- Don

On 2/10/07, Donald Bruce Stewart
1) Use Hscolour to pretty-ifiy the Core so its more parsable:
ghc -O Foo.hs -ddump-simpl | HsColour -tty | less -r
will colourise the Core, and pipe it into less (which will display the metachars). A screenshot:
Just out of curiosity, what window manager is that? Mathieu

0xbadcode:
On 2/10/07, Donald Bruce Stewart
wrote: 1) Use Hscolour to pretty-ifiy the Core so its more parsable:
ghc -O Foo.hs -ddump-simpl | HsColour -tty | less -r
will colourise the Core, and pipe it into less (which will display the metachars). A screenshot:
Just out of curiosity, what window manager is that?
That's dwm, the super minimal window manager. Spencer Janssen's actually attempting a rewrite in Haskell though, which should be fun. http://www.suckless.org/wiki/dwm -- Don

"Mathieu Boespflug" <0xbadcode@gmail.com> writes:
On 2/10/07, Donald Bruce Stewart
wrote: metachars). A screenshot:
Just out of curiosity, what window manager is that?
Mathieu
Looks like ratpoison. http://www.nongnu.org/ratpoison/ But give Ion3 a try. You'll love it. http://modeemi.cs.tut.fi/~tuomov/ion/ http://tinyurl.com/25sd9f VVV
participants (3)
-
dons@cse.unsw.edu.au
-
Mathieu Boespflug
-
vvv@umc.com.ua