Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-06-11

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

All times shown according to UTC.

Time Nick Message
02:03 sivoais joined #marpa
03:22 ronsavage joined #marpa
03:35 jeffreykegler Kollos update:
03:36 jeffreykegler I'm prototyping the LUIF, and in the process changing it -- the basic idea remains the same, but as always, no spec survives contact with the metal :-)
03:37 jeffreykegler As an aside, this is a topic that seems to have come up in the Perl 6 community, which has tried a spec-driven model and seems to be backing away from that.
03:38 jeffreykegler As a 2nd aside, spec-driven *does* make sense in many $work situations, where the technical challenges are minor compared to the organizational ones, and you are not trying to be leading-edge.
03:40 jeffreykegler In Kollos, we are alternating -- we've done a spec up to the point where we're uncomfortable with what it'll be like to actually use,
03:40 jeffreykegler and are now prototyping.
04:31 rns joined #marpa
09:07 koo6 joined #marpa
12:16 rns re http://irclog.perlgeek.de/marpa/2015-06-11#i_10733944 -- yes, and the prototyping is parser-driven.
12:21 rns So, in a sense, LUIF development started parser-driven [1], then turned to spec-driven [2], and is now back to parser-driven. Which seems to be a good thing to get things right while on the leading edge.
12:21 rns [1] http://irclog.perlgeek.de/marpa/search/?nick=&q=parser-driven
12:21 rns [2] http://irclog.perlgeek.de/marpa/2015-04-15#i_10445779
15:19 Cheery it can parse: http://i.imgur.com/hbR2xyX.png
15:19 Aria \o/
15:20 Cheery can't yet parse ambiguous, but that because I don't have mechanism in place to select from ambiguous parses.
15:21 Cheery I'm putting this into github
15:21 Cheery now
15:24 Cheery https://github.com/cheery/little_list_editor
15:32 Aria Tidy!
16:29 Cheery I did few adjustments to it, which made it to resemble the parser in harmonia project
16:33 Cheery it'll be interesting to see how that changes when I add in ambiguity resolution
16:34 Cheery in a while I will turn the language ambiguous
16:34 Cheery by adding the prefix and postfix plus and minus rules :)
16:35 Aria Nice!
16:43 koo6 joined #marpa
17:51 lwa joined #marpa
19:41 jeffreykegler joined #marpa
19:56 Cheery I ended up with a slight problem
19:57 Cheery if my  language is unambiguous, the system manages to recognize when it cannot parse sub-section and collapse it enough that it can parse it.
19:58 Cheery but say I have prefix + and infix + without comma.
19:58 Cheery when I type in + and then something, it recognizes the prefix first.
19:59 Cheery instead of recognizing that the syntax was ambiguous
19:59 jeffreykegler Do you explicitly check for ambiguity?
20:00 Cheery nope
20:00 jeffreykegler As it happens I just ran into this in hacking together a Lua parser
20:00 Cheery hmmm...
20:00 jeffreykegler I checked explicity for ambiguity and got a nice message telling me where it was
20:01 Cheery if I resort to triggering the parsing with tab, this thing seems to behave much nicer
20:01 jeffreykegler My solution was to rewrite the expression, which I'd written without precedence because I don't need to evaluate it ...
20:01 jeffreykegler I was just doing a pass-through of the tokens, kind of pre-processor style ..
20:02 jeffreykegler ... to rewrite it with precedence, which you can do manually with BNF,
20:02 jeffreykegler or with Marpa's precedenced statements.
20:07 Cheery I'm not entirely sure how to proceed with this now.
20:08 Cheery it exposes some really really nice behavior.
20:08 Cheery especially when the syntax is unambiguous
20:08 Cheery in a way it feels like some advanced incremental parser when that happens
20:09 Cheery but if I make the syntax intentionally ambiguous a little bit, it immediately stops working
20:11 Cheery it may be due to how I designed it
20:12 Cheery practically it parses only subsection of the tree at a time
20:12 Cheery that is. say you made a change that retained a group that was tagged X
20:13 Cheery it attempts to produce X from that group
20:13 Cheery if it cannot produce X
20:13 Cheery it collapses it and tries again
20:14 Cheery so if X was part of Y, it tries with larger section of Y next
20:14 Cheery all the way down to root if it fails everywhere.
20:15 jeffreykegler "say you ..." meaning this is what you are trying to do?
20:17 Cheery it's not necessarily correct way to do it
20:18 jeffreykegler The method you describe is procedural and backtracks.
20:19 jeffreykegler I won't use words like "wrong" but it is *exactly* the kind of parsing to which I thought Marpa could be a better alternative.
20:19 Cheery yeah. it works bit better if I don't parse after every command, but after pressing tab
20:20 Cheery that's because editing commands destroy more structures, allowing the parser to build up larger constructs
20:20 Cheery occassionally it fails on that too though.
20:21 Cheery but this far these are the best results I've gotten.
20:21 jeffreykegler Is this inspired by the "inverse parsing" idea you showed me the other day?
20:22 Cheery not yet. This is more like something I tried earlier without having a well working parser to it.. and not realising that I'd need strong parser for it.
20:24 Cheery the motivation would be to have an editor that can provide meaningful structure editing with ambiguous grammars.
20:25 jeffreykegler This does not sound easy :-)
20:26 Cheery it probably is not
20:31 Cheery it's also maybe good idea to leave it into backburner for now
20:32 Cheery who knows maybe I get an another idea to the problem it presented today.
20:33 Cheery having seen that it worked there rather well.. I'm slightly excited about trying this for what I was going to try it for.
20:57 Cheery using the parser revealed a bug that possibly caused issues in my structure editor too.
20:58 Cheery or then not.. I was using the input directly.
21:10 Cheery jeffreykegler: I'm not still sure whether I understood what you meant with that "you get the grammar you write"
21:11 jeffreykegler That was just another was of saying that Marpa is declarative ---
21:11 Cheery I'm this far at defining pyllisp: https://bpaste.net/show/dde8765266f8
21:11 jeffreykegler You get exactly what is in the BNF.
21:12 Cheery yeah. especially the line 26 at that paste points it out
21:12 Cheery I figure any deterministic parser kit would've screamed about that already
21:13 Cheery but it exactly describes the language I want because 'expr' cannot come after dedent
21:13 Cheery only dedent or newline can come after it.
21:15 Cheery I call this kind of situation 'coercion'
21:16 Cheery and it happens often to me. the program is correct under conditions I give to it, but it doesn't necessarily coerce to simpler model.
21:18 jeffreykegler Break time!  AFK
21:18 Cheery getting sleep here
21:18 Cheery I'm likely getting to that inverse parsing too, but not necessarily in this month.
21:25 Cheery relatively significant coincidence that the tool which may make structure editing possible is also the largest demotivator to implementing it
23:11 ronsavage joined #marpa
23:59 sivoais joined #marpa

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