Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernizing the Packaging #187

Closed
4 of 6 tasks
Ericson2314 opened this issue Mar 19, 2021 · 6 comments
Closed
4 of 6 tasks

Modernizing the Packaging #187

Ericson2314 opened this issue Mar 19, 2021 · 6 comments

Comments

@Ericson2314
Copy link
Collaborator

Ericson2314 commented Mar 19, 2021

We have some discussion in #167 and #149, but let's lay out the first steps in a separate issue.

At this point the bootstrap will be as simple as it's ever been, and we still support GHCs 7 and up, so I would like to do a release.

Afterwords I would like to take more radical changes:

  • Start splitting up package into (sub) libraries
    • Maybe factor out "run time" into one such library, rather than shoving it in the same file as the generated output from templates
  • Maybe drop support for old cabal
@Ericson2314 Ericson2314 transferred this issue from haskell/alex Mar 19, 2021
@sgraf812
Copy link
Collaborator

Start splitting up package into (sub) libraries

I think @knothed already made some progress in that direction. Since hackage doesn't support multi public library packages yet, we settled on one cabal file for each subcomponent, which means more administrative overhead each release. Maybe some script/configure/Makefile can automate the process.

@sgraf812
Copy link
Collaborator

sgraf812 commented Apr 23, 2021

The current example is at https://github.com/knothed/modular-happy. Still a few refactorings away from being feasible to merge back into happy mainline, but hopefully not too long. The general ideas of #167 (comment) are still valid, there's but one more package: happy-executable (maybe happy-cli would be better), that provides CLI parsing facilities. We were prveiously wrangling the different design options and arrived at a satisfying one that David is going to implement in the next weeks. Here's a sneak peek of a main function that includes support for the RAD extension (which ultimately will live in a different package than mainline happy):

main = do
    options <- parseOptions =<< getArgs
    grammar <- try $ runFrontend (frontendOpts options)
    (action, goto, lr1Items, unused_rules) <- runMiddleend (middleendOpts options) grammar
    case backend options of
      Normal opts -> runBackend opts grammar action goto
      RAD opts -> runRADBackend opts grammar action goto lr1Items unused_rules

This seems like an acceptable maintenance overhead for extension developers, compared to having to closely follow the happy GH repository.

@int-index
Copy link
Collaborator

This way we can also make happy and happy-boot into separate executables, replacing the complicated flag-based logic.

@sgraf812
Copy link
Collaborator

What is the way forward here? Does this issue still apply?

@int-index
Copy link
Collaborator

I would like us to take a critical look at what we're trying to achieve. Why wouldn't a single library happy-lib suffice?

@sgraf812
Copy link
Collaborator

Happy 2.0 shipped with said happy-lib. Let's close this issue and perhaps open a new one if there are any open TODOs here that apply. I don't currently see any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants