Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm familiar with Haskell but that's about all the context I have. Anyone care to translate, summarize, or contextualize?


GHC currently has an excellent semi-whole program optimizer for Haskell-level code. And it has LLVM for optimizing the generated assembly. What is missing is an intermediate level optimizer that optimizes asm prior to LLVM, and has awareness of the properties of the Haskell runtime: e.g. immutability, lack of aliasing (properties LLVM can't see). With this last piece, all aspects of code generation are getting heavy duty optimizer treatment.

The new code gen is also pluggable, so you can add new optimizer passes easily (e.g. by implementing text book algorithms)


Heh, 'semi-whole' seems to be a bit of an oxymoron. Could you explain exactly what that means? Do you just mean that it looks at your whole program but not the libraries you use?


Basically, it inlines across module boundaries (except where such modules are mutually recursive).


I don't think cyclic imports are allowed in Haskell.


Sure they are, and full cross-module inlining too


Since when? I just merged 3 files together because GHC complained of the cyclic imports. I would love to pull them apart again.



Right, .hs-boot files. I was being naive and trusting the compiler warnings.


As far as I know it looks at out-of-module calls and does some optimization, but can't run the full optimization suite on outside modules.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: