summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Schmits <git@tryp.io>2023-05-17 16:10:57 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-17 17:11:53 -0400
commit14b690edc8c8883e04a7632a6e73b8aace099497 (patch)
treea7037e71794d8d4a653bc6801872ae8d5ea54585
parenteeea0ce01b59af7a1700dd4b41eb1351bf8edaae (diff)
downloadhaskell-wip/marge_bot_batch_merge_job.tar.gz
Update the users guide paragraph on -O in GHCiwip/marge_bot_batch_merge_job
In relation to #23056
-rw-r--r--docs/users_guide/ghci.rst38
1 files changed, 8 insertions, 30 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index ce384ade79..8ed5203a1e 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -3546,41 +3546,19 @@ The interpreter can't load modules with foreign export declarations!
Unfortunately not. We haven't implemented it yet. Please compile any
offending modules by hand before loading them into GHCi.
-:ghc-flag:`-O` doesn't work with GHCi!
+:ghc-flag:`-O` is ineffective in GHCi!
.. index::
single: optimization; and GHCi
- For technical reasons, the bytecode compiler doesn't interact well
- with one of the optimisation passes, so we have disabled
- optimisation when using the interpreter. This isn't a great loss:
- you'll get a much bigger win by compiling the bits of your code that
- need to go fast, rather than interpreting them with optimisation
- turned on.
+ Before GHC 9.8, optimizations were considered too unstable to be used with
+ the bytecode interpreter.
+ This restriction has been lifted, but is still regarded as experimental and
+ guarded by :ghc-flag:`-funoptimized-core-for-interpreter`, which is enabled
+ by default.
+ In order to use optimizations, run: ::
-Modules using unboxed tuples or sums will automatically enable :ghc-flag:`-fobject-code`
-
- .. index::
- single: unboxed tuples, sums; and GHCi
-
- The bytecode interpreter doesn't support most uses of unboxed tuples or
- sums, so GHCi will automatically compile these modules, and all modules
- they depend on, to object code instead of bytecode.
-
- GHCi checks for the presence of unboxed tuples and sums in a somewhat
- conservative fashion: it simply checks to see if a module enables the
- :extension:`UnboxedTuples` or :extension:`UnboxedSums` language extensions.
- It is not always the case that code which enables :extension:`UnboxedTuples`
- or :extension:`UnboxedSums` requires :ghc-flag:`-fobject-code`, so if you
- *really* want to compile
- :extension:`UnboxedTuples`/:extension:`UnboxedSums`-using code to
- bytecode, you can do so explicitly by enabling the :ghc-flag:`-fbyte-code`
- flag. If you do this, do note that bytecode interpreter will throw an error
- if it encounters unboxed tuple/sum–related code that it cannot handle.
-
- Incidentally, the previous point, that :ghc-flag:`-O` is
- incompatible with GHCi, is because the bytecode compiler can't
- deal with unboxed tuples or sums.
+ ghci -fno-unoptimized-core-for-interpreter -O
Concurrent threads don't carry on running when GHCi is waiting for input.
This should work, as long as your GHCi was built with the