X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=docs%2Fusers_guide%2Fghci.xml;h=03f4a3eb32f5477862c5705bdbbf6e37e75126a4;hp=06eb348bfb562b1b58275c992e66708befde9c70;hb=3c22606bf3114747deeae0a8a1d5832ee834d9d1;hpb=d55443e6ab108ae0570bd92dc19de09b07b4ebfa diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml index 06eb348..03f4a3e 100644 --- a/docs/users_guide/ghci.xml +++ b/docs/users_guide/ghci.xml @@ -1952,6 +1952,32 @@ Main.hs:15> x' + + Compiling to object code inside GHCi + + By default, GHCi compiles Haskell source code into byte-code + that is interpreted by the runtime system. GHCi can also compile + Haskell code to object code: to turn on this feature, use the + flag either on the command line or + with :set (the option + restores byte-code compilation + again). Compiling to object code takes longer, but typically the + code will execute 10-20 times faster than byte-code. + + Compiling to object code inside GHCi is particularly useful + if you are developing a compiled application, because the + :reload command typically runs much faster than + restarting GHC with from the command-line, + because all the interface files are already cached in + memory. + + There are disadvantages to compiling to object-code: you + can't set breakpoints in object-code modules, for example. Only + the exports of an object-code module will be visible in GHCi, + rather than all top-level bindings as in interpreted + modules. + + FAQ and Things To Watch Out For