haskell / happy

The Happy parser generator for Haskell
Other
290 stars 84 forks source link

Merge `happy-*` library packages into a single `happy` library component #292

Closed sgraf812 closed 2 months ago

sgraf812 commented 2 months ago

Triggered by the discussion in https://github.com/haskell/happy/issues/288, we found that it would be preferable to merge all happy-* library packages into the library component associated with the happy executable. The reasons are:

I will prepare a PR.

phadej commented 2 months ago

all components are built anyway.

Wrong. I didn't say that. I said solved for.

Ericson2314 commented 2 months ago

I am very much against this for the reasons I wrote in https://github.com/haskell/happy/pull/293#pullrequestreview-2303292028 (I keep on seeing the PRs first before the issues, sorry.)

sgraf812 commented 2 months ago

Wrong. I didn't say that. I said solved for.

Fair enough. Sorry for misquoting you. Compile-times are not an issue with happy anyway.

everything will bleed back together

I honestly don't see what could "bleed back together" here, or what improved since the package split happened in the first place, apart from a proper module hierarchy.

What concrete evidence can you point to that justifies the increased maintenance overhead? I would prefer that we inform our decisions based on said evidence, rather than daydreaming a vibrant composable ecosystem that we will never have.

Do note that the original motivation was reuse (in happy-rad). For that it doesn't matter whether we have multiple libraries or just one; what matters is that it is complete (and we fail at that for the CLI interface, as I argued in https://github.com/haskell/happy/issues/286#issuecomment-2349075329). Beyond that, I prefer the solution that causes the least maintenance overhead, which is a single library component.

Ericson2314 commented 2 months ago

concrete evidence

Let me flip this around. If we do multiple libraries in a single package, what evidence is there for concrete overhead? If no one wants to use new features like multi-package nix repl, multiple libraries per package, etc. what is even the point of these features being developed? Someone has to be the guinea pig.

Now, because we've had the multiple libraries, things have not bled back together. So I have no evidence of this happening in happy since the split, nor should I, because the remedy is in place. However, I've seen numerous examples of the architecture going to shit in many other projects, including GHC, projects at work, etc. etc. I can't share the work ones publicly but you can ask me privately if you like.

I always hoped that happy and alex could be the pioneer for doing things "the right way", i.e. with internal component boundary enforcement. Yes, they are smaller projects, but that makes it easier to demonstrate the viability of things. If we try shipping a multiple-libraries-per-package release and shit hits the fan, then we should gather up those bug s and get the HF to coordinate them being fixed.

sgraf812 commented 2 months ago

Closed in favor of the design described in https://github.com/haskell/happy/issues/288#issuecomment-2350867172.