|
| 1 | ++++ |
| 2 | +title = "GHC 9.12 & Cabal 3.14 releases" |
| 3 | +date = 2024-12-22 |
| 4 | +[taxonomies] |
| 5 | +authors = ["Hécate"] |
| 6 | +categories = ["Cabal", "GHC"] |
| 7 | +tags = ["Release"] |
| 8 | ++++ |
| 9 | + |
| 10 | +To conclude the year 2024, the GHC and Cabal teams are happy to announce the releases of GHC 9.12 and cabal 3.14. |
| 11 | + |
| 12 | +<!-- more --> |
| 13 | + |
| 14 | + |
| 15 | +Here are some highlights: |
| 16 | + |
| 17 | +## GHC 9.12 |
| 18 | + |
| 19 | +### Language Extensions |
| 20 | + |
| 21 | +This release brings many new and exciting extensions: |
| 22 | +* [Multiline string literals][MultilineStrings] to write string literals with newlines kept verbatim, |
| 23 | + enabling multiline strings without the need for string gaps and literal \n characters"; |
| 24 | +* [Or-Patterns][OrPatterns], allowing you to match on several patterns in a single `case` branch: |
| 25 | + |
| 26 | +```haskell |
| 27 | +data Sweet = Cupcake | Liquorice | Cookie | Raisins |
| 28 | + |
| 29 | +-- Without Or-Patterns |
| 30 | +tasty Cupcake = True |
| 31 | +tasty Cookie = True |
| 32 | +tasty _ = False |
| 33 | + |
| 34 | +-- With Or-Patterns |
| 35 | +tasty (Cupcake; Cookie) = True |
| 36 | +tasty (Liquorice; Raisins) = False |
| 37 | +``` |
| 38 | + |
| 39 | +* [NamedDefaults][NamedDefaults] allows you to create type defaulting declarations for literals other than for the `Num` class. This mechanism is used to make sure that in the expression `print (6 + 7)`, the multiplication gets a concrete type like `Integer`, `Int` or `Double`, instead of the vague `Num a => a`. |
| 40 | +You can now apply this mechanism to other typeclasses, like: |
| 41 | + |
| 42 | +```haskell |
| 43 | +default IsString (Text, String) |
| 44 | +``` |
| 45 | + |
| 46 | +Which means that in a module with [`OverloadedStrings`][OverloadedStrings], string literals `"like this"` will default to [`Text`][Text] |
| 47 | +instead of triggering an error about a polymorphic type. |
| 48 | + |
| 49 | +### Base Library |
| 50 | + |
| 51 | +* Improvements to backtraces and exceptions. Lots of them. |
| 52 | + |
| 53 | +#### ⚠️ Deprecations |
| 54 | + |
| 55 | +* The deprecation cycle of [GHC.Pack][GHC.Pack] has reached its conclusion and the module has been removed. |
| 56 | +* [GHC.Desugar][GHC.Desugar] will be removed in GHC 9.14. |
| 57 | + |
| 58 | +### Code Generation |
| 59 | + |
| 60 | +* Experimental support for the [RISC-V Platform](https://gitlab.haskell.org/ghc/ghc/-/issues/16783); |
| 61 | +* SIMD! In the x86: Most floating-point operations and some integer vector operations are supported 128-bit vectors **without LLVM**. [Get in touch](https://matrix.to/#/#ghc:matrix.org) to help with this effort |
| 62 | +* You can try the new experimental [`-fobject-determinism`][-fobject-determinism] flag to enable deterministic object code generation. |
| 63 | + |
| 64 | +#### ⚠️ Deprecations |
| 65 | + |
| 66 | +* Support 32-bit Windows & macOS/iOS has been dropped; |
| 67 | +* As a result, the `stdcall` calling convention for FFI has been dropped, `ccall` should be used instead. |
| 68 | + |
| 69 | +You can read the full release notes [here](https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/9.12.1-notes.html). |
| 70 | + |
| 71 | +## Cabal 3.14 |
| 72 | + |
| 73 | +### New things |
| 74 | + |
| 75 | +* (Spec v3.14 only) New field: `extra-files` allows you to bundle files in the source distribution (*sdist*) of your cabal package. It serves as an alternative when the files you want to bundle do not fit in the existing `data-files` (for runtime data), `extra-source-files` (built by cabal) or `extra-doc-files` (shipped with Haddocks). This field has no inherent meaning, to avoid misuse of the already existing fields. For instance, you can use `extra-files` to ship `stack.yaml` files, which are not used either by the program at run-time, nor by Cabal or Haddock. |
| 76 | + |
| 77 | +* You can now compile projects dynamically with profiling enabled. The following options are now available: |
| 78 | + * cabal.project: `profiling-shared: <Boolean>`; |
| 79 | + * cabal file: `ghc-prof-shared-options` for passing options when building in profiling dynamic way; |
| 80 | + * Command-line arguments: `--enable-profiling --enable-executable-dynamic`. |
| 81 | + |
| 82 | +* [New GHC options and extensions](https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/9.12.1-notes.html) are supported. |
| 83 | + |
| 84 | +* New build type: Hooks. This build type, intended to eventually replace the Custom build type, integrates better with the rest of the ecosystem (cabal-install, Haskell Language Server). |
| 85 | + |
| 86 | +* The experimental `haddock-project` command supports sub-components. |
| 87 | + |
| 88 | +### Changed |
| 89 | + |
| 90 | +* `cabal init` remembers the chosen language within current session (`Haskell2010`, `GHC2021`, etc.). |
| 91 | + |
| 92 | +* `cabal check` will raise an error about the insecure `git://` protocol in `source-repository`. |
| 93 | + |
| 94 | +* Enable recompilation avoidance during Haddock generation. |
| 95 | + |
| 96 | +* Clarify error message when `pkg-config` is not found. |
| 97 | + |
| 98 | +* Print out which project file(s) we are using. |
| 99 | + |
| 100 | +### Fixed |
| 101 | + |
| 102 | +* The `--promised-dependency` flag now accepts the version of a package in the package name. Previously you could only call it with an argument like `void=void-0.5.8`. |
| 103 | +Now, it is possible to write: `--promised-dependency=void-0.5.8=void-0.5.8`. |
| 104 | + |
| 105 | +* Always pass `ghc-options` to GHC. |
| 106 | + |
| 107 | +* Enhance error detection for cabal root project files, including broken symlinks. |
| 108 | + |
| 109 | +* Don't pass `--coverage-for` for non-dependency libs of a testsuite. |
| 110 | + |
| 111 | +* Fix a bug that causes `cabal init` to crash if `git` is not installed. |
| 112 | + |
| 113 | +### Unresolved |
| 114 | + |
| 115 | +* Recompilation avoidance during Haddock generation sometimes does not work on Windows ([haskell/cabal#9177](https://github.com/haskell/cabal/pull/9177#issuecomment-2167768305)). |
| 116 | + |
| 117 | +You can see the full changelogs for [Cabal & Cabal-syntax](https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.1.0.md), and for [cabal-install and cabal-install-solver](https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.0.0.md) |
| 118 | + |
| 119 | +As always, the Cabal team is always welcoming of new contributors. We have a nice back catalogue of bugs, oddities and feature requests. Stop by our [matrix channel](https://matrix.to/#/#hackage:matrix.org)! |
| 120 | + |
| 121 | +[MultilineStrings]: https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/multiline_strings.html#multiline-string-literals |
| 122 | +[OrPatterns]: https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/or_patterns.html#or-patterns |
| 123 | +[NamedDefaults]: https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/named_defaults.html#named-default-declarations |
| 124 | +[OverloadedStrings]: https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/overloaded_strings.html |
| 125 | +[Text]: https://hackage.haskell.org/package/text/docs/Data-Text.html#t:Text |
| 126 | +[-fobject-determinism]: https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/using-optimisation.html#ghc-flag-fobject-determinism |
| 127 | +[GHC.Pack]: https://gitlab.haskell.org/ghc/ghc/-/issues/21461 |
| 128 | +[GHC.Desugar]: https://hackage.haskell.org/package/base-4.21.0.0/docs/GHC-Desugar.html |
0 commit comments