What, again?
Posted May 2, 2007 17:16 UTC (Wed) by
dcoutts (subscriber, #5387)
In reply to:
What, again? by ncm
Parent article:
The Rise of Functional Languages (Linux Journal)
Yeah, adding domain-specific optimisations into libraries is cool stuff and really practical. We do this with the Haskell compiler GHC which allows you to stick equational rewrite rules into a library and then the compiler applies them to users code. In effect it allows you to program the optimiser letting the library author apply domain-specific knowledge to direct how to compile user's code.
We do this for example to fuse array operations, combining mutliple passes over arrays into a single pass and eliminating intermediate temporary arrays. This allows users to write in a higher level modular style but then we can compile this down to fast low level code.
(
Log in to post comments)