Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supero (Haskell supercompiler) usage?

I'm having a look at this project http://community.haskell.org/~ndm/supero/

I have downloaded and compiled the program, and could use it on the included samples. But I tried it on my source code and it looks like the program only understands a subset of Haskell.

I got something like this:

supercompiler: Unhandled fromDecl: PatBind (SrcLoc {srcFilename = "unknown.hs", srcLine = 15, srcColumn = 1}) (PTuple [PVar (Ident "width"),PVar (Ident "height")]) Nothing (UnGuardedRhs (Tuple [Lit (Int 7),Lit (Int 6)])) (BDecls [])

The code is available here https://github.com/phuc/Score4-haskell/blob/master/Main.hs

How do I get GHC to outputs the kind of Haskell that Supero understands?

Thank you very much.

like image 455
Phil Avatar asked Jul 13 '11 11:07

Phil


2 Answers

The slides here seem to suggest that it is first run through Yhc, then transformed into an intermediate form HILL (First order Haskell Intermediate Little Language - see slides), and then, finally, the analysis can be done.

Another slideshow provides this diagram:

Diagram of Compilation Process

like image 84
gereeter Avatar answered Nov 16 '22 17:11

gereeter


As I understand it, the current version of Supero only handles a subset of Haskell described in the ICFP 2010 paper.

The previous version did integrate with the YHC pipeline and could handle a larger subset. This was quite a while back and the compilation of YHC itself is pretty soul destroying. I wouldn't recommend it.

Max Bolingbroke is currently integrating his own supercompiler into GHC. However, I can't see the code on his GitHub repository so it might not yet be ready for public consumption.

like image 21
Jason Reich Avatar answered Nov 16 '22 16:11

Jason Reich