Skip to content
Snippets Groups Projects
  1. Aug 18, 2024
    • Cheng Shao's avatar
      testsuite: remove undesired -fasm flag from test ways · 88488847
      Cheng Shao authored
      This patch removes the -fasm flag from test ways, except ways like
      optasm that explicitly state they are meant to be compiled with NCG
      backend. Most test ways should use the default codegen backend, and
      the precense of -fasm can cause stderr mismatches like this when GHC
      is configured with the unregisterised backend:
      
      ```
      --- /dev/null
      +++ /tmp/ghctest-3hydwldj/test   spaces/testsuite/tests/profiling/should_compile/prof-late-cc.run/prof-late-cc.comp.stderr.normalised
      @@ -0,0 +1,2 @@
      +when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)]
      +    Target platform uses unregisterised ABI, so compiling via C
      *** unexpected failure for prof-late-cc(prof_no_auto)
      ```
      
      This has been breaking the wasm unreg nightly job since !12595 landed.
      88488847
  2. Aug 17, 2024
    • Simon Peyton Jones's avatar
      Make kick-out more selective · 1deba6b2
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This MR revised the crucial kick-out criteria in the constraint solver.
      
      Ticket #24984 showed an example in which
       * We were kicking out unnecessarily
       * That gave rise to extra work, of course
       * But it /also/ led to exponentially-sized coercions due to lack
         of sharing in coercions (something we want to fix separately #20264)
      
      This MR sharpens up the kick-out criteria; specifially in (KK2) we look
      only under type family applications if (fs>=fw).
      
      This forced me to understand the existing kick-out story, and I ended
      up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet.
      Especially look at the new `Note [The KickOut Criteria]`
      
      The proof of termination is not air-tight, but it is better than before,
      and both Richard and I think it's correct :-).
      1deba6b2
    • Mario's avatar
      Implements the Exportable Named Default proposal (#24305) · fa0dbaca
      Mario authored and Mario's avatar Mario committed
      This squashed commit adds support for exportable named defaults, the accepted
      GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409
      
      The proposal extends the Haskell '98 declarations
      
          default (Int, Double)
      
      which were implicitly always applying to Num class alone, to allow specifying
      an arbitrary single-parameter class:
      
          default IsString (Text, String)
      
      The effect of this declaration would be to eliminate the ambiguous type errors
      around string literals when OverloadedStrings extension is active. The
      declaration by itself has effect only in its module, so the proposal also adds
      the ability to export class defaults:
      
          module MyModule (default IsIstring)
      
      Once the language extension is published and established, we can consider using
      it in base and other libraries.
      
      See Note [Named default declarations] in GHC.Tc.Gen.Default
      for implementation details.
      fa0dbaca
  3. Aug 16, 2024
    • Sylvain Henry's avatar
      Linker: some refactoring to prepare for #24886 · 4bee377c
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      - Rename LoadedBCOs into LazyBCOs
      - Bundle SptEntries with CompiledByteCode and removed [SptEntry] field
        from the BCOs constructor
      - Rename Linkable's LM constructor into Linkable: in the past we had LM
        and LP for Module and Package, now we only have the former.
      - Rename Unlinked into LinkablePart (and linkableUnlinked into
        linkableParts)
      - Use NonEmpty to encode invariant in Linkable's linkableParts type
      - Add helpers: linkableLibs, linkableBCOs, etc.
      - Add documentation
      - Remove partial nameOfObject
      - Rename nameOfObject_maybe into linkablePartPath
      - Rename byteCodeOfObject into linkablePartAllBCOs.
      - Refactor linkablePartAllBCOs to avoid a panic if a LazyBCO has a C
        stub. Document the fact that LazyBCOs are returned in this case
        (contrary to linkableBCOs which only returns non-lazy ones)
      
      Refactoring done while trying to understand how to adapt the linker code
      to support the JS backend too (cf #24886).
      4bee377c
    • sheaf's avatar
      isIrrefutableHsPat: look up ConLikes in the HscEnv · bdd77b9e
      sheaf authored and Marge Bot's avatar Marge Bot committed
      At GhcRn stage, in isIrrefutableHsPat we only looked up data constructors
      in the RdrEnv, which meant that we lacked fallibility information for
      out-of-scope constructors (which can arise from Template Haskell splices).
      
      Instead, we use 'lookupGREInfo', which looks up the information in
      the type environment. This was the correct function to call all along,
      but was not used in 572fbc44 due to import cycle reasons. The appropriate
      functions, 'irrefutableConLike{Rn,Tc}' have been moved to 'GHC.Rename.Env',
      which avoids import cycles.
      
      Fixes #25164
      bdd77b9e
  4. Aug 14, 2024
  5. Aug 13, 2024
  6. Aug 07, 2024
  7. Aug 06, 2024
    • Serge S. Gulin's avatar
      testsuite: extend size performance tests with gzip (fixes #25046) · eb1cb536
      Serge S. Gulin authored
      The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric.
      
      Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case.
      
      2 groups of tests are added:
      1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler).
      2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used.
      eb1cb536
    • Rodrigo Mesquita's avatar
      hi: Deterministic ImportedMods in Usages · a1e42e7a
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The `mi_usages` field of the interface files must use a deterministic
      list of `Usage`s to guarantee a deterministic interface. However, this
      list was, in its origins, constructed from a `ModuleEnv` which uses a
      non-deterministic ordering that was leaking into the interface.
      
      Specifically, ImportedMods = ModuleEnv ... would get converted to a list and
      then passed to `mkUsageInfo` to construct the Usages.
      
      The solution is simple. Back `ImportedMods` with a deterministic map.
      `Map Module ...` is enough, since the Ord instance for `Module` already
      uses a stable, deterministic, comparison.
      
      Fixes #25131
      a1e42e7a
  8. Aug 03, 2024
  9. Aug 02, 2024
    • Brandon Chinn's avatar
      Implement MultilineStrings (#24390) · 66e7f57d
      Brandon Chinn authored
      This commit adds support for multiline strings, proposed at
      https://github.com/ghc-proposals/ghc-proposals/pull/569.
      Multiline strings can now be written as:
      
          myString =
            """
            this is a
            multiline string
            """
      
      The multiline string will have leading indentation stripped away.
      Full details of this post-processing may be found at the new
      GHC.Parser.String module.
      
      In order to cleanly implement this and maximize reusability, I
      broke out the lexing logic for strings out of Lexer.x into a
      new GHC.Parser.String module, which lexes strings with any
      provided "get next character" function. This also gave us the
      opportunity to clean up this logic, and even optimize it a bit.
      With this change, parsing string literals now takes 25% less
      time and 25% less space.
      66e7f57d
    • Andrei Borzenkov's avatar
      Type syntax in expressions (#24159, #24572, #24226) · 8b2f70a2
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      
      This patch extends the grammar of expressions with syntax that is
      typically found only in types:
        * function types (a -> b), (a ->. b), (a %m -> b)
        * constrained types (ctx => t)
        * forall-quantification (forall tvs. t)
      
      The new forms are guarded behind the RequiredTypeArguments extension,
      as specified in GHC Proposal #281. Examples:
      
        {-# LANGUAGE RequiredTypeArguments #-}
        e1 = f (Int    -> String)          -- function type
        e2 = f (Int %1 -> String)          -- linear function type
        e3 = f (forall a. Bounded a => a)  -- forall type, constraint
      
      The GHC AST and the TH AST have been extended as follows:
      
         syntax        | HsExpr   | TH.Exp
        ---------------+----------+--------------
         a -> b        | HsFunArr | ConE (->)
         a %m -> b     | HsFunArr | ConE FUN
         ctx => t      | HsQual   | ConstrainedE
         forall a. t   | HsForAll | ForallE
         forall a -> t | HsForAll | ForallVisE
      
      Additionally, a new warning flag -Wview-pattern-signatures has been
      introduced to aid with migration to the new precedence of (e -> p :: t).
      
      Co-authored-by: default avatarVladislav Zavialov <vlad.z.4096@gmail.com>
      8b2f70a2
  10. Aug 01, 2024
  11. Jul 30, 2024
Loading