Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-02-12

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

All times shown according to UTC.

Time Nick Message
00:19 flaviu joined #marpa
01:40 jeffreykegler rns: If you're out to get a set of Libmarpa changes to your name, this one might be of interest.
01:41 jeffreykegler It requires a good Marpa internals knowledge, but not *too* much
01:41 jeffreykegler And of course I'm always checking the changes before they go in, so there's a "safety net"
01:41 jeffreykegler I discovered that marpa_r_latest_earley_set() fails for trival grammars
01:43 * jeffreykegler when he says "trivial grammar" means one that only recognizes a null parse -- for example "top ::= null; null ::= "
01:43 jeffreykegler I suspect there are others.
01:43 jeffreykegler The task would be, first, to census these.
01:45 jeffreykegler Second to apply the fix, which will usually be easy -- see https://github.com/jeffreykegler/libmarpa/com​mit/ed67544a5bc52fa8de75fd004e80570c8e81129e
01:45 jeffreykegler Third, to add a test of the fixes to the Libmarpa test suite.
01:46 jeffreykegler Of this list, you can do only the first, the 1st two or all of them, as you wish
01:47 jeffreykegler Of course, you're doing a lot of other cool stuff, so you can also leave it to me to fix my own messes. :-)
01:54 * jeffreykegler changes to a new, if not unrelated topic
01:54 jeffreykegler The reason for the current focus on zero-length parses, and on trivial grammars ...
01:56 jeffreykegler is that I forsee people using Marpa *solely* for the discard events --
01:56 jeffreykegler That is, not doing an actual parse, but simply using the discard events to divide up an input stream.
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
03:46 ronsavage joined #marpa
05:24 ronsavage joined #marpa
05:59 jeffreykegler joined #marpa
05:59 jeffreykegler Calling it a night, CA time
05:59 jeffreykegler I just added a new test file to the test suite, dedicated to discard events -- all tests pass.
06:00 jeffreykegler There will be two more test files, one to test initialization of discard events to on/off
06:01 jeffreykegler and a second one with a sort of "real life" (if very small) example of their use.
06:02 jeffreykegler So there will be a total of 3 test files.
06:02 jeffreykegler Unless I decide I need more. :-)
10:20 lwa joined #marpa
12:06 rns joined #marpa
13:21 rns jeffreykegler: re http://irclog.perlgeek.de/m​arpa/2015-02-12#i_10101585 -- sounds interesting.
13:23 rns census of a grammar for triviality can be done by checking that all of its rules are nulling via marpa_g_rule_is_nulling(), after @<Classify rules@>@;?
13:25 rns BTW Grune 2nd ed. has an example of a trivial grammar in Fig. 9.30, p.296
13:28 rns on a second thought, if all rules are nulling, then there should be no start rule, so G_is_Trivial seems to be sufficient.
13:29 rns Or census meaning finding other grammars, which are trivial and testing if G_is_Trivial() catches them?
13:32 rns All-in-all, I'd be glad to help with that as I can learning libmarpa internals in the process.
13:37 jeffreykegler joined #marpa
13:38 jeffreykegler rns: by census I meant something different -- sorry I was not clear
13:39 rns ok
13:39 jeffreykegler I meant a list of the external, documented Libmarpa methods which fail when called with a trivial grammar.
13:40 jeffreykegler I just fixed one, which I encountered in the course of testing the "discard events"
13:40 jeffreykegler I suspect there are others.
13:41 rns ok, I see, those which fail like marpa_r_latest_earley_set()
13:41 jeffreykegler YES!
13:42 rns So the test case is to take a trivial grammar (as in trivial.c) and call applicable libmarpa methods to see if they work?
13:42 jeffreykegler Only methods called after grammar precomputation need to be considered.
13:43 jeffreykegler Yes, and if you wish, try to fix them.
13:43 jeffreykegler Fixes will often be simple, as was the case for marpa_r_latest_earley_set()
13:44 jeffreykegler And then, if you wish, add them to the (currently very small) Libmarpa test suite.
13:45 rns Ok, I see.
13:46 rns So, methods starting from marpa_r_new() up to and including marpa_v_*() in the valuator step?
13:46 jeffreykegler Yes, to the extent that makes sense.
13:48 rns Ok, so I'd start with the grammar in trivial.c and see if it parses empty string ok and returns null parse?
13:49 jeffreykegler Sure.  That part should be OK, but when you get into the more obscure accessors, ...
13:49 jeffreykegler some of them have just never been tried with trivial grammars ...
13:49 jeffreykegler marpa_r_latest_earley_set() being one such case until today.
13:51 jeffreykegler Nobody had ever called it for a trivial grammar, and when I did, it failed.
13:51 rns So, I'd first make sure that null input produced null parse and then insert tests of suspicious methods calls?
13:52 rns s/produced/produces/
13:53 jeffreykegler Exactly -- and all of them that are supposed to work after precomputation will be suspicious.
13:59 jeffreykegler I'll go back to sleep now.  AFK.
13:59 rns Sounds good -- I'll start writing the test case and testing those methods and try to fix them.
14:00 rns Do you prefer that in separate pull requests or separate commits in a single pull request branch?
14:00 jeffreykegler Oh, yes, and please provide your consent to change the license to MIT, or a statement that you're assigning copyright to me.
14:00 jeffreykegler Separate per-method may be best.
14:01 jeffreykegler I'm *not* doing copyright assignment in general, but in this one case I'm planning the license change imminently, so this is an exception.
14:01 jeffreykegler IIRC you were an MIT license supporter.
14:03 rns Yep, how do I express my consent? some copyright assignment form? I'm not a lawyer. :)
14:05 jeffreykegler "I hereby assign copyright of my fixes to the Libmarpa repo to Jeffrey Kegler"
14:06 jeffreykegler That sentence should do it, we can hope.
14:08 rns Ok I'll include that line in the test case, is that ok?
14:08 jeffreykegler Put that sentence in a file in the Libmarpa repo, under a new directory called "legal/", with your typed name and date after it as the "signature"
14:08 rns ok.
14:09 jeffreykegler Did I recall correctly you were in favor of the MIT license?
14:12 rns Yes.
14:12 rns Should I say so in legal/?
14:12 jeffreykegler Another approach is for you to restart the discussion in the Google group, and then submit the change as a pull request.
14:14 jeffreykegler That should make your consent to the change pretty obvious to any court. :--)
14:15 rns :)).
14:15 jeffreykegler That is, restart the discussion as to whether to change Libmarpa to the MIT license.  I think we have a consensus, but in the copyright assignment discussion, things may have gotten confused, so best to make sure.
14:16 rns Ok, I will.
14:16 jeffreykegler The license language is all over the place in Libmarpa, and there's a mechanism for checking it, but you can find all that with ack or grep.
14:18 jeffreykegler Of course, tell the Google group that you're taking on the license change as a favor to me, and at my request.
14:18 rns Sure. So, after the consensus is reached, a pull request to convert GNU LGPL language to MIT?
14:18 jeffreykegler Exactly!
14:19 jeffreykegler OK, now to sleep.  I'll backlog if you have further thoughts.
14:19 jeffreykegler AFK/
14:19 rns Good night.
14:21 jeffreykegler joined #marpa
14:21 jeffreykegler Oh, yes.
14:21 jeffreykegler Make sure it'
14:22 jeffreykegler Make sure that it is the Lua version of the MIT license.
14:22 jeffreykegler There are a few "MIT licenses" out there.
14:22 jeffreykegler Thanks!
14:23 rns Ok, I will. Absolutely welcome!
14:41 sivoais joined #marpa
14:56 pczarn joined #marpa
16:40 koo5 joined #marpa
17:37 rns jeffreykegler: in the trivial grammar set up PR just merged, marpa_g_symbol_is_start() does not return 1 for S_top, so it fails, both before and after precompute().
17:40 rns I'm not sure about the fix -- should it just soft fail if (G_is_Trivial(g))?
17:40 rns Or perhaps a special error code, e.g. ERR_GRAMMAR_IS_TRIVIAL and message 'grammar is trivial, so start isn't defined' needed?
17:41 rns Or is it a false positive? :)
18:04 rns jeffreykegler: The issue in 4 above lines has been answered on github, thanks.
18:20 jeffreykegler joined #marpa
18:20 jeffreykegler rns discovered that the behavior of marpa_g_symbol_is_start() is (at best) counter-intuitive.
18:20 jeffreykegler I think Libmarpa has no promises of backward compatibility, and that I am free to change the behavior to make sense.
18:20 jeffreykegler Libmarpa is different from Marpa::R2 in that you've got to recompile to use a new Libmarpa, whereas the CPAN infrastructure, by default, upgrades you to the latest Marpa::R2.
18:20 jeffreykegler So you're not likely to upgrade Libmarpa unexpectedly, or absent-mindedly.
18:22 jeffreykegler I should bump the major version # of Libmarpa though, if I do make that change.
18:23 jeffreykegler It's a good time for a major version bump, since we are probably changing the license to MIT.
19:42 koo7 joined #marpa
20:21 pczarn joined #marpa
21:25 ronsavage joined #marpa
23:50 ronsavage joined #marpa

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