On Sun, 23 May 2010, Sönke Hahn wrote:

On Friday, May 21, 2010 11:45:18 am John Lato wrote:

You could try compiling the time-critical stuff with ghc -O2, then
just load the object files with ghci.  That might give better results.

IIRC, you can configure ghci not to run the code interpreted but to compile it
first.

This is certainly equivalent to the -fobject-code option and means that modules are compiled (and optimized) when loaded. As far as I know, expressions you type into GHCi are not compiled (and thus not optimized). Then expressions like
   mix signalA signalB
can be fast, if 'mix' is monomorphic (I'm afraid a 'SPECIALISE mix' is not enough), but slightly more complicated examples like
   oscillator wave freq
where 'wave' is a function, are slow, since the 'oscillator' and 'wave' must be inlined for efficient execution.

With the LLVM based signal processing EDSL that I developed recently (http://arxiv.org/abs/1004.4796) you could in principle generate fast signal processing code from GHCi. However sadly, in LLVM-2.6 GHCi aborts with a failed LLVM assertion, whereas LLVM-2.5 could be pursuaded to work with GHCi with a bit of effort.
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to