You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kie.apache.org by Toshiya Kobayashi <to...@gmail.com> on 2024/02/26 08:36:46 UTC
new Antlr4 based DRL parser development
Hello,
In the drools team, we are developing a new Antlr4 based DRL parser. The
current parser is Antlr3 based and contains lots of hard-coded logic in a
generated java code (DRL6Parser.java), so it's hard to maintain.
Originally the new parser was developed under
https://github.com/kiegroup/drools-lsp/ at the early stage. Now we are
testing the new DRL parser with the existing drool unit tests using a
feature branch `dev-new-parser`. We hit lots of test failures (as expected)
and are fixing them one-by-one.
This is the parent issue where Jiri Locker made a great effort to split
child issues (test failures):
https://github.com/apache/incubator-kie-drools/issues/5678
Those child issues are fine grained, so it would be nice to contribute!
If you are willing to contribute, please put you as an assignee (if you
have a committer permission) or post a comment to avoid duplicate work on
the child issue.
Also you can track the progress by watching the parent issue and share your
thoughts any time you want.
Cheers,
Toshiya
Re: new Antlr4 based DRL parser development
Posted by Toshiya Kobayashi <to...@gmail.com>.
Sure thing. Thank you for the reminder, Alex!
Toshiya
On Wed, Feb 28, 2024 at 10:04 PM Alex Porcelli <al...@porcelli.me> wrote:
> Thank you very much for the detailed information, Mario and Toshiya.
>
> Let's use this as an opportunity to remind ourselves about the
> importance of continued communication following the guidelines we
> collectively defined [1].
>
> [1] -
> https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
>
> On Tue, Feb 27, 2024 at 6:53 AM Mario Fusco <ma...@apache.org> wrote:
> >
> > Hi Alex,
> >
> > Just to clarify the purposes of this effort and from where this
> originate, consider that the development of this new ANTLR v4 based parser
> for the DRL started even before the migration to Apache and its main goal
> was to support the implementation of an LSP server that could allow to
> develop an IDE plugin for the DRL language providing code completion and
> syntax coloring.
> >
> > More in general however the current Drools parser is a very legacy part
> of our codebase. It is implemented with a weird mix of an ANTLR v3
> generated parser with tons of handwritten code covering the most complex
> edge cases of the language. After so many years it has become very hard to
> maintain and evolve to the point that now I consider it one of the most
> relevant contributor to Drools' technical debt.
> >
> > As for the risks related with the replacement of the old parser with
> this new one, I honestly don't have any concern, also considering that:
> >
> > 1. This is a long ongoing work that we are developing on a feature
> branch. It will still require a few months of development (to be
> optimistic), so for sure it won't be part of the 10.0.0 release.
> >
> > 2. As Toshiya already mentioned, this parser is confined in its own
> module and its interactions with the rest of the project are well defined
> and under control.
> >
> > 3. The Drools test base is huge, with tens of thousands of test cases
> covering each and every details and edge cases of the DRL. I'm 100% sure
> that if the new parser won't be implementing correctly even only one of the
> DRL specification, there will be at least one test failure evidencing the
> problem and of course we will do the replacement only when the entire
> Drools test suite will be green also using the new parser.
> >
> > I hope this clarifies the situation.
> > Thanks,
> > Mario
> >
> > On 2024/02/26 13:57:11 Alex Porcelli wrote:
> > > Toshiya,
> > >
> > > Thank you for the heads up, however I'm a bit concerned how far this
> > > implementation has gone without a previous proposal to be discussed as
> > > stated in our community communication guidelines [1].
> > >
> > > Although I really appreciate the effort to keep up to date with
> > > technology advances (ANTLR v4 has been around for soooo many years
> > > now), but I'm also concern that this will introduce complexity and
> > > risk while we still improving the codebase stability (ie. issues [2]
> > > [3] [4] [5]).
> > >
> > > So I would like to better understand what's the timeline expected to
> > > see this incorporated into the codebase, and besides the library
> > > upgrade, what are the goals of this change.
> > >
> > > Note: I'm not sure what you mean by Drools team, as far as I know we
> > > are all part of a single community under KIE. Although we might have
> > > more areas of specialization, I don't think we are split into
> > > different teams.
> > >
> > > [1] -
> https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
> > > [2] - https://github.com/apache/incubator-kie-issues/issues/941
> > > [3] - https://github.com/apache/incubator-kie-issues/issues/903
> > > [4] - https://github.com/apache/incubator-kie-issues/issues/968
> > > [5] - https://github.com/apache/incubator-kie-issues/issues/969
> > >
> > >
> > > On Mon, Feb 26, 2024 at 3:37 AM Toshiya Kobayashi
> > > <to...@gmail.com> wrote:
> > > >
> > > > Hello,
> > > >
> > > > In the drools team, we are developing a new Antlr4 based DRL parser.
> The
> > > > current parser is Antlr3 based and contains lots of hard-coded logic
> in a
> > > > generated java code (DRL6Parser.java), so it's hard to maintain.
> > > >
> > > > Originally the new parser was developed under
> > > > https://github.com/kiegroup/drools-lsp/ at the early stage. Now we
> are
> > > > testing the new DRL parser with the existing drool unit tests using a
> > > > feature branch `dev-new-parser`. We hit lots of test failures (as
> expected)
> > > > and are fixing them one-by-one.
> > > >
> > > > This is the parent issue where Jiri Locker made a great effort to
> split
> > > > child issues (test failures):
> > > >
> > > > https://github.com/apache/incubator-kie-drools/issues/5678
> > > >
> > > > Those child issues are fine grained, so it would be nice to
> contribute!
> > > >
> > > > If you are willing to contribute, please put you as an assignee (if
> you
> > > > have a committer permission) or post a comment to avoid duplicate
> work on
> > > > the child issue.
> > > >
> > > > Also you can track the progress by watching the parent issue and
> share your
> > > > thoughts any time you want.
> > > >
> > > > Cheers,
> > > > Toshiya
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> > > For additional commands, e-mail: dev-help@kie.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> > For additional commands, e-mail: dev-help@kie.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> For additional commands, e-mail: dev-help@kie.apache.org
>
>
Re: new Antlr4 based DRL parser development
Posted by Alex Porcelli <al...@porcelli.me>.
Thank you very much for the detailed information, Mario and Toshiya.
Let's use this as an opportunity to remind ourselves about the
importance of continued communication following the guidelines we
collectively defined [1].
[1] - https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
On Tue, Feb 27, 2024 at 6:53 AM Mario Fusco <ma...@apache.org> wrote:
>
> Hi Alex,
>
> Just to clarify the purposes of this effort and from where this originate, consider that the development of this new ANTLR v4 based parser for the DRL started even before the migration to Apache and its main goal was to support the implementation of an LSP server that could allow to develop an IDE plugin for the DRL language providing code completion and syntax coloring.
>
> More in general however the current Drools parser is a very legacy part of our codebase. It is implemented with a weird mix of an ANTLR v3 generated parser with tons of handwritten code covering the most complex edge cases of the language. After so many years it has become very hard to maintain and evolve to the point that now I consider it one of the most relevant contributor to Drools' technical debt.
>
> As for the risks related with the replacement of the old parser with this new one, I honestly don't have any concern, also considering that:
>
> 1. This is a long ongoing work that we are developing on a feature branch. It will still require a few months of development (to be optimistic), so for sure it won't be part of the 10.0.0 release.
>
> 2. As Toshiya already mentioned, this parser is confined in its own module and its interactions with the rest of the project are well defined and under control.
>
> 3. The Drools test base is huge, with tens of thousands of test cases covering each and every details and edge cases of the DRL. I'm 100% sure that if the new parser won't be implementing correctly even only one of the DRL specification, there will be at least one test failure evidencing the problem and of course we will do the replacement only when the entire Drools test suite will be green also using the new parser.
>
> I hope this clarifies the situation.
> Thanks,
> Mario
>
> On 2024/02/26 13:57:11 Alex Porcelli wrote:
> > Toshiya,
> >
> > Thank you for the heads up, however I'm a bit concerned how far this
> > implementation has gone without a previous proposal to be discussed as
> > stated in our community communication guidelines [1].
> >
> > Although I really appreciate the effort to keep up to date with
> > technology advances (ANTLR v4 has been around for soooo many years
> > now), but I'm also concern that this will introduce complexity and
> > risk while we still improving the codebase stability (ie. issues [2]
> > [3] [4] [5]).
> >
> > So I would like to better understand what's the timeline expected to
> > see this incorporated into the codebase, and besides the library
> > upgrade, what are the goals of this change.
> >
> > Note: I'm not sure what you mean by Drools team, as far as I know we
> > are all part of a single community under KIE. Although we might have
> > more areas of specialization, I don't think we are split into
> > different teams.
> >
> > [1] - https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
> > [2] - https://github.com/apache/incubator-kie-issues/issues/941
> > [3] - https://github.com/apache/incubator-kie-issues/issues/903
> > [4] - https://github.com/apache/incubator-kie-issues/issues/968
> > [5] - https://github.com/apache/incubator-kie-issues/issues/969
> >
> >
> > On Mon, Feb 26, 2024 at 3:37 AM Toshiya Kobayashi
> > <to...@gmail.com> wrote:
> > >
> > > Hello,
> > >
> > > In the drools team, we are developing a new Antlr4 based DRL parser. The
> > > current parser is Antlr3 based and contains lots of hard-coded logic in a
> > > generated java code (DRL6Parser.java), so it's hard to maintain.
> > >
> > > Originally the new parser was developed under
> > > https://github.com/kiegroup/drools-lsp/ at the early stage. Now we are
> > > testing the new DRL parser with the existing drool unit tests using a
> > > feature branch `dev-new-parser`. We hit lots of test failures (as expected)
> > > and are fixing them one-by-one.
> > >
> > > This is the parent issue where Jiri Locker made a great effort to split
> > > child issues (test failures):
> > >
> > > https://github.com/apache/incubator-kie-drools/issues/5678
> > >
> > > Those child issues are fine grained, so it would be nice to contribute!
> > >
> > > If you are willing to contribute, please put you as an assignee (if you
> > > have a committer permission) or post a comment to avoid duplicate work on
> > > the child issue.
> > >
> > > Also you can track the progress by watching the parent issue and share your
> > > thoughts any time you want.
> > >
> > > Cheers,
> > > Toshiya
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> > For additional commands, e-mail: dev-help@kie.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> For additional commands, e-mail: dev-help@kie.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
For additional commands, e-mail: dev-help@kie.apache.org
Re: new Antlr4 based DRL parser development
Posted by Mario Fusco <ma...@apache.org>.
Hi Alex,
Just to clarify the purposes of this effort and from where this originate, consider that the development of this new ANTLR v4 based parser for the DRL started even before the migration to Apache and its main goal was to support the implementation of an LSP server that could allow to develop an IDE plugin for the DRL language providing code completion and syntax coloring.
More in general however the current Drools parser is a very legacy part of our codebase. It is implemented with a weird mix of an ANTLR v3 generated parser with tons of handwritten code covering the most complex edge cases of the language. After so many years it has become very hard to maintain and evolve to the point that now I consider it one of the most relevant contributor to Drools' technical debt.
As for the risks related with the replacement of the old parser with this new one, I honestly don't have any concern, also considering that:
1. This is a long ongoing work that we are developing on a feature branch. It will still require a few months of development (to be optimistic), so for sure it won't be part of the 10.0.0 release.
2. As Toshiya already mentioned, this parser is confined in its own module and its interactions with the rest of the project are well defined and under control.
3. The Drools test base is huge, with tens of thousands of test cases covering each and every details and edge cases of the DRL. I'm 100% sure that if the new parser won't be implementing correctly even only one of the DRL specification, there will be at least one test failure evidencing the problem and of course we will do the replacement only when the entire Drools test suite will be green also using the new parser.
I hope this clarifies the situation.
Thanks,
Mario
On 2024/02/26 13:57:11 Alex Porcelli wrote:
> Toshiya,
>
> Thank you for the heads up, however I'm a bit concerned how far this
> implementation has gone without a previous proposal to be discussed as
> stated in our community communication guidelines [1].
>
> Although I really appreciate the effort to keep up to date with
> technology advances (ANTLR v4 has been around for soooo many years
> now), but I'm also concern that this will introduce complexity and
> risk while we still improving the codebase stability (ie. issues [2]
> [3] [4] [5]).
>
> So I would like to better understand what's the timeline expected to
> see this incorporated into the codebase, and besides the library
> upgrade, what are the goals of this change.
>
> Note: I'm not sure what you mean by Drools team, as far as I know we
> are all part of a single community under KIE. Although we might have
> more areas of specialization, I don't think we are split into
> different teams.
>
> [1] - https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
> [2] - https://github.com/apache/incubator-kie-issues/issues/941
> [3] - https://github.com/apache/incubator-kie-issues/issues/903
> [4] - https://github.com/apache/incubator-kie-issues/issues/968
> [5] - https://github.com/apache/incubator-kie-issues/issues/969
>
>
> On Mon, Feb 26, 2024 at 3:37 AM Toshiya Kobayashi
> <to...@gmail.com> wrote:
> >
> > Hello,
> >
> > In the drools team, we are developing a new Antlr4 based DRL parser. The
> > current parser is Antlr3 based and contains lots of hard-coded logic in a
> > generated java code (DRL6Parser.java), so it's hard to maintain.
> >
> > Originally the new parser was developed under
> > https://github.com/kiegroup/drools-lsp/ at the early stage. Now we are
> > testing the new DRL parser with the existing drool unit tests using a
> > feature branch `dev-new-parser`. We hit lots of test failures (as expected)
> > and are fixing them one-by-one.
> >
> > This is the parent issue where Jiri Locker made a great effort to split
> > child issues (test failures):
> >
> > https://github.com/apache/incubator-kie-drools/issues/5678
> >
> > Those child issues are fine grained, so it would be nice to contribute!
> >
> > If you are willing to contribute, please put you as an assignee (if you
> > have a committer permission) or post a comment to avoid duplicate work on
> > the child issue.
> >
> > Also you can track the progress by watching the parent issue and share your
> > thoughts any time you want.
> >
> > Cheers,
> > Toshiya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> For additional commands, e-mail: dev-help@kie.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
For additional commands, e-mail: dev-help@kie.apache.org
Re: new Antlr4 based DRL parser development
Posted by Toshiya Kobayashi <to...@gmail.com>.
Hi Alex,
Thank you very much for the important suggestions.
> I'm a bit concerned how far this
> implementation has gone without a previous proposal to be discussed as
> stated in our community communication guidelines [1].
https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
```
Any significant change or new work streams must be discussed on the mailing
list before that work can be accepted.
```
This development had started before the apache migration, but I agree that
it should be discussed as a "proposal".
I'll send an email with [PROPOSAL] for the discussion.
> I'm also concern that this will introduce complexity and
> risk while we still improving the codebase stability
DRL parser implementation is isolated under `drools-drl` modules, so
complexity wouldn't likely be large. Once the new parser will replace the
old parser, the complexity should be reduced because the old parser has
lots of hard-coding on generated codes.
Regarding stability, this is something to be discussed further, but
personally I guess we will keep both old and new parsers until we are
confident that the new parser has matured. During the time, we would have
the complexity, but users can switch back to the old parser when there is
an issue with a new parser.
> So I would like to better understand what's the timeline expected to
> see this incorporated into the codebase, and besides the library
> upgrade, what are the goals of this change.
This doesn't target v10.0 release. Fixing all issues keeping backward
compatibility is a large effort. I don't expect that we can complete it
within a month. Even if we can do it more quickly, I don't want to disrupt
the v10.0 release, so we will wait to incorporate it.
The goal of this change is just code maintainability. This is an
implementation detail, so should not impact users.
> I'm not sure what you mean by Drools team, as far as I know we
> are all part of a single community under KIE.
Ahh, sorry, I should not say "Drools team", rather, "Currently Mario, Jiri
and I are actively working on this, but anyone would be welcome!".
Regards,
Toshiya
On Mon, Feb 26, 2024 at 10:58 PM Alex Porcelli <al...@porcelli.me> wrote:
> Toshiya,
>
> Thank you for the heads up, however I'm a bit concerned how far this
> implementation has gone without a previous proposal to be discussed as
> stated in our community communication guidelines [1].
>
> Although I really appreciate the effort to keep up to date with
> technology advances (ANTLR v4 has been around for soooo many years
> now), but I'm also concern that this will introduce complexity and
> risk while we still improving the codebase stability (ie. issues [2]
> [3] [4] [5]).
>
> So I would like to better understand what's the timeline expected to
> see this incorporated into the codebase, and besides the library
> upgrade, what are the goals of this change.
>
> Note: I'm not sure what you mean by Drools team, as far as I know we
> are all part of a single community under KIE. Although we might have
> more areas of specialization, I don't think we are split into
> different teams.
>
> [1] -
> https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
> [2] - https://github.com/apache/incubator-kie-issues/issues/941
> [3] - https://github.com/apache/incubator-kie-issues/issues/903
> [4] - https://github.com/apache/incubator-kie-issues/issues/968
> [5] - https://github.com/apache/incubator-kie-issues/issues/969
>
>
> On Mon, Feb 26, 2024 at 3:37 AM Toshiya Kobayashi
> <to...@gmail.com> wrote:
> >
> > Hello,
> >
> > In the drools team, we are developing a new Antlr4 based DRL parser. The
> > current parser is Antlr3 based and contains lots of hard-coded logic in a
> > generated java code (DRL6Parser.java), so it's hard to maintain.
> >
> > Originally the new parser was developed under
> > https://github.com/kiegroup/drools-lsp/ at the early stage. Now we are
> > testing the new DRL parser with the existing drool unit tests using a
> > feature branch `dev-new-parser`. We hit lots of test failures (as
> expected)
> > and are fixing them one-by-one.
> >
> > This is the parent issue where Jiri Locker made a great effort to split
> > child issues (test failures):
> >
> > https://github.com/apache/incubator-kie-drools/issues/5678
> >
> > Those child issues are fine grained, so it would be nice to contribute!
> >
> > If you are willing to contribute, please put you as an assignee (if you
> > have a committer permission) or post a comment to avoid duplicate work on
> > the child issue.
> >
> > Also you can track the progress by watching the parent issue and share
> your
> > thoughts any time you want.
> >
> > Cheers,
> > Toshiya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
> For additional commands, e-mail: dev-help@kie.apache.org
>
>
Re: new Antlr4 based DRL parser development
Posted by Alex Porcelli <al...@porcelli.me>.
Toshiya,
Thank you for the heads up, however I'm a bit concerned how far this
implementation has gone without a previous proposal to be discussed as
stated in our community communication guidelines [1].
Although I really appreciate the effort to keep up to date with
technology advances (ANTLR v4 has been around for soooo many years
now), but I'm also concern that this will introduce complexity and
risk while we still improving the codebase stability (ie. issues [2]
[3] [4] [5]).
So I would like to better understand what's the timeline expected to
see this incorporated into the codebase, and besides the library
upgrade, what are the goals of this change.
Note: I'm not sure what you mean by Drools team, as far as I know we
are all part of a single community under KIE. Although we might have
more areas of specialization, I don't think we are split into
different teams.
[1] - https://cwiki.apache.org/confluence/display/KIE/Communication+within+Apache
[2] - https://github.com/apache/incubator-kie-issues/issues/941
[3] - https://github.com/apache/incubator-kie-issues/issues/903
[4] - https://github.com/apache/incubator-kie-issues/issues/968
[5] - https://github.com/apache/incubator-kie-issues/issues/969
On Mon, Feb 26, 2024 at 3:37 AM Toshiya Kobayashi
<to...@gmail.com> wrote:
>
> Hello,
>
> In the drools team, we are developing a new Antlr4 based DRL parser. The
> current parser is Antlr3 based and contains lots of hard-coded logic in a
> generated java code (DRL6Parser.java), so it's hard to maintain.
>
> Originally the new parser was developed under
> https://github.com/kiegroup/drools-lsp/ at the early stage. Now we are
> testing the new DRL parser with the existing drool unit tests using a
> feature branch `dev-new-parser`. We hit lots of test failures (as expected)
> and are fixing them one-by-one.
>
> This is the parent issue where Jiri Locker made a great effort to split
> child issues (test failures):
>
> https://github.com/apache/incubator-kie-drools/issues/5678
>
> Those child issues are fine grained, so it would be nice to contribute!
>
> If you are willing to contribute, please put you as an assignee (if you
> have a committer permission) or post a comment to avoid duplicate work on
> the child issue.
>
> Also you can track the progress by watching the parent issue and share your
> thoughts any time you want.
>
> Cheers,
> Toshiya
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@kie.apache.org
For additional commands, e-mail: dev-help@kie.apache.org