X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Ffaq.sgml;h=beda1cb7c6c984aae01af1dba94f04b8e2e3a305;hb=dc6afe4242238aa1a7a5d3a150a346d23dd6ea22;hp=8055d15db8ed8a76cce280fdae97740322cfae04;hpb=8c58d23464c76f52c6aad7e6653908eb99e64743;p=ghc-hetmet.git
diff --git a/ghc/docs/users_guide/faq.sgml b/ghc/docs/users_guide/faq.sgml
index 8055d15..beda1cb 100644
--- a/ghc/docs/users_guide/faq.sgml
+++ b/ghc/docs/users_guide/faq.sgml
@@ -45,6 +45,34 @@
+ Do I have to recompile all my code if I upgrade
+ GHC?
+
+ Yes. There are two reasons for this:
+
+
+ GHC does a lot of cross-module optimisation, so
+ compiled code will include parts of the libraries it was
+ compiled against (including the Prelude), so will be
+ deeply tied to the actual version of those libraries it
+ was compiled against. When you upgrade GHC, the libraries
+ may change; even if the external interface of the
+ libraries doesn't change, sometimes internal details may
+ change because GHC optimised the code in the library
+ differently.
+
+
+ We sometimes change the ABI (application binary
+ interface) between versions of GHC. Code compiled with
+ one version of GHC is not necessarily compatible with code
+ compiled by a different version, even if you arrange to
+ keep the same libraries.
+
+
+
+
+
+ Why doesn't GHC use shared libraries?The subject of shared libraries has come up several
@@ -128,6 +156,17 @@
+ The build fails in readline.
+
+ It has been reported that if you have multiple versions
+ of the readline library installed on Linux, then this may
+ cause the build to fail. If you have multiple versions of
+ readline, try uninstalling all except the most recent
+ version.
+
+
+
+ When I try to start ghci (probably one I compiled myself)
it says ghc-5.02: not built for interactive
use
@@ -277,7 +316,140 @@ details.
+
+ Why does linking take so long?
+
+ Linking a small program should take no more than a few
+ seconds. Larger programs can take longer, but even linking
+ GHC itself only takes 3-4 seconds on our development
+ machines.
+
+ Long link times have been attributed to using Sun's
+ linker on Solaris, as compared to GNU ld
+ which appears to be much faster. So if you're on a Sun box,
+ try switching to GNU ld. This
+ article from the mailing list has more
+ information.
+
+
+
+
+ If I explicitely set the buffering on a Handle to
+ "NoBuffering" I'm not able to enter EOF by typing
+ "Ctrl-D".
+
+
+ This is a consequence of Unixy terminal semantics. Unix
+ does line buffering on terminals in the kernel as part of the
+ terminal processing, unless you turn it off. However, the
+ Ctrl-D processing is also part of the terminal processing
+ which gets turned off when the kernel line buffering is
+ disabled. So GHC tries its best to get NoBuffering semantics
+ by turning off the kernel line buffering, but as a result you
+ lose Ctrl-D. C'est la vie.
+
+
+
+
+ If I print out a string using putStr,
+ and then attempt to read some input using
+ hGetLine, I don't see the output from the
+ putStr.
+
+
+ The stdout handle is line-buffered by
+ default, which means that output sent to the handle is only
+ flushed when a newline (/n) is output, the
+ buffer is full, or hFlush is called on the
+ Handle. The right way to make the text appear without sending
+ a newline is to use hFlush:
+
+
+ import System.IO
+ main = do
+ putStr "how are you today? "
+ hFlush stdout
+ input <- hGetLine
+ ...
+
+ You'll probably find that the behaviour differs when
+ using GHCi: the hFlush isn't necessary to
+ make the text appear. This is because in GHCi we turn off the
+ buffering on stdout, because this is
+ normally what you want in an interpreter: output appears as it
+ is generated.
+
+
+
+
+ I can't get finalizers to work properly. My program
+ sometimes just prints
+ <<loop>>.
+
+
+ Chances are that your program is trying to write a
+ message to stdout or
+ stderr in the finalizer. Handles have
+ finalizers themselves, and since finalizers don't keep other
+ finalized values alive, the stdout and
+ stderr Handles may be finalized before your
+ finalizer runs. If this happens, your finalizer will block on
+ the handle, and probably end up receiving a
+ NonTermination exception (which is printed
+ as <<loop>>).
+
+
+
+
+
+ Does GHC implement any kind of extensible records?
+
+
+ No, extensible records are not implemented in GHC.
+ Hugs
+ implements TRex, one extensible record variant. The problem
+ is that the record design space is large, and seems to lack
+ local optima. And all reasonable variants break backward
+ compatibility. As a result, nothing much happens.
+
+
+
+
+ Why do I get errors about missing include files when
+ compiling with or
+ ?
+
+
+ Certain options, such as , turn on
+ via-C compilation, instead of using the native code generator.
+ Include files named by options
+ or in foreign import declarations are only
+ used in via-C compilation mode. See for more details.
+
+
+
+
+ How do I compile my program for profiling without
+ overwriting the object files and hi files
+ I've already built?
+
+ You can select alternative suffixes for object files and
+ interface files, so you can have several builds of the same
+ code coexisting in the same directory. For example, to
+ compile with profiling, you might do this:
+
+ ghc --make -prof -o foo-prof -osuf p.o -hisuf p.hi Main
+
+ See for more details on
+ the and
+ options.
+
+
+
+