New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHC2024 #613
GHC2024 #613
Conversation
Fall is coming close, and I’d like to start the process of defining GHC2024. In last year’s attempt (#559) the vote was not to define a new language edition, but I hope that we can have it now. I still think that we should strive to produce a regular stream of “This is modern haskell” language extensions, given that they do little harm (existing code is unaffected), and we don't want a new language edition release to be something that scares people. At least no more than a GHC release itself. I hope we can do this without too much entanglement with the extension classificaiton proccess (#601) and the stability guarantee discussion. We should only include extensions that we consider “stable” in some sense, but I hope we can make that call without finalizing the other pieces. I’ve copied the proposal over from last year, with four suggestions. The committee will eventually vote upon them individually, so including one that doesn't make it shouldn’t affect the other extensions’ prospect. I invite interested parties who have good arguments for additional changes to submit them as PRs or “suggested edits” against this branch. Committee members can just commit directly. If you have further refinements to the pros and cons of an extension, please also add them. |
Thanks for kicking this off @nomeata! I have made some small edits and suggested adding |
Would I personally use it systematically with newtypes and even have contributed a hlint hint to enforce it. |
Agreed, DerivingStrategies is part of the dialect of a number of organisations using Haskell and I can't imagine writing (and publishing) Haskell code without it. |
I agree |
Another potential candidate for inclusion: |
Certainly worth considering! It received few votes in 2021, but maybe just because there were so many extensions considered back then. Do you want to propose concrete wording for the section? |
That is terrible. I don't see that kind of syntax go through in untyped language where there are no types to catch mistakes. But having types doesn't make it a good syntax. I'm not a fan of whitespace sensitive expression syntax. It's already terrible with |
I also opened a GHC issue, https://gitlab.haskell.org/ghc/ghc/-/issues/24062 |
Thanks for mentioning that! Just FTR: There are even more operators that are already whitespace-sensitive since proposal 229 (which also introduced In that light, I think it makes sense to still wait until a future iteration of the |
I don't expect any large movement. It feels we are approaching a local optima of the syntax evolution: there is very little one can do without breaking something. Off-topic: I agree that So i back up my complaint. I'd say that |
That makes a lot of sense; I don't know the exact historical details, but judging from
(src) the motivation might just have been for In that case, maybe |
We should probably set out a timeline for this process. I suggest to collect nominations and rationales until the end of October, start the committee discussion November 1st with a vote early December. Hopefully this means the implementation makes it to 9.10. @adamgundry, you seem to visibly care the most. WDYT? |
It seems to be a bit more contentious than initially thought. Do you still want to push for it, or shall we use that discussion bandwidth for something else? |
No, I think it makes sense to defer discussions on |
Is it worth having a list of all extensions annotated with which are included and nominated for GHC2021 and GHC2014 respectively? Discovery of what's missing from GHC2021 is a bit difficult otherwise. Sorry if I've missed such a list. |
See https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/control.html#extension-GHC2021 for the official list (will add link to the proposal)
see the proposal https://github.com/ghc-proposals/ghc-proposals/blob/joachim/ghc2024/proposals/0000-ghc2024.rst#proposed-change-specification |
(we need to make it possible for GHC to output the list of extensions not part of a language, figuring this out is tedious!)
I'd also suggest, which is probably more contentious, but let's get the discussion started on this one:
|
-XTypeInType is actually deprecated and now only acts as a synonym for -XPolyKinds, -XDataKinds, and -XKindSignatures (see User Guide) |
@JakobBruenker Oh, right. I'd completely forgotten about that, thanks. Well, only |
@aspiwack if you are feeling confident about your nomination, please edit the proposal directly, and maybe include some rationale. |
I'd like to make a case against
Given that the |
b63fc0f
to
3b49916
Compare
This is an interesting question. @gbaz and @davean are Haskell Infrastructure Admins, and that might imply they are also Hackage administrators (contact details under "Reporting Problems"). The group that determines Hackage policy might be another group entirely. I'm not sure. |
Hackage does not do a check for a language version existing now. In general we do not want hackage to perform any checks cabal does not. We at most want hackage to turn some cabal warnings into hackage errors -- in fact, the cabal codebase specifically is designed to warn on things that may cause hackage upload errors, and the intention is that every package that Here's the issue where default-language was made optional by cabal: haskell/cabal#6288 There's no real motivation for it, and I think it was an unfortunate decision. If we want to force users to specify default-langauge, then the order of operations is we should make at least a warning in cabal. I would suggest that interested parties just open a cabal ticket to make it entirely non-optional again. I see no good reason why it was made optional, and many good reasons to require it. however, note that all cabal packages have an implicit bound on the ghc they work with, as set by their bound on base. And this in turn proxies to limiting to a range of which "default-language" options will be implicitly selected as the compiler default by the compiler versions that correspond. So as long as changes to ghc's implicit default-language correspond to major version bumps in base, then the situation as it stands is workable. Finally -- note that |
Because it's not a hard requirement. People complained that writing minimal The issue is that:
I think that writing a bare minimum Or to put it differently: And that means that (recall auto populating IMHO a compromise is to allow Your experience may vary, but for myself cabal-version: 2.0
name: foo
version: 0
library
build-depends: base, ...
exposed-modules: Foo is just better user experience for myself. TBH, I have a saved code-snippet in my text editor which has a bit more stuff, but I'm not always using my text editor, so occasionally I write |
I don't agree with all the above reasoning, but I think its not worth hashing out further, especially in this ticket. We have a pretty clear plan of action that we can all agree on -- a pr to the cabal repo that creates a warning for missing language of at least "suspicious" severity -- which will lead to it being classified by |
So the authoritative place for the checks that hackage performs is in the Cabal library after all? Then my answer on the other thread wasn't missing the mark after all, phew. |
I'd argue it's not authoritative, and shouldn't be. The analogy is that GHC has various warnings and has various severities for warnings ( But we leave in the real world unfortunately. E.g. Stackage maintainers rejected to add Now as I bring that up, I notice that I have been myself inconsistent. In For the record: haskell/cabal#6288 no-one objected making |
I've opened haskell/cabal#9620 to track the Cabal-level warning discussed above. The fact that changing GHC's default language to |
Given the discussion on this ticket, I am quite surprised that a GHC MR has been proposed already which bumps the default extension to GHC2024.
It seems that these issues with the ecosystem need to be patched up first before such changes can be introduced by default. It seems that for 9.10 it would be ok to introduce GHC2024 as an extension set but I am currently strongly opposed to making it the default. |
It was always the explicit plan that GHC when run as-is gives you the latest edition, for a good experience in ghci and throw-away scripts, and that code that should last more than one GHC release should be explicit in the edition. This is how we did it for GHC2021 (which enabled many more extensions than GHC2024). Of course it’s something we could have communicated more loudly, but that’s always the case. It’s a bit of unfortunate timing that The use case of just firing up The GHC testsuite is hardly representative here; it tests weird corners by construction, and it is written to work with just the current GHC, with the least effort. |
The environment is now very different than when It seems that at least cabal developers, and also ghc developers (myself) are not aware of this expectation that everyone must provide a language edition for any stability guarantee. It seems to make other stability efforts a bit pointless if every few releases many standalone scripts will break because a new non-conservative language edition will be released and quickly made the default. Is this change going to break people compiling xmonad configs? Will this change render instructions about using GHC directly in university courses redundant? The proposal is quiet about any kind of breakage impact and whether the ecosystem is ready to absorb such breakage, even if "it was always the plan", that doesn't mean everything is lined up and ready for the change. |
Of course you have a point, and it’s not completely unexpected. The worry that we’ll have this “OHG GHC2024 suddenly happens what do we do why is not everything behaving the way it did since GHC2021” effect was one of the main reasons I tried to push for more frequent GHC20xx releases, so that it wouldn’t have come as a surprise anymore, no more than a GHC release itself. But I failed to convince back then. Anyways, I will not stand in the way of a decision to make GHC2021 not the default until the world is ready, should someone make a push for that. |
I share Matthew's opinion. MonoLocalBinds, more precisely, is quite dangerous by default for non-cabal packages, because it is mostly in scripts that eg top-level definitions go by without signatures whatsoever. Simon raised this point earlier in the thread, but it got somewhat resolved/cleared as "to upload to hackage, a default-language is mandatory". However, that fails to account for scripts and lecture-notes/material and such. Even though GHC2021 introduced a lot of extensions, did it introduce one with as much potential for breakage as MonoLocalBinds? I think it is a fair extension to include in GHC2024, just not by default when running the compiler! When part of a package, this is much less of a problem. First, because It's unfortunate that we seemingly overlooked this before the proposal was accepted. And I agree with @nomeata that we shouldn't introduce a warning by default to require a language extension -- that is indeed too burdensome for a quick ghci session. |
It's an absolutely key part of GHC Proposal #625, for which I have widely sought feedback. See GR1. A standalone script specifies what compiler to use (Python, Haskell, bash etc). Think of However GR3 says that, whenever possible we should release a compiler that warns of an upcoming change, rather than simply introducing it. Sometimes it it not feasible to do this. For example adding In the case of |
I'm not sure we need to go to the trouble of checking for issues specific to We could put the warning in |
I've made a PR specifying the above idea: #632 |
See ghc-proposals/ghc-proposals#613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
See ghc-proposals/ghc-proposals#613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
See ghc-proposals/ghc-proposals#613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
The proposal has been accepted; the following discussion is mostly of historic interest.
Rendered
This PR will guide the process of deciding if we want to have, and then defining, GHC2024, as per the process outlined in #372.