Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-01-28

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

All times shown according to UTC.

Time Nick Message
00:55 jeffreykegler joined #marpa
02:05 ronsavage joined #marpa
02:40 flaviu joined #marpa
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:18 flaviu joined #marpa
04:48 sivoais joined #marpa
04:58 jeffreykegler joined #marpa
05:04 ronsavage joined #marpa
05:16 ronsavage One problem is that 'balanced text' does not make sense the way 'delimited text' does.
09:28 rns joined #marpa
09:31 rns left #marpa
10:02 sirdancealot joined #marpa
10:03 koo5 joined #marpa
10:27 rns joined #marpa
10:28 rns left #marpa
13:03 btyler joined #marpa
14:57 ioann_ jeffreykegler: thank you! printed materials would be better because i am not native speaker
16:24 jeffreykegler joined #marpa
17:00 lwa joined #marpa
18:08 jeffreykegler ronsavage: I think perhaps the Web site should be re-arranged -- hits on my tutorials & blog posts have plummeted over the last month or two.
18:09 jeffreykegler Now, unlike most sites that are into getting as many hits as possible, I think we want to "right size" them -- we don't need hits from people who aren't really interested.
18:10 jeffreykegler That is, when the combined reddit/ycombinator debate was live, I got 15,000 hits over 2 days, but presumably most of them were only slightly curious, and there is no reason we'd want to try to duplicate that kind of number.
18:11 jeffreykegler But I can't help but think the currently folks who want to read my tutorials, etc., are not finding them.
18:12 jeffreykegler Perhaps if the first two "pages" of the Marpa web site were stuff of highest interest to new visitors, and then the remaining stuff was in alphabetical and/or random order.
18:29 koo5 joined #marpa
21:05 ronsavage joined #marpa
21:16 ronsavage jeffreykegler: I've moved the Tutorials section up to be 2nd in the TOC.
21:36 sadmac joined #marpa
22:19 RandalSchwartz in http://savage.net.au/Perl-modules​/html/marpa.papers/chapter3.html, answer 11...
22:19 RandalSchwartz could I have also written
22:19 RandalSchwartz ... sign_maybe ~ [+-] |
22:19 RandalSchwartz oh, and [+-] I think is malformed
22:19 RandalSchwartz unless marpa is more forgiving than normal regex. ::)
22:21 lucs Isn't  [+-]  an acceptable Perl character class?
22:21 RandalSchwartz no
22:21 RandalSchwartz that's + through ], and now we're missing a ]
22:21 RandalSchwartz you need to write that [-+]
22:21 RandalSchwartz if - is first char, it is not a range op
22:21 RandalSchwartz 25 years of perl regex... I spot this immediately
22:22 RandalSchwartz I think you can also use [+\-]
22:22 RandalSchwartz but generally I just put the - in the front
22:24 lucs Oh, I believe (and it appears to work here) that the dash can correctly be placed at the end of the character class too.
22:25 RandalSchwartz Yeah - so marpa is actually smarter than Perl there
22:25 RandalSchwartz I wonder if [+-]] is also parsed correctly then?
22:25 RandalSchwartz to mean a char class from + to ]
22:25 lucs I mean, in regular perl:  perl -le 'print "meep" if "a+b" =~ /[+-]/'
22:26 RandalSchwartz maybe we blame that on ilya :)
22:26 lucs Again ;)
22:26 RandalSchwartz the two most complex things in perl.  the debugger, and advanced regex.
22:26 RandalSchwartz mad russian struck twice
22:27 RandalSchwartz on the other hand, I wrote a JSON parser as a single perl regex thanks to some of his more advanced work. :)
22:28 lucs "A single perl regex", right, like a perl "one-liner" eh :)
22:28 RandalSchwartz well you've seen it I presume?
22:28 lucs Nope, but I'm guessing it must be rather longish?
22:29 RandalSchwartz ... http://www.perlmonks.org/?node_id=995856
22:29 RandalSchwartz it reads like a grammar
22:29 RandalSchwartz because it's recursive. :)
22:29 RandalSchwartz with named rules
22:30 RandalSchwartz the hard part is passing values to and from the grammar rules
22:30 RandalSchwartz but that's what $^R can do.
22:31 lucs Ah, not as inpenetrable as I expected. Nice.
22:31 RandalSchwartz probably the most bizarre thing is if the match succeeds, it's an implicit substitute, replacing the target json string with the equivalent nested data structure
22:31 RandalSchwartz yeah, I basically started with the JSON spec.
22:31 RandalSchwartz the tricky bits are of course, the $^R being need both to go down and go up
22:32 RandalSchwartz and to accumulate intermediate values
22:32 RandalSchwartz it is even indeed commented
22:32 RandalSchwartz and some commented-out debugging dumps that I used while developing
22:38 RandalSchwartz what's the term "recce" in reference to?
22:39 lucs It's a "nick" for "recognizer".
22:40 RandalSchwartz ahh.  it misparses for me
22:40 RandalSchwartz I would have used recog
22:41 lucs Yeah, until I understood what it meant, I had a real hard time (read: I couldn't) making sense of the code.
22:41 RandalSchwartz As I said in the podcast, I'm still looking for something that is interesting enough to force me to learn Marpa :)
22:42 lucs Has anyone done a Marpa JSON parser, with capabilities similar to yours?
22:43 RandalSchwartz I believe yes
22:43 RandalSchwartz might even be part of the core test suite
22:43 lucs Maybe just having a look a it will inspire you :)
22:44 lucs *at it
22:46 RandalSchwartz oooh... http://savage.net.au/Perl-modules/​html/marpa.papers/chapter5.html#p9
22:46 RandalSchwartz I even talked about that in the podcast.
22:46 RandalSchwartz ahh... that reference is to the podcast.  this is now recursive. :)
22:48 RandalSchwartz my undumper had to be clever to handle a left-recursion problem with P::RD
22:48 RandalSchwartz it would be much more straightforward with marpa
22:56 RandalSchwartz Also I think a lot of perlito could have been simplified with Marpa
22:57 RandalSchwartz ah - there - https://metacpan.org/release/JSON-Decode-Marpa
22:59 idiosyncrat joined #marpa
23:00 idiosyncrat https://metacpan.org/relea​se/MarpaX-Demo-JSONParser
23:01 idiosyncrat A CPAN distro with 3 Marpa-powered JSON parsers
23:02 idiosyncrat They are a favorite test case because they are small and a challenge -- JSON is an ideal target for a hand-written parser, and there are some out there are probably literally unbeatable
23:03 idiosyncrat RandalSchwartz: welcome back.  Btw, idiosyncrat is a handle I use within the Marpa community -- jeffrey
23:05 idiosyncrat re the character class -- Marpa::R2 passes those up to Perl to deal with, via callbacks.  The inefficiency of that approach is dealt with via memoization.
23:06 idiosyncrat One downside is that what works in a Marpa::R2 character class depends on what Perl you're running it in.
23:10 RandalSchwartz ahh, weird
23:10 RandalSchwartz so you could pass my entire JSON parser as a lex token? :)
23:10 idiosyncrat If you rewrote it as a character class, yes. :-)
23:11 idiosyncrat No doubt Ilya has added that feature. :-)
23:13 idiosyncrat "recce" is WW2 slang for a reconnaisance.  I thought it'd be familiar, but it's one of many things which seems natural to me and me only. :-)
23:14 idiosyncrat I pronounce it WRECK-EE
23:21 RandalSchwartz ok
23:22 RandalSchwartz yeah.. googling, I see that's the term
23:23 idiosyncrat I needed a short nickname because, unlike in the usual implementations of traditional parsers, ...
23:23 RandalSchwartz oh - and why do you say "linking to google group" when it's an irc log?
23:23 idiosyncrat an explicit recognizer phase is very visible in Marpa
23:24 idiosyncrat "linking to google group" -- where do I say that?
23:35 RandalSchwartz Oh.. it's ron saying that
23:35 RandalSchwartz .. http://savage.net.au/Perl-modules/​html/marpa.papers/chapter5.html#p9
23:38 RandalSchwartz ˈrɛki in IPA says http://en.wiktionary.org/wiki/recce
23:38 ronsavage I say a lot of things.
23:38 RandalSchwartz but I can't read IPA :)
23:38 RandalSchwartz I can *drink* IPA
23:39 ronsavage As for the [+-] stuff. I quote other's people code without running it, but I never heard of '+' having that effect in a Perl regexp. '-' indicates a range except when first or last, yes that I get.
23:41 ronsavage idiosyncrat: /Now/ you tell us!?
23:42 idiosyncrat ronsavage: were you referring to a particular one of my blindsidings?  Or just talking in general? :-)
23:42 RandalSchwartz Oh.. never heard the rule "or last"
23:43 RandalSchwartz because then how would you indicate a range from 3 to ]
23:43 RandalSchwartz [3-]] ?
23:43 lwa RE: using an external JSON parser as a Marpa lexeme – user-defined Unicode properties (IsFoo subroutines) don't cut it here. The usual way would be to introduce a phantom lexeme, and wire the external parser up to the prediction event for that lexeme.
23:43 lwa However, that doesn't mesh well with alternative lexeme. If possible, it would be preferable to describe the syntax of the JSON in a L0 Marpa grammar, then use a pre-lexeme event to produce the parsed value.
23:43 RandalSchwartz I've only ever heard it non-special if *first*
23:44 RandalSchwartz but I'm thinking back to early (not earley :) regex parsers
23:44 RandalSchwartz maybe they weren't as smart
23:45 RandalSchwartz maybe [+-] is just special cased because everyone types it :)
23:45 RandalSchwartz looks like posix regex permits - as last
23:45 RandalSchwartz ahh - this is what I'm confusing it with: The ] character can be included in a bracket expression if it is the first (after the ^) character: []abc].
23:46 RandalSchwartz that's first only, not last.
23:46 RandalSchwartz so saith the Internet Bible ... chapter 4, verse 17.. aka: https://en.wikipedia.org/wiki/Regular​_expression#POSIX_basic_and_extended
23:46 idiosyncrat RandalSchwartz: except I'm not sure that Marpa is smart enough not to terminate a char class at the first ']'
23:47 ronsavage Damn. I'll go back to sleep now, if ($im_awake);
23:47 RandalSchwartz so ronsavage - gonna fix up that reference?
23:47 RandalSchwartz since it's not to a google group, but to an irclog?
23:47 idiosyncrat Patience, please, Randal
23:47 RandalSchwartz well - I don't care about the rate of change. :)
23:48 RandalSchwartz just willingness. :)
23:48 ronsavage Getting to it......
23:50 RandalSchwartz sorry if I seem overeager.  especially when my own website is in shambles.
23:50 idiosyncrat A basic law of all-volunteer efforts is that folks do things when and if they feel like it.
23:50 RandalSchwartz shoemaker's children, and all that.
23:52 ronsavage Fixed.
23:52 idiosyncrat ronsavage: thanks!
23:53 ronsavage He, he, he. /Some/ people can't call me unresponsive!
23:53 ronsavage I have read a doc saying the '-' could go at the end, but I'd better not swear it was a Perl doc.
23:54 idiosyncrat btw, for representing brackets, I always use the hex value, adding a comment
23:55 idiosyncrat I hope that's most readable -- I know it's something I can get right the 1st time :-)
23:56 ronsavage I find an escaped bracket to be rather more readable than a hex value. But then, I don't think in hex, slif, or other weird stuff.................
23:57 idiosyncrat In the SLIF code, I pick up the character class as a string.  It is possible I am told in theory to make the escape character survive the trip from string, to intermediate representation in a file, to Perl string, and then to regex ...
23:59 lwa perldoc perlrecharclass says about hyphens: “If a hyphen in a character class cannot syntactically be part of a range, for instance because it is the *first or the last character* of the character class, […] the hyphen isn't special, and so is considered a character to be *matched literally*.” – http://perldoc.perl.org/perlrecharclass.html#Spec​ial-Characters-Inside-a-Bracketed-Character-Class
23:59 idiosyncrat but my approach is to ban escape characters

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