Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-05-18

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

All times shown according to UTC.

Time Nick Message
03:12 ronsavage joined #marpa
06:21 ronsavage joined #marpa
14:32 idiosyncrat joined #marpa
14:45 idiosyncrat https://github.com/jeffreyk​egler/Marpa--R2/issues/178
14:46 idiosyncrat That github issue was about a potential problem with the impact of some Config::Autoconf changes on Marpa::R2
14:47 idiosyncrat I *think* what happened if that it got lost, the changes happened without any prior checking 5 months ago,
14:48 idiosyncrat which would mean everything is fine
14:48 idiosyncrat although no great alertness was shown, "all is well that ends well" :-)
14:49 idiosyncrat If other folks could look this thing over, I'd appreciate it -- I'm about to close it on the theory that there never was a problem and it went away. :-)
16:11 koo6 joined #marpa
18:42 lwa joined #marpa
18:59 idiosyncrat rns: I have changed Kollos's C wrapper of marpa_g_rule_new() to allow a RHS of up to 7 in length
19:00 idiosyncrat That may be temporary, but since I am not sure that a maximum length of 2 does not create more trouble than it eliminates, I am testing the higher max ...
19:00 idiosyncrat I may lower it again.
19:01 idiosyncrat Context for others: Right now libmarpa has an external, more user-friendly layer, and an internal set of rules, which are not user-friendly.
19:01 idiosyncrat In Kollos I intend to move all the external, user-friendly stuff *out* of Libmarpa, and to make the internal interface even more internals-ish.
19:02 idiosyncrat One thing I will do is enforce, within Libmarpa, a maximum RHS length.
19:02 idiosyncrat This will have no effect on users of Kollos -- they will be able to write rules with a RHS as long as they like
19:04 ceridwen What's the purpose of the maximum RHS length?
19:05 rns idiosyncrat: yep, I saw that commit in github feed. Overall, I had a feeling that the internal grammar of the reduced Libmarpa will be more like CNF.
19:07 * rns on another topic
19:09 rns The location object in the KIR's external rule database described the position of the external rule in the LUIF source? Or it is to hold location info on the inout span matched by the external rule? Or both? :)
19:11 rns The thing it, I've started prototyping the LUIF's D2L (you might have seen it in the today's commits to libmarpa-bindings/lua/kollos [1] and got that question.
19:12 rns [1] https://github.com/rns/libma​rpa-bindings/commits/master
19:12 rns s/The thing it/The thing is/
19:20 rns s/inout/input/
22:46 idiosyncrat joined #marpa
22:47 idiosyncrat ceridwen: the maximum RHS length is internal only -- it will be invisible to Kollos users.
22:48 ceridwen Yes, I understand that---I'm curious why, from an implementation perspective, you think it's beneficial.
22:48 idiosyncrat Internally, currently Libmarpa must, wherever it uses a rule, allow for a RHS of arbitrary length\
22:48 ceridwen I mean, when I hear that, my first thought is CYK, not Earley.
22:48 idiosyncrat So, for example, dot location must be a 32- or 64-bit integer
22:49 idiosyncrat If it's max 7 symbols, 3 bits will do fine and the 3 bits are essentially free because I have plenty of space left over in the full word the C compiler allocates for Booleans.
22:50 idiosyncrat ceridwen -- there are all sorts of other optimizations that become possible.
22:51 ceridwen If you don't mind explaining them, I'm curious :).
22:51 idiosyncrat I won't go into them, because I have not fully worked them out -- I am still debating whether to go down to 2 symbols per RHS, or leave it at 7
22:51 ceridwen Right.
22:52 idiosyncrat I don't think I'll be able to decide the 2 vs. 7 (or some other number) until I get into the Libmarpa code deeply, which won't be soon.
22:54 idiosyncrat ceridwen: and, yes, 2 symbols per RHS will given the grammar a kind of CYK feel. :-)
22:54 idiosyncrat rns: re location objects
22:54 ceridwen Personally speaking, my suspicion is that that kind of optimization needs to be profiled before I'd be convinced it's worth doing.
22:56 idiosyncrat ceridwen: parsing, except for speed was solved in the 1970's --
22:56 idiosyncrat if I waited for profiling, there would be no Marpa.
22:57 idiosyncrat In any case, much of what I am after is code simplification, so that the code becomes more readable,
22:57 ceridwen Right.
22:57 idiosyncrat and so that new features can be added.
22:58 idiosyncrat rns: location objects are for all things you mentioned
22:59 ceridwen I meant, specifically, that tweaking a parameter (2 versus 7 versus 32-bit/64-bit) would be something I'd want to profile.  If it simplifies the code, though, that's a completely different issue.
22:59 idiosyncrat They can be cursors, position indicators, or describe spans.
23:00 idiosyncrat ceridwen: it's not a parameter, but a major algorithmic revision -- it just looks like a change of number
23:01 idiosyncrat As you pointed out, with 2 symbols per RHS, the algorithm becomes gets a CYK feel, so it's really a qualitative change.
23:02 ceridwen Yes.  I'll have to think more about it to work out the algorithmic implications.  For now, I have to leave---if you don't mind I might ask more questions later.
23:02 idiosyncrat I know that the "avoid unprofiled optimization" advice is standard, and in most cases makes sense -- I sure don't optimize any of my other code the way I do Marpa
23:03 idiosyncrat But it does not apply sanely to the Marpa effort -- almost all effort I devote to the internals would be shown to be pointless by profiling --
23:04 idiosyncrat the overhead is at the Perl level -- speeding up Libmarpa makes literally no measurable difference.
23:04 idiosyncrat So should I stop working on Libmarpa?
23:04 idiosyncrat So should I stop working on Libmarpa?
23:05 * idiosyncrat apologizes for the repetition -- his IRC client ate the last line for some reason
23:07 idiosyncrat rns: with locations objects I am thinking of using Lua for a kind of "inside out" object -- I've yet to work it out fully but here is the idea
23:08 idiosyncrat The string itself is keep in an index object, so creating many objects referencing the same string is simply copying the pointer.
23:09 idiosyncrat What kind of object it is, is determined *not* by the index, but by the base object.
23:09 idiosyncrat If the "current location" field is set, it is a cursor.
23:09 idiosyncrat If a "start", "end" field, it represents a substring -- for example a specific line for use in an error message.
23:11 idiosyncrat The index, meanwhile, consists only of fields which do not change after it is created -- it contains the string, but no reference to positions in it -- that is left to the base object
23:11 * idiosyncrat return to the optimization question.
23:12 idiosyncrat It's important to note that the standard advice against optimization is about *speed*, and is not applicable to *time complexity".
23:12 idiosyncrat I never (almost never?) optimize for speed without profiling.
23:15 idiosyncrat Theoretical time complexity is another matter.  Time complexity is about the ability to scale, and time complexity results have a much longer life than profiling results.
23:23 LLamaRider joined #marpa

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