[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 27 commits: Add release notes entry for #17816

Marge Bot gitlab at gitlab.haskell.org
Wed Jul 22 16:17:32 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
05910be1 by Krzysztof Gogolewski at 2020-07-21T14:47:07-04:00
Add release notes entry for #17816

[skip ci]

- - - - -
a6257192 by Matthew Pickering at 2020-07-21T14:47:19-04:00
Use a newtype `Code` for the return type of typed quotations (Proposal #195)

There are three problems with the current API:

1. It is hard to properly write instances for ``Quote m => m (TExp a)`` as the type is the composition
   of two type constructors. Doing so in your program involves making your own newtype and
   doing a lot of wrapping/unwrapping.

   For example, if I want to create a language which I can either run immediately or
   generate code from I could write the following with the new API. ::

      class Lang r where
        _int :: Int -> r Int
        _if  :: r Bool -> r a -> r a -> r a

      instance Lang Identity where
        _int = Identity
        _if (Identity b) (Identity t) (Identity f) = Identity (if b then t else f)

      instance Quote m => Lang (Code m) where
        _int = liftTyped
        _if cb ct cf = [|| if $$cb then $$ct else $$cf ||]

2. When doing code generation it is common to want to store code fragments in
   a map. When doing typed code generation, these code fragments contain a
   type index so it is desirable to store them in one of the parameterised
   map data types such as ``DMap`` from ``dependent-map`` or ``MapF`` from
   ``parameterized-utils``.

   ::

      compiler :: Env -> AST a -> Code Q a

      data AST a where ...
      data Ident a = ...

      type Env = MapF Ident (Code Q)

      newtype Code m a = Code (m (TExp a))

   In this example, the ``MapF`` maps an ``Ident String`` directly to a ``Code Q String``.
   Using one of these map types currently requires creating your own newtype and constantly
   wrapping every quotation and unwrapping it when using a splice. Achievable, but
   it creates even more syntactic noise than normal metaprogramming.

3. ``m (TExp a)`` is ugly to read and write, understanding ``Code m a`` is
   easier. This is a weak reason but one everyone
   can surely agree with.

Updates text submodule.

- - - - -
58235d46 by Ben Gamari at 2020-07-21T14:47:28-04:00
users-guide: Fix :rts-flag:`--copying-gc` documentation

It was missing a newline.

- - - - -
19e80b9a by Vladislav Zavialov at 2020-07-21T14:50:01-04:00
Accumulate Haddock comments in P (#17544, #17561, #8944)

Haddock comments are, first and foremost, comments. It's very annoying
to incorporate them into the grammar. We can take advantage of an
important property: adding a Haddock comment does not change the parse
tree in any way other than wrapping some nodes in HsDocTy and the like
(and if it does, that's a bug).

This patch implements the following:

* Accumulate Haddock comments with their locations in the P monad.
  This is handled in the lexer.

* After parsing, do a pass over the AST to associate Haddock comments
  with AST nodes using location info.

* Report the leftover comments to the user as a warning (-Winvalid-haddock).

- - - - -
eb4c66f3 by David Binder at 2020-07-22T12:17:11-04:00
Fix dead link to haskell prime discussion

- - - - -
5ba46417 by BinderDavid at 2020-07-22T12:17:11-04:00
Replace broken links to old haskell-prime site by working links to gitlab instance.
[skip ci]

- - - - -
3537c647 by Daniel Gröber at 2020-07-22T12:17:12-04:00
Remove length field from FastString

- - - - -
4e2218fe by Daniel Gröber at 2020-07-22T12:17:12-04:00
Use ShortByteString for FastString

There are multiple reasons we want this:

- Fewer allocations: ByteString has 3 fields, ShortByteString just has one.
- ByteString memory is pinned:
  - This can cause fragmentation issues (see for example #13110) but also
  - makes using FastStrings in compact regions impossible.

Metric Decrease:
    T5837
    T12150
    T12234
    T12425

- - - - -
a03cf346 by Daniel Gröber at 2020-07-22T12:17:12-04:00
Pass specialised utf8DecodeChar# to utf8DecodeLazy# for performance

Currently we're passing a indexWord8OffAddr# type function to
utf8DecodeLazy# which then passes it on to utf8DecodeChar#. By passing one
of utf8DecodeCharAddr# or utf8DecodeCharByteArray# instead we benefit from
the inlining and specialization already done for those.

- - - - -
2e5a985e by Daniel Gröber at 2020-07-22T12:17:12-04:00
Encoding: Add comment about tricky ForeignPtr lifetime

- - - - -
9f8acb2b by Daniel Gröber at 2020-07-22T12:17:12-04:00
Use IO constructor instead of `stToIO . ST`

- - - - -
853d0ec6 by Daniel Gröber at 2020-07-22T12:17:12-04:00
Encoding: Remove redundant use of withForeignPtr

- - - - -
bb1cb881 by Daniel Gröber at 2020-07-22T12:17:12-04:00
Encoding: Reformat utf8EncodeShortByteString to be more consistent

- - - - -
eb880bc7 by Daniel Gröber at 2020-07-22T12:17:12-04:00
FastString: Reintroduce character count cache

Metric Increase:
    ManyConstructors

Metric Decrease:
    T4029

- - - - -
70eeb593 by Ben Gamari at 2020-07-22T12:17:12-04:00
get-win32-tarballs: Fix detection of missing tarballs

This fixes the error message given by configure when the user
attempts to configure without first download the win32 tarballs.

- - - - -
587d256e by Andreas Klebinger at 2020-07-22T12:17:13-04:00
Enable BangPatterns, ScopedTypeVariables for ghc and hadrian by default.

This is only for their respective codebases.

- - - - -
4ad8dc33 by Sylvain Henry at 2020-07-22T12:17:16-04:00
Remove unused "ncg" flag

This flag has been removed in 066b369de2c6f7da03c88206288dca29ab061b31
in 2011.

- - - - -
53a7555e by Sylvain Henry at 2020-07-22T12:17:16-04:00
Don't panic if the NCG isn't built (it is always built)

- - - - -
367c9574 by Sylvain Henry at 2020-07-22T12:17:16-04:00
Remove unused sGhcWithNativeCodeGen

- - - - -
d72e2cbc by Sylvain Henry at 2020-07-22T12:17:16-04:00
Correctly test active backend

Previously we used a platform settings to detect if the native code
generator was used. This was wrong. We need to use the
`DynFlags.hscTarget` field instead.

- - - - -
302b1d83 by Sylvain Henry at 2020-07-22T12:17:16-04:00
Replace ghcWithNativeCodeGen with a proper Backend datatype

* Represent backends with a `Backend` datatype in GHC.Driver.Backend

* Don't detect the default backend to use for the target platform at
  compile time in Hadrian/make but at runtime. It makes "Settings"
  simpler and it is a step toward making GHC multi-target.

* The latter change also fixes hadrian which has not been updated to
  take into account that the NCG now supports AIX and PPC64 (cf
  df26b95559fd467abc0a3a4151127c95cb5011b9 and
  d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984)

* Also we don't treat iOS specifically anymore (cf
  cb4878ffd18a3c70f98bdbb413cd3c4d1f054e1f)

- - - - -
5a591e5d by Sylvain Henry at 2020-07-22T12:17:16-04:00
Replace HscTarget with Backend

They both have the same role and Backend name is more explicit.

Metric Decrease:
    T3064

Update Haddock submodule

- - - - -
34161fd3 by Andreas Klebinger at 2020-07-22T12:17:17-04:00
Deprecate -fdmd-tx-dict-sel.

It's behaviour is now unconditionally enabled as
it's slightly beneficial.

There are almost no benchmarks which benefit from
disabling it, so it's not worth the keep this
configurable.

This fixes #18429.

- - - - -
a8de5005 by Sylvain Henry at 2020-07-22T12:17:20-04:00
Add test for #18064

It has been fixed by 0effc57d48ace6b719a9f4cbeac67c95ad55010b

- - - - -
86048883 by Krzysztof Gogolewski at 2020-07-22T12:17:24-04:00
Define type Void# = (# #) (#18441)

There's one backwards compatibility issue: GHC.Prim no longer exports
Void#, we now manually re-export it from GHC.Exts.

- - - - -
11c278ab by Sebastian Graf at 2020-07-22T12:17:25-04:00
Add regression test for #18478

!3392 backported !2993 to GHC 8.10.2 which most probably is responsible
for fixing #18478, which triggered a pattern match checker performance
regression in GHC 8.10.1 as first observed in #17977.

- - - - -
607d0d90 by Sylvain Henry at 2020-07-22T12:17:26-04:00
Minor refactoring of Unit display

* for consistency, try to always use UnitPprInfo to display units to
  users

* remove some uses of `unitPackageIdString` as it doesn't show the
  component name and it uses String

- - - - -


30 changed files:

- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types/Prim.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/Switch.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/CoreToByteCode.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/StringBuffer.hs
- + compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Types.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/863c544c9849e49872acac64b8faea56a3311564...607d0d90da96d0762461d04125d2e94c63a249f5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/863c544c9849e49872acac64b8faea56a3311564...607d0d90da96d0762461d04125d2e94c63a249f5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200722/5c6244ef/attachment-0001.html>


More information about the ghc-commits mailing list