Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2014-06-27

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

All times shown according to UTC.

Time Nick Message
00:24 jeffreykegler joined #marpa
03:04 shadowpaste "jeffreykegler" at 108.70.209.148 pasted "Correcting mismatched brackets" (63 lines) at http://scsys.co.uk:8002/401971
03:05 jeffreykegler Larry in his YAPC::NA talk mentioned a couple of RFC's rejected because they were impossible from a parsing standpoint, and I thought they'd be instructive to revisit using Marpa.
03:06 Aria Ooh!
03:07 jeffreykegler One such impossibility was unmatched closing and starting brackets.  In math, things like (0 ... 1] are pretty common.
03:08 jeffreykegler I just pasted something that deals with unmatched parentheses.  For the purpose of experiment, the semantics I picked was auto-correction -- try to close a < with a ], and you get an auto-correction and a warning.
03:10 shadowpaste "jeffreykegler" at 108.70.209.148 pasted "Output from bracket auto-correct script" (11 lines) at http://scsys.co.uk:8002/401975
03:12 jeffreykegler Another technique illustrated here is error-catching rules -- fallback rules to deal with errors.  In this case matched brackets are dealt with by one set of rules, and then there's a fallback rule that catches the case of unmatched brackets.
03:14 jeffreykegler Error-catching rules don't get much use with current parsers, because it's so hard to get a parser working with just the rules for the correct cases.
03:14 jeffreykegler But Marpa is more easy-going if you throw in some extra rules.
04:24 jeffreykegler Re Lua: I'm still looking at a lightweight embeddable/extensible language for coupling with Marpa.
04:25 jeffreykegler I even took a peek at GNU's guile.  (The LISP-like syntax is not a show-stopper, since Marpa can run a front-end for it.)
04:26 jeffreykegler I've realized that, beyond the bare minimum of features I am looking for, the best criteria is "How many features does it have that I won't use or will want to replace?"
04:27 jeffreykegler In other words, beyond the core set of features, every other feature counts *against* a language -- which pretty much kills guile as a contender.
04:28 jeffreykegler By this criteria, Lua does quite well -- when it comes to not having features, Lua is good at it.
04:44 sivoais joined #marpa
13:14 Aria Quite.
14:30 jeffreykegler joined #marpa
14:31 shadowpaste "jeffreykegler" at 108.70.209.148 pasted "The "RFC rejects" language, phase 2" (77 lines) at http://scsys.co.uk:8002/402258
14:33 shadowpaste "jeffreykegler" at 108.70.209.148 pasted "Output from test run of "RFC rejects" language, phase 2" (22 lines) at http://scsys.co.uk:8002/402260
14:34 jeffreykegler Continuing my series of Marpa implementations of Perl 6 RFC's rejected because they were unparseable.
14:35 jeffreykegler Also rejected was a RFC for chained relationals.  Thet is, "a > b < c", meaning "a > b && b < c".  It would be a pretty nifty syntax.
14:36 jeffreykegler And I've implemented it in the mini-language just pasted, with sample output.
14:36 Aria Nice! Now that one I can totally get behind
14:37 jeffreykegler I've implemented it together with auto-correction of unmatched brackets, including angle brackets.
14:37 jeffreykegler For, example it parses this: (a>b)((<{b<<<c>)>d>>>>
14:38 jeffreykegler It parses as this: (a gt b)((<{b lt <<c>> gt d}>))
14:39 jeffreykegler That is, it figures out which of the <>'s are relationals, and which are angle brackets
14:39 jeffreykegler It also auto-corrects an angle bracket mismatch with a closing ')'
14:42 jeffreykegler What I'm trying to do here is not to promote particular syntaxes, but ...
14:43 jeffreykegler to suggest to this who are confining themselves to under-engined parsers that they are cheating themselves.
14:44 jeffreykegler That is ...
14:44 jeffreykegler To get them asking themselves, if the impossible suddenly became easy, what would I do?
14:47 jeffreykegler A couple of points about the previous example -- first, a human being could go through it and spot the relationals and unmatched brackets, so why do we think this should be impossible for a computer?
14:49 jeffreykegler Second, Marpa handles ambiguity, but it's so powerful that ambiguities are much rarer.  The example above is not ambiguous, and Marpa can see that.
14:50 Aria Oh nice. Handled via error correction rules, true, makes things not-ambiguous.
14:51 jeffreykegler ( I know when I was working on ambiguity detection some time ago, and wanted to test my logic, I had a hard time coming up with "real life" examples that Marpa could not disambiguate.)
14:52 jeffreykegler Comments welcome.  I'm thinking of writing this up, but trying to figure out a way to do so that people get the point ...
14:52 Aria Yeah, that's the hard part.
14:53 Aria "Look! Error handling!" and "Look! Parsing hard things!" are distracting from each other.
14:53 Aria Despite being the same tools used.
14:53 Aria Then again, actually allowing broken syntax to work is ... probably bad.
14:53 jeffreykegler which is *not* the specific language features, but that they should use a powerful enough parser that they are free to invent their own cool new syntax.
14:55 jeffreykegler Yes, kind of "Gee whiz, Wilbur and Orville, if you wanted to cross the field behind the barn, why didn't you just walk?"
14:57 jeffreykegler hobbs: By the way, one thing I really enjoyed about your talk, if that you clearly understood a number of points I've been making over the months, points on which I worried I was just talking to myself.
14:57 jeffreykegler hobbs: I'm thinking particularly of Marpa's non-determinism, which you explained very nicely.
14:58 hobbs that's nice to hear :)
14:59 jeffreykegler Yes, whenever I'd post about non-determinism vs. determinism, I'd get limited response ...
14:59 jeffreykegler and 100% of them had completely missed the point.
15:00 jeffreykegler Aria: re the broken syntax.  I could abend when I catch mismatched parens, but it makes a better example if the parse goes through.
15:02 jeffreykegler And in real life, I think something like that approach -- auto-correct so the parse can continue, but also issue a stern warning -- may be best, because letting the parse goes through makes it easier to find other errors, and to see the context.
15:02 Aria jeffreykegler: Yeah. It demos error correction neatly -- but I think people are used to a mindset where that 'should' break.
15:03 jeffreykegler I maybe should look up that Perl 6 RFC -- it proposed unmatched brackets with some sort of special semantics, I think.
15:03 hobbs jeffreykegler: rock is http://www.rockstack.org/, something we use in-house at shutterstock. It falls somewhere between Carton and Docker in what it does
15:04 hobbs associates a project directory with a language runtime, installs dependencies locally, and runs commands with that perl (or ruby, or python, or whatever) and that local::lib (or rbenv, or whatever)
15:05 jeffreykegler hobbs: thanks
15:05 hobbs it might be abandoned by its author soon, so don't worry too hard about it :)
15:06 jeffreykegler By the way, the mixture of angle brackets and '<>' relationals is a great example of the power of LATM
15:08 Aria Absolutely!
15:10 voodoo1 joined #marpa
15:11 voodoo1 left #marpa
15:16 jeffreykegler Here's another example, input: (a>b)((<{ b < << i>j >> > d >>>>
15:16 jeffreykegler Output: (a gt b)((<{b lt <<i gt j>> gt d}>))
15:18 jeffreykegler Anyway, I'm thinking of turning this RFC rejects theme into a blog post.
15:19 jeffreykegler There was one more syntax-motivated Perl 6 RFC rejection, which was lazy sequences, written like this: a ..
15:20 jeffreykegler That is, a multi-dot operator, with a LHS but no RHS.
15:20 jeffreykegler But I may ignore it as too easy :-)
15:20 Aria Great way to introduce the concept.
15:29 jeffreykegler Aria: re http://irclog.perlgeek.de/marpa/2014-06-27#i_8939325 -- of course, another point is that with a more powerful parser, parsing can be error handling ...
15:29 Aria Yeah. Though that's not the same as 'not having errors'.
15:30 jeffreykegler that is, error handling, which used to require a total halt in the parsing and drastic measures, can now be fit more naturally into the parse.
15:30 jeffreykegler As techniques, the two become a continuum
15:31 jeffreykegler Whether the zero tolerance approach is still best, is a separate question.
15:31 jeffreykegler But note the real question in most cases, is *not* whether you abend the parse.
15:32 jeffreykegler That is, in a C compiler, for example, you could continue the parse, but refuse to create an object file.
15:32 Aria Yeah.
15:33 jeffreykegler So the compiler's approach becomes kind of, "OK, here's what I think you meant, but until you clean this stuff up, I ain't gonna give you an object file."
15:33 jeffreykegler So the approach stays fascist, but a more helpful brand of fascism. :-)
15:34 Aria ++
15:35 jeffreykegler I'm taking it, but the way, that I should not go on to add the lazy list syntax to this example, because ...
15:36 jeffreykegler while short, it's already complex and already raises more than enough issues.
15:38 Aria I kinda like that example -- such a tiny case to show off.
15:38 jeffreykegler * "but the way" => "by the way"
15:38 jeffreykegler Aria: which example?
15:39 Aria The open list.
15:40 jeffreykegler Sigh.
15:40 jeffreykegler I do have the problem of creating very ambitious examples, and getting the reaction, "Interesting, but probably overkill"
15:41 jeffreykegler Aria: would you be interested in extending a calculator to use it?
15:41 jeffreykegler You could take one of the calculators from the synopsis.
15:41 jeffreykegler Or start your own new language. :-)
15:44 Aria Heh, perhaps.
16:18 hobbs jeffreykegler: as Larry mentioned in his talk, and to me after my talk, Perl 6 made a lot of changes to get a less ambiguous grammar than Perl 5.
16:25 jeffreykegler hobbs: Perl 6 switched to a less powerful parser -- LL as opposed to LALR.
16:27 jeffreykegler Because of disappointment in LALR, the trend in language design has been to (frankly) "dumb down" the syntax.  The field gave up on improving parsers.
16:28 hobbs right
16:28 jeffreykegler Now in the early days, parsers kept improving, and it was very exciting for languages.
16:29 jeffreykegler You got first FORTRAN and LISP, which broke new ground.
16:30 jeffreykegler And then came ALGOL, which itself got little use, but changed the way people looked at and designed languages.
16:32 jeffreykegler I've been surprised that nobody (so far) has looked at Marpa, and said, "OMG!  Cool totally new languages!"
16:32 jeffreykegler Because so far Marpa usage has been aimed an incremental improvements in dealing with existing kinds of syntax.
16:33 jeffreykegler * "an increment" => "at incremental"
16:34 hobbs yeah, I can see that
16:35 jeffreykegler ALGOL was sort of like Dylan showing up at Newport with an all-electric band and launching full-bore into a blistering rendition of "Maggie'
16:35 jeffreykegler s Farm"
16:36 jeffreykegler An interesting thing to consider is that ALGOL made the parsing revolution, without having a new parser.
16:38 jeffreykegler That is, they designed ALGOL because they wanted really great new syntax, and had no idea how they'd parse it.  They just assumed somebody would.  (This was typically of projects where Alan Perlis played a role.  Alan was very visionary.)
16:39 jeffreykegler It was another professor of mine, Ned Irons, who invented recursive descent in order to parse ALGOL.
16:40 jeffreykegler I think we need to bring some of that ALGOL spirit back into language design.
16:41 jeffreykegler I think I've said before Marpa is out-of-the-box thinking, but that's by accident -- since the 1970's the box has shrunk.
17:02 Aria Heh, true that.
21:22 ronsavage joined #marpa
21:23 ronsavage I loved using Burroughs Extended Algol. People used to call it 'over-extended', but it's how I really learned to program.
21:27 ronsavage I do have to admin though, that there were times it was frustrating because it wasn't designed for string handling. Then came Pascal, which had strings, but short ones only. More frustration! Slowly the industry faced the fact that variable-length strings were part of the real world, and hence had to be available in programming languages.
21:30 aredridel joined #marpa
21:31 ronsavage And now I'm reading https://medium.com/the-physics-arxiv-blog/deeper-than-quantum-mechanics-david-deutschs-new-theory-of-reality-9b8281bc793a
23:14 ronsavage joined #marpa

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