diff options
author | Alexis King <lexi.lambda@gmail.com> | 2022-09-11 11:30:32 +0200 |
---|---|---|
committer | Alexis King <lexi.lambda@gmail.com> | 2022-09-11 11:30:32 +0200 |
commit | 04062510806e2a3ccf0ecdb71c704a8e1c548c53 (patch) | |
tree | 23fe7599fa11138695b127581e2f8904ddc9b6d9 /docs | |
parent | 9c4ea90c6b493eee6df1798c63a6031cc18ae6da (diff) | |
download | haskell-04062510806e2a3ccf0ecdb71c704a8e1c548c53.tar.gz |
Add native delimited continuations to the RTS
This patch implements GHC proposal 313, "Delimited continuation
primops", by adding native support for delimited continuations to the
GHC RTS.
All things considered, the patch is relatively small. It almost
exclusively consists of changes to the RTS; the compiler itself is
essentially unaffected. The primops come with fairly extensive Haddock
documentation, and an overview of the implementation strategy is given
in the Notes in rts/Continuation.c.
This first stab at the implementation prioritizes simplicity over
performance. Most notably, every continuation is always stored as a
single, contiguous chunk of stack. If one of these chunks is
particularly large, it can result in poor performance, as the current
implementation does not attempt to cleverly squeeze a subset of the
stack frames into the existing stack: it must fit all at once. If this
proves to be a performance issue in practice, a cleverer strategy would
be a worthwhile target for future improvements.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/9.6.1-notes.rst | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/docs/users_guide/9.6.1-notes.rst b/docs/users_guide/9.6.1-notes.rst index e58b56a6d8..2e8302ad22 100644 --- a/docs/users_guide/9.6.1-notes.rst +++ b/docs/users_guide/9.6.1-notes.rst @@ -63,14 +63,13 @@ Language Compiler ~~~~~~~~ -- The :extension:`TypeInType` is now marked as deprecated. Its meaning has been included +- The :extension:`TypeInType` is now marked as deprecated. Its meaning has been included in :extension:`PolyKinds` and :extension:`DataKinds`. - GHCi ~~~~ -- GHCi will now accept any file-header pragmas it finds, such as +- GHCi will now accept any file-header pragmas it finds, such as ``{-# OPTIONS_GHC ... #-}`` and ``{-# LANGUAGE ... #-}`` (see :ref:`pragmas`). For example, instead of using :ghci-cmd:`:set` to enable :ghc-flag:`-Wmissing-signatures`, you could instead write: @@ -81,6 +80,17 @@ GHCi This can be convenient when pasting large multi-line blocks of code into GHCi. +Runtime system +~~~~~~~~~~~~~~ + +- The `Delimited continuation primops <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0313-delimited-continuation-primops.rst>`_ + proposal has been implemented, adding native support for first-class, + delimited continuations to the RTS. For the reasons given in the proposal, + no safe API to access this functionality is provided anywhere in ``base``. + Instead, the ``prompt#`` and ``control0#`` primops are intended to be consumed + by library authors directly, who may wrap them a safe API that maintains the + necessary invariants. See the documentation in ``GHC.Exts`` for more details. + ``base`` library ~~~~~~~~~~~~~~~~ @@ -152,4 +162,3 @@ for further change information. libraries/unix/unix.cabal: Dependency of ``ghc`` library libraries/Win32/Win32.cabal: Dependency of ``ghc`` library libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable - |