Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-01-18

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

All times shown according to UTC.

Time Nick Message
02:02 flaviu joined #marpa
05:01 ronsavage joined #marpa
05:33 ronsavage After hobbs was interviewed by Randal, I mentioned the idea of a series of Marpa-oriented lightning-like talks. I don't want to call them Marpa Lightning Talks, since there could already be (now and in the future) any number written by others. I'm here referring to those whose text I'll host on my site. ATM I'm writing 'Marpa Insight Talk # 1', about MarpaX::Languages::SVG::Parser. I am hopeful I will by only 1 of many of you who contribute (h
06:05 ronsavage I'd prefer another name for the series, too. Perhaps Marpa App Insights?
07:21 koo5 joined #marpa
08:04 rns jdurand: re http://irclog.perlgeek.de/​marpa/2015-01-17#i_9959356 -- I ran /usr/bin/time -f %M prove -Ilib on patched and source repos under cygwin and it was 131727360 vs. 131923968 kb, so I should have rather told "very slightly" :)
08:39 jdurand rns: ok, thanks.
09:04 basiliscos joined #marpa
13:32 rns ronsavage: caught a typo on the Marpa website -- s/C:Struct - Disect C structures/C::Struct -- Dissect C structures/
15:01 jdurand There are projects that were discontinued and are not usuable. The last C::Struct is one of them I believe (& my fault -;)
15:10 lwa joined #marpa
16:31 jdurand ronsavage: in https://metacpan.org/pod/Text::Balanced::Marpa it is said that pos() and length() are parameters to new(). Are they also, or can they be, parameters to parse() ? Or can they be simply called on the new()ed object just before calling parse() ? Thx.
17:11 jeffreykegler joined #marpa
19:56 LLamaRider joined #marpa
20:35 jeffreykegler joined #marpa
21:37 ronsavage joined #marpa
22:14 ronsavage rns: http://irclog.perlgeek.de/​marpa/2015-01-18#i_9962385. Correct! And after Jean-Damien's reply I've removed both references to the module in question.
22:15 ronsavage Jean-Damien: Re http://irclog.perlgeek.de/​marpa/2015-01-18#i_9962945. They are not yet parameters to parse. I'll release a new version now which allows that.
22:37 hobbs Is there a good example around of how I might parse a length-prefixed string with Marpa?
22:37 hobbs (as part of a larger grammar)
22:38 jeffreykegler Do you mean a Hollerith string: 3HABC
22:38 jeffreykegler or something like that?
22:38 hobbs that idea, yes
22:38 jeffreykegler I did a blog post on a Dyck-Hollerith grammar a while ago
22:39 hobbs oh yes you did
22:39 hobbs found it. Yes, that's just the kind of thing.
22:39 hobbs I'm actually trying to do the Java class parser that jdurand suggested
22:40 jeffreykegler Java uses hollerith strings?
22:41 hobbs the class file format uses strings like http://docs.oracle.com/javase/spec​s/jvms/se7/html/jvms-4.html#jvms-4.4.7
22:41 hobbs as well as lots of tables of things that are just stored as the number of entries, followed by that many entries
22:41 jeffreykegler OK.  This is connected with the idea of parsing binary data
22:41 hobbs yes
22:42 jeffreykegler http://jeffreykegler.github.io/Ocean-of-Awarenes​s-blog/individual/2013/06/mixing-procedural.html
22:42 jeffreykegler is the latest on the Dyck-Hollerith thing (I think).
22:43 jeffreykegler But since then I've done a lot more with events, and I suspect for parsing binary data, you will want to get deep into procedural logic
22:43 jeffreykegler and events.
22:50 jeffreykegler hobbs: Also, Ron Savage's parsers take a very event-driven approach these days ...
22:50 jeffreykegler I personally tend to be more syntax-driven.
22:54 jdurand hobbs: when I had a little spare time, I did this very quick snapshot reading the .class document. This can be miles away from what you are doing, anyway, if that can help... this is how I represented the doc in my head while I was reading it: https://gist.github.com/jdd​urand/7b7074f8ebbf668c25d7
22:57 jdurand ronsavage: I know you are a Moo user, are you a Moops one? the rewrite of the M4 stuff in Moops is well advanced, but I admit I suffered from totally unusable error reporting from that framework more than once. Suppose you write 500 lines of code. Try it. it fails saying oooups, parsing failure with irrelevant line number and source code.
22:57 jdurand Just wanted to know -;
22:58 jdurand Otherwise, once you get it up and running, this looks (and it, to me) very elegant - Since Moops == Moo + all the new Tiny stuff, I am almost pretty sure in advance that the OO framework on it will be a performance penalty (ok, crossing fingers)
22:59 jdurand "(and is, to me)"
22:59 jdurand 'will NOT be" -; grrrr sorry
23:02 hobbs jdurand: yes, that mostly looks good, but I think I will need to enforce the counts rather than just having things like interfaces ::= interface*
23:05 hobbs Jeffrey's blog post looks like the thing I need to do that.
23:06 jdurand hobbs: yes, jus re-readed it, it is a good post - no pb - that was just in case
23:06 ronsavage jdurand: I've released V 1.06 of Text :: Balanced :: Marpa. It has 3 small but incompatible changes. See the Changes file. Most important is that parse() now takes a hash.
23:07 jdurand ronsavage: Ah... ok. Btw in he meantime I switched to regexp (oups) - Do you think your module could be adapted to a Text::Delimited::Marpa easily ?
23:07 hobbs jeffreykegler: what if 'array' didn't have the '(' and ')'? So instead of ')' ending the array and check_array validating that the count is consistent, I just want to read <array count> worth of elements, no more and no less
23:08 jeffreykegler Left as an exercise to the reader? :-)
23:09 hobbs okay, I'll think on it
23:09 jeffreykegler I think it's straightforward to throw away the part you don't need.
23:10 jeffreykegler The original problem was their weird hybrid language that was trying to use both counts (Hollerith strings) and parentheses (a Dyck language)
23:10 jeffreykegler I think just using the Hollerith string part simplifies the problem.  Let me know if there's some kind of wrinkle to it.
23:11 hobbs I see your solution for counts for strings, which is just lopping off that many bytes of the input. Makes great sense.
23:12 hobbs But counts for *rules* like element needs a different approach
23:14 * jdurand oups, time to sleep
23:14 ronsavage jdurand: Yes, Text :: Delimited :: Marpa is a good name. Ahh. It's time for morning tea. Let me think about it, but I'm 90% convinced to change :-)
23:14 hobbs but I would guess that what might work is pausing before an artificial "check" token in element, seeing whether we've read the right number of things, and having the code either provide it, or not.
23:15 jdurand ronsavage: oh, great - ok AFK - have a nice day and and of day for the others and... oh well -;
23:15 jeffreykegler hobbs: a chance to pioneer yet another new technique! :-)
23:16 jeffreykegler hobbs: Did you see my notes on your interview, btw
23:16 hobbs no
23:16 jeffreykegler jdurand: good night!
23:18 jeffreykegler hobbs: https://gist.github.com/jeffr​eykegler/3563fd82932663837f01
23:18 hobbs thanks
23:19 jeffreykegler hobbs: re the counted rules
23:19 jeffreykegler I could throw guesses at you, but ...
23:19 jeffreykegler you'll come up with the same guesses once you've studied events and done some thinking.
23:20 jeffreykegler So I'll let you have the fun. :-)
23:23 hobbs yeah, I'll do my best. I like to digest something already working, but I *can* think for myself :)
23:24 hobbs I skimmed through your notes, looks pretty good. Mostly stuff I could have clarified, I'll try to remember for the future.
23:26 hobbs You're right, I was definitely off about "streaming" parsing. Interesting that you're looking to the future on that, though!

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