Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-02-02

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

All times shown according to UTC.

Time Nick Message
23:07 jdurand ronsavage: Heu... no - tell me more
00:02 ronsavage JavaScript: The Good Parts is just 150 pages, with discussions of some of the bad parts of JS. The author's attitude is that there are many appalling design decisions baked into the syntax. He recommends therefore a smallish subset to use in reliable code. Appendix A is Awful Parts. Appendix B is Bad Parts. Appendix C is JSLint. Appendix D is syntax in railroad form. Appendix E is JSON in railroad form incl. a JSON parser in JS.
00:05 jdurand ronsavage: ah! Many thanks!
00:21 jeffreykegler joined #marpa
05:11 ilbot3 joined #marpa
05:11 Topic for #marpa is now Current release: https://metacpan.org/pod/Marpa::R2   Source: https://github.com/jeffreykegler/Marpa--R2   public logs at http://irclog.perlgeek.de/marpa/today
05:35 jeffreykegler joined #marpa
05:36 jeffreykegler A quick report on Phase 3:
05:36 jeffreykegler It's going very smoothly, if a bit slowly.
05:37 jeffreykegler In the aftermath of the removal of the LR(0) states, a lot of code is now unnecessary, and is being removed as I go.
05:37 jeffreykegler For example, one full pass over the entire bocage during its construction was for the removal of duplicates, something which now cannot occur.
05:38 jeffreykegler I've just removed that pass.  Libmarpa is getting smaller and simpler, while adding features.
05:39 jeffreykegler Anyway, if there is pressure to do an interpass, I can interrupt Phase 3 at pretty much any point.
05:41 jeffreykegler In Phases 1 and 2, it was like having a motorcycle in pieces on the living room floor -- you can't just take it off the race course at a moment's notice.
05:42 jeffreykegler Phase 3 is more like I'm polishing the chrome, or maybe changing a spark plug.
05:42 jeffreykegler Good night!
05:48 jeffreykegler joined #marpa
05:49 jeffreykegler * "take it off the race course" -> "take it out on the race course"
06:25 ronsavage jeffreykegler: This sort of progress must be very pleasing
06:28 ronsavage Off topic: After another fight with BerkeleyDB (http://savage.net.au/Ron/html/Oracle.and.Perl.BerkeleyDB.html) I've manged to install all my modules under Perl V 5.18.2 (which I switched to a couple of days ago)
10:14 * jdurand is now entering test phase of the Marpa-powered JavaScript regexp
12:46 jdurand joined #marpa
17:15 jdurand Jeffrey, there is no way to pass arguments to a semantics_package's new() except by localizing variables, is that correct?
19:02 jeffreykegler joined #marpa
19:04 jeffreykegler judrand: re http://irclog.perlgeek.de/marpa/2014-02-02#i_8213714 -- The per-parse argument is passed using the $slr->value() method: https://metacpan.org/pod/release/JKEGL/Marpa-R2-2.078000/pod/Scanless/R.pod#value
19:07 jdurand ok - thx
22:11 jdurand FYI the tests with the JavaScript regexp engine are doing well, minor bug fixes on the way
22:15 jdurand Question about actions: it seems that if I say action => XXX and XXX cannot be resolved, Marpa does not yell and ignores it - is that an expected behaviour ?
22:23 jeffreykegler joined #marpa
22:25 jeffreykegler jdurand: re http://irclog.perlgeek.de/marpa/2014-02-02#i_8214702 -- An action which cannot be resolved should be a fatal error.  If Marpa is silently ignoring a resolution failure, that is a bug.  Can you create a test case?
22:33 jdurand Yep - otherwise big success with the Marpa-powered JavaScript Regexp Engine -; !
22:33 jeffreykegler judrand: Glad to hear it.
22:39 jdurand issue created
22:41 jdurand Yes, I am very happy, because this was really tedious work, and very glad to have perl in my hands since doing a user-land regular expression engine required closures calling closues callsing closures etc... A very dynamic clode
22:41 jdurand "code"
22:41 jdurand The JavaScript regexp is pecular: it has adopted a subset of perl from grammar point of view, but the semantics are different
22:41 jeffreykegler judrand: Are you thinking of blogging this?
22:42 jdurand I was - the only "problem", if it is, is that it is inside the bigger package MarpaX::Languages::ECMAScript::AST
22:42 jdurand and not a package of its own
22:43 jdurand but if that is not a problem for you, well it is not for me
22:43 jdurand neither
22:43 jeffreykegler jdurand: I don't see a problem.
22:44 jeffreykegler It would introduce people to MarpaX::Languages::ECMAScript::AST through a subset of its capabilities.
22:44 jdurand ok, blogs.perl.org then - I finish the test suite, c.f. https://github.com/jddurand/MarpaX-Languages-ECMAScript-AST/blob/master/t/pattern.t just to be sure I am hitting all the actions writen, and can blog about it
22:45 jdurand The "data" is in the %DATA hash of this file
22:45 jdurand Ah yes, very important...
22:45 jeffreykegler A lot of people learn things best via subsets they already understand ...
22:45 jdurand I could have "fake" JavaScript regular expression by using perl regexp in my actions right
22:45 jeffreykegler and the Perl audience easily relates to regexes.
22:46 jdurand so I made sure I do not fall into this plagiat - yes, you are right, this will be a good advertising of Marpa and its capabilities
22:46 jdurand in fact I can gaurantee that I could have never writen that without it
22:47 jeffreykegler very nice
22:48 jdurand this is very tricky... the final value returned by Marpa is a CODE reference that is a "live" engine created using closures through all the actions of the Regular Expression grammar
22:49 jdurand Sometimes some actions are returning closures that contain themselve closures !
22:49 jeffreykegler very trendy :-)
22:50 jdurand For the curious the grammar is in the __DATA__ section of https://github.com/jddurand/MarpaX-Languages-ECMAScript-AST/blob/master/lib/MarpaX/Languages/ECMAScript/AST/Grammar/ECMAScript_262_5/Pattern.pm
22:50 jdurand nothing particular with it - quite a simple BNF stuff in fact
22:50 jdurand but the actions... ouh ouh....!
22:50 jdurand https://github.com/jddurand/MarpaX-Languages-ECMAScript-AST/blob/master/lib/MarpaX/Languages/ECMAScript/AST/Grammar/ECMAScript_262_5/Pattern/DefaultSemanticsPackage.pm
22:51 jeffreykegler You could have done it using recursive descent, and then your parser would be just as complicated and large as your semantics :-)
22:52 jdurand hmmmm why not
22:52 jdurand .... lol! [smiles] -;
22:53 jeffreykegler Not only that, but the two would be tangled together is a very impressive way. :-)
22:55 jdurand yep - anyway, that is a major step in my work for the full JavaScript Runtime Engine -
22:55 jdurand First I naively though to use perl regexps in the background... but not, JavaScript has the remarquable attribute that it looks like X but is not X
22:56 jdurand where X is a mixture of Perl, C, in particular
22:56 jdurand and actions returning closures that call themselves recursively is quite impressive
22:57 jeffreykegler For some things, the Marpa-powered regexes might work better than the native ones -- particularly cases involving ambiguity or where the regex engines have to backtrack a lot.
23:00 jdurand Sure I understand that - and what is nice is that it is userland - so every modif can be tested very easily
23:01 jdurand Btw, when I started, it was friday evening, I was thinkg to do that in XS maybe, and, luckily (!?) I decided no because
23:01 jdurand ahemmm...
23:01 jdurand there is no way to do closures in C without having to deal explicitely with stack operations in our code isn't it?
23:02 jeffreykegler ... you can do Perl closures from C, and earlier versions of Marpa did.
23:03 jeffreykegler But it makes catching errors harder, and raises a lot of tricky issues.
23:03 jeffreykegler For example, have you noted the controversy about fatal warnings now in the Perl blogosphere?
23:03 jdurand Yes, the XS way via perl - I understand that - your experience in that says me it is good I have not done it like this
23:04 jdurand I have seen that in blogs, yes
23:04 jeffreykegler Now, just to be clear, I am *not* addressing that controversy itself -- I'll stay out of it, but ...
23:04 jdurand Understood - but it worried me because I systematically using warnings FATAL => 'ALL'
23:05 jeffreykegler Consider callbacks.  What do you do about warnings in the Perl code you are calling back from C?
23:05 jdurand Damned... that's a good question
23:05 jeffreykegler Do you silently throw away warnings in Perl callbacks?
23:06 jeffreykegler Or do you make them fatal?  (Again emphasizing I am *not* addressing the general case discussed in the blog pieces.)
23:06 jeffreykegler Either of these has extreme disadvantages.
23:07 jdurand Yes - understood
23:07 jeffreykegler A third way is to set up a kind of event mechanism to transmit the warning from Perl through C, and then report it in Perl.
23:07 jeffreykegler And that is just one issue with callbacks.
23:08 jeffreykegler So Marpa no longer uses Perl callbacks from C -- I switched to doing via an event mechanism, which directs the outer Perl layer to make the call.
23:08 jeffreykegler That way I always have Perl calling Perl, and the issues become much easier.
23:08 jdurand Non trivial issues, almost philosophical, I have not read blogs since a day and a hlaf maybe I should to keep uptodate on this subject - I guess you took the correct decision
23:09 jdurand in the sense that within one framework this is managable, where framework mean the runtime engine
23:09 jeffreykegler I looked at a lot of other Perl modules, and almost universally they callback Perl from XS in similar cases.
23:09 jdurand and I mean here that the perl runtime engine is not the same thing as an XS below
23:10 jeffreykegler And I implemented it that way originally in Marpa.
23:10 jeffreykegler But I think event-driven really is the better way.
23:13 jdurand You have biggger experience than me on that subject - clearly
23:14 jdurand ok, it is a bit late here in west Europe, and have to sleep a while - many thanks for your support
23:14 jdurand and yes, I will blog about it
23:14 jeffreykegler Great!  A good night to you!
23:14 jdurand and I have not forgotten I have to write a test case for the lexeme stuff
23:14 jdurand -;
23:14 jdurand good night
23:25 ronsavage jdurand: What is the word 'plagiat' that you used?
23:30 jeffreykegler ronsavage: it's French ("No kidding, Sherlock"), related to our word plagiarism, but I think in French it also has a sense similar to the way we use "borrow".
23:32 jeffreykegler jdurand was (I think) referring to having considered simply being a very thin layer over Perl regexes, in effect, simply borrowing his semantics from them.

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