Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-11-21

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

All times shown according to UTC.

Time Nick Message
00:56 Spads joined #marpa
01:26 Spads joined #marpa
01:35 ronsavage lwa: Hmmm. It's a bottomless pit to start adding commentry per package, so I won't. I suggest submitting a pull request to the author to fix the docs if that 'feature' is unimplemented. Perhaps mark it as a warning or limitation. Of course, it could be argued it's a limitation of CommonMark, not the implementation.
01:36 jeffreykegler Perhaps it's something a volunteer can do -- a website which discusses the merits of selected examples of Marpa usage.
01:37 jeffreykegler Such a view could be highly personal -- it would almost have to be
04:08 Spads_ joined #marpa
05:07 ronsavage joined #marpa
06:34 ronsavage I'll do the pull/doc patch myself. I've just found a couple of typos in my DOT grammar, and now have 90+ tests working or failing exactly as expected. Next I'll start testing on files which ship with Graphviz itself.
06:36 lwa joined #marpa
06:52 ronsavage Pull request sent to rns.
07:33 ronsavage Pull request merged.
09:23 Spads joined #marpa
12:00 rns_ joined #marpa
12:03 rns_ jeffreykegler: re LUIF to lua transpiling — with the recent commits to Lua::AST, LUIF sources can now be parsed.
12:05 rns_ The extended parser and transpiler is now a separate module MarpaX::Languages::Lua::LUIF, example inout/output is in https://github.com/rns/MarpaX-Languages-Lua-AST/blob/master/t/luif.t
12:15 rns_ Transpiling now just turns grammar() to function() and BNF rules to lua tables; a draft transpiling spec in this issue filed against Lua::AST repo — https://github.com/rns/MarpaX-Languages-Lua-AST/issues/3
12:22 rns_ Feedback is appreciated.
12:54 rns_ joined #marpa
13:09 daxim jdurand_, please contribute the code so that it's useful not only personally but for everyone
13:12 jluis joined #marpa
13:15 rns_ daxim: IIRC, that code is in https://github.com/jddurand/MarpaX--Import
13:23 daxim nice, I cloned and ran the tests, mostly works
13:24 daxim that should be really in marpa proper, not an extension
13:24 daxim the code is on GH only, not on cpan, no wonder I didn't know about it
13:31 rns_ Sure, no problem. I also did my share of EBNF-enabling Marpa once, https://github.com/rns/MarpaX-Parse-Take-I/blob/master/t/21_ebnf_snippets.t
13:33 rns_ The above code converts EBNF to Marpa::R2::NAIF — https://metacpan.org/pod/distribution/Marpa-R2/pod/NAIF.pod — and supports embedded actions.
13:34 daxim how do you do 3*token in Parse-Take-I?  (that's (token){3} in regex-like notation)
13:38 rns_ IIRC, I didn't went that far — {} quantifiers were not on standard EBNF — but I was going to support regexes in the lexer I had to write.
13:42 rns_ Oh, I'm recalling that lexer supported regexes written as literals via qr, e.g. 'qr/.../' — https://github.com/rns/MarpaX-Parse-Take-I/blob/master/t/19_multiple_parse_trees.t#L23
13:43 rns_ So {} quantifiers are supported at lexical level via regexes, I just had no use case to provide them for sequences.
13:44 rns_ BTW, such sequences would be relatively easy to add.
13:45 rns_ Anyway, SLIF had made it all irrelevant — it's got some time getting used to, but all the effort paid off greatly.
13:45 daxim that would be progress
13:45 daxim say, your code isn't on cpan either
13:46 daxim SLIF is Marpa::R2::Scanless, right?
13:47 rns_ Yes.
13:47 rns_ and it was an experiment and http://blogs.perl.org/users/neilb/2013/03/dont-release-experiments-to-cpan.html is arguably right.
13:48 daxim explain how SLIF made your better Parse-Take-I irrelevant
13:48 rns_ Once you got used to SLIF, you just go YAGNI about all that cool EBNF syntax. It just blurries your understanding of how your grammar works.
13:49 rns_ Also, SLIF had lexer built and that lexer supported character classes.
13:51 daxim I disagree about yagni.  a low-level bnf with many rules is much worse to comprehend than ebnf with fewer.  concrete example:
13:52 daxim https://gist.github.com/jeffreykegler/5015057#file-comments-t-L63  versus a one-liner '/*' [^*]* ("*"+ [^/*] [^*]*)* "*"* '*/'
13:54 daxim higher abstractions are clearly better (vast majority of the time).  that's why we program in perl and not in machine code
13:55 rns_ No offence, but your one-liner looks like the machine code to me and Jeffrey's BNF looks like perl.
13:56 daxim also, as I said yesterday, manually transforming ebnf into simple bnf as marpa currently eats is error-prone.  I love those automatic transformations in MarpaX--Import
13:56 rns_ Well, my experience is different.
13:57 rns_ I converted a EBNF gramamr for Lua to SLIF and was pretty straightforward.
13:58 rns_ You can take a look https://github.com/rns/MarpaX-Languages-Lua-AST/blob/master/lib/MarpaX/Languages/Lua/AST.pm#L89
13:59 daxim your experience does not invalidate mine.  do you resist that automatic conversions get added into marpa, like I suggest?
13:59 koo6 joined #marpa
13:59 rns_ EBNF rules are commented and followed by BNF. And you know what? They just read better to me, because I can understand what's going on (how the rewriting is done) much better.
14:00 rns_ Actually, I don't. We will see them in LUIF, hopefully.
14:00 daxim cool
14:01 rns_ Not sure about {} quantifiers for sequences though. But I'd like to see them for character classes in LUIF.
14:03 rns_ LUIF (Kollos project) is going to be the best thing ever happened to Marpa — lua with BNF statements as an extension language to libmarpa.
14:05 rns_ Early example of LUIF — lus with BNF can be seen at https://github.com/rns/MarpaX-Languages-Lua-AST/blob/master/t/luif.t#L23
14:05 rns_ Jean-Damien is doing the wrapper for libmarpa https://github.com/jddurand/marpaWrapper using SWIG
14:08 rns_ s/lus/lua/
14:08 daxim aha, so it's still usable from perl, I thought kollos abandons perl as convenience wrapper
14:10 rns_ Jeffrey, once here after some hours, will be able to provide more info, if you're interested.
14:22 daxim idiosyncrat, I already know where the code is, I mentioned the tarball, right?  I just need help identifying where the part with the linked list is - looking for a file name and line number.
14:22 daxim suggesting that I read the scientific paper and source code in entirety just for the one aspect I'm interested in is not helpful.
14:33 rns_ daxim: you might be interested to look into
14:33 rns_ https://github.com/jeffreykegler/libmarpa/tree/master/work/obs
14:33 rns_ https://github.com/jeffreykegler/libmarpa/tree/master/work/tavl
14:33 rns_ and perhaps https://github.com/jeffreykegler/libmarpa/tree/master/work/avl
14:35 daxim wow, heavy stuff
14:35 rns_ You still need to read the paper and the code to know how it all works together.
14:36 rns_ You can start with http://flaviut.github.io/libmarpa-api-onepage/ to get the big picture and work downwards from there.
14:37 daxim it's much easier now that I have a name to grep for
14:37 daxim thanks
14:38 rns_ My pleasure. 'waidmanns heil', IIRC?
14:39 * daxim makes a grimace
14:39 rns_ :)
15:14 lwa joined #marpa
15:40 jeffreykegler joined #marpa
15:45 jeffreykegler re Kollos and Lua vs. Perl
15:46 jeffreykegler Kollos's use of Lua is not a move away from Perl.  Right now a lot of Marpa's SLIF is implemented in Perl's XS layer, and that layer is far more complex than is advisable for XS, which is intended to be like SWIG -- just for wrappering.
15:46 jeffreykegler With Kollos, the Perl/XS layer will become just a wrapper, the way it's intended.
15:47 jeffreykegler Kollos/Lua also gives Marpa a Turing-complete extension language.  Why not use Perl for this? ...
15:49 jeffreykegler Perl callbacks are expensive, whereas Lua is ruthlessly lightweight.
15:49 jeffreykegler Lua can do things like call C which calls Lua which calls C, etc. ...
15:50 jeffreykegler which Perl can also do, but it's much harder, and much more expensive
15:52 jeffreykegler The particular difficulty (which many folks ignore up front) is not how difficult it is to do the main thread of execution, but how difficult it is to do exceptions and error conditions which are thrown across several language-to-language interfaces.
15:53 jeffreykegler Lua is very lightweight and designed for this.
15:54 jeffreykegler Perl's design is older, and it's a much, much larger and fully-featured language and it's a miracle it can do this sort of thing at all.
15:55 jeffreykegler Finally, the SLIF right now has a couple of virtual machines in its implementation, which approach the size of Lua ...
15:56 jeffreykegler with Kollos they'll be replaced by Lua.
16:03 jeffreykegler I *do* expect they'll be a pure Lua way of using Marpa once Kollos is here, and also that it will now be possible to have other languages interface, not just to Libmarpa, but also to the LUIF, which will have all the higher-level stuff now in the SLIF.
16:03 jeffreykegler rns_: Apologies for my inattention to your efforts, whjch are really exciting.
16:04 jeffreykegler What I'm doing now is catching up with the Marpa::R2 issue list.
16:04 rns_ No problem at all. I've create the issue in Lua::Ast repo so you can take a look when you have time.
16:04 jeffreykegler These are mainly documentation issues, but some of these are real obstacles to users trying to get into these features.
16:05 jeffreykegler Are we at the point where you could put up sample LUIF code for the community to look over?
16:05 jeffreykegler It would not have to actually execute ...
16:05 jeffreykegler just show off the interface.
16:06 jeffreykegler I'm thinking some "Here, this is what we think the LUIF will look like" posts.
16:08 rns_ Well, the example from Kollos design note and Marpa synopsys (bare and with actions) are in the test file.
16:08 rns_ https://github.com/rns/MarpaX-Languages-Lua-AST/blob/master/t/luif.t#L107
16:09 jeffreykegler OK, I see where we are.
16:09 rns_ But I think we need to come to terms with how it will be transpiled to lua before showing — that way it all will look more robust.
16:10 jeffreykegler You're right -- I need to look at it some more.
16:10 rns_ Yes, it'd be great.
16:10 jeffreykegler Kollos/LUIF is what I *want* to be doing.
16:11 jeffreykegler but I think Marpa::R2 maintenance & issues should take 1st priority.
16:12 jeffreykegler There have been a number of projects which are all about future features & users, and who ignore anyone actually using their stuff.
16:12 jeffreykegler I don't want Marpa to follow this example.
16:13 rns_ I agree. The better SLIF is the more credible LUIF will look, so to say.
16:13 jeffreykegler jdurand: the same apology for my lack of followup on your SWIG wrapper.
16:14 rns_ In a meanwhile, I have a number of issue to follow-up on Lua::Ast so I won't be idle.
16:14 jeffreykegler Good.  I might easily become the bottleneck, but it's good to know I am not at the moment. :-)
16:15 rns_ :)
16:15 jeffreykegler daxim: because of considerations like the just above, new interfaces inside Marpa::R2 are not happening, even if they are excellent ideas.
16:16 jeffreykegler Also, perhaps I should comment on people trying to get into Marpa or Earley-based parsing by writing it or something like it from the bottom up -- nearly, etc.
16:18 jeffreykegler I thnk this kind of attempt shows excellent programming instincts -- really focusing on getting into the nuts and bolts and understanding it yourself from the bottom up.
16:19 daxim yes, that would be cool with the help.  nearley is lacking the optimisations you put on top of the generic earley to make marpa:  https://github.com/Hardmath123/nearley/issues/10  and /11 and /22
16:20 daxim loup vaillant hasn't gotten around yet to explain them in simple prose
16:20 jeffreykegler I notice Loup is a Lua programmer.
16:21 daxim so if you could translate from the scientific paper into simple english that would be splendid
16:21 jeffreykegler daxim: You can ask Aria ... she considers my paper exactly that
16:22 jeffreykegler a translation of Joop Leo's paper into simpler language
16:23 daxim it's not enough
16:25 jeffreykegler I know as I re-explain and re-explain, I do find simpler ways to put things, but that takes a lot of effort ...
16:25 jeffreykegler my sources were very difficult, but the authors were explaining things as clearly as they could
16:26 jeffreykegler so I just struggled through.
16:27 jeffreykegler The part I think we're talking about in particular ...
16:27 jeffreykegler Joop Leo's optimization,
16:27 jeffreykegler I must have re-read his paper a hundred times at this point and I still don't find it an easy concept.
16:29 jeffreykegler and at this point I think it's fair to say that most people who know the concept know it via my writing
16:30 jeffreykegler and I seem to have been nearly unique in spotting it as important and worth re-reading and re-explaining.
16:31 jeffreykegler So, it like with one of my bosses who hailed from the Netherlands, and every once in a while I'd be explaining something and he'd interrupt ...
16:32 jeffreykegler and say, "Jeffrey, how would I explain this in Dutch".
16:32 daxim that's funny
16:33 jeffreykegler Dutch meaning "the way ordinary folks talk"
16:33 daxim aha
16:33 jeffreykegler And explaining stuff "in Dutch" was hard.
16:33 jeffreykegler Sometimes I simply could not do it.
16:34 jeffreykegler So the "Dutch" version of Joop's idea is coming, maybe I'll figure it out, maybe Loup will ...
16:34 jeffreykegler maybe you will.
16:35 daxim perhaps we can communicate in code and tests where natural language fails us
16:35 jeffreykegler Ironically, by the way, Joop *is* from the Netherlands.
16:35 jeffreykegler daxim: that's a difference here and a point where a lot of programmers come to this stuff have a problem.
16:36 jeffreykegler This is mathematical code.
16:36 jeffreykegler It's like asking for quantum mechanics without the math ....
16:37 jeffreykegler while quantum mechanics *is* its math.
16:37 daxim hmmm
16:37 jeffreykegler Coding it up just confuses things.
16:38 jeffreykegler My recent post of top-down and bottom-up I think may illustrate.
16:38 jeffreykegler I tried to come up with a better way of explaining them than anything in the literature -- which is big.
16:38 jeffreykegler A "conceptual" overview, but one that was not pure buzzwords.
16:39 jeffreykegler I think it worked, but one problem ...
16:39 jeffreykegler it was so high-level you could *not* implement the algorithms from those descriptions.
16:40 daxim perhaps make another post to arrange that information in a table.  row headers are parsers, column headers are features.
16:40 jeffreykegler It'd also be dangerous to go even in the conceptual direction, because I skipped over some important theoretical difference, because they weren'
16:40 jeffreykegler t relevant to my point in that post.
16:42 jeffreykegler Tables tend to reduce things to buzzwords
16:43 daxim you make it sound like a bad thing
16:44 jeffreykegler daxim: I think it is a bad thing.  You're eager to really understand this stuff, and buzzwords lead to just repeating what other people say.
16:45 jeffreykegler Sometimes you just want the "expert" to give you the right answer, and then buzzwords are OK.
16:46 jeffreykegler But otherwise it's like in the movie, where the guy keeps saying "inconceivable", and doesn't really understand what the word means.
16:48 jeffreykegler By the way, one way of doing really cool stuff with Marpa, that folks can do without a lot of math, and I think is really being under-pursued ...
16:48 jeffreykegler is new ways of using its features.
16:49 jeffreykegler There are, I am convinced, other "Ruby Slippers" out there,
16:50 jeffreykegler or ways to use "higher level languages", languages which write languages (which is how the prioritized statments in the SLIF works),
16:50 jeffreykegler working with these things requires a lot of thinking in BNF, but no math beyond that.
17:56 jdurand_ joined #marpa
17:57 jdurand_ Re http://irclog.perlgeek.de/marpa/2014-11-21#i_9699069 - in https://github.com/jddurand/marpaXml/blob/master/tools/generateMarpaWrapperCode.pl there is also a SLIF implementation - that is generating a Marpa's SLIF out of the W3C - minus the 'Lexeme - Lexeme' clause that is considered as an external rule to an external parser
17:57 jdurand_ Example in the pastebin below
18:00 jdurand_ Hmmm pastebin did not male it ? The link is http://fpaste.scsys.co.uk/444556
18:00 jdurand_ "make it"
20:18 ronsavage daxim: To add to what Jeffrey's saying: When people pretend to 'explain' OOP by saying polymorphism, I feel like wringing their throat. Substituting 1 buzzword (OOP) for another (polymorphism) is /not/ an explanation. And when I first learned Perl I found the texts and language difficult and frustrating, so I've spent years ensuring my documentation would spell out the details. When writing, I always try to put myself in the place of a beginn
20:19 ronsavage Did you see I said 'maths', not 'math'? In America they say 'math', but here in Australia it's always 'maths'.
21:50 Spads joined #marpa

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