Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-09-08

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:17 Idiosyncrat joined #marpa
00:26 Idiosyncrat https://crates.io/crates/marpa/
00:26 Idiosyncrat Above link is said to be Marpa (libmarpa?) bindings for Rust.
00:27 Idiosyncrat Caveat: this is the first I've heard of this site, so exercise all the usual cautions
01:26 ronsavage joined #marpa
04:59 Pursuit Who's responsible for the memory pointed to by p_pvalue once it's been set in marpa_r_earley_set_values_set? Will the recognizer free it or is it up to the application?
05:21 idiosyncrat1 joined #marpa
05:22 idiosyncrat1 Pursuit: re http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11182661
05:22 idiosyncrat1 The application
05:22 idiosyncrat1 Libmarpa simply stores it -- it will *never* indirect from it.
05:22 idiosyncrat1 So it does not have to be a valid pointer.
05:23 idiosyncrat1 You could, for example, use it to store an integer value, if you have available appropriate macros for safe conversion back and forth.
05:24 idiosyncrat1 By the way, storing values in the Earley sets is kind of a hack, to work around the efficiency issues with Perl --
05:25 idiosyncrat1 A lot of applications want to store an value per Earley set, and doing so as a Perl array was vastly more expensive then asking Libmarpa to set aside an extra few bytes per Earley set.
05:26 idiosyncrat1 An interface writer targeting a more efficient language ...
05:27 * idiosyncrat1 thinks of example and just pulls Rust out of the air :-)
05:27 idiosyncrat1 might well want to omit those calls entirely -- it's better just to store the values in a Rust array, would be my guess.
05:27 Pursuit Hehe, yeah, that's what I'm working on :D
05:28 Pursuit And yeah, I guess that's what I'll do
05:28 Pursuit the rust crate that you linked earlier this evening is my work so far. I'm targeting 1:1 feature-pairity with libmarpa, complete with all of the errors and such
05:29 idiosyncrat1 If I were doing it, I would simply omit marpa_r_earley_set_values_set
05:29 idiosyncrat1 and the others like it.
05:32 pczarn joined #marpa
06:00 idiosyncrat1 Good night!
06:01 idiosyncrat1 left #marpa
06:18 CQ joined #marpa
06:41 ronsavage joined #marpa
08:23 rns http://irclog.perlgeek.de/m​arpa/2015-03-06#i_10235207 -- a discussion about marpa_r_earley_set_value() and its use -- http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11182720
08:24 rns cf. http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11182720 and http://irclog.perlgeek.de/m​arpa/2015-03-06#i_10235269
08:26 rns so, yeah, the things in marpa_r_earley_set_values*() seems to better left to the application level.
08:26 rns s/to better/to be better/
08:29 ronsavage joined #marpa
09:07 spacebat joined #marpa
10:34 jddurand joined #marpa
10:37 jddurand Hello - am I right saying that, when we are paused somewhere in a SLIF'S G1 rule (but /not/ at positions 0 or -1), the result of lexemes_expected() will always be the same. ..? Thanks.
12:42 pczarn joined #marpa
13:19 spacebat I finally got around to doing another marpa tutorial, the deny-allow one. I have a few questions though :)
13:20 spacebat http://marpa-guide.github.io/chapter3.html
13:22 spacebat I made a change to allow multiple users to appear in an allow/deny rule, but in so doing, the rule matched multiple lines, matching Deny on the next line as another user
13:23 spacebat so I added \n as a lexeme called eol and made all the rules end in eol - that worked fine, but then I started getting \n in the parse tree, and discarding them raised other errors
13:25 spacebat I guess I'm looking for a way to use such an element to delimit a rule yet not collect it in the parse tree
13:30 rns perhaps you can find parens useful -- "Within an alternative, primaries may be enclosed in parentheses. A primary enclosed in parentheses is hidden from Marpa's semantics." https://metacpan.org/pod/distribution/Marp​a-R2/pod/Scanless/DSL.pod#RHS-alternatives
13:31 spacebat thanks rns I'll look into that
13:33 spacebat also, in order to allow multiple users and lists of users (prefixed by @), I wound up nesting rules
13:33 spacebat user_decl ::= user '=' user_list
13:34 spacebat user_list ::= user_spec+
13:34 spacebat user_spec ::= user | list_ref
13:34 spacebat that works but the results in the parse tree are deeply nested
13:38 spacebat is there a way to prevent the nesting in the output I wonder
13:44 CQ joined #marpa
13:45 rns specebat: you can use semantic actions and action adverb to flatten as needed -- https://metacpan.org/pod/Marpa​::R2::Semantics#Lexeme-actions
13:45 rns s/specebat/spacebat/, sorry
14:00 spacebat thanks again rns++
15:15 CQ idiosyncrat_ maybe this kind of a post is needed to convince people that marpa is "a natural way of parsing" ;) http://stackoverflow.com/questions/​1218390/what-is-your-most-productiv​e-shortcut-with-vim/1220118#1220118
15:26 Idiosyncrat joined #marpa
15:28 Idiosyncrat jdurand: re http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11183930
15:28 Idiosyncrat during a single pause the result of lexemes_expected() should always be the same.
15:29 Idiosyncrat If you pause using the same rule, but at multiple locations, other rules may come into play, and lexemes_expected() may produce different results
15:29 Idiosyncrat that would depend on the grammar
15:41 Idiosyncrat CQ: re http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11185283
15:41 Idiosyncrat The tutorials I've written come as close as I am able to get to that.
15:42 Idiosyncrat Other folks have written tutorials also.
15:42 CQ Idiosyncrat: yeah... I keep thinking that if you want to do real parsing and need something like marpy, you'll find your way there
15:42 Idiosyncrat A problem is that folks are strangely persistent in using parsers that are a misery to use
15:43 CQ there is enough information... if you compare the amount of posts on Marpa vs. other parsers, there doesn't seem to be a logt specifically on any other parser
15:43 Idiosyncrat I thought folks would just get sick of them, and in the case of yacc/bison they basically have.
15:44 Idiosyncrat I was reluctant to actually get into dissing other parsers, but finally all the PEG usage for so long got too much for me
15:45 Idiosyncrat I think we may have hit a turning point, though.
15:46 Idiosyncrat Now if you talk about parsing on IRC or other forums, and you don't mention Marpa, enough people know about it to say, "Whoa, dude, you're missing something"
15:46 CQ how do you measure / see the uptake of marpa? are there cpan stats or downloads measured somewhere? google hits?
15:47 Idiosyncrat CPAN/metacpan don't release stats and it is not clear how useful they would be
15:47 CQ rotflmao: MARPA: Modification and Replacement Parts Association
15:48 Idiosyncrat Actually my favorite Marpa competitor (aside from the namesake saint) is the Mid-Anglia Rail Passengers Association
15:49 Idiosyncrat Anyway, I don't have a good way of measuring Marpa uptake
15:50 CQ then maybe a weekly google lookup to track search results is an indicator... http://search.cpan.org/~rokr/Google​-Search-0.028/lib/Google/Search.pm#$search-%3Ematch%28_%3Ccode%3E_%29 can return search results in scalar context
15:51 CQ s/search results/number of search results/
15:52 Idiosyncrat I do do searches, but they aren't good for long term trends, because Google keeps changing its search engine.
15:52 CQ ah.
15:52 Idiosyncrat Google's changes are usually improvements,
15:53 Idiosyncrat but they wreck any long-term comparisons by number of search results.
15:53 Idiosyncrat If you want to know how to study web uptake ...
15:54 Idiosyncrat one way is to study what Gabor Szabo of Perl Weekly does
15:55 Idiosyncrat He's as good as anyone at tracking web uptake, and it's hard.
15:56 CQ Idiosyncrat: has he written anything on it? I'd be interested in that... it comes up every now and then in projects
15:56 Idiosyncrat Right now I have the disadvantage that Marpa hits are spread over many sites, most of which do not track hits.
15:56 CQ so grab marpa.me or marpa.one and consolidate...
15:56 Idiosyncrat Gabor has done lots of blogs on it -- he tells all
15:57 CQ ok, I'll read up on it
15:57 CQ thanks for the pointer
15:58 Idiosyncrat Gabor consolidates (and advises me to do so) but the advantage of multiple sites is that each of the other sites are there because someone is helping me
15:58 Idiosyncrat which saves me time to work on Marpa
15:58 CQ Idiosyncrat: wordpress with several authors.... but yes, it is work
15:59 CQ and the content is probably more important
15:59 Idiosyncrat Also, knowing the numbers is *not* always a good thing.
15:59 Idiosyncrat Voting sites in the past have been hard on Marpa, because folks "know" the answer already ...
16:00 CQ well, I guess the really interesting part is where they are coming from... seeing the search context, and being able to address that
16:00 Idiosyncrat and Marpa is math-y which guarantees a lot of quick downvotes
16:00 CQ aren't all parsers though?
16:01 Idiosyncrat Regular expressions *were* math, but they've become so familiar to working programmers they are not considered math.
16:02 CQ sure, and I think alot of people do as much as possible before switching ot a parser because it's a step change in learning effort
16:02 Idiosyncrat That is, if you say, as one person will on perlmonks, that all Theory of Computation is nonsense, he's not talking about regular expressions
16:03 Idiosyncrat Recursive descent is not really math-y -- it's calling subroutines.
16:03 Idiosyncrat CQ: that last is a good point.
16:04 Idiosyncrat If you've got a big parsing project, which represents a corporate investment of person-years and big $$, you are understandably very reluctant to bet it on a new technology
16:04 Idiosyncrat Even one that you think is very promising.
16:11 Idiosyncrat CQ: re http://stackoverflow.com/questions/​1218390/what-is-your-most-productiv​e-shortcut-with-vim/1220118#1220118
16:12 Idiosyncrat Actually that is a very good vi tutorial.  I'm a long time vi users, and I've just learned some handy new tricks.
16:13 Idiosyncrat It'd be hard to duplicate for Marpa.  It relies on giving one example after another, which works because vi commands are a few characters long
16:13 Idiosyncrat The equivalent for Marpa would be a fat book.
16:13 pczarn Actually, when programmers start looking for Marpa's disadvantages and outright dismiss it, they rationalize reluctance to make learning effort.
16:14 Idiosyncrat Yes.
16:14 CQ agree
16:14 Idiosyncrat Also, there are fashions in learning.  That is folks are quite eager to learn new OO systems.
16:14 Idiosyncrat Because OO is cool.
16:15 Idiosyncrat When I first started studying parsing in the 1970's, *parsing* was cool
16:17 pczarn OO is not math-y. It's presented as not too hard to learn.
16:19 Idiosyncrat Speaking of math-y, I'm still working on the revised Marpa paper.
16:20 Idiosyncrat Math-y or not, I'm hoping it will be helpful -- it presents Earley's algorithm in a new way ...
16:20 Idiosyncrat and I think it may help folks understand Earley's and Leo's algorithm, and Marpa
16:22 Idiosyncrat Already, I think more people have learned Leo's algorithm from my paper than from Leo's
16:25 pczarn Yes, I learned it by reading section 6 in reverse order.
16:34 pczarn I know the recognizer's passes are ordered like this, but the section about Leo's algorithm feels backwards.
16:46 Idiosyncrat pczarn: it will get a rewrite shortly
16:47 Idiosyncrat http://research.swtch.com/yyerror
16:47 Idiosyncrat This seems like something Marpa could do much better
17:32 MerittClarksdale What do you think of recursive descent?
18:33 idiosyncrat1 joined #marpa
18:33 idiosyncrat1 http://jeffreykegler.github.io/Ocean-of-Aware​ness-blog/individual/2015/08/fast_handy.html
18:34 idiosyncrat1 MerittClarksdale: RD is the correct choice in some very limited cirucumstances IMHO
18:35 idiosyncrat1 In the above-pasted link, at the very end, in a section on "When NOT to use Marpa", I give details.
18:46 idiosyncrat1 left #marpa
20:11 koo7 joined #marpa
20:42 aredridel joined #marpa
21:51 Idiosyncrat AFK
22:04 ronsavage joined #marpa
22:31 ronsavage CQ: Re http://irclog.perlgeek.de/m​arpa/2015-09-08#i_11185545. We might consolidate, but actually we want people all over the internet to discuss Marpa. And yes, I am close to registering a new domain name, but I don't think it'll be some magical solution. It would help to have $n contributors sending links to all these discussions. I can get some by backlogging here, of course. We'll see.
22:59 spacebat I'm playing with a tutorial grammar and found I had to create an eol lexeme and put it at the end of my rules to stop the parser from running over multiple lines in a single rule
22:59 ronsavage cfg, the Rust interface, is now on Marpa's homepage. And yes, I know :-( the latest Datatable handling of Novels/Modules/Wines has lost the search feature.
23:00 spacebat that put a bunch of newlines in my parse tree, last night I was advised to try putting parens around the eol to prevent it from being captured
23:00 ronsavage And yes, I know the names using utf8 are corrupted, probably by double-encoding. Sigh.
23:00 spacebat though when I did that, my grammar didn't match at all
23:01 spacebat is there a more idiomatic way of saying this lexeme should not wind up in the parse tree?
23:01 ronsavage Now, back to $work.
23:05 spacebat I tried indicating the lexeme should be discarded but that produced errors compiling the grammar
23:09 Pursuit ssh titan
23:09 Pursuit whoops, this is not a terminal
23:10 spacebat it could be
23:10 spacebat Pursuit@titan$
23:14 spacebat according to the docs, L0 rule alternatives do not become nodes in the parse tree, so I substitued eol with its lexeme definition, [\n]+ but that also fails to compile
23:17 spacebat I guess its a part of a rule, not a whole L0 rule alternative itself
23:17 spacebat rule ::= cmd_type user_list eol
23:18 spacebat anyway, its time for $work, hopefully a flash of insight will strike me during the day

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary