Tricks for making low level haskell hacking easier

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tricks for making low level haskell hacking easier

Donald Bruce Stewart
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
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

[OT] Re: Tricks for making low level haskell hacking easier

Mathieu Boespflug
On 2/10/07, Donald Bruce Stewart <[hidden email]> 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:
>
>     http://www.cse.unsw.edu.au/~dons/tmp/screen-core.png

Just out of curiosity, what window manager is that?

Mathieu
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Re: Tricks for making low level haskell hacking easier

Donald Bruce Stewart
0xbadcode:

> On 2/10/07, Donald Bruce Stewart <[hidden email]> 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:
> >
> >    http://www.cse.unsw.edu.au/~dons/tmp/screen-core.png
>
> 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
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Re: Tricks for making low level haskell hacking easier

Valery V. Vorotyntsev-2
In reply to this post by Mathieu Boespflug
"Mathieu Boespflug" <[hidden email]> writes:

> On 2/10/07, Donald Bruce Stewart <[hidden email]> wrote:
>> metachars). A screenshot:
>>
>>     http://www.cse.unsw.edu.au/~dons/tmp/screen-core.png
>
> 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
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe