Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-11-02

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:10 dayangkun joined #perl6
00:12 ChoHag joined #perl6
00:13 havenn joined #perl6
00:13 kurahaupo left #perl6
00:15 havenn_ joined #perl6
00:15 jaldhar_ joined #perl6
00:17 havenn joined #perl6
00:20 fgomez joined #perl6
00:30 Khisanth joined #perl6
00:35 plobsing joined #perl6
00:48 stocks joined #perl6
00:55 anuby joined #perl6
01:09 hypolin joined #perl6
02:08 meilin joined #perl6
02:19 meilin ?
02:20 meilin left #perl6
02:23 skids joined #perl6
03:02 larks joined #perl6
03:12 orafu joined #perl6
03:25 dayangkun joined #perl6
03:26 tokuhiro_ joined #perl6
03:38 larks joined #perl6
03:39 meilin joined #perl6
03:40 meilin left #perl6
03:45 havenn joined #perl6
03:48 havenn joined #perl6
04:02 [particle]1 joined #perl6
04:08 gootle joined #perl6
04:36 havenn joined #perl6
04:47 chinese_man joined #perl6
05:05 kaleem joined #perl6
05:24 CharellKing joined #perl6
05:24 CharellKing which browser are you using?
05:26 sorear chrome and elinks
05:39 telex joined #perl6
05:41 sudokode joined #perl6
05:44 meilin joined #perl6
05:45 kaleem_ joined #perl6
05:47 birdwindupbird joined #perl6
06:02 benabik joined #perl6
06:09 meilin left #perl6
06:18 minmax joined #perl6
06:20 minmax moritz: ping
06:24 moritz minmax: pong
06:24 moritz jnthn: iirc FROGGS volunteered for the next rakudo release
06:24 minmax moritz: is there a way to run perl6 expressions in a REPL via a webservice?
06:25 azawawi :)
06:26 azawawi or better use the local perl6 REPL
06:26 meilin joined #perl6
06:26 azawawi basically i want to put a perl6 REPL inside farabi6 :)
06:27 moritz azawawi: try.rakudo.org contains some code that does that
06:27 azawawi im actually looking at it... https://github.com/moritz/try.rakudo.org/blob/master/frontend/try-rakudo.pl
06:28 sjohnson hi
06:28 * azawawi breakfast &
06:28 azawawi moritz: thanks :)
06:39 cotto general question from Parrotland: I see an old branch from chromatic that implements timely destruction and seem to remember that being something that Rakudo cares about.
06:39 cotto Does Rakudo care about this, and if so what's a good way to test that it does what Rakudo needs?
06:40 sorear how timely is it, and how fast is it?
06:41 sorear running a full mark/sweep cycle every time a variable is set is not something Rakudo wants
06:41 cotto https://github.com/parrot/parrot/compare/master...chromatic;early_pmc_gc
06:41 cotto It's smarter than that, though it assumes that any GCables in need of early destruction will be in the most recent generation.
06:43 sorear also it assumes that GCables in need of early destruction will never be referenced from the remembered set
06:43 moritz cotto: rakudo wants that, because otherwise we don't have a way to close files whose handles go out of scope
06:44 wtw joined #perl6
06:44 moritz my $f = open 'file', :w; $f.say: "some content"; # oops, empty file created, because $f is never closed
06:46 sorear I do not like scope-related file closing; niecza will (may or may not currently) flush files on GC or at program exit, whichever comes first
06:47 sorear I really hope what you just did didn't constitute a binding decision on all p6 implementations
06:50 cotto looks like it requires the previously-useless needs_destroy pir op, which nqp and Rakudo unsurprisingly don't make use of
06:54 moritz sorear: I didn't decide anything. I just want the .close to happen not too late after the scope exit, doesn't need to be immediately
06:56 cotto moritz, isn't that a separate issue?  The destructor should get called at some point.
06:56 cotto rt?
06:56 moritz cotto: yes, and the sooner the better
06:57 wtw joined #perl6
06:57 moritz though maybe the main motivation behind that branch was something else; pmichaud probably remembers
06:58 cotto I'll try to catch him.
06:59 sorear moritz: how late is 'too late'?
07:02 SamuraiJack joined #perl6
07:32 moritz sorear: the later the worse
07:33 moritz sorear: if it surprises the user, it's too late
07:36 sorear _anything_ we do will suprise users.
07:36 sorear will surprise somebody, I mean
07:38 moritz so the goal is to surprise few people
07:41 moritz just because we can't achieve perfection doesn't mean we shouldn't try
07:41 mucker joined #perl6
07:43 sorear there's a local optimum and beyond that you'll cause people to say "I can't beleive how stupid that implementation is"
07:44 sorear in the general case, detecting a dead file handle requires a major collection
07:45 sorear if the heap is pretty big and a major collection needs 300ms, then to detect and close a file handle within 3 seconds would require spending 10% of CPU time on detecting file handles to close
07:45 sorear assuming a CPU-intensive task
07:58 kurahaupo joined #perl6
08:00 * cotto throws a surprise party, but only for moritz
08:04 telex joined #perl6
08:05 brrt joined #perl6
08:07 GlitchMr joined #perl6
08:13 wk joined #perl6
08:14 brrt msg [Coke] the fix in parrot was merged, you should be able to build nqp now
08:15 flightrecorder joined #perl6
08:21 domidumont joined #perl6
08:21 FROGGS joined #perl6
08:21 am0c joined #perl6
08:27 domidumont joined #perl6
08:29 pmichaud_ joined #perl6
08:31 CharellKing joined #perl6
08:31 CharellKing I use opera,chrome,firefox
08:32 CharellKing Elink maybe be too stupid
08:33 marloshouse joined #perl6
08:34 meilin left #perl6
08:35 moritz \o/ cotto++
08:37 brrt \o moritz
08:37 moritz o/ brrt
08:38 moritz brrt: fwiw in #perl6 you can use phenny to send messages with 'phenny, tell [Coke] ...'
08:38 moritz msg won't work here
08:38 brrt ok
08:38 brrt i believe he already saw it
08:38 brrt judging by the github thread
08:40 fhelmberger joined #perl6
08:42 marloshouse joined #perl6
08:44 marloshouse joined #perl6
08:47 marloshouse joined #perl6
08:53 kurahaupo left #perl6
08:55 domidumont joined #perl6
08:58 azawawi joined #perl6
08:58 azawawi hi
09:04 * azawawi reads perl 6 book
09:09 jnthn The reliable way to handle stuff that should happen at scope exit in Perl 6 is to have it triggered by LEAVE
09:16 cognominal joined #perl6
09:26 CharellKing hi everyone
09:27 azawawi CharellKing: hi
09:28 grondilu joined #perl6
09:28 * grondilu created http://rosettacode.org/wiki/SHA-256
09:29 tadzik wow
09:29 arnsholt o/
09:30 tadzik \o
09:31 brrt impressive grondilu
09:31 tadzik grondilu: so, is that a module already? :)
09:32 jnthn r: my $x = 42; say Q{lol $x!}; say Q:s{lol $x!};
09:32 p6eval rakudo c45b02: OUTPUT«lol $x!␤lol 42!␤»
09:32 grondilu it's more or less what I had written in https://github.com/grondilu/libdigest-perl6 but it's a bit too messy to submit ot the ecosystem.
09:33 * brrt likes the pressence of LoL, Cat, and Rat in p6
09:34 brrt although Cat() isn't implemented?
09:35 brrt r: say LoL.new(Rat()).perl
09:35 p6eval rakudo c45b02: OUTPUT«LoL.new(0/1)␤»
09:35 jnthn Wow, it even declares an infix to use it in a metaop :)
09:35 jnthn grondilu++
09:35 brrt r: say Cat().perl
09:35 p6eval rakudo c45b02: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Cat' called (line 1)␤»
09:35 jnthn No Cat yet.
09:49 woosley left #perl6
09:57 domidumont joined #perl6
10:06 imarcusthis joined #perl6
10:12 CharellKing It's time to go off work
10:12 CharellKing ByeBye
10:16 SamuraiJack joined #perl6
10:16 leont joined #perl6
10:32 MayDaniel joined #perl6
10:45 dayangkun joined #perl6
10:50 rindolf joined #perl6
10:59 flightrecorder joined #perl6
11:15 spider-mario joined #perl6
11:19 sorenso joined #perl6
11:32 masak r: macro twice($code) { quasi { {{{$code}}}; {{{$code}}} } }; my $x; BEGIN { $x = 0 }; twice $x++; BEGIN { say $x }; say $x
11:32 p6eval rakudo c45b02: OUTPUT«0␤0␤»
11:32 masak hm.
11:33 MayDaniel joined #perl6
11:41 arnsholt masak: Is 1830 or so a good time for us to meet in Malmö tonight?
11:43 masak dude, that's like 178 years ago.
11:44 masak (yes, that time worksforme)
11:44 jnthn wtf too
11:44 jnthn er, wfm!
11:45 * jnthn will also arrive by train
11:45 jnthn So malmo centralstation is probably a good place to meet
11:46 masak aye.
11:46 masak any plans for tonight?
11:47 jnthn Will the plans involve eating something? :)
11:52 * masak hopes so
11:53 masak by longstanding tradition, I usually have a warm meal at that approximate time in the evening.
11:54 jnthn OK, provided arnsholt is up for food too, then I think we can settle on the plan at least involving, "eat something, somewhere".
11:55 jnthn That can probably be late-bound... It's not like Malmo has a restaurant shortage :P
11:55 arnsholt Noms will be good
11:56 arnsholt Like masak I have a tradition to uphold ^_^
11:56 jnthn \o/
11:56 masak jnthn: wait... are you suggesting we leave the fate of our finding food for the evening to *chance*? o.O
11:57 jnthn masak: Yes, but if past success is a predictor of the future, that's less scary than it sounds :P
11:58 arnsholt It worked out well enough at the hackathon in Copenhagen at least =)
12:00 * masak strains to see the complete lack of A Plan as something positive :)
12:16 brrt joined #perl6
12:17 bowtie joined #perl6
12:20 tokuhiro_ joined #perl6
12:21 masak moritz: (timely destruction) I think I agree with sorear. the only "too late" for closing filehandles is "never". if someone wants the closing of the file to happen at a certain point, that's a good case for doing $f.close
12:22 sorenso joined #perl6
12:23 masak or what jnthn said, use LEAVE.
12:25 masak the notion of having things GC "basically at block exit" (a la refcounting) is counterindicated by the move to many-core computing. this was the theme of an early p6l thread about RAII.
12:26 masak erm, 182 years ago.
12:26 jnthn No, p6l hasn't been going on that long, even if it feels like it :P
12:27 brrt refcounting will cost you at runtime
12:28 masak don't worry, we're not doing refcounting.
12:28 brrt :-)
12:28 jnthn Reachability-based GC also costs you at runtime :)
12:28 brrt because even in the positive case, you still have to gc to clear cycles, which means you're doing double work
12:28 brrt yes
12:28 brrt what about cheney-on-the-mta?
12:29 brrt i've found that intriguing since forever
12:29 arnsholt I guess if you really need closing on block exit, we could make a using macro
12:30 jnthn .oO( Cheney is visting New York? )
12:30 brrt which cheney, i recall there being many
12:32 jnthn I was thinking of Dick :)
12:32 masak arnsholt: 'a using macro'?
12:33 jnthn brrt: I thougth the Cheney appraoch was a copying GC scheme...
12:33 brrt it is
12:33 brrt basically, iirc
12:33 brrt you allocate everything on stack
12:33 arnsholt masak: Something like using in Python
12:33 brrt you never return from a function (so the stack isn't cleared)
12:33 jnthn hah, that's cute...
12:33 arnsholt Which does cleanup on block exit
12:34 jnthn you use the c stack as...wow, that's disgusting :D
12:34 brrt and when you overflow the stack, you copy everything
12:34 brrt doesn't have to be the c stack, can be a stack of your own design as well
12:34 jnthn Yeah
12:34 brrt i like copying gc, dunno why
12:34 brrt its just elegant
12:34 jnthn Semispace copying is nice because dead things are basically free
12:35 brrt i recall seeing an article on hacker news, which suggested that the copying fase basically consisted of pushing a pointer
12:35 brrt now i implemented one once and it had to copy the whole object
12:35 brrt so
12:35 brrt who is right?
12:37 jnthn Certainly the typical approach is copying the whole object
12:38 jnthn That's what the GC handbook describes, anyways.
12:38 brrt good, then i'm not crazy
12:38 jnthn I guess you could just keep an "alive list" that points to the actual bodies and just copy the alive things out of that, but it's a level of indirection for everything and probably suffers fragmentation issues...
12:38 brrt that is a bit wasteful when you have a large live set compared to the dead set
12:39 brrt copying was designed to stop fragmentation
12:39 jnthn Semispace is mostly wasteful 'cus you need twice as much heap as you get to use
12:39 brrt (i almost said inhibit, biological mind playing up)
12:39 jnthn otoh, you don't have to do it for all the generations :)
12:41 brrt thats is basically the other side of it; a copying generational collector would be pretty nice
12:47 * [Coke] drinks coffee
12:48 arnsholt brrt: Isn't that sort of how many Lisps do GC?
12:49 brrt it comes from the scheme community, yes
12:53 [Coke] brrt: saw it was fixed. haven't had time to test out partcl-nqp on the latest and greatest yet.
12:54 * brrt wonders why it didn't break on non-mac systems
12:54 brrt maybe mac is more aggressive with zeroing
12:59 sqirrel joined #perl6
13:04 Psyche^ joined #perl6
13:25 kaleem joined #perl6
13:32 PacoAir joined #perl6
13:35 tokuhiro_ joined #perl6
13:38 [Coke] we need a better name for #115540 than "possible rakudo bug". suggestions?
13:40 tokuhiro_ joined #perl6
13:43 masak [Coke]: "IO::Socket::INET.new times out on multiple .open() calls for the same port"
13:43 masak (also, it seems a non-bug to me)
13:43 jnthn "How is socket formed"
13:44 jnthn I'm not surprised by the behavior either, fwiw.
13:44 tokuhiro_ joined #perl6
13:51 kaleem joined #perl6
14:07 stopbit joined #perl6
14:11 flightrecorder joined #perl6
14:12 stopbit joined #perl6
14:22 FROGGS joined #perl6
14:28 kaare_ joined #perl6
14:52 Woodi joined #perl6
14:53 cognominal joined #perl6
14:56 dalek rakudo/nom: e7ab9ac | masak++ | src/Perl6/Actions.pm:
14:56 dalek rakudo/nom: [Perl6::Actions] refactor
14:56 dalek rakudo/nom:
14:56 dalek rakudo/nom: De-duplicated some code. This will help us during
14:56 dalek rakudo/nom: the next commit, because we'll be adding more
14:56 dalek rakudo/nom: code in that path.
14:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e7ab9ace23
14:56 dalek rakudo/nom: 9bb7de6 | masak++ | src/Perl6/Actions.pm:
14:56 dalek rakudo/nom: [Perl6::Actions] wrap macro-arg ASTs in thunks
14:56 dalek rakudo/nom:
14:56 dalek rakudo/nom: This causes the macro arguments to correctly carry
14:56 dalek rakudo/nom: their lexical environment with them, and so everything
14:56 dalek rakudo/nom: inside of them is now correctly, hygienically resolved.
14:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9bb7de6dbf
14:57 brrt dalek in overdrive
14:57 dalek roast: bfeeefb | masak++ | S06-macros/unquoting.t:
14:57 dalek roast: [S06-macros/unquoting.t] unfudge for Rakudo
14:57 dalek roast: review: https://github.com/perl6/roast/commit/bfeeefbbfd
14:58 masak folks, your attention please.
14:58 masak as of this day, macros in Rakudo are usable.
14:58 jnthn \o/
14:58 arnsholt =D
14:58 jnthn masak++
14:58 masak I will demo it for you as soon as p6eval does a recompile.
14:58 arnsholt masak++ indeed
14:58 jnthn Wow, November release will really rock
14:58 masak essentially, 'twice $x++' works now.
14:59 masak the deeper reason being that macro-argument ASTs now correctly carry around their lexical context.
14:59 masak blog post(s) upcoming.
14:59 [Coke] masak++
15:00 masak r: macro twice($code) { quasi { {{{$code}}}; {{{$code}}} } }; my $counter = 0; twice $counter++; say $counter
15:00 p6eval rakudo c45b02: OUTPUT«0␤»
15:00 masak just one last time wrongly for sentimental reasons :P
15:01 Woodi allo everyone :)
15:01 masak I'd like to explicitly thank jnthn, who through all this is a great mentor-ish discussion partner, and who through D2 especially said more than once "hm, wonder if we're not making things overly complex here...". I finally listened to him, and the above solution is indeed very simple.
15:02 masak Woodi! \o/
15:02 Woodi gz masak++! :)
15:02 masak dz :)
15:03 PerlJam masak++  (I can't say that enough :)
15:03 masak this concludes the D2 part of the macros grant.
15:03 Woodi what's D3 ?
15:03 masak (though I'm going to look at a code path unification now)
15:03 masak Woodi: D3 is "implicit hygiene, explicit lack of hygiene".
15:04 masak and D2 essentially already gave us the former for free, so I'll focus on the latter.
15:04 masak here's the original grant application: http://news.perlfoundation.org/2011/09/hague-grant-application-implem.html
15:05 Woodi masak: I have no idea what you talking about but tutorial for macros would be nice :)
15:05 Woodi looking
15:05 benabik joined #perl6
15:06 Woodi D5 is nice :)
15:06 masak haven't need to do much aligning.
15:07 masak though TimToady++'s promise/threat about ¤ is still looming, I guess... :)
15:07 felher masak++ # /me is eagerly awaiting the blog post :)
15:07 masak I'm going to make two blog posts.
15:07 masak one regular progress report, the first one in quite a while.
15:07 masak and one TPF halfway report.
15:08 masak r: say "updated yet"?
15:08 p6eval rakudo c45b02: OUTPUT«===SORRY!===␤Confused␤at /tmp/gS4lAGHTr8:1␤»
15:08 masak nope.
15:08 jnthn std: say "updated yet"?
15:08 p6eval std edd7715: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confused at /tmp/k1zq0cc5p4 line 1:â�¤------> [32msay "updated yet"[33mâ��[31m?[0mâ�¤    expecting any of:â�¤    POSTâ�¤   infixâ�¤  infix or meta-infixâ�¤    infixed functionâ�¤       postcircumfixâ�¤  postfixâ�¤        postfix_prefix_meta_operatorâ�¤   postopâ�¤
15:08 p6eval ..statement modifi…
15:08 masak jnthn: yes, I was confused :)
15:08 felher *two* blogposts <3 :)
15:09 jnthn Just seeing if STD did any better ;)
15:09 masak probably not a common typo :)
15:09 jnthn Aye. The keys aren't right next to each other.
15:09 masak fwiw, bohr() still fails in unquotes.t
15:09 jnthn How bohring.
15:09 jnthn Isn't that due to cloning mess-ups?
15:10 masak r: macro bohr() { my $q1 = quasi { 6 }; my $q2 = quasi { 6 * 10 }; my $q3 = quasi { 100 + 200 + 300 }; quasi { {{{$q1}}} + {{{$q2}}} + {{{$q3}}} } }; say bohr()
15:10 p6eval rakudo c45b02: OUTPUT«Cannot call 'infix:<+>'; none of these signatures match:␤:($x = { ... })␤:(int $a, int $b)␤:(num $a, num $b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(Rational \a, Rational \b)␤:(Rational \a, Int \b)␤:(Int \a, Rational \b)␤:(Complex:D \a, Complex:D \b)␤:(Instan…
15:10 masak the other week we found and fixed some mess-ups having to do with cloning of AST nodes in evaluate_unquotes in the QAST classes in NQP.
15:10 masak but it didn't fix the above, which was connected to some very weird relationship between $q1 and $q2 and the expressions inside of them.
15:11 masak r: macro bohr() { my $q1 = quasi { 6 }; my $q2 = quasi { 6 * 10 }; quasi { {{{$q1}}} + {{{$q2}}} } }; say bohr()
15:11 p6eval rakudo c45b02: OUTPUT«Cannot call 'infix:<+>'; none of these signatures match:␤:($x = { ... })␤:(int $a, int $b)␤:(num $a, num $b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(Rational \a, Rational \b)␤:(Rational \a, Int \b)␤:(Int \a, Rational \b)␤:(Complex:D \a, Complex:D \b)␤:(Instan…
15:15 jnthn r: macro bohr() { my $q1 = quasi { 6 }; my $q2 = quasi { 6 * 10 }; quasi { {{{say 'x'; $q1}}} + {{{say 'y'; $q2}}} } }; say bohr()
15:15 p6eval rakudo 9bb7de: OUTPUT«x␤y␤Cannot call 'infix:<+>'; none of these signatures match:␤:($x = { ... })␤:(int $a, int $b)␤:(num $a, num $b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(Rational \a, Rational \b)␤:(Rational \a, Int \b)␤:(Int \a, Rational \b)␤:(Complex:D \a, Complex:D \b)␤:(In…
15:16 jnthn r: macro bohr() { my $q1 = quasi { say 'badger'; 6 }; my $q2 = quasi { say 'mushroom'; 6 * 10 }; quasi { {{{say 'x'; $q1}}} + {{{say 'y'; $q2}}} } }; say bohr()
15:16 p6eval rakudo 9bb7de: OUTPUT«x␤y␤badger␤mushroom␤Cannot call 'infix:<+>'; none of these signatures match:␤:($x = { ... })␤:(int $a, int $b)␤:(num $a, num $b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(Rational \a, Rational \b)␤:(Rational \a, Int \b)␤:(Int \a, Rational \b)␤:(Complex:D \a, Co…
15:16 jnthn hm, odd indeed
15:17 havenn joined #perl6
15:20 masak r: macro twice($code) { quasi { {{{$code}}}; {{{$code}}} } }; my $counter = 0; twice $counter++; say $counter
15:20 p6eval rakudo 9bb7de: OUTPUT«2␤»
15:20 masak \o/
15:20 masak jnthn: yeah, well. it's RT'd.
15:20 jnthn hah, I running that under the debugger will be fun :)
15:21 jnthn "I said next statement...y u no progress?"
15:21 masak r: macro pathological { AST.new }; pathological
15:21 p6eval rakudo 9bb7de: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling block : Unknown QAST node type Any␤»
15:21 * masak looks into fixing this bug, too.
15:23 skids joined #perl6
15:35 [Coke] r: say quasi { say "OH HAI" };
15:35 p6eval rakudo 9bb7de: OUTPUT«AST.new()␤»
15:35 [Coke] r: my $a = quasi { say "OH HAI" }; $a();
15:35 p6eval rakudo 9bb7de: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'AST'␤  in  at src/gen/BOOTSTRAP.pm:852␤  in any  at src/gen/BOOTSTRAP.pm:836␤  in block  at /tmp/OQSAtjJjUh:1␤␤»
15:36 [Coke] r: my $a = quasi { say "OH HAI" }; $a.();
15:36 p6eval rakudo 9bb7de: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'AST'␤  in  at src/gen/BOOTSTRAP.pm:852␤  in any  at src/gen/BOOTSTRAP.pm:836␤  in block  at /tmp/Z0bCsv1mJM:1␤␤»
15:36 [Coke] r: my $a = quasi { say "OH HAI" }; $a.^methods.say;
15:36 p6eval rakudo 9bb7de: OUTPUT«BUILD incarnate evaluate_unquotes is_quasi_ast␤»
15:36 [Coke] r: my $a = quasi { say "OH HAI" }; $a.incarnate
15:36 p6eval rakudo 9bb7de: OUTPUT«Not enough positional parameters passed; got 1 but expected 3␤  in method incarnate at src/gen/CORE.setting:10262␤  in block  at /tmp/_pQdLM5U5Z:1␤␤»
15:37 masak [Coke]: no, you can't call AST objects. they're tree structures.
15:37 [Coke] r: my $a = quasi { say "OH HAI" }; {{{$a}}};
15:37 p6eval rakudo 9bb7de:  ( no output )
15:37 masak .incarnate is essentially a compiler-internal method, but it's exposed to userland.
15:37 [Coke] r: my $a = quasi { say "OH HAI" }; {{{$a}}}();
15:37 p6eval rakudo 9bb7de:  ( no output )
15:37 masak [Coke]: {{{$a}}} doesn't "work" outside of quasi blocks.
15:37 masak it just parses as three nested blocks.
15:38 masak (that's a feature, not a bug)
15:38 jnthn Aye, STD has it that way
15:38 jnthn In fact, we can even factor it the way STD does now, I imagine.
15:38 jnthn I think that means we get arbitrary delims :)
15:38 [Coke] Can you do anything with $a in that snippet?
15:39 masak [Coke]: if you constructed $a in a macro, yes.
15:39 jnthn r: my $a = quasi { say "OH HAI" }; macro foo() { $a }; foo;
15:39 [Coke] or: is there a point to quasi outside of macros
15:39 p6eval rakudo 9bb7de: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
15:39 masak then you could return it from the macro and have it incorporated in your program.
15:39 [Coke] ?
15:39 jnthn hah :)
15:39 jnthn r: BEGIN my $a = quasi { say "OH HAI" }; macro foo() { $a }; foo;
15:39 p6eval rakudo 9bb7de: OUTPUT«OH HAI␤»
15:40 masak [Coke]: quasi outside of macros work fine, but unless you have a way to go back in time, there's not much you can do with them.
15:40 masak they're meant to integrate into the program during compilation.
15:40 jnthn You can use an eval to go forward in time :P
15:40 [Coke] (back in time) like BEGIN. :)
15:40 masak right.
15:40 [Coke] masak: my point being if there's not much point to them outside macros, why not disallow them there.
15:40 jnthn r: my $a = quasi { say "OH HAI" }; macro foo() { $a }; eval 'foo;'
15:40 p6eval rakudo 9bb7de: OUTPUT«OH HAI␤»
15:40 masak [Coke]: why not disallow 'when' outside of 'given'?
15:40 thou joined #perl6
15:41 [Coke] WFM. :)
15:41 masak [Coke]: why not disallow methods outside of classes?
15:41 [Coke] Yes. These are all good ideas.
15:41 jnthn [Coke]: Somebody will find a creative use. I'm struggling for a concrete one, but that's probably because I've not written many macros yet :)
15:41 masak [Coke]: why not disallow 'take' outside of 'gather'?
15:41 jnthn All the above examples worked as I expected \o/
15:41 masak (my point being that all those cases *have* found creative uses)
15:41 jnthn Taht's nice :)
15:41 masak yes :)
15:42 jnthn I'll have to work harder to find bugs for masak :D
15:43 [Coke] r: macro a() { 1 }
15:43 p6eval rakudo 9bb7de:  ( no output )
15:43 [Coke] r: macro a() { 1 }; a
15:43 p6eval rakudo 9bb7de: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
15:44 [Coke] r: macro a() { 1 }; a();
15:44 p6eval rakudo 9bb7de: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
15:44 [Coke] I know the macro should be returning a quasi - is that what the error is trying to tell me?
15:45 masak hm, no, it should complain that the macro doesn't return an AST.
15:45 masak seem to have regressed on that.
15:45 masak will look into it.
15:46 [Coke] masak++
15:47 arnsholt masak: You can use take outside gather? (The dynamic scope of gather, that is)
15:48 masak arnsholt: not outside the dynamic scope, no.
15:49 masak arnsholt: my point is that take is *allowed* outside of the dynamic scope of gather, not that you can use it there.
15:49 arnsholt Yeah, definitely
15:49 masak (because, since it's a dynamic scope, static checking of its appropriateness is not possible)
15:50 arnsholt Yup
15:51 arnsholt And disallowing something just because noone can see the point has never really been an argument 'round here =)
15:53 jnthn r: take 'me'
15:53 p6eval rakudo 9bb7de: OUTPUT«take without gather␤  in block  at src/gen/CORE.setting:429␤  in block  at src/gen/CORE.setting:478␤  in block  at /tmp/NRputOwqD5:1␤␤»
15:53 jnthn Good. Sane error. :)
15:53 masak I'm pretty confident someone will find a use for quasis even outside of macros.
15:54 jnthn masak: I'm imagining situations where its convenient to collect quasis outside a macro and use them in multiple macros, for example.
15:55 arnsholt That's a very good use of it
15:55 sizz joined #perl6
15:56 masak right. tricks having to do with context may play in here as well.
15:56 masak (i.e. the quasi needs to be build in one module and then passed to another)
15:56 masak built*
15:56 arnsholt Oooh, nice!
15:57 arnsholt Neat way to punch an appropriate-sized hole in encapsulation
15:57 cognominal joined #perl6
15:57 benabik joined #perl6
15:57 masak the hole isn't any bigger than with passing closures.
15:57 masak it's just done at another stage of the compile/run cycle.
15:57 arnsholt True
16:01 birdwindupbird joined #perl6
16:06 xinming joined #perl6
16:24 [Coke] masak: repl doesn't complain about macro redefinition, happily keeps showing result of original macro.
16:27 masak REPLs generally aren't known to complain about routine redefinitions.
16:27 masak that's usually considered a feature.
16:27 masak though why it insists on showing the first one defined, I don't know.
16:29 rindolf joined #perl6
16:30 * arnsholt heads for the train station
16:31 eiro hello guys
16:31 masak eiro! \o/
16:32 eiro wip: i start to write about writing modules. is there any official doc about the official way  to use panda ?
16:32 thou joined #perl6
16:32 eiro masak, \o from france
16:33 eiro damned! kivutar didn't join
16:33 masak say hi to france from me.
16:33 masak or "bonjour", or whatever... :)
16:34 eiro haha :) "hello" becomes as frequent as bonjour actually :)
16:34 eiro "salut" is also commonly used
16:35 masak just nod curtly and say "alors".
16:37 eiro yep
16:37 eiro so! it seems there is no doc for panda: i start to read the code
16:37 jnthn There is a "who to make your module panda compliant" thingy linked from modules.perl6.org
16:37 masak if there's a doc for panda, it's probably in the panda repo.
16:37 jnthn er, how :)
16:38 tadzik eiro: ooh, I have an image Just Waiting For This
16:39 eiro oh! it's not in the source but in a wiki: http://wiki.perl6.org/Create%20and%20Distribute%20Modules
16:39 tadzik Panda docs! http://imgur.com/WAyGR
16:39 eiro haha :)
16:40 eiro http://instagram.com/p/LBWST9HsHd/
16:41 tadzik :D
16:45 eiro oh! there is no submit form! maybe we wan write it with Bailador?
16:45 eiro Ping someone on IRC (#perl6 at freenode) to either show you how to add your module to the ecosystem, or else ask them if they could please add it for you.
16:49 tadzik hm
16:49 tadzik we could do that with Bailador, yes
16:49 tadzik but the wiki is not Bailador-driven
16:50 eiro i don't think of wiki instructions but a new set of commands in panda to manage the modules
16:50 eiro panda new
16:50 eiro panda publish
16:50 eiro panda announce
16:51 eiro how about that ?
16:51 tadzik hmm
16:52 tadzik sounds good to me :)
16:55 jnthn back later &
17:06 domidumont1 joined #perl6
17:14 sudokode joined #perl6
17:24 havenn joined #perl6
17:47 sirrobert joined #perl6
17:47 sirrobert hi p6
17:47 sorear o/
17:49 sorear masak: heh, that bottle has an inherently funny label :D
17:58 sirrobert This does what I expect:
17:58 sirrobert r: my %foo = a => 1; say %foo; %foo ,= b => 2; say %foo;
17:58 p6eval rakudo 9bb7de: OUTPUT«("a" => 1).hash␤("a" => 1, "b" => 2).hash␤»
17:58 sirrobert Why doesn't this do what I expect?
17:58 sirrobert r: my %bar= a => {c=>3}; say %bar<a>; %bar<a> ,= d=>4; say %bar<a>;
17:59 p6eval rakudo 9bb7de: OUTPUT«(timeout)("c" => 3).hash␤»
17:59 sirrobert or, rather, it hangs (which isn't what I expect =)
18:03 leont joined #perl6
18:03 adu joined #perl6
18:05 sudokode joined #perl6
18:12 benabik joined #perl6
18:22 SamuraiJack joined #perl6
18:33 zby_home joined #perl6
18:34 spider-mario joined #perl6
18:55 havenn joined #perl6
19:00 nyuszika7h joined #perl6
19:05 cognominal joined #perl6
19:10 Chillance joined #perl6
19:16 spider-mario joined #perl6
19:22 wk joined #perl6
19:45 s3333 joined #perl6
19:54 s3333 left #perl6
20:03 moritz \o/ macros
20:03 moritz masak++
20:03 flussence masakros!
20:06 [Coke] r: macro marco($a, $b) { eval "macro $a { quasi {{{ $b }}} }" }; marco polo { say "marco!" }; polo
20:06 p6eval rakudo 9bb7de: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤at /tmp/jKTg8CSkRO:1␤»
20:06 [Coke] *snap*
20:15 am0c joined #perl6
20:18 havenn joined #perl6
20:27 havenn joined #perl6
20:28 sirrobert joined #perl6
20:28 sirrobert back
20:34 rindolf sorear: hi.
20:36 wk joined #perl6
20:59 sudokode left #perl6
21:07 sirrobert is there a good way to deal with precompiling circular dependencies yet?
21:10 azawawi joined #perl6
21:11 havenn joined #perl6
21:11 benabik joined #perl6
21:14 azawawi is https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Compiler.nqp usable within a Perl 6 script or not?
21:15 azawawi star: Perl6::Compiler.interactive
21:15 p6eval star 2012.10: OUTPUT«Could not find symbol '&Compiler'␤  in method <anon> at src/gen/CORE.setting:9956␤  in  at src/gen/Metamodel.pm:2401␤  in any find_method_fallback at src/gen/Metamodel.pm:2389␤  in any find_method at src/gen/Metamodel.pm:925␤  in  at src/gen/BOOTSTRAP.pm:827␤  in an…
21:15 azawawi star: ::('Perl6::Compiler')
21:15 p6eval star 2012.10:  ( no output )
21:18 azawawi Perl6::Compiler.interactive no longer usable in rakudo http://irclog.perlgeek.de/perl6/2010-06-25#i_2480559 ?
21:18 * azawawi sleep &
21:25 fgomez joined #perl6
21:30 bruges joined #perl6
21:38 bapa joined #perl6
21:47 havenn joined #perl6
21:56 jaldhar_ joined #perl6
21:56 havenn_ joined #perl6
21:58 Gothmog__ joined #perl6
21:58 twinshadow_ joined #perl6
21:58 jrockway_ joined #perl6
21:59 Psyche^ joined #perl6
22:15 sorear rindolf: ?
22:15 rindolf sorear: what?
22:16 rindolf sorear: oh, I meant someone else.
22:17 rindolf sorear: I meant sirrobert
22:23 havenn joined #perl6
22:23 bapa joined #perl6
22:24 TimToady hi, you guys are on the screen at Westmont
22:24 diakopter howdy Westmont
22:24 flussence o/
22:25 colomon \o
22:25 sorear o/
22:33 flussence .oO( "please don't tap on the fish tank" )
22:38 skids joined #perl6
22:49 cognominal joined #perl6
23:04 masak greetings, Westmont.
23:10 stocks joined #perl6
23:34 havenn joined #perl6
23:34 jnthn Is Westmont in the west, and has it a mountain?
23:39 sorear I suspect the reference is to https://en.wikipedia.org/wiki/Westmont_College
23:39 jnthn Ah :)
23:40 fgomez joined #perl6
23:42 masak etymology is "WEST Moreland and VerMONT". cute.
23:51 masak good night, #perl6
23:52 sorear o/ masak
23:56 sorear ...I just started a P5 test file with use Test::More; plan 50;
23:56 flussence *only* 50? :)
23:57 doy (people still use explicit test plans?)
23:58 sorear doy: explicit plans are prefered in the spectest suite because we like to know the total number of tests, even when some files run on zero implementations

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

Perl 6 | Reference Documentation | Rakudo