Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible optimizations in Haskell that are not yet implemented in GHC? [closed]

So, purely functional languages have their own class of potentials due to the clear separation between pure and impure code. I have seen several features that are somewhat simpler to implement in Haskell like Nested Data Parallelism or Stream Fusion.

My question is, what are other improvements/optimizations that are more or less unique to Haskell in terms of feasibility/simplicity but not yet implemented? (I mostly care about GHC, but also love to hear about others)

like image 289
Phil Avatar asked Jan 18 '11 04:01

Phil


3 Answers

One optimization I'd love to see in GHC is supercompilation. That seems unlikely in the near-future of GHC, though, because it's whole-program optimization, and GHC is very focused on module-at-a-time compilation.

Basically, supercompilation is executing as much of a program as possible at compile time. It naturally subsumes inlining, deforestation, specialization, and any number of other techniques. Early experimental results have been promising, but it's a very expensive process. It's hard to see it being a practical optimization, but the concept is ridiculously awesome.

like image 150
Carl Avatar answered Dec 19 '22 08:12

Carl


Another issue that SPJ states in his paper on modular supercompilation is combining supercompilation with unboxing. Possibilities for unboxing in supercompiled program are significantly reduced. This causes decrease in performance in comparison with unoptimized program passed through GHC strict-analyser/unboxer. See http://research.microsoft.com/en-us/um/people/simonpj/papers/supercompilation/

like image 25
Victor Nazarov Avatar answered Dec 19 '22 08:12

Victor Nazarov


Another powerful but also "not yet ready for production use" technique is worker-wrapper transformation.

like image 29
Ilya Klyuchnikov Avatar answered Dec 19 '22 08:12

Ilya Klyuchnikov