-
Notifications
You must be signed in to change notification settings - Fork 84
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
Consider a recusive ascent/descent backend #167
Comments
FWIW, I now have a student tackling this for his bachelor's thesis. So eventually there will be at least one PR. |
(And half a year later, there's #174 🎉 ) |
@sgraf812 @simonmar Ideally, of course, it is great to have added functionality. From a pragmatical side, there are down sides:
Note that we already have a broken backend in I think these aspects should be taken into account when adding functionality to Sorry for playing the devil's advocate here. My reservation comes from experiences with maintaining the BNFC front-end to parser generators. This tool has suffered from feature bloat from eager contributors who then moved on to other projects, already after 5 years not feeling responsible to maintain their components. In the end, I had to weed out these components. That is undesirable, because you never know whether some user out there depends on these features. I think all of |
Those are very good points. I agree, In an ideal world, it would make sense to split
I think #149 wants to replace (1) with a TH-based frontend (maybe in the form of "Staged Selective Parser Combinators"), while #174 wants to replace (3) with an RAD-based one. "Staged Selective Parser Combinators" also describes some Grammar optimisation passes that might qualify as an extension to (2). (It's also certainly possible to want to replace (2) with an LL(k)-based middle-end, although it's not a need of mine.) If we can make the plumbing of the vanilla |
Yes splitting happy along those lines is very much something I'm interested in. As always, Happy can pave the way for the architectural changes GHC itself should make :D. |
The question is if the maintainers of I'd be open to contributing a patch that does the separation, but I'm rather reluctant to do so if it won't end up being merged as it would quickly bitrot. I'm vary of back-compat to older GHC/Cabal versions a bit. Worst case there would be two cabal project file (hierarchies) to be maintained: One with the library components and one where it's all one exe (as it is the case now). |
@sgraf812 I am sorry I didn't see this eariier; I would very much be a fan of such a split! I think @int-index would too, but he should confirm. I am not sure what @simonmar thinks, he might want to weigh in too. I opened #187 to track these great (in my opinion) refactors separately from the recursive ascent/descent backend question. |
Can someone explain what happened to the RA backend PR and the modularisation effort? They both seem to have been closed without progress several years ago... |
The modularisation effort has been merged here: #191 Since then, The RA backend was rebased wrt. I started preparing a 2.0 release a while back, but higher priorities intervened. Perhaps I can get back to it later this week. |
Here's a collection of open issues that we need to resolve before the release: https://github.com/haskell/happy/milestone/2 Most of them have PRs already, but #288 does not and needs a bit of coordination with / opinion of the other maintainers. |
I'm delighted to report that This should allow a rebased https://github.com/knothed/happy-rad to be released with the recursive ascent/descent backend. Perhaps @knothed is interested? :) I opened a PR so that it builds again over here: knothed/happy-rad#1 |
Thank you @sgraf812 for pushing this forward! I will take a look at it. Just have never done a hackage release before :) |
See https://github.com/djspiewak/scala-bison, its tool paper and the original paper on recursive ascent/descent.
There's also the Typed LR paper, which maybe is a preferrable embedding compared to plain recursive ascent-descent.
I expect that with a bit of tuning, such a parser can outperform happy's current table-driven backend because GHC will be able to inline functions.
The text was updated successfully, but these errors were encountered: