HI Steffen,

Thanks for the report, number pleases me :)

Speaking of tool for porting, I was recently showed this one, I don't have any experience with it:
https://github.com/ObjectProfile/Pharo2VW

Speaking of character ranges, there is currently available:
#letter asPParser (to recognize character matching #isLetter predicate)
#word asPParser (characters matching #isAlphaNumeric predicate)
#digit (#isDigit predicate)
#hex ([a-fA-F])
#space
#blank
#any

You can find definitions in PP2NodeFactory, see implementation of #hex, which is probably closest to what you want. For your convenience, your project can extend the class to fit your needs.

You can also specify:$a asPParser / $b asPParser / $c asPParser / #digit asPParser ... PetitParser2 can recognize this pattern and makes a character class during optimization pass.

On Sat, Oct 13, 2018 at 5:38 PM Steffen M��rcker <merkste@web.de> wrote:
Hi,

I gave PetitParser 2 a try and I am pretty impressed by the results,��
please see the updated table below. =) Again, that's pure parsing and��
Array-based AST-building. Moving to PP2 was indeed as easy as sending��
#asPParser and working around character ranges ($a - $z). Is there a��
preferred way to do the latter?

Jan mentioned that there might be an automated tool to port stuff to��
VisualWorks. Do you have a name? And again the old question: what is the��
preferred workflow to exchange code between the two dialects? Till now I��
stick to FileOut30.

input�� Prism�� �� �� �� Storm�� Xtreams.PEG�� PP�� �� ��PP2
size�� ��parse check�� check�� parse cache�� parse�� parse optim
230kB�� ��0.1s�� ��10s�� �� ��6s�� �� ��9s�� �� 3s�� �� ��2s�� �� ��4s�� 0.2s
544kB�� ��0.2s�� ��90s�� �� 20s�� �� 20s�� �� 7s�� �� ��5s�� �� ��9s�� 0.5s
1.1MB�� ��0.4s�� 392s�� �� 46s�� �� 34s�� ��13s�� �� ��8s�� �� 15s�� 1.0s
1.4MB�� ��0.8s 1091s�� �� 85s�� �� 47s�� ��20s�� �� 12s�� �� 20s�� 1.3s
2.2MB�� �� �� �� �� �� �� �� �� �� �� �� 63s�� ��30s�� �� 16s�� �� 27s�� 1.9s
2.9MB�� �� �� �� �� �� �� �� �� �� �� �� 81s�� ��44s�� �� 20s�� �� 34s�� 2.5s
3.8MB�� �� �� �� �� �� �� �� �� �� �� ��107s�� ��61s�� �� 25s�� �� 45s�� 3.1s
4.4MB�� �� �� �� �� �� �� �� �� �� �� ��123s�� ��76s�� �� 30s�� �� 56s�� 3.7s

Best, Steffen


Am .10.2018, 05:22 Uhr, schrieb Tudor Girba <tudor@tudorgirba.com>:

> Hi,
>
> Interesting experiment. Thanks for sharing!
>
> I assume that you tried the original PetitParser. PetitParser2 offers��
> the possibility to optimize the parser (kind of a compilation), and this��
> provides a significant speedup:
> https://github.com/kursjan/petitparser2
>
> Would you be interested in trying this out?
>
> Cheers,
> Doru
>
>
>
>> On Oct 4, 2018, at 10:46 PM, Steffen M��rcker <MerkSte@web.de> wrote:
>>
>> I gave Xtreams-Parsing and PetitParser a shot and like to share my��
>> findings.[*]
>>
>> The task was to parse the modelling language of the probabilistic model��
>> checker PRISM. I've written a grammer of about 130 definitions in the��
>> Xtreams DSL, which is close to Bryan Fords syntax. To avoid doing it��
>> all again with PetitParser, I wrote a PetitParserGenerator that takes��
>> the DSL and builds a PetitParser.
>>
>> The numbers below are just parsing times, no further actions involved.��
>> For reference I show the times from PRISM (which uses JavaCC), too --��
>> although they involve additional verification and normalization steps��
>> on the AST.
>>
>> input�� Prism�� �� XP�� ��PP�� �� ��
>> 230kB�� �� 14s�� �� 9s�� ��2s
>> 544kB�� �� �� �� 121s�� ��20s�� ��5s
>> 1.1MB�� �� �� �� 421s�� ��34s�� ��8s
>> 1.4MB�� 1091s�� ��47s�� 12s
>> 2.2MB�� �� �� �� �� 63s�� 16s
>> 2.9MB�� �� �� �� �� 81s�� 20s
>> 3.8MB�� �� �� �� ��107s�� 25s
>> 4.4MB�� �� �� �� ��123s�� 30s
>>
>> Please note that these times are not representative at all. It's just a��
>> single example and I put zero effort in optimization. However, I am��
>> quite satisfied with the results.
>>
>> [*] I was already familiar with the DSL of Xtreams-Parsing, which I��
>> like very much. I did not consider SmaCC, as I find PEGs easier to use.
>>
>> Best, Steffen
>>
>>
>>
>> Am .10.2018, 20:14 Uhr, schrieb Steffen M��rcker <merkste@web.de>:
>>
>>> Dear all,
>>>
>>> I have two questions regarding parsing frameworks.
>>>
>>> 1) Do you have any insights on the performance of SmaCC VS Xtreams��
>>> Parsing VS PetitParser?
>>> 2) Has anybody started to port PetitParser 2 from Pharo to VW? Is it��
>>> worth the effort?
>>>
>>> Sorry for cross-posting, I thought this might interest both��
>>> communities.
>>>
>>> Cheers, Steffen
>
> --
> www.feenk.com
>
> "No matter how many recipes we know, we still value a chef."
>
>
>
>
>
>
>