Closed simonpj closed 1 year ago
Thanks Simon. All this looks pretty eminently rational to me. I especially like proposal 3 that we shouldn't go around renaming modules that already exist rapidly, but rather should over time have individual discussions as we start to disentangle things and migrate them across packages.
I think that only six people have contributed to this discussion so far. I bet that many more have an opinion. Please do say what you think! Reminder:
This proposal suggests naming conventions for the libraries
I'm also in favour of the
.Experimental
suffix. I imagineData.List.Experimental
could re-export the contents ofData.List
and add some extra experimental goodies; it's then a very small delta to switch between import Data.List and importData.List.Experimental
, whereas importExperimental.Data.List
would appear somewhere completely different if imports are sorted.
So to be clear, you advocate:
.Experimental
suffix in ghc-experimental
GHC.Internal.
prefix in ghc-internals
Is that right? It seems superficially inconsistent, and yet each on its own makes sense.
Modules in the ghc
library (GHC API) are all called GHC.*
(e.g. GHC.Tc.Gen.App
) and I don't think we can change that.
What do others think? It's all about what colour to paint the bikeshed, but we do need to agree it, otherwise we'll get a mess of inconsistent approaches in different modules.
So to be clear, you advocate:
- Use a
.Experimental
suffix inghc-experimental
- Use a
GHC.Internal.
prefix inghc-internals
Is that right? It seems superficially inconsistent, and yet each on its own makes sense.
Exactly. I'm not particularly worried about making these consistent, since they serve quite different purposes.
Is that right? It seems superficially inconsistent, and yet each on its own makes sense.
I think there is a logic to it:
Foo.Experimental
is a close cousin or variant of of Foo
: you might well want to use both together, and in the long run the latter will hopefully migrate to the formerGHC.Internal
and GHC
may have little to do with each other apart from the fact that the latter uses the former. There might be GHC.Foo
and GHC.Internal.Foo
, but more likely there will be completely independent sets of modules.Use a
.Experimental
suffix inghc-experimental
Data.List.Experimental
is not as strong as Experimental.List
. In a code review with sorted imports scattered X.Y.Experimental
are easier to miss than a group of Experimental.*
.
If you want to optimize for experts do X.Y.Experimental
, if you want to make it more obvious and easier to spot use Experimental.*
. I think the introduction of unstable dependencies should be as prominent as possible.
it would be possible to expose both…
if you want to make it more obvious and easier to spot use Experimental.*
Or EXPERIMENTAL.
maybe? Too bad we can't include ⚠️ in the module name.
Instead of relying on the module name to warn users, another solution could be to add {-# WARNING in "x-experimental" Data.List.Experimental "<some message>" #-}
, and have users use Wno-x-experimental
if they are sure they want to use it. I don't think we currently have module-scoped warnings though.
(Edit: I think technically https://github.com/ghc-proposals/ghc-proposals/pull/134 allows you to do this, although probably not in a super convenient way)
I like the idea of X.Y.Experimental, it feels more appropriately categorized and I kind of doubt someone would miss it. A simple search/replace would probably find them anyways. Perhaps we could even add an experimental warning flag that could be triggered on when desired so the compiler could show warnings for anything deemed experimental that was being used in the code.
On another note:
I'm just bike-shedding here, but it seems like ghc-experimental
should actually be called "base-experimental". Because the code living in it has a life-goal of moving into base, and users are encouraged (or atleast not forbidden) to use it in their own code.
I think this naming change helps to enforce the policy that users shouldnt be depending on ghc libraries but the base libs instead
it seems like ghc-experimental should actually be called "base-experimental". Because the code living in it has a life-goal of moving into base
Whose life-goal? If anyone's, it's the goal of GHC HQ. It's not the goal of CLC, who have purview over base. Therefore I don't think the name "base" should be co-opted here.
users are encouraged (or atleast not forbidden) to use it in their own code
I truly hope the name "ghc-experimental" sounds discouraging because I wouldn't like users to depend on this library lightly!
Whose life-goal? If anyone's, it's the goal of GHC HQ. It's not the goal of CLC, who have purview over base. Therefore I don't think the name "base" should be co-opted here.
I truly hope the name "ghc-experimental" sounds discouraging because I wouldn't like users to depend on this library lightly!
ghc-experimental
definitely sounds like it's something users shouldn't be referencing in their code. Even base-experimental
sounds pretty scary to me. But the quote from the rendered makes it seem like it's ok to use it
- Functions and types in here are usually candidates for later transfer into base. But not necessarily: if a collection of functions is not adopted widely enough, it may not be proposed for a move to base.
- It is user-facing (user are encouraged to depend on it), but its API is less stable than base.
Based on that wording, it sounds like the intent is that the code from experimental eventually matures and takes a home in base, and that it's ok to use it with the warning that it might change on you.
If that's the case, I think base-experimental
is more appropriate. If it's supposed to be super scary and normal devs shouldn't be depending on it, then I agree with calling it ghc-experimental
. But ghc-experimental
sounds like it shouldn't even be user facing
I'm just bike-shedding here, but it seems like
ghc-experimental
should actually be called "base-experimental". Because the code living in it has a life-goal of moving into base, and users are encouraged (or atleast not forbidden) to use it in their own code.
It seems you are reading the purpose of ghc-experimental
as being a staging ground for inclusion into base
. I don't think it's correct: the primary goal for ghc-experimental
is to experiment with API required to implement GHC proposals. It may never end up in base
(after all, it is only aspirational, "ultimate" goal to do so), and it's more likely than not that, building upon results of experiments, the final design approved for inclusion in base
will be much different from one in ghc-experimental
.
If it's supposed to be super scary and normal devs shouldn't be depending on it, then I agree with calling it
ghc-experimental
.
It depends whether experiments scare you, right? If you depend on ghc-experimental
, you agree to participate in an experiment. Sure, this experiment is not supposed to be "super scary", and it is designed to bring positive outcomes in mind, but there is always a chance, and we want consumers to be conscious about it.
The heuristics is simple: ghc-internal
for GHC developers, base
for CLC, and ghc-experimental
for GHC Steering Committee. If there is ghc
in the package name, it is guided by a community body with GHC in its name. I'm quite strongly opposed to renaming to base-experimental
.
I'm just bike-shedding here, but it seems like
ghc-experimental
should actually be called "base-experimental". Because the code living in it has a life-goal of moving into base, and users are encouraged (or atleast not forbidden) to use it in their own code.It seems you are reading the purpose of
ghc-experimental
as being a staging ground for inclusion intobase
. I don't think it's correct: the primary goal forghc-experimental
is to experiment with API required to implement GHC proposals. It may never end up inbase
(after all, it is only aspirational, "ultimate" goal to do so), and it's more likely than not that, building upon results of experiments, the final design approved for inclusion inbase
will be much different from one inghc-experimental
.If it's supposed to be super scary and normal devs shouldn't be depending on it, then I agree with calling it
ghc-experimental
.It depends whether experiments scare you, right? If you depend on
ghc-experimental
, you agree to participate in an experiment. Sure, this experiment is not supposed to be "super scary", and it is designed to bring positive outcomes in mind, but there is always a chance, and we want consumers to be conscious about it.The heuristics is simple:
ghc-internal
for GHC developers,base
for CLC, andghc-experimental
for GHC Steering Committee. If there isghc
in the package name, it is guided by a community body with GHC in its name. I'm quite strongly opposed to renaming tobase-experimental
.
Got it. I totally agree with the logic. I think some of those finer points should be included in the description of ghc-experimental just to make it a little more clear. Thanks for the explanation!
The heuristics is simple: ghc-internal for GHC developers, base for CLC, and ghc-experimental for GHC Steering Committee. L
The apparent inevitability of Conway's Law amazes me every time.
I have done a full refresh of this library-module-naming-convention proposal, and pushed the result.
I think we are done. Any final thoughts?
I, for one, am quite happy with where this proposal ended up. Thanks, @simonpj!
I am too.
ghc-internals
ghc-experimental
Thanks @simonpj!
Great -- let's take this proposal as decided.
merging as approved.
This proposal suggests naming conventions for the libraries
ghc-internal
ghc-experimental
base
ghc
Rendered form here