Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-09-07

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

All times shown according to UTC.

Time Nick Message
01:48 ilbot3 joined #marpa
01: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
02:13 hobbified joined #marpa
02:16 sadmac joined #marpa
03:14 Pursuit joined #marpa
03:27 Idiosyncrat joined #marpa
05:50 pczarn joined #marpa
06:17 ronsavage joined #marpa
07:28 CQ joined #marpa
07:28 CQ "A Term and a Factor separated by an addition operator; or" ... that should be multiplication, not addition in http://search.cpan.org/~jkegl/Marpa-R2-3.000000/pod/Marpa_R2.pod#A_simple_calculator
08:44 ronsavage joined #marpa
15:04 pczarn My CFG package is published: https://github.com/pczarn/cfg
16:21 Idiosyncrat joined #marpa
16:22 Idiosyncrat_ pczarn: re http://irclog.perlgeek.de/marpa/2015-09-07#i_11180669
16:22 Idiosyncrat_ very cool
16:22 Idiosyncrat_ When I started Marpa, if there had been a toolkit like that.
16:23 Idiosyncrat_ It would have been very handy.
16:23 Idiosyncrat_ And it's major steps toward a port of the SLIF or something like it to rust.
16:23 Idiosyncrat_ Any plans?
16:23 pczarn thanks. Yes, I'm now thinking what to do next.
16:25 pczarn I'll probably continue working on the parser engine.
16:25 Idiosyncrat_ Very, very cool
16:26 pczarn The cfg library needs a couple more things, e.g. unused symbol elimination.
16:27 Idiosyncrat_ In doing Marpa, I plunged right into writing the parser w/o creating a library.
16:27 Idiosyncrat_ This approach -- creating a CFG toolkit first -- might have been smarter.
16:30 pczarn I found a few CFG toolkits on github, but they're all fairly small or incomplete. (The ones in OCaml and Haskell are largest.)
16:32 pczarn Could you explain when exactly do you have to go between internal and external grammars?
16:38 pczarn I'm not going to undo any rewrites, if possible.
16:42 pczarn Pursuit: you may want to take a look at ^
16:49 Idiosyncrat_ Currently the SLIF actually has grammars, as an artifact of the way it developed.
16:50 Idiosyncrat_ The SLIF grammar at the Perl level, and Libmarpa's external and internal grammars.
16:51 Idiosyncrat_ Kollos will cut this down to two -- there are 3 basically because I did sequences in C for Libmarpa, but precedenced rules are rewritten at the higher level.
17:19 MerittClarksdale Kollos will be totally accessible from Perl?
17:20 Idiosyncrat_ Yes
17:21 Idiosyncrat_ It will also be useable stand-alone -- it contains a very small but Turing-complete language called Lua
17:28 pczarn Idiosyncrat_: Are rewrites literally reversed at any point?
17:29 Idiosyncrat_ Yes
17:29 Idiosyncrat_ 1.  You've got to do the semantics, and the semantics are in terms of the external grammar
17:30 Idiosyncrat_ 2.  You've got to allow tracing and debugging and that has to be in terms of the external grammar
17:30 Idiosyncrat_ Re 2. -- actually yacc/bison/LALR didn't do no sticking tracing ...
17:31 Idiosyncrat_ but that's why it's no longer used
17:33 Idiosyncrat_ After a lot of experimentation I created a general scheme for reversable rewriting -- the one in the SLIF is ad hoc and it's a mess
17:33 Idiosyncrat_ Every rewrite must be of a single rule, and symbols in the rewrite are either brick or mortar.
17:34 Idiosyncrat_ Brick means they correspond (possibly many-to-one) to an external symbol.
17:34 Idiosyncrat_ Mortar means not brick
17:34 Idiosyncrat_ Terminals are bricks, and the rewrite is obvious.
17:35 Idiosyncrat_ To rewrite a non-terminal brick, call it <top>, you do a top-down left-to-right traversal from it of a subtree
17:36 Idiosyncrat_ You treat all brick symbols as leaves of the subtree -- that is, you stop the traversal there and do not go below them.
17:37 Idiosyncrat_ Let a rule be <top> ::= A B C
17:37 Idiosyncrat_ This traversal will encounter brick equivalents of <top>, <A>, <B>, <C> in that order.
17:38 pczarn so, pre-order traversal?
17:39 pczarn Or... no
17:39 Idiosyncrat_ yes pre-order traversal
17:39 Idiosyncrat_ Note that not all potential rewrites preserve the correctness of per-order traversal.
17:40 Idiosyncrat_ You must stick to rewrites that *do* preserve the correctness of pre-order traversal
17:40 Idiosyncrat_ Every rewrite in Marpa, the SLIF or Kollos *does* preserve this correctness
17:41 pczarn 1. There could be a mapping from internal rule IDs to semantic actions.
17:42 pczarn 2. Similarly, a mapping to parts of external rules.
17:43 Idiosyncrat_ That's more or less the approach of the SLIF, and the code is a mess
17:43 Idiosyncrat_ Because you have to keep track of the rewrite history of each internal symbol
17:43 pczarn Even just for the precedenced rule rewrite?
17:44 * Idiosyncrat_ did not understand the question
17:45 pczarn That's the SLIF's approach, and SLIF does precedenced rule rewrite.
17:45 Idiosyncrat_ "Even just" what?
17:45 pczarn the code is a mess.
17:46 Idiosyncrat_ Well, if you think I'm being too hard on myself, you can look at the code ...
17:46 Idiosyncrat_ if you want to come back and say nice things about it ...
17:46 Idiosyncrat_ that'd be nice, but I won't believe you :-)
17:47 Idiosyncrat_ Anyway the scheme above un-rewrites without knowing what the rewrite was, which eliminates lots of special cases and interactions thereof
17:48 Idiosyncrat_ A warning though -- the pre-order traversal rewrite has only been tried experimentally in Kollos.
17:48 pczarn well, I'm quoting "the code [with the older approach] is a mess"
17:48 Idiosyncrat_ Yes, having to know what the rewrite was in order to un-rewrite made the code very hard to read.
17:49 Idiosyncrat_ rns has done amazing things about reading my code, but even he I believe has never unraveled that part.
17:49 pczarn I think you need to keep track of the rewrite history of each internal *rule*.
17:51 Idiosyncrat_ Note that I am not trying to tell you how to implement ...
17:51 Idiosyncrat_ but I am sharing the history of my efforts and the state of my current thinking.
17:52 Idiosyncrat_ Having someone else tackle these things, and being able to learn from their efforts is something I'd very much look forward to
17:57 pczarn Ok, predicting the future is hard :)
17:57 pczarn I idly wonder whether I'll have to undo a couple hours of work
18:04 idiosyncrat2 joined #marpa
18:04 idiosyncrat2 commit c353943c08d7bcad041961af0999353b0aa056af
18:04 idiosyncrat2 CQ: re http://irclog.perlgeek.de/marpa/2015-09-07#i_11178823
18:04 idiosyncrat2 Fixed in the above mentioned commit
18:05 idiosyncrat2 Marpa::R2 is frozen except for significant bug fixes, so it may be a while before it hits CPAN
18:12 Idiosyncrat_ pczarn: first you may want to think over the pre-order traversal method and convince yourself that it does work
18:13 Idiosyncrat_ The "history with every internal rule" method *does* have a strong track record -- the SLIF is by far the most used Marpa interface.
18:14 * Idiosyncrat_ wonders, is it is the most used general BNF parser interface ever?
18:14 Idiosyncrat_ While the pre-order traversal method has only seen experimental use.
18:17 CQ joined #marpa
18:54 lwa joined #marpa
19:23 Idiosyncrat joined #marpa
19:50 Idiosyncrat AFK
21:34 ronsavage pczarn: Re http://irclog.perlgeek.de/marpa/2015-09-07#i_11180669. I've put a link in the XML file I use to construct my website, but I'm currently re-writing parts of the code, so it'll be some days before the link appears on Marpa's homepage. But - Well done anyway!
22:41 ronsavage joined #marpa

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