[commit: ghc] wip/static-pointers: Implement -XStaticValues. (79c87c0)

git at git.haskell.org git at git.haskell.org
Tue Dec 2 15:05:12 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/static-pointers
Link       : http://ghc.haskell.org/trac/ghc/changeset/79c87c039c47be0baf7a6dd33ecf5434daa1501c/ghc

>---------------------------------------------------------------

commit 79c87c039c47be0baf7a6dd33ecf5434daa1501c
Author: Facundo Domínguez <facundo.dominguez at tweag.io>
Date:   Wed Jan 29 12:43:03 2014 -0200

    Implement -XStaticValues.
    
    Contains contributions from Alexander Vershilov and Mathieu Boespflug.
    
    As proposed in [1], this extension introduces a new syntactic form
    `static e`, where `e :: a` can be any closed expression. The static form
    produces a value of type `StaticPtr a`, which works as a reference that
    programs can "dereference" to get the value of `e` back. References are
    like `Ptr`s, except that they are stable across invocations of a
    program.
    
    In essence the extension collects the arguments of the static form into
    a global static pointer table. The expressions can be looked up by a
    fingerprint computed from the package, the module and a fresh name
    given to the expression. For more details we refer to the users guide
    section contained in the patch.
    
    The extension is a contribution to the Cloud Haskell ecosystem
    (distributed-process and related), and thus has the potential to foster
    Haskell as a programming language for distributed systems.
    
    The immediate improvement brought by the extension is the elimination of
    remote tables from Cloud Haskell applications. Such applications contain
    table fragments spread throughout multiple modules and packages.
    Eliminating these fragments saves the programmer the burden required to
    construct and assemble the global remote table, a verbose and
    error-prone process, even with the help of Template Haskell, that
    moreover pollutes the export lists of all modules.
    
    [1] Jeff Epstein, Andrew P. Black, and Simon Peyton-Jones. Towards
    Haskell in the cloud. SIGPLAN Not., 46(12):118–129, September 2011. ISSN
    0362-1340.


>---------------------------------------------------------------

79c87c039c47be0baf7a6dd33ecf5434daa1501c
 compiler/deSugar/Coverage.lhs                      |   3 +
 compiler/deSugar/Desugar.lhs                       |  31 ++++--
 compiler/deSugar/DsExpr.lhs                        |  78 +++++++++++++
 compiler/deSugar/DsMeta.hs                         |   9 +-
 compiler/deSugar/DsMonad.lhs                       |  22 +++-
 compiler/deSugar/SPT.lhs                           |  88 +++++++++++++++
 compiler/ghc.cabal.in                              |   1 +
 compiler/hsSyn/Convert.lhs                         |   1 +
 compiler/hsSyn/HsExpr.lhs                          |   7 ++
 compiler/main/DynFlags.hs                          |   4 +-
 compiler/parser/Lexer.x                            |   7 ++
 compiler/parser/Parser.y                           |   2 +
 compiler/prelude/PrelNames.lhs                     |  25 +++++
 compiler/prelude/TysWiredIn.lhs                    |  86 +++++++++++++-
 compiler/rename/RnExpr.lhs                         |  33 ++++++
 compiler/typecheck/TcBinds.lhs                     |   2 +-
 compiler/typecheck/TcExpr.lhs                      |  30 +++++
 compiler/typecheck/TcHsSyn.lhs                     |   4 +
 compiler/typecheck/TcHsType.lhs                    |   2 +-
 compiler/typecheck/TcRnDriver.lhs                  |  65 ++++++++++-
 compiler/typecheck/TcRnMonad.lhs                   |   6 +-
 compiler/typecheck/TcRnTypes.lhs                   |  24 +++-
 compiler/typecheck/TcType.lhs                      |   2 +
 compiler/typecheck/TcValidity.lhs                  |   1 +
 docs/users_guide/glasgow_exts.xml                  | 124 +++++++++++++++++++++
 includes/HsFFI.h                                   |   2 +
 includes/Rts.h                                     |   1 +
 includes/rts/SPT.h                                 |  32 ++++++
 libraries/base/GHC/StaticPtr.hs                    | 107 ++++++++++++++++++
 libraries/base/base.cabal                          |   1 +
 libraries/template-haskell/Language/Haskell/TH.hs  |   2 +-
 .../template-haskell/Language/Haskell/TH/Lib.hs    |   3 +
 .../template-haskell/Language/Haskell/TH/Ppr.hs    |   2 +
 .../template-haskell/Language/Haskell/TH/Syntax.hs |   1 +
 rts/Hash.c                                         |  41 +++++++
 rts/Hash.h                                         |  10 ++
 rts/Linker.c                                       |   2 +
 rts/SPT.c                                          |  20 ++++
 .../tests/codeGen/should_run/CgStaticPointers.hs   |  31 ++++++
 .../codeGen/should_run/CgStaticPointers.stdout     |   2 +
 testsuite/tests/codeGen/should_run/all.T           |   3 +
 .../tests/deSugar/should_run/DsStaticPointers.hs   |  20 ++++
 .../deSugar/should_run/DsStaticPointers.stdout     |   2 +
 testsuite/tests/deSugar/should_run/all.T           |   2 +
 testsuite/tests/driver/T4437.hs                    |   3 +-
 .../parser/should_compile/RdrNoStaticPointers01.hs |   7 ++
 testsuite/tests/parser/should_compile/all.T        |   1 +
 .../rename/should_fail/RnStaticPointersFail01.hs   |   5 +
 .../should_fail/RnStaticPointersFail01.stderr      |   6 +
 .../rename/should_fail/RnStaticPointersFail02.hs   |   7 ++
 .../should_fail/RnStaticPointersFail02.stderr      |   8 ++
 .../rename/should_fail/RnStaticPointersFail03.hs   |   5 +
 .../should_fail/RnStaticPointersFail03.stderr      |   6 +
 testsuite/tests/rename/should_fail/all.T           |   6 +
 testsuite/tests/rts/GcStaticPointers.hs            |  33 ++++++
 testsuite/tests/rts/GcStaticPointers.stdout        |   3 +
 testsuite/tests/rts/all.T                          |   4 +
 testsuite/tests/th/TH_StaticPointers.hs            |  19 ++++
 testsuite/tests/th/TH_StaticPointers.stdout        |   1 +
 testsuite/tests/th/all.T                           |   3 +
 .../typecheck/should_compile/TcStaticPointers01.hs |  14 +++
 .../typecheck/should_compile/TcStaticPointers02.hs |  19 ++++
 testsuite/tests/typecheck/should_compile/all.T     |   2 +
 .../should_fail/TcStaticPointersFail01.hs          |  11 ++
 .../should_fail/TcStaticPointersFail01.stderr      |   6 +
 .../should_fail/TcStaticPointersFail02.hs          |  12 ++
 .../should_fail/TcStaticPointersFail02.stderr      |  13 +++
 .../should_fail/TcStaticPointersFail03.hs          |   9 ++
 .../should_fail/TcStaticPointersFail03.stderr      |   6 +
 testsuite/tests/typecheck/should_fail/all.T        |   6 +
 70 files changed, 1127 insertions(+), 29 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 79c87c039c47be0baf7a6dd33ecf5434daa1501c


More information about the ghc-commits mailing list