Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2016-05-14

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

All times shown according to UTC.

Time Nick Message
00:35 ronsavage joined #marpa
00:43 ronsavage JK: My immediate reaction to http://irclog.perlgeek.de/marpa/2016-05-13#i_12474209 is, no, leave the ppo up front. The params can still be accessed as my($children) = @_, and users can just ignore [0]. The point is that someone might develop a class-based Perl i/f, and then they'd want [0] to be $self. So I figure might as well not pre-empt this possibility.
00:45 ronsavage JK: Re http://irclog.perlgeek.de/marpa/2016-05-13#i_12476031. I'd support ::1th, ::2th, odd as they are, but I don't think this is where ::0th should be used. They are literally ordinals, and I reckon they should start from 1.
01:17 idiosyncrat_ I'm 0-based except when I'd been fighting an established standard.
01:18 idiosyncrat_ Line number and columns in texts start at 1 even in strongly 0-based environment, which is why they do in Marpa.
01:18 idiosyncrat_ And I can't change the way Lua works.
01:19 idiosyncrat_ But Perl is 0-based, so here I'd be saying that the child value at index 1 is the ::2th.  Sorry, just not gonna do it.
01:20 idiosyncrat_ Btw, the reason 0-based became the trend, and IMHO deserves to be, is when you get into offset arithmetic, as you very often do in C, although it's handy everywhere.
01:21 idiosyncrat_ In 1-based ordinals 2+2=3.  If you're doing any amount of offset arithmetic, that's gonna drive you mad.
01:22 idiosyncrat_ It's a sign of how much I like Lua that I'm willing to overlook the fact that it's 1-based. :-)
01:24 idiosyncrat_ ronsavage: re per-parse-object -- good point.
01:32 ronsavage I understand the ASM & C-based basis of 0-based arithmetic. It saves adding 1 all over the place. My argument here is that the author of the grammar is writing pseudo English, and will not be doing things like ::1th + 1, right? We'll just be counting tokens, 1, 2, 3, ... across the editor's page of grammar statements. You can do anything behind the scenes mapping ::1th to an offset of 0 if you wish.
01:48 ilbot3 joined #marpa
01:48 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Pastebin: http://scsys.co.uk:8002/marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today
02:18 idiosyncrat_ ronsavage: An interesting argument
02:19 idiosyncrat_ My theory is that the author of the SLIF grammar is writing Perl, and will be doing 0-based thinking.
03:46 kaare_ joined #marpa
08:11 koo7 joined #marpa
09:16 idiosyncrat_ Good night!
15:56 idiosyncrat_ joined #marpa
15:57 idiosyncrat_ ronsavage: Based on your point, I'll keep the per-parse object first, unless somebody else has a good reason it should be moved.
16:14 idiosyncrat_ As for 0-based, you're arguing with a fanatic. :-)
16:14 idiosyncrat_ Dijkstra numbered his book chapters starting with 0, and I'd do the same if I didn't think TeX would punish me for it in the long run. :-)
16:28 idiosyncrat_ ronsavage: Adopting another of your suggestions, I think I will be going ahead shortly using the bang ("!") as a hide "quantifier.
16:29 idiosyncrat_ So that parens no longer hide but
16:29 idiosyncrat_ A ::= B C! D
16:29 idiosyncrat_ hides <C>
16:29 idiosyncrat_ and
16:29 idiosyncrat_ A ::= B ( C D )!
16:29 idiosyncrat_ hides <C> and <D>
16:41 pczarn joined #marpa
17:09 pczarn I'm putting the parser engine on github
17:16 idiosyncrat_ pczarn: Great!
17:41 pczarn here's gearley: https://github.com/pczarn/gearley
18:13 pczarn it has ASF (src/forest/depth_first), events,  and potential support for boolean grammars
18:35 kaare_ joined #marpa
19:24 kaare_ joined #marpa
19:35 idiosyncrat_ Thinking about Lua inside Marpa::R3 and threads
19:36 idiosyncrat_ A Lua interpreter has a small start up overhead, and cannot be shared among threads.
19:36 idiosyncrat_ Right now I document Marpa::R2 so that you cannot share Marpa grammars between threads.
19:37 idiosyncrat_ AFAICT Perl threads never worked well and are now discouraged -- I don't know of anybody trying to use Marpa with threads.
19:38 idiosyncrat_ If I document Marpa::R3 as not for use with threads, I can use a single Lua intrepreter within Marpa.
19:39 idiosyncrat_ If I stick to the present policy -- threads OK as long as the SLIF grammar is not shared -- each time you create a Marpa grammar you'll pay the cost of starting a Lua interpreter.
19:40 idiosyncrat_ This is not great, but in applications which create lots of SLIF grammars, and I'd like to encourage that sort of thing, it could add up.
19:40 idiosyncrat_ Right now I'm seeing nothing to lose by simply saying no Perl threads with Marpa::R3
19:40 idiosyncrat_ Comments?
20:16 pczarn I found an issue in kollos design notes
20:18 pczarn With the rewrite described there, certain sequences may be ambiguous.
20:19 pczarn For example, `x ** 1..3` has more than 3 derivation trees
20:20 pczarn or maybe it's `x ** 1..4`
20:20 idiosyncrat_ pczarn: interesting because I am soon to introduce that into Marpa::R3
20:21 idiosyncrat_ if you can come up with a small example, that'd help
20:21 idiosyncrat_ Have to run off now
20:21 idiosyncrat_ AFK
21:25 koo7 joined #marpa
23:25 idiosyncrat_ joined #marpa
23:32 ronsavage joined #marpa
23:39 ronsavage JK: Re http://irclog.perlgeek.de/marpa/2016-05-14#i_12479194. Success at last!
23:41 ronsavage Re Threads. I'd certainly discourage anyone from using them.
23:44 idiosyncrat_ It'd be easy enough to restore the thread support (at the limited level it was in Marpa::R2) in Marpa::R3 -- just have a SLIF grammar argument that tells it to create its own Lua interpreter, which will again make it thread-safe.
23:46 idiosyncrat_ But the perlthread doc calls threads "discouraged", which according to perlpolicy means it is considered a "mistake" and on its way to being "deprecated" and then "removed".
23:47 idiosyncrat_ So I frankly wonder if there'll ever be any call for Perl threads support in Marpa::R3 -- I expect not.
23:53 ronsavage No, I wouldn't expect anyone to demand thread support.

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