kursjan / petitparser2

A high-performance top-down parser
MIT License
41 stars 19 forks source link

Use different baselines instead of groups #19

Closed JurajKubelka closed 6 years ago

JurajKubelka commented 6 years ago

This pull request adds the following baselines:

kursjan commented 6 years ago

I wonder, why did you do this @JurajKubelka?

JurajKubelka commented 6 years ago

Basically because it is impossible to debug baselines (project dependencies) when groups are used. So, the best habit is not using groups, neither to define the default group.

In this PR, I split existing groups to several baselines. Since then we can easily visualize project dependencies and understand dependency issues by looking at a dependency graph. Something that is impossible to do when groups are involved.

Maybe @girba can give better explanation. Check this post: http://www.humane-assessment.com/blog/identifying-a-configuration-problem-with-gtinspector/

girba commented 6 years ago

The reason is indeed tooling.

The argumentation goes like this: If we can depend on Groups, it means that groups should be polymorphic with Baselines. However, they are not reified, and as a consequence it is unnecessary hard to build tools for them.

In our case, we need a finer grained configuration because we want to be able to depend on BaselineOfPetitParser2Core without the RewriteEngine that has a dependency to a version of SmaCC that conflicts with the one from John Brant.

kursjan commented 6 years ago

This dependency management is pretty annoying :confused:

WDYT, @JurajKubelka, @girba?

JurajKubelka commented 6 years ago

Hi @kursjan, there are as many baselines as many groups used to be there :-)

I think there is an issue with existing SmaCC that conflicts with another SmaCC version used in Moose. @girba Am I right?

For Pillar, we currently depends on BaselineOfPetitParser2Core only. So, I do not mind to change other dependencies. @girba needs to load Gui without Smacc, right?

Considering:

we should move RewriteEngine deeper into the dependencies, so that Gui can be loaded without loading SmaCC

@kursjan: Maybe I misunderstood the original configuration. Does RewriteEngine need SmaCC of that specific version that is defined in its baseline (below)?

spec baseline: 'SmaCC' with: [ 
            spec
                repository: 'github://ThierryGoubier/SmaCC';
                loads: 'Rewrite' ].
JurajKubelka commented 6 years ago

there seems to be too many baselines, feels strange. Is it normal that other projects has so many of them?

I do not know. I think the complexity managing groups or baseline is similar. If there is any issue loading projects, baselines are easier do debug.

girba commented 6 years ago

Currently PP2 loads SmaCC from https://github.com/ThierryGoubier/SmaCC which conflicts with the original SmaCC from John Brant which lives in StHub for now. So, that is why Moose cannot load PP2 with a SmaCC dependency.

So, the first question is: do you need the dependency to that specific SmaCC? And is the rewrite engine integration working?

It is not abnormal to have more baselines if you have variations.

kursjan commented 6 years ago

SmaCC is needed only for the rewrite group. And rewrite is highly experimental. Any dependency on rewrite group is accidental and should be re-factored/fixed.

That particular SmaCC is probably needed, because it overrides some methods needed for PP2Rewrite to hook into the rewrite system.

JurajKubelka commented 6 years ago

OK. So we have an incompatibility between a PP2 version necessary for Moose and you. Do you agree that I create another baseline for you? Or maybe the experimental baseline can also loas the rewrite tool? What do you think?

kursjan commented 6 years ago

I would suggest Moose to completely ignore RewriteEngine configuration. It is an experiment, maintaining this for Moose does not bring anything.

JurajKubelka commented 6 years ago

I agree. This means that Gui baseline cannot depend on RewriteEngine. So, do you agree to add RewriteEngine into Experimental baseline that you can use for your purpose? (And Gui baseline will be used for Moose.)

kursjan commented 6 years ago

Hey, yes please. Gui should not depend on RewriteEngine. Feel free to move RewriteEngine to Experimental as well.

JurajKubelka commented 6 years ago

Hi @kursjan, it is done. I have updated README to easy copy-and-paste installation scripts.

kursjan commented 6 years ago

Thank you for the help!