I explicitly did not call out the GHC HQ directly here. This is a community issue, however, I’m not ok with deflection. It is as much the GHC HQ’s problem as it is the CLCs and the Steering Committees.
The GHC HQ is ultimately the entity that produce the releases. As such they are the gateway as to what goes into the compiler or not. And this power has been exercised before.
What I’d like to see is the GHC HQ taking ownership of the compiler, including what source code it accepts, and which not. And then I’d like the following two policies set forward:
- GHC will not include any library that abruptly changes its interface, without a proper deprecation story (with warnings, …) over a specified timeframe. (e.g. 2 years).
- GHC will not include language features that conflict with past behaviour unless they are behind a language pragma (we have language pragmas, so let’s use them).
Today we have the situation that you have a thousands to millions of lines of codebase, and try to migrate to a new compiler (Q: why is this even a thing? migrating to a new compiler?). If you are extremely lucky the surface language didn’t change, and your code as it is still compiles. Most likely not though. (you probably need something like allow-newer for base and other libs), but I guess we can dream.
The knock on effects are, your dependency tree is massive. So you can’t really upgrade to a new compiler until your complete dependency tree is compatible with that new compiler. But maybe you didn’t upgrade all your dependencies to their lates major version all the time. Maybe you are just happy with the old libraries interface? Well tough luck, the probably that that old major version is being made compatible with that new compiler is even less likely, so now you have to deal with interface breakage throughout the whole dependency tree. And why? Because GHC doesn’t accept the old code it did accept.
So, best is probably to just stick to that one compiler you know that works, and not spend major resources on the migration. (Note that you’ll need to have everything compatible with the old and new compiler; otherwise what are you going to do should the new compiler regress in any form?).
Fine, ignore GHC development outright, and stick with the old compiler, but ohh wait, you still live on a moving planet, and things change, new architectures show up, operating systems change. So now the old compiler becomes a liability. And patches you write for that compiler have zero probability of ending up in what ever is upstream. So you patch a virtually dead compiler. And getting those patches into master is likely a major undertaking. Again, it just costs enormous resources.
The problem is not that, for a single module, I can’t fix that up for compatibility, it’s the complexity of the whole dependency chain.
Do I want to use GHC 9.6, try it out, see what regressions we see? Absolutely. Do I have any realistic chance of doing so. No. So I can hope to use GHC 9.2 soon. But writing patches against 9.2 is going to equally frustrating and not going to end up in master, as it is on 8.10 today.
Hence even from a contribution to GHC, and a regression testing of GHC perspective, the GHC HQ should want GHC to keep accepting old code just fine.
if GHC was able to perfectly fine accept old code we wouldn’t even need to upgrade base, mtl and other libraries. Now, I know there are interaction with the RTS that make this a bit harder; so it’s probably not completely realistic to expect to just compile completely old base with the new compiler and ignore newer base and other CLC libraries.
Let’s assume we have deprecation warnings, and language macros then. I could most likely still compile code that was perfectly fine accepted by GHC 8.10 (assuming that didn’t have lots of deprecation warning already), with GHC 9.2. Also the surface language wouldn’t change, because any change to the surface language would require a language pragma. (you called out simplified subsumptions here).
If we wouldn’t be actively contributing to GHC, we’d probably just stay on 8.10 forever. As we are actively contributing (and thus contributions go into new releases, not 8.10), we somehow have to migrate forward to use our own contributions. I absolutely do not want to hack features into 8.10; and the times I’ve contemplated back porting the aarch64 ncg to 8.10–which ironically is the compiler in which that NCG started–make me very sad.
David, if you can make sure that the relevant parties are informed of this, that would be great!