Bringing Data.Text into `base`: What is the next step?

That is a very complicated design space. Package imports can be guarded by deeply nested if conditions: compiler, architecture, OS, flags,. …

At worst, HLS might try to add an unbuildable dep, because it doesn’t understand the context well enough (relationship of CPP directives to cabal flags etc).

I also feel this is slightly offtopic, to be honest.

I’m under the impression that the conversation is moving away from the initial point.

While not having text available by default in every cabal project is a valid papercut, the point of moving text to base seems to be to start resolving this ridiculous situation where Haskell is one of the only language where the core apis are using a placeholder textual type (String) and most of the ecosystem is using another one (Text).

So, to come back to the original question: What is the nest step? What are the concrete blockers?
I’m not certain of what the transition plan would exactly look like: a new version of text that doesn’t do anything on newer ghc versions? I there a way to do this while still being compatible with libraries that depend on older text versions? Is it painful to upgrade the entire ecosystem to a new text version (I assumed we’ve learned that recently)

8 Likes

How does that differ from adding module imports (which HLS already supports)?

1 Like

Module imports don’t work well either in light of CPP, correct. Supporting cabal files will be even less reliable though. I can already think of a number of my packages, where it will not work well: e.g. when you have dedicated modules per platform.

1 Like

For those motivated to make this happen, you should definitely contribute to the efforts to split base as discussed in: Pre-Pre-HFTP: Decoupling base and GHC. I expect @Ericson2314 would love your help in getting the ball rolling!

Although my suggestions are partial fixes (e.g. don’t account for dev flags), they solve a vast majority of the problems people have. Given the work involved in the full fix (which will take 1-2 _years), finding interim solutions is much more productive imo. We also might find that the small and easy fixes are enough to reduce the problem enough to not warrant the larger breaking changes.

Some observations:

  • prior to version 6.8.1, the contents of the array boot library was part of base;

  • Data.Array is a standard type in Haskell 2010 (see Ch. 14 of the Report).

Two questions:

  • Since array appeared in version 6.8.1, has there been any problems with accessing the Data.Array type from standard Haskell 2010 automatically, as a result of that split?

  • If not, can the technique used for array for that purpose now also be used to bring the text library into Haskell circa. 2022?

If that is still possible, and practical:

  • text and base can then remain separated - base doesn’t get any larger;

  • the technique could then be used to split other portions of base into new separate libraries - base could get smaller;

  • the new libraries would be readily available, just like base and array are now.

2 Likes

Draft: move base to ghc base, #20647 (!7898) · Merge requests · Glasgow Haskell Compiler / GHC · GitLab this is a very simple PR which almost works. Some just needs to debug the remaining Safe Haskell and TH test failures; I would love it if that someone were not me. After that is done I think splitting base up can proceed incrementally with assorted volunteer effort. This is the one and only stumbling block!

6 Likes

(rant: And to be frank, I think that I am quite fed up by this Haskell Exceptionalism that is so pervasive in our culture to the point of justifying the worst design decision from the last millennium as if their rectification was an intolerable attack on our very being. I’m not only speaking of what this discussion brings but it is a general sentiment that strikes me when I read similar community debates.)

<neutral tone, not attacking you or anything>

Is this really Haskell Exceptionalism, though? Because if it is, Haskell can’t ever get it right.

Either we please the “let’s correct our mistakes” group, or we please the “think about backwards compatibility” group. In the first case, Haskell is unreliable, because stuff breaks all the time (including things like tutorials etc. so the educators would also get mad); and in the second case, we’re exceptionalist because we don’t want to change things?

I dunno, I feel like everyone’s always mad at Haskell, no matter which direction is chosen. :thinking:

4 Likes

It’s more about the ecosystem than the language; namely there’s only one of them, and it’s (mostly) centred on GHC, Cabal and Hackage. This single resource is then being used for multiple and frequently-diverging purposes, hence the frustration and “burn-out”.

As it is now, the Haskell ecosystem has a curious resemblance to an OS distribution (GNU+Linux, BSD, GNU+BSD kernel, etc) - apart from the obvious absence of boot sectors, device drivers and other OS staples, there’s only one version (which could be called torment).

If I’ve used an OS distro with such an arrangement, I have completely forgotten it. I can only recall using ones with at least two versions:

  • current (stable for regular use)

  • future (testing for new features, etc.)

and people can then choose what’s best for their needs.

Whether or not the Haskell ecosystem could ever have a similar arrangement is a question I leave for those much more knowledgable on these matters…

Personally, I love Haskell as it is and hope it will continue to improve. And I’m ready to pay for it by fixing all the stuff that’s getting broken. Maybe I just love fixing stuff AND seeing things change for the better :smiley:

5 Likes

This long conversation has petered out. But I think the question asked at the beginning is still pertinent (if maybe better rephrased to be neutral on a solution):

Making Data.Text more available: What is the next step?

One item of broad consensus in this thread is that making the Text type more available would be good. Some want to move text into base, while others would want to keep Data.Text outside of base but make it more easily available in other ways, perhaps by incorporating Data.Text into an alternative to base or by making cabal more interactive in suggesting new packages. There may be yet other solutions that did not come up here.

Regardless, I’d like to propose a next step: pass this to the Technical Working Group of the Haskell Foundation, if they’ll accept the challenge. Right now, the TWG is designed around evaluating and acting on proposals brought forth from the community. However, the group of people comprising the TWG (to be clear: I’m not one of this group) is very well positioned to come up with a solution to this problem. And so, if @david-christiansen agrees, I wonder whether they could take this on and develop a concrete proposal in-house. In recognition of the expertise and doubtless thoughtful care this group will give, I urge us in the community to accept the direction they propose. It will be imperfect, but hopefully move us forward.

3 Likes

When it comes to the discussion about base, this is clearly a CLC proposal. The TWG can of course raise CLC proposals as well, but that doesn’t mean they will get accepted.

I also would rather like to see CLC spearhead this in general and not be too shy about retaking more responsibility beyond base.

I’ll follow up with the group and see if there’s interest in taking it up. Given that there are multiple paths to a solution, only some of which involve CLC proposals, I think it’s a reasonable forum in which to try to work out some ideas to then submit to the proper channels.

5 Likes