Quantcast

Announce: grappa 1.0.0-beta.6

classic Classic list List threaded Threaded
7 messages Options
fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Announce: grappa 1.0.0-beta.6

fge
Yes, this is quite soon after beta.5. And it is not to fix a brown paper bag bug ;)

The major feature of this new version is the appearance of a trie-based string matcher.

A little explanation of why I did that since after all, there is firstOf...

Well, OK, you should know that firstOf(s1, s2, s3) where s1 etc are strings also yields a special matcher (a FirstOfStringsMatcher). But the trie matcher is different in two respects:

* its matches are "atomic"; as such, at this moment, it cannot be used with the same efficiency than firstOf in a RecoveringParseRunner;
* it is independent of the ordering of its arguments; well, so is FirstOfStringsMatcher, except that trie() accepts ("long", "longer") as arguments whereas firstOf() does not (it requires "longer" before "long");
* its runtime is independent of the initial set size: it maintains a sorted array of which characters it has to match next, so finding the next node to run is as simple as Arrays.binarySearch().

In the plans: making it work with a RecoveringParseRunner and more importantly making a Unicode trie: right now it's char by char, which means surrogate pairs are split (and Java allows you to create strings with incomplete surrogate pairs or even "non characters" anyway -- that makes handling this stuff quite difficult...)

Also some other various code cleanups etc etc.

In other news, grappa-support is usable on the performance testing front; it requires however that you have an API key at https://microbenchmarks.appspot.com. The part to generate the source code of a generated parser is still not done... I'm going to work on it.

Happy parsing!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

chbussler
Hi,

thanks. Just tried it and I see that TracingParseRunner.getLog() has been deprecated. What method do I use now to get the logs?

Thanks!

Christoph


On May 13, 2014, at 6:46 AM, fge [via parboiled users] <[hidden email]> wrote:

Yes, this is quite soon after beta.5. And it is not to fix a brown paper bag bug ;)

The major feature of this new version is the appearance of a trie-based string matcher.

A little explanation of why I did that since after all, there is firstOf...

Well, OK, you should know that firstOf(s1, s2, s3) where s1 etc are strings also yields a special matcher (a FirstOfStringsMatcher). But the trie matcher is different in two respects:

* its matches are "atomic"; as such, at this moment, it cannot be used with the same efficiency than firstOf in a RecoveringParseRunner;
* it is independent of the ordering of its arguments; well, so is FirstOfStringsMatcher, except that trie() accepts ("long", "longer") as arguments whereas firstOf() does not (it requires "longer" before "long");
* its runtime is independent of the initial set size: it maintains a sorted array of which characters it has to match next, so finding the next node to run is as simple as Arrays.binarySearch().

In the plans: making it work with a RecoveringParseRunner and more importantly making a Unicode trie: right now it's char by char, which means surrogate pairs are split (and Java allows you to create strings with incomplete surrogate pairs or even "non characters" anyway -- that makes handling this stuff quite difficult...)

Also some other various code cleanups etc etc.

In other news, grappa-support is usable on the performance testing front; it requires however that you have an API key at https://microbenchmarks.appspot.com. The part to generate the source code of a generated parser is still not done... I'm going to work on it.

Happy parsing!


If you reply to this email, your message will be added to the discussion below:
http://users.parboiled.org/Announce-grappa-1-0-0-beta-6-tp4024326.html
To start a new topic under parboiled users, email [hidden email]
To unsubscribe from parboiled users, click here.
NAML

fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

fge
Hello,

On Tue, May 13, 2014 at 6:01 PM, chbussler [via parboiled users]
<[hidden email]> wrote:
> Hi,
>
> thanks. Just tried it and I see that TracingParseRunner.getLog() has been
> deprecated. What method do I use now to get the logs?
>
> Thanks!
>
> Christoph
>

It is the return type which is deprecated (Sink). Do you intend to
write to what is now replaced with a CharSink?

(note: maybe this should be opened as an issue? I am sometimes pretty
violent on deprecation...)

--
Francis Galiegue, [hidden email], https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

chbussler
Hi,

not sure I follow. The method getLog() is deprecated, and so I am wondering what method to use instead. This might be very well because you deprecated Sink, but that does still make the method getLog() deprecated. As far as I can see there is no other method that was added instead.

If this is an issue, I don't know; right now for me this looks like a regression.

There is nothing wrong with deprecation, however, it would help if deprecated methods/classes/etc. would be noted in the release notes with a remark how to replace the deprecated functionality (this is the second time I had to bother you on a deprecation issue because I was not able to figure this out myself - sorry for that).

Deprecation might be because of refactoring. But I would assume it'll not take away functionality that is being relied on (regression). I am happy to try out the changes and new ways right away, but to avoid bothering you would require a bit more documentation.

Thanks!

Christoph


On May 13, 2014, at 9:26 AM, fge [via parboiled users] <[hidden email]> wrote:

Hello,

On Tue, May 13, 2014 at 6:01 PM, chbussler [via parboiled users]
<<a href="x-msg://443/user/SendEmail.jtp?type=node&amp;node=4024328&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
> Hi,
>
> thanks. Just tried it and I see that TracingParseRunner.getLog() has been
> deprecated. What method do I use now to get the logs?
>
> Thanks!
>
> Christoph
>

It is the return type which is deprecated (Sink). Do you intend to
write to what is now replaced with a CharSink?

(note: maybe this should be opened as an issue? I am sometimes pretty
violent on deprecation...)

--
Francis Galiegue, <a href="x-msg://443/user/SendEmail.jtp?type=node&amp;node=4024328&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email], https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)



If you reply to this email, your message will be added to the discussion below:
http://users.parboiled.org/Announce-grappa-1-0-0-beta-6-tp4024326p4024328.html
To start a new topic under parboiled users, email [hidden email]
To unsubscribe from parboiled users, click here.
NAML

fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

fge
On Tue, May 13, 2014 at 6:36 PM, chbussler [via parboiled users]
<[hidden email]> wrote:
> Hi,
>
> not sure I follow. The method getLog() is deprecated, and so I am wondering
> what method to use instead. This might be very well because you deprecated
> Sink, but that does still make the method getLog() deprecated. As far as I
> can see there is no other method that was added instead.
>

If I asked that, it is because I am genuinely curious: what do you use
the .getLog() method for?

It only returns a Sink<String> which the TracingParseRunner writes its
output to; does it mean you want to write to the same sink as
TracingParseRunner?

> If this is an issue, I don't know; right now for me this looks like a
> regression.
>

.getLog() is not deprecated but Sink it. It is replaced with CharSink
or PrimitiveSink depending on the usage. And note that I did say in
which version it will be removed (1.1).

> There is nothing wrong with deprecation, however, it would help if
> deprecated methods/classes/etc. would be noted in the release notes with a
> remark how to replace the deprecated functionality (this is the second time
> I had to bother you on a deprecation issue because I was not able to figure
> this out myself - sorry for that).
>
> Deprecation might be because of refactoring. But I would assume it'll not
> take away functionality that is being relied on (regression). I am happy to
> try out the changes and new ways right away, but to avoid bothering you
> would require a bit more documentation.
>

In the case of .getLog() it is really because I don't see why one
would use it in the first place but apparently I am wrong ;)

Can you please open an issue on the project?

Thanks,
--
Francis Galiegue, [hidden email], https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

chbussler

On May 13, 2014, at 9:52 AM, fge [via parboiled users] <[hidden email]> wrote:

On Tue, May 13, 2014 at 6:36 PM, chbussler [via parboiled users]
<<a href="x-msg://488/user/SendEmail.jtp?type=node&amp;node=4024330&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
> Hi,
>
> not sure I follow. The method getLog() is deprecated, and so I am wondering
> what method to use instead. This might be very well because you deprecated
> Sink, but that does still make the method getLog() deprecated. As far as I
> can see there is no other method that was added instead.
>

If I asked that, it is because I am genuinely curious: what do you use
the .getLog() method for?

CB> See here: https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging The getLog() gets you the detailed actions that the parser is doing and this is a majorly important debugging tool. Without that it would sometimes be impossible to figure out whats going on. Maybe the name getLog() is not a good one, but it gives me the info I really need.


It only returns a Sink<String> which the TracingParseRunner writes its
output to; does it mean you want to write to the same sink as
TracingParseRunner?

CB> I am not familiar with the details, I followed what is proposed in https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging So any other way to get to the same data/info would do.


> If this is an issue, I don't know; right now for me this looks like a
> regression.
>

.getLog() is not deprecated but Sink it. It is replaced with CharSink
or PrimitiveSink depending on the usage. And note that I did say in
which version it will be removed (1.1).

CB> Well, getLog() shows up as deprecated and is flagged during compilation. So therefore it is:-)

It might be that you deprecate a class, however, this causes methods to be deprecated also (as in this case). So there is a cascading effect and that might be of concern also.


> There is nothing wrong with deprecation, however, it would help if
> deprecated methods/classes/etc. would be noted in the release notes with a
> remark how to replace the deprecated functionality (this is the second time
> I had to bother you on a deprecation issue because I was not able to figure
> this out myself - sorry for that).
>
> Deprecation might be because of refactoring. But I would assume it'll not
> take away functionality that is being relied on (regression). I am happy to
> try out the changes and new ways right away, but to avoid bothering you
> would require a bit more documentation.
>
In the case of .getLog() it is really because I don't see why one
would use it in the first place but apparently I am wrong ;)

CB> Looks like there is not regression test on this. Again, this is where it is being used: https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging


Can you please open an issue on the project?


CB> OK, I will. Np.

Thanks,

Christoph

Thanks,
--
Francis Galiegue, <a href="x-msg://488/user/SendEmail.jtp?type=node&amp;node=4024330&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email], https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)



If you reply to this email, your message will be added to the discussion below:
http://users.parboiled.org/Announce-grappa-1-0-0-beta-6-tp4024326p4024330.html
To start a new topic under parboiled users, email [hidden email]
To unsubscribe from parboiled users, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Announce: grappa 1.0.0-beta.6

chbussler
In reply to this post by fge
Done: https://github.com/parboiled1/grappa/issues/2

On May 13, 2014, at 10:02 AM, Christoph Bussler <[hidden email]> wrote:


On May 13, 2014, at 9:52 AM, fge [via parboiled users] <[hidden email]> wrote:

On Tue, May 13, 2014 at 6:36 PM, chbussler [via parboiled users]
<<a href="x-msg://488/user/SendEmail.jtp?type=node&amp;node=4024330&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
> Hi,
>
> not sure I follow. The method getLog() is deprecated, and so I am wondering
> what method to use instead. This might be very well because you deprecated
> Sink, but that does still make the method getLog() deprecated. As far as I
> can see there is no other method that was added instead.
>

If I asked that, it is because I am genuinely curious: what do you use
the .getLog() method for?

CB> See here: https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging The getLog() gets you the detailed actions that the parser is doing and this is a majorly important debugging tool. Without that it would sometimes be impossible to figure out whats going on. Maybe the name getLog() is not a good one, but it gives me the info I really need.


It only returns a Sink<String> which the TracingParseRunner writes its
output to; does it mean you want to write to the same sink as
TracingParseRunner?

CB> I am not familiar with the details, I followed what is proposed in https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging So any other way to get to the same data/info would do.


> If this is an issue, I don't know; right now for me this looks like a
> regression.
>

.getLog() is not deprecated but Sink it. It is replaced with CharSink
or PrimitiveSink depending on the usage. And note that I did say in
which version it will be removed (1.1).

CB> Well, getLog() shows up as deprecated and is flagged during compilation. So therefore it is:-)

It might be that you deprecate a class, however, this causes methods to be deprecated also (as in this case). So there is a cascading effect and that might be of concern also.


> There is nothing wrong with deprecation, however, it would help if
> deprecated methods/classes/etc. would be noted in the release notes with a
> remark how to replace the deprecated functionality (this is the second time
> I had to bother you on a deprecation issue because I was not able to figure
> this out myself - sorry for that).
>
> Deprecation might be because of refactoring. But I would assume it'll not
> take away functionality that is being relied on (regression). I am happy to
> try out the changes and new ways right away, but to avoid bothering you
> would require a bit more documentation.
>
In the case of .getLog() it is really because I don't see why one
would use it in the first place but apparently I am wrong ;)

CB> Looks like there is not regression test on this. Again, this is where it is being used: https://github.com/sirthias/parboiled/wiki/Grammar-and-Parser-Debugging


Can you please open an issue on the project?


CB> OK, I will. Np.

Thanks,

Christoph

Thanks,
--
Francis Galiegue, <a href="x-msg://488/user/SendEmail.jtp?type=node&amp;node=4024330&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email], https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)



If you reply to this email, your message will be added to the discussion below:
http://users.parboiled.org/Announce-grappa-1-0-0-beta-6-tp4024326p4024330.html
To start a new topic under parboiled users, email [hidden email]
To unsubscribe from parboiled users, click here.
NAML


Loading...