GHC Process Template for Removing Components (for simplifying architecture)

An architecture can be more simplified after things have been removed.

Simpler architecture then makes changes easier.

While there are established GHC Proposal and GHC Feature Request and Bug types, there is no template for removing components. In other words, a systematic way to simplify the architecture is missing. — It is quite natural that from today’s perspective some components can and maybe even should be undone (for some there might be better alternatives; so as a first step, a documentation could be a start!).

Therefore there is a risk of the architecture to become less and less simple, in other words harder to implement future changes. Also, refactorings as such are more effortful than needed, without a less simpler architecture than possible.

To re-establish a balance between adding and removing, I am proposing:

  1. introduce a template / process to remove components from GHC
  2. a systematic evaluation of components of GHC and their usage vs. the complexity they introduce to have a good overview of what’s the value vs. the cost in the ecosystem
  3. for those components where are better known approaches available know, document them systematically to give users the chance to use the better approach instead of the old one (which facilitates future removal)
  4. a migration system (80% solution) that allows (maybe similar to linting), easy migration from code before to after removed state, facilitating acceptance of breaking changes; it can be run as dry-run before an update of GHC to tell before what will break!

Of course collecting candidates for removal can be categorized in clear, disputable and shouldnt-be-removed to get traction.

7 Likes

I’m not getting why you think removing something needs a different process. Isn’t any change to be handled as a proposal/pull request? And what do you mean by ‘architecture’? Again, isn’t all behaviour just made up of features more-or-less visible in their effect in source code (including pragmas and options).

Please give some examples of what you have in mind.

The clearest example I can think of, of something getting removed is DatatypeContexts. These are part of the H2010 Language Report. They were removed from GHC soon after. (So nowadays to use them you must switch them on with a LANGUAGE directive.) Perhaps you mean even that option could be removed(?) The impact would need to be discussed by the community/Steering Group — why not as a Proposal?

3 Likes

I’m in favour of removing old stuff more aggressively from GHC, e.g. NPlusKPatterns or -fregs-graph. And it would be nice to have some kind of report that identifies candidates for removal.

For now, you’ve inspired me to delete a bunch of old CLI flags. :slight_smile:

3 Likes

o.p. might not be aware of the continuing efforts/process to categorise language extensions. (inluding marking some as Deprecated.) These have all been handled through the Proposal/Pull request mechanism. The current in-flight PR is Amend #669 to categorize more language extensions (under review) by telser · Pull Request #738 · ghc-proposals/ghc-proposals · GitHub ; note the link there to earlier rounds and further links to definitions of categories.

I think what threw me off is the words used in o.p. ‘architecture’ and ‘components’ are something different in GHC-speak. See this write-up, esp Section 5.2 The Architecture of Open Source Applications (Volume 2)The Glasgow Haskell Compiler

ImplicitParams come to my mind. I have never seen a library that uses them in its public interface. If you try to use implicit parameters you will quickly find that they are not really simpler than using the Reader monad as a more explicit approach.

It seems to have been discussed before:

ImplicitParams, if you follow the links to #699, is Category Stable, no expectation to change that.

If you wish it to get deprecated, comment/discuss on github.

I’m still unclear what o.p. thinks this Discourse thread is for.