Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-06-30

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

All times shown according to UTC.

Time Nick Message
03:02 ronsavage joined #marpa
06:41 ronsavage joined #marpa
15:25 LLamaRider joined #marpa
15:31 jeffreykegler joined #marpa
16:24 lucs Is the mailing list the best place to ask about a problem I'm having with MarpaX::Languages::ECMAScript::AST?
16:26 lucs (I have some short, apparently simple, JS code that makes it throw an exception withA.) "Complex regular subexpression recursion limit (32766) exceeded"
16:26 lucs s/withA.)/with/
16:45 jeffreykegler That's Jean-Damien's module (though the problem might trace back to Marpa)
16:46 jeffreykegler I think Jean-Damien backlogs regularly, so he may let you know what he prefers.
16:46 lucs Okay, I'll wait for him to be around.
16:47 jeffreykegler Or you could just go onto the mailing list, which I know he follows.
16:48 jeffreykegler The "SUPPORT" section of the README for the module, for what it's worth, suggests "the issue tracker at
16:48 jeffreykegler <https://rt.cpan.org/Public/Dist/Disp​lay.html?Name=MarpaX-Languages-ECMA
16:48 jeffreykegler Script-AST>"
16:49 jeffreykegler That may just be boilerplate, however.
16:49 lucs Oh, right, I should have checked that.
16:49 lucs Anyway, I think I'll still wait for him to be around and talk to him "in person" :)
16:50 jeffreykegler My own current practice is to take bug reports however the user chooses to report them.  If the forum isn't right for the nature of the request, I suggest changing it.
16:51 jeffreykegler As time goes on, it's likely I'll become more restrictive.
16:51 lucs I may end up submitting it more formally anyway, for the documentation of it.
16:52 lucs jeffreykegler: Say, do you happen to have that module installed? If so you might want to try out my code, which I shall pastebin posthaste.
16:52 jeffreykegler I could install it, and give it a run.
16:53 jeffreykegler Which version?
16:53 shadowpaste "lucs" at 70.81.138.180 pasted "Throws a subexpression recursion limit exception." (14 lines) at http://scsys.co.uk:8002/404380
16:53 jeffreykegler Bear in mind since it's not my module, my answer is likely to be not very helpful.
16:53 lucs I used the latest version from github, .15 I think
16:53 lucs Oh, I was just wondering if you'd get the exception too.
16:54 lucs I'm on perl 5.16, and there are many dependencies, so who knows...
16:54 jeffreykegler The main reason I'm doing it is that's it's a good excuse to look at Jean-Damien's work.
16:55 lucs You'll have a lot to look at! :) Apparently, he put in _a lot_ of work into this.
16:57 jeffreykegler And that's just one of Jean-Damien's big projects.
16:57 jeffreykegler He's done a lot.
16:58 jeffreykegler What I'm going to do is just give a quick glance.  If it's at all complicated, I'll just say, "Yup.  Better ask Jean-Damien."
16:59 lucs No problem :)
17:04 jeffreykegler install takes a while ...
17:05 lucs Yeah, and some dependencies only reveal themselves at runtime :(
17:06 lucs jeffreykegler: If you're busy, don't bother, I'll wait for Jean-Damien.
17:06 jeffreykegler I've just duplicated the problem.
17:07 lucs Oh, good! (so to speak)
17:08 lucs It's weird, because if you remove a comment line, or the  x = 42;  line, it parses fine.
17:09 lucs If you slowly shorten one of the Lorem ipsum comments, at one point, it will work again.
17:10 lucs I looked at the code, and it has something to do with isEnd(), but I didn't get much farther.
17:10 jeffreykegler The error message is actually pretty clear (assuming it's accurate)
17:11 lucs (I spent most of my time reducing the origing 5000 line snippet that exhibited the problem to those few lines.)
17:11 jeffreykegler A perl regex is being used, and is overflowing.
17:11 jeffreykegler Which lines?
17:11 jeffreykegler Regex overflow is sort of an ironic problem for a Marpa app. :-)
17:12 jeffreykegler You mean the lines in the paste?
17:12 lucs I mean, I was having the problem on a 5000 line JavaScript snippet at first, but I was eventually able to reproduce it with just those few pastebinned lines.
17:13 lucs Which I figure I was lucky with :)
17:14 jeffreykegler /home/jeffreykegler/perl5/perlbrew/perls/​perl-5.10.1/lib/site_perl/5.10.1/MarpaX/L​anguages/ECMAScript/AST/Grammar/Base.pm line 210
17:14 jeffreykegler That seem to be where the problem occurs, and it's a regex overflow issue.
17:14 jeffreykegler May be the solution is to replace it with Marpa. :-)
17:14 lucs :)
17:15 jeffreykegler Anyway, having thrown out a few thoughts are guesses which are probably useless or misleading ...
17:16 jeffreykegler I'll let Jean-Damien take over. :-)
17:16 lucs Okay :) Thanks for looking.
17:16 jeffreykegler * "thoughts are guesses" -> "thoughts and guesses"
17:16 jeffreykegler Btw, since it is an overflow issue.
17:17 jeffreykegler That could explain why cutting out just about anything makes the problem go away.
17:17 lucs Yeah, makes sense, but I'm surprised JD hasn't hit the problem before.
17:21 lucs jeffreykegler: When the exception occurs, doesn't your error message mention the .../Grammar/ECMAScript_262_5/Program.pm file?
17:23 jeffreykegler Yes it did
17:24 jeffreykegler I was trying to guess where in the stack the problem occurred, and that's one stack level up from my guess.
17:24 jeffreykegler Which since it'
17:24 jeffreykegler s a regex issue and there's no regex in sight at either place, is not necessarily a very good guess.
17:25 lucs Ah. I think the offending regex may be the one on L-379 of the Program.pm file:  our $isEnd = qr/\G$S*$/;
17:26 lucs Anyway, Jean-Damien will know what to do.
17:26 lucs Hopefully ;)
17:26 jeffreykegler Best of luck!
19:09 jdurand_ joined #marpa
19:10 lucs Voici l'homme que j'attendais! :)
19:10 lucs Hi jdurand_
19:11 * lucs switches to English for the benefit of eventual channel readers.
19:11 jdurand_ Re http://irclog.perlgeek.de/​marpa/2014-06-30#i_8950318 - this link should work provided RT forwards correctly to my email -;
19:11 * jdurand_ is not a native speaker but understand lucs's choice -;
19:11 * jdurand_ "native english"
19:12 jdurand_ lucs, gimme few seconds to finish catch up the backlog
20:05 lucs Okay, for those of you reading this log, let me recap what Jean-Damien has discovered, following our private conversation (in French -- it's nice to be able to speak your native language once in a while :-)
20:06 lucs In the Program.pm file, replacing  our $isEnd = qr/\G$S*$/;  with  our $isEnd = qr/(?:\G$S)*$/;  appears to fix the problem, although it breaks some tests in asi.t.
20:07 lucs He will be looking into it later, but right now, I'm a happy camper :)
20:59 jdurand_ lucs, going deeper in the analysis, I believe this is because of $MultiLineComment that is backtracking
21:00 jdurand_ and indeed, if you remove the comment /* Allo */ from your test code, this is passing ok, for me at least.
21:00 lucs Yep, me too.
21:01 jdurand_ I remember well having difficulty with this regexp, and yes, a Marpa sub grammar would do it -; a nice exercice to embed Marpa deeper in the module
21:02 jdurand_ Ok - the good news is that I know now exactly what is the culprit - I'll let you know about the fix - it is a question of backtracking and me not using Marpa - ok, the only technical reason to not use Marpa in this case
21:03 jdurand_ in that if Marpa fails to parse, it will emit an exception - and I wanted to avoid eval{} around Marpa - I am pretty sure this is the real technical reason...
21:04 jdurand_ Jeffrey, would it possible to instruct Marpa perl's interface to not emit an exception in case of failure, but return something in some other place, for example using and input/output variable in the recognizer options?
21:12 jdurand_ lucs, unfortunately it seems that I mistyped in $MultiLineComment
21:13 jdurand_ Replace IsSourceCharacterButNotSlash by IsSlash and tell me -;
21:23 lucs jdurand_: Should I keep the regex fix too?
21:25 jdurand_ Hmmm... I'd do so - but this is not the end of the story anyway - ok I leave you - and will think/hopefully dream if that can help (-;) about it
21:26 jdurand_ AFK
21:30 lucs_ joined #marpa
21:39 jeffreykegler joined #marpa
21:53 jeffreykegler jdurand_: re http://irclog.perlgeek.de/​marpa/2014-06-30#i_8951854
21:53 jeffreykegler I've noted the question and will think about it over lunch.
21:54 jeffreykegler Could you point out the regex?  I may know of some workarounds.

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