Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2015-06-08

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

All times shown according to UTC.

Time Nick Message
03:27 lucs joined #marpa
09:38 rns left #marpa
11:00 koo6 joined #marpa
11:42 ceridwen joined #marpa
17:25 jeffreykegler joined #marpa
17:40 lwa joined #marpa
18:23 koo6 joined #marpa
22:57 Cheery I am getting back to parsing subject again
22:58 Cheery but after working on something else it's again about reset.
23:01 Cheery the problem I'm looking at is that any parsing technique I pick, it limits what kind of language can be built
23:02 Cheery practically I manage to do useful only with state push/pop or recursive descent parsing
23:02 Cheery because the limits are so bleedingly obvious
23:05 Cheery on earley-style parsing I may use ruby-slippers or stropping
23:06 Cheery but although early likely is aware exactly of what I mean with input string, it may also find out all the other meanings
23:10 ronsavage joined #marpa
23:11 Cheery another problem is that although writing a parser could be easy for some expressive language
23:12 Cheery I easily end up with constructs that need different treatment based on where they are
23:12 ronsavage Cheery: In case you're wondering, then yes, Marpa can handle ambiguous input.
23:13 Cheery I know that.
23:13 ronsavage Cheery: Apart from that, it's very hard to tell what's bothering you, but if you post a gist on github or pastebin we can then see exactly what sorts of issues you are facing.
23:13 Cheery and it'd seem I can also figure out the algorithms, it's all clean.
23:14 Cheery but if I take this out into practice, the pratice mangles it beyond recognition.
23:15 Cheery ronsavage: I'd want a language sort of like python or coffeescript
23:16 Cheery but I'd kind of want something better than either of them.
23:16 Cheery it might be I'm just looking for too much.
23:17 Cheery https://github.com/cheery/pyllisp/blob/master/tests/0
23:18 Cheery I have written a parser for this language by hand
23:18 Cheery the language is sensitive about whether a symbol is spaced like: x+x   x + x  or  x  +x
23:19 Cheery it determines the meaning of structures after parsing
23:20 Cheery similarly it handles indexing and lists
23:20 Cheery x[ means different thing than x [
23:21 Cheery https://github.com/cheery/pyllisp/blob/master/tests/1
23:22 ronsavage OK. Frankly I think that syntax is pathological, since the whitespace usage contradicts so much of what we are used to. But let's put that aside.
23:22 Cheery there is  no comma, and since the parser is handwritten, I avoided defining special semantics.
23:22 ronsavage What immediately comes to mind is Marpa's event, triggered by lexeme detection. I use that preferentially over the 'action' clause on rules.
23:23 Cheery what's that?
23:24 ronsavage With the event giving you the point in the input string - i.e. context - you can take an intelligent decision about how to interpret the char (here '+') be examining the whitespace before returning control to the parser.
23:25 ronsavage I suspect you've defined special semantics by assigning differing meanings to whitespace depending on its context!
23:25 ronsavage Anyway, it's 9:28 am here now, so I'll have to switch to another virtual desktop (love Debian!) and start work. Good luck!
23:26 Cheery the hand written parser observes whether adjacent tokens start and stop in same point as the token starts and stops
23:26 Cheery ok.
23:26 Cheery I need to go to sleep.
23:27 Cheery it can be I've just punched myself to face with this bit too many times.
23:28 Cheery so..
23:32 Cheery I could attach a condition as a terminal, instead of a symbol name.
23:42 Cheery so few adjustments and the language could be parsed.
23:43 Cheery since I'm not using marpa, but I've written similar algorithms into a python program.
23:43 Cheery I have problem of transforming the output of parsing into desired format.
23:44 Cheery I've found that affects the structure of language too
23:45 Cheery https://github.com/cheery/pyllisp/blob/master/compiler/__init__.py#L516
23:45 Cheery there the interpreter.. but..
23:45 Cheery https://github.com/cheery/pyllisp/blob/master/compiler/__init__.py#L883
23:45 Cheery this
23:47 Cheery just preorder+postorder traversal could likely be useful.
23:48 Cheery that is. parsing reconstruct called with an object (env), gets transformed along the way.
23:50 Cheery then on postorder (coming back from tree leaves), command gets invoked with env-out, return values
23:51 Cheery ambiguity interrupts the processing.
23:54 jeffreykegler joined #marpa
23:54 jeffreykegler Cheery -- good luck
23:56 jeffreykegler Your situation echoes that of many Marpa users -- current parsing practice (rec descent) is basically non-parsing techniques -- calling subroutines and using procedural hacks.
23:56 jeffreykegler Programmers tolerate its limits because programmers are supposed to know how to call procedures and hack their way out of binds -- when things go wrong they blame themselves and not the technique.
23:57 jeffreykegler Marpa is declarative-based, so you have to think in terms of BNF -- it's not that hard ...
23:58 Cheery I can write a well working recursive descent parser. there's two things that I can't do aftewards though.
23:58 Cheery changing it based on new insights about the language opens a portal straight to hell
23:58 Cheery can't avoid that
23:58 jeffreykegler Right -- top-down hackery does not scale.
23:59 Cheery also can't reapply it easily either. It'll be easily stuck to what it originally was doing

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