Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-02-21

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

All times shown according to UTC.

Time Nick Message
00:03 pczarn Also, you can think about lexing and parsing in separation thanks to that barrier impenetrable by ambiguity.
00:10 VsyachePuz is somewhere an algorithm to build these longes possible tokens ?
00:19 pczarn Some regex engines will match leftmost-longest alternative.
00:20 pczarn Or you can run all regexes separately.
00:21 pczarn Marpa basically uses a second fully-featured parser as a lexer
00:29 pczarn which is described here http://search.cpan.org/~jkegl/Marpa-R2-3.000000/pod/Scanless.pod
00:29 pczarn good night
00:42 VsyachePuz so, this all done only to join 2 grammars - target grammar and grammar for whitespace separation, right?
00:44 Idiosyncrat VsyachePuz: re http://irclog.perlgeek.de/marpa/2016-02-20#i_12075686 -- pczarn is right ...
00:44 Idiosyncrat it is possible.
00:44 Idiosyncrat If I were doing the SLIF over again, I might take a crack at it.
00:45 Idiosyncrat Complications: all semantics must go in the upper layer -- shouldn't be too hard to implement, but it is something that needs to be watched for
00:46 Idiosyncrat 2nd potential complication: with all my interfaces, it's a question of whether they'll seem "natural" to the user ...
00:46 VsyachePuz Idiosyncrat: I know, that you are big fan of grammars multiplication. Is it possible to describe writespace parsing as a separate grammar and multiply it with main grammar explicitly ?
00:47 Idiosyncrat That's probably the hardest part, Perl 6's approach is worth looking at.
00:48 VsyachePuz i.e. if i have rules for my grammar, and rules of space grammar, I want an algoritm to create a combined grammar
00:48 Idiosyncrat You can either force whitespace to be explicitly accounted for, which the BNF in many standards does
00:49 VsyachePuz Idiosyncrat: Now the only mode which I can really use is explicit whitespaces in Eto.Parse in it's Ebnf
00:49 Idiosyncrat Note in your top grammar you'll have to identify rules where spaces goes between symbols and others where it does not
00:50 Idiosyncrat And that divides your top grammar into 2 grammars, leaving you with 3 --
00:50 Idiosyncrat the space-significant top grammar, the space-indifferent top grammar and the whitespace grammar.
00:51 VsyachePuz so space-significant top grammar can't be generated from two others ?
00:51 Idiosyncrat sure, probably
00:52 Idiosyncrat it'd be an interesting approach
00:52 VsyachePuz then it's impossible to merge proprocessor grammar and C-language grammar by the same reasons
00:53 Idiosyncrat C-preprocessor and C grammars are *defined* as 2-pass.
00:54 Idiosyncrat That does not make a difference in standard usage of preprocessing, but it does make a difference.
00:54 Idiosyncrat I believe I read somewhere that either Ritichie or Thompson said that, if they had it to do over, they would not have defined C that way ...
00:54 Idiosyncrat because of the burden it imposes on tools,
00:55 Idiosyncrat but we are stuck with it.
00:55 Idiosyncrat But as defined in the standard, the C-preprocessor does *not* know C ...
00:56 Idiosyncrat and the C compiler has next to no information about what was in the actual text before it was preprocessed.
00:56 VsyachePuz i don't understood how grammar multiplication works, that is why i dont' see how it is different from whitespaces * tokens
00:56 Idiosyncrat I don't know what "grammar multiplication" means
00:59 Idiosyncrat do you mean "use of more than one grammar"?
01:00 VsyachePuz Idiosyncrat: I mean, that grammar is math object, multiplication is operation, which constructs another grammar
01:00 Idiosyncrat OK
01:01 Idiosyncrat There are lots of ways 2 grammars can be combined.
01:04 VsyachePuz in my imagination the word "combined" is analogy of "+" operation, and "*" operation should be something more powerfull
01:05 VsyachePuz like insetion of spaces into all rules
01:06 VsyachePuz r
01:07 Idiosyncrat For an alternative, look at what Perl 6 grammars do.
01:08 Idiosyncrat That was an alternative I studied and considered, and even implemented on a trial basis.
01:09 Idiosyncrat Grammar arithmetic is an interesting idea, btw.
01:09 Idiosyncrat Someone would have to have the interest & time to experiment -- they will encounter a lot of issues and
01:10 Idiosyncrat corner cases, but not necessarily show-stoppers.
01:10 Idiosyncrat Btw, I was late to this party myself.
01:10 Idiosyncrat The first person to combine two Marpa grammars was Andrew Rodland (hobbs).
01:11 Idiosyncrat I'd considered the idea, but did not implement it until I saw Andrew's effort.
02:48 ilbot3 joined #marpa
02:48 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
04:44 kaare_ joined #marpa
04:51 kaare_ joined #marpa
07:28 koo7 joined #marpa
08:48 ronsavage joined #marpa
16:37 Idiosyncrat joined #marpa
18:42 ilbot3 joined #marpa
18:42 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
19:09 koo7 joined #marpa
19:24 pczarn .
19:31 Idiosyncrat pczarn: looks the backlog bot was on break during your last.
19:31 Idiosyncrat Also, did you try it?  I am not 100% sure it would work.
19:32 Idiosyncrat In particular, I don't think you can continue the parse after an exhaustion event.
19:33 pczarn I don't have the code for accessing Earley table from events.
19:34 pczarn I'm currently bootstrapping the high-level layer.
19:39 pczarn I'd like to see the impact on parsing with real grammars before I change anything in my recognizer.
19:43 pczarn my high-level layer temporarily lacks alternatives and sequences
19:56 Idiosyncrat On another topic:
19:57 Idiosyncrat Leo's algorithm, on which Marpa is based, came out in 1991 ...
19:57 Idiosyncrat but Marpa was the first non-toy implementation, and that was 2 decaces later.
19:58 Idiosyncrat I've previously explained this in terms of the prejudice against non-deterministic and Earley parsing, and I think that is a major part of it, but ...
19:58 Idiosyncrat might another part be that it's simply too hard to go from Leo's paper to an implementation?
19:59 Idiosyncrat [ By the way, Grune & Jacobs do have a simpler overview of it, in their parsing text. ]
20:28 pczarn Idiosyncrat: How to use Leo's algorithm with the bocage? Does it go top-down when creating bocage nodes?
21:30 ronsavage joined #marpa
23:29 Idiosyncrat joined #marpa
23:30 Idiosyncrat pczarn: re http://irclog.perlgeek.de/marpa/2016-02-21#i_12078636 -- yes
23:31 Idiosyncrat You have to undo the Leo memoizations to create the bocage -- either as a preliminary step or during the traversal.
23:31 Idiosyncrat This sounds like it means the Leo memoizations were not worth bothering with, but in fact ...
23:32 Idiosyncrat you only have to undo those memoizations which actually wind up in the parse forest.
23:32 Idiosyncrat In the unambiguous case (that is, the parse forest contains a single tree),
23:32 Idiosyncrat where the length of the right recursion is n,
23:33 Idiosyncrat O(n^2) Earley items will have been memoized, but
23:34 Idiosyncrat only O(n) memoizations will need to be undone, so the "win" from Leo memoization stays intact.

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