Re: I may be teaching my colleagues Marpa
A good start. -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
Yep all great points - and I agree POLS should be prioritized. I think an obvious solution may be to use a null keyword? Then it's possible to explicitly provide it as an alternative while at the same time possibly even being more clear than the current syntax (which can throw off the first timers). If one can bolster intuition while preserving principle of least surprise then it's probably a win/win. Thoughts? On Jun 19, 2014, at 12:10, Jeffrey Kegler jeffreykeg...@jeffreykegler.com wrote: Christopher is right that I could make null RHS's part of the syntax of other rules.. I don't because: 1.) Null alternatives would be easy to create by accident. 2.) Null alternatives are very special in the adverbs they do and do not allow. 3.) Null rules can make parent symbols nullable, which can have tricky or unintended results. 4.) Allowing null alternatives does not eliminate the non-orthogonality. It just moves the issue elsewhere -- null alternatives in a prioritized rule would almost certanily mean a typo, or an attempt to do something that won't really work, and probably should be banned. All of which means that forcing a user to specify a null RHS as a special separate rule is in keeping with the Principle of Least Surprise. Note that one of the people who might be victim of these surprises is me -- in my own SLIF grammars, I don't regret having to make my null rules separate. Finally, I welcome experimentation. It's quite possible to create your own front-end to the SLIF, if you think you can improve on the SLIF and handle null rules in a way that combines safety and elegance. As I've said before, the SLIF exists because of the experiments by Peter Stuifzand and Andrew Rodland, experiments which took Marpa beyond where I'd gone and showed me that I could and should improve on Marpa's original interface (the NAIF). -- jeffrey On 06/19/2014 11:42 AM, Christopher Layne wrote: If you ignore the null rule it'll blow your mind less if you think about it as: A ::= B | 'hello!' A ::= There's no conceptual reason that the null rule couldn't be the last alternative but I believe the DSL grammar won't allow it hence it's a separate statement. On Jun 18, 2014, at 9:37, Paul Bennett paul.w.benn...@gmail.com wrote: A ::= B A ::= 'hello!' A ::= # empty Point not taken. Point, in fact, blew my mind. More research is required. -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
If your audience is smart you can also use an alternative way of demonstrating the value of grammars and parsing by taking a very simple parsing example (one that requires state management if implemented literally) and showing a slide before anything else that has a literal non-grammar based implementation - complete with if ($state == 1) { stuff; } etc type stuff. Usually balanced and nested parens is a good example as it's a common problem. Most of your audience will think this is crazy - why not use regex? which is where you go to the next slide showing the regex implementation and the associated hairiness involved to get the job done. After they realize it's less trivial than they thought you show them the BNF/parser based approach and they then fully realize the value - rather than just assuming this is some kind of arcane 1960s approach to getting the job done. A lot of programmers today lack basic knowledge on things like grammars, FSMs, etc because they've been taught regex is the hammer along with too much high level language teaching at the expense of low level problem solving. In a sense, they're sheltered by the features of their tools but when said tools cannot do something efficiently they do not know where to go because they lack survival skills. You end up with a lot of really sketchy/brittle/inefficient solutions. This is why C should continue to be the first real language students are taught in and things like Java and the like are deferred until students adequately understand the value proposition of why they would use a higher level language vs a lower level one. Relative value requires contrast and jumping right into languages that provide convenience factor quickly ultimately dumbs people down by reducing critical thinking. Also, man does not respect hammer until he smashes his thumb. On Jun 19, 2014, at 3:09, Ruslan Shvedov ruslan.shve...@gmail.com wrote: Finally, this quote from Jeffrey helped me understand BNF better; perhaps it'll be useful to you. So the basic idea of the SLIF is BNF -- a rewriting system with an alphabet of terminals, and rules which are composed of symbols. In a context-free grammar every rule has one LHS symbol, and zero or more RHS symbols. Add a special start symbol, and you're ready to rock 'n roll! -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
On 06/18/2014 09:37 AM, Paul Bennett wrote: Slide 2: Calling Marpa a scribe is a bit like calling Indiana Jones a professor. Marpa was an explorer/adventurer/teacher/translator, and founder of the major lineages of Tibetan Buddhism. Yes, but there's only so much you can fit on a slide without butchering the font size and whatnot. I'll see whether I can squeeze in a footnote quoting that description verbatim though. The word translator would suffice, and explains why Marpa is named after him. His longer name Marpa Lotsawa -- Marpa the Translator, like Ethelred the Unready or Harold the Tyrant or Alfred the Great. One reason it is dangerous is that several rules can have the same LHS: A ::= B A ::= 'hello!' A ::= # empty Point not taken. Point, in fact, blew my mind. More research is required. If you think your audience does not understand BNF, you might want to do 1, 2 or 3 slides just on the BNF rewriting system. These days it seems you can get an MSCS from a good school without encountering BNF anywhere in the curriculum, so many quite accomplished programmers don't have BNF in their skillset. For decades, it's only been useful for using yacc, which strains the meaning of the word useful. When the rule A ::= B C is said to be named A, to my ear it is like saying that the equation. e = 2 + 1/2! + 1/3! + is the equation named e. Now admittedly, I contributed to this confusion by, when I allowed rule names, having them default to the LHS. But it is so convenient to do that in most cases, I could not see a way of avoiding it without seeming to make unnecessary difficulties. There is a name adverb, so you can say A :: B C name = Rumplestiltskin -- jeffrey -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
An update on this: a speaker dropped out at YAPC::NA next week, and I'll be filling in with a version of my Marpa talk that will hopefully be less out-of-date :) The slides will be online, and with any luck, so will video. English. (Reini, were you there?) It's outdated in parts, particularly the material on lexing. In fact, Andrew's comments on lexing and his work on TAP described in the slides were extremely important in the new approach to lexing that I took with the SLIF. -- jeffrey On 05/08/2014 06:36 AM, Paul Bennett wrote: Yesterday, I was approached at work about the possibility of leading a seminar on Marpa . I feel thrills of excitement and of terror in equal proportion, but I'm going to start penciling together a few slides and see how it goes. I wonder whether any of the luminaries in the field (e.g. Ron, JD, and of course Jeffrey, among others on this list) would have any pointers on leading a group of competent Perl programmers from zero to hero in the space of an hour or two? Also, if I do go through with it, I wonder how much interest there would be in recording a screencast of the presentation (or a recording of the actual seminar) to be shared online? tl;dr? I need to teach Marpa. HELP! -- Paul PAUSE: P/PW/PWBENNETT -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
On 05/08/2014 03:36 PM, Paul Bennett wrote: Yesterday, I was approached at work about the possibility of leading a seminar on Marpa . I feel thrills of excitement and of terror in equal proportion, but I'm going to start penciling together a few slides and see how it goes. [...] Also, if I do go through with it, I wonder how much interest there would be in recording a screencast of the presentation (or a recording of the actual seminar) to be shared online? Hi Paul, I for one would be very interested in a recording or your slides. Good luck! Sven -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I may be teaching my colleagues Marpa
I too would be interested. On Thursday, May 8, 2014 8:36:22 AM UTC-5, Paul Bennett wrote: Yesterday, I was approached at work about the possibility of leading a seminar on Marpa . I feel thrills of excitement and of terror in equal proportion, but I'm going to start penciling together a few slides and see how it goes. I wonder whether any of the luminaries in the field (e.g. Ron, JD, and of course Jeffrey, among others on this list) would have any pointers on leading a group of competent Perl programmers from zero to hero in the space of an hour or two? Also, if I do go through with it, I wonder how much interest there would be in recording a screencast of the presentation (or a recording of the actual seminar) to be shared online? tl;dr? I need to teach Marpa. HELP! -- Paul PAUSE: P/PW/PWBENNETT -- You received this message because you are subscribed to the Google Groups marpa parser group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.