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

Compatibility goals? #2

Open
ysangkok opened this issue Jun 5, 2024 · 4 comments
Open

Compatibility goals? #2

ysangkok opened this issue Jun 5, 2024 · 4 comments

Comments

@ysangkok
Copy link
Contributor

ysangkok commented Jun 5, 2024

This looks like a very interesting project, but I am wondering what the goal is, is this supposed to be compatible with a large fraction of packages on Hackage? Or is that simply not a goal?

For example, parsec-2.1.0.1 has tabs and carriage return in its cabal file. I was able to adjust the parser to accept that. But it also uses braces, which I hadn't seen before. And now I don't know whether it makes sense to start to have MicroCabal parse this.

Since I suspect that the code will be more minimal if unnecessary features are avoided, it's a trade-off: Either the code is uglier and more compatible, or it is prettier and less compatible. To align contributors to the project goals, it would make sense to specify the goals in the readme file.

@augustss
Copy link
Owner

augustss commented Jun 5, 2024

I think it makes sense for the parser to be compatible. It's hard to do without trial-and-error since there is no documented grammar.
I'm happy to take any fixes you make.

@augustss
Copy link
Owner

augustss commented Jun 6, 2024

The goal is to be able to build all packages from Hackage. It's far from there.

@ysangkok
Copy link
Contributor Author

The goal is to be able to build all packages from Hackage.

That's good to hear.

there is no documented grammar.

There is this, but it doesn't seem to cover indention (possibly because it is context-sensitive then?) comment in Fields/Parser.hs.

There is a paper with a modification of Happy that provides an academic underpinning of indention: Principled Parsing for Indention-Sensitive Languages. Thanks to @TeofilC for making me aware of this.

@augustss
Copy link
Owner

My parser can deal with Haskell style indentation, so it should be adaptable to Cabal too.
I had not noticed the comment in the field parser. I wonder how accurate it is?

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

2 participants