Is there options, except -O0
, that can speed up compilation time?
It's not matter if resulting programs will be not optimised. Actually I want to just type-check large haskell package often and fast.
Flag -fno-code
dramatically speeds up compilation but it's not possible to use it because TemplateHaskell is used by this program.
The reason it takes so long is that there's a lot of redundant recomputation, and the intermediate results are not memoized. Just what we need to see how well GHC can do the same thing at compile time.
Also, instead of dealing with machine data types, you make algebraic data types all the time. Weirdest of all though is higher order functions. You would think that creating functions on the fly, and throwing them around, would make a program slower. But using higher order functions actually makes Haskell faster.
This library offers interfaces which mediate interactions between the ghci interactive shell and iserv , GHC's out-of-process interpreter backend.
Unlike Python, Ruby, JavaScript, Lua, and other interpreted languages, Haskell is compiled ahead-of-time, directly to native machine code.
Looks like a task for hdevtools! Hdevtools is used to as a backend for vim-plugin of the same name and it provides speedy syntax and type checking, directly from the editor. It is about as fast as ghci when reloading modules. I assume that it can be used from the command line.
Another alternative would be to keep a ghci instance running and use that to type check your modules.
I've found splitting up large files can speed up compilation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With