Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-11-26

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:01 Ingis-Kahn joined #perl6
00:03 preflex joined #perl6
00:03 vlixes joined #perl6
00:09 dalek joined #perl6
00:10 lutok joined #perl6
00:11 donri left #perl6
00:15 aindilis` joined #perl6
00:19 lutok left #perl6
00:24 bbkr joined #perl6
00:26 mkramer joined #perl6
00:29 dalek rakudo/nom: de3e8e7 | jnthn++ | src/Perl6/ (2 files):
00:29 dalek rakudo/nom: Implement an optimization for private method calls. If possible, it reduces them to sub calls. Can also detect and complain about missing private method calls at CHECK time (since they're non-virtual). Requires --optimize=3.
00:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/de3e8e7e92
00:30 dalek rakudo/nom: 09097de | jnthn++ | docs/ChangeLog:
00:30 dalek rakudo/nom: Couple of ChangeLog additions.
00:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/09097de5d2
00:33 jnthn phenny: tell Woodi did a couple of optimzations to the core setting that seem to give a 10%-15% improvement on Simple::Redis benchmark. Also the optimizer does private method calls better; try it with --optimize=3 (not on by default just yet)
00:33 phenny jnthn: I'll pass that on when Woodi is around.
00:57 kmwallio joined #perl6
01:03 flussence I like it when something blows up but with a well-written error message :)
01:03 flussence perl6: say int(4, ...);
01:03 p6eval niecza v11-27-gdaa9117: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'int' used at line 1â�¤â�¤Potential difficulties:â�¤  Comma found before apparent series operator; please remove comma (or put parensâ�¤    around the ... listop, or use 'fail' instead of ...) at /tmp/XCeaQQIFCW…
01:03 p6eval ..pugs b927740: OUTPUT«*** No compatible multi variant found: "&int"␤    at /tmp/p47PVgoJ4W line 1, column 5-16␤»
01:03 p6eval ..rakudo da4426: OUTPUT«===SORRY!===␤Comma found before apparent series operator; please remove comma (or put parens␤    around the ... listop, or use 'fail' instead of ...) at line 1, near " ...);"␤»
01:05 molaf_ joined #perl6
01:05 flussence (and more languages should have a "...;" thing; much better than putting "TODO" comments everywhere :)
01:05 Chillance joined #perl6
01:12 snarkyboojum except you can grep for TODO whereas grep'ing for … would also show sequences
01:12 flussence hm, yeah
01:13 flussence still, you won't forget to fix it when a test hits that line
01:14 dalek rakudo/nom: 1e5b310 | jnthn++ | src/core/IO/Socket/INET.pm:
01:14 dalek rakudo/nom: Method calls automatically coerce their results into Perl 6 things, so we don't need to re-do it in this case.
01:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1e5b310ede
01:14 dalek rakudo/nom: 8fe7111 | jnthn++ | src/core/IO/Socket.pm:
01:14 dalek rakudo/nom: Avoid various accidental v-table calls in socket IO.
01:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8fe7111b66
01:14 dalek rakudo/nom: 78cf70e | jnthn++ | src/core/Str.pm:
01:14 dalek rakudo/nom: Optimize chomp a little.
01:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/78cf70e733
01:17 snarkyboojum seems that running like something like perl6 -e 'exit(...)' on the cli actually prints a message to stderr
01:17 snarkyboojum "Stub code executed"
01:17 snarkyboojum that's a bit weird
01:19 flussence looks like one of the things that should have a line number...
01:20 snarkyboojum a line number?
01:20 flussence "Stub code executed at line blah"
01:20 snarkyboojum should it print anything to stderr?
01:20 flussence well it returns a Failure, which stringifies to that.
01:21 snarkyboojum ah
01:21 flussence (well, emits a warning if you try to use it as a value)
01:21 snarkyboojum fair enough
01:22 jnthn sleep &
01:37 plutoid joined #perl6
01:38 vinian joined #perl6
02:03 Timbus are perl 6 exceptions resumable coroutines, and is it possible to use them to emulate yield/resume type functions, and is it a good idea to incorporate them into MuEvent to allow for 'pausable' callbacks
02:07 mkramer1 joined #perl6
02:15 mattp_ joined #perl6
02:31 mkramer joined #perl6
02:40 benabik joined #perl6
02:57 bacek joined #perl6
03:39 skangas joined #perl6
04:52 colomon joined #perl6
04:54 colomon Just updated https://github.com/colomon/mandelbrot with a new Gtk version.  Still pretty simple, and I would desperately like to optimize it a good bit more....
05:00 aindilis` joined #perl6
05:01 BinGOs joined #perl6
05:12 plutoid joined #perl6
05:36 vinian joined #perl6
05:52 Sarten-X joined #perl6
06:02 localhost joined #perl6
06:14 am0c joined #perl6
06:15 vinian joined #perl6
06:16 Woodi Timbus: spec says: "Such a construct, where many calls made to the name of a sub with different parameters, expecting to reach the same sub every time, is not really compatible with multi-method-dispatch"...
06:16 phenny Woodi: 00:33Z <jnthn> tell Woodi did a couple of optimzations to the core setting that seem to give a 10%-15% improvement on Simple::Redis benchmark. Also the optimizer does private method calls better; try it with --optimize=3 (not on by default just yet)
06:17 Timbus :/
06:17 Timbus wait, but that's not really the same thing
06:18 Woodi however yesterday I learned useful use case for yield...
06:19 Timbus in an event based system, "yield until ready;" is a very handy thing..
06:19 Woodi from Ruby: def bench(descr) \n def bench(descr) \n yield \n ....
06:20 Woodi grr, second line is: start = Time.now
06:20 Woodi so nice benchmark helper
06:20 Woodi and Ruby have Fibers too ?
06:21 Timbus probably
06:21 Woodi jnthn: I will try with optimisations as sun as I get access to proper workstation :)
06:22 Woodi Timbus: second part of that spec cite is that gather/take work like coroutines
06:22 Woodi but I realy need some manual for them :)
06:23 Timbus but I can't see how
06:23 Woodi Timbus: want to know Perl6 tip ? :)
06:23 Timbus well, I can't see how you'd make an event system use gather/take
06:23 Timbus tip away.
06:25 Woodi a) go to perl6.org b) click Synopsis c) click 'C tags' down there d) use browser search for anything you want :)
06:26 Woodi maybe there is a better way for that :)
06:32 thou joined #perl6
06:55 [Sec] joined #perl6
07:08 mkramer joined #perl6
07:19 mkramer1 joined #perl6
07:22 mkramer1 left #perl6
07:25 vinian joined #perl6
09:02 alvis joined #perl6
09:11 stepnem joined #perl6
09:37 hundskatt joined #perl6
10:30 fsergot joined #perl6
10:36 MayDaniel joined #perl6
10:54 mj41 joined #perl6
11:03 f00li5h joined #perl6
11:06 Trashlord joined #perl6
11:15 grondilu joined #perl6
11:15 grondilu nom: say grep none(foo), <foo bar>
11:15 p6eval nom 78cf70: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&foo' called (line 1)␤»
11:15 grondilu nom: say grep none('foo'), <foo bar>
11:15 p6eval nom 78cf70: OUTPUT«bar␤»
11:17 grondilu weird.  I thought I tried that yesterday on my machine and it didn't work.  Nevermind, it does now.
11:30 jnthn Whenever I see somebody say "X didn't work on my machine" and it's got quotes in, I wonder if their shell eated the quotes. :)
11:36 fsergot joined #perl6
11:56 zby_home joined #perl6
12:09 masak good day, #perl6
12:10 colomon O/
12:10 colomon my head seems to have grown!
12:11 * masak .oO( cOlOmOn )
12:11 HarryS joined #perl6
12:13 Psyche^ joined #perl6
12:23 moritz http://facts.learnpython.org/2008
12:24 moritz "How can addition be more easier than this?", using eval and join
12:24 moritz how 'bout [+] ?
12:24 masak :)
12:24 kokos joined #perl6
12:27 masak nonsense! it's a Python Fact -- it has to be right! :P
12:30 mj41 joined #perl6
12:31 whiteknight joined #perl6
13:01 mkramer joined #perl6
13:05 MayDaniel joined #perl6
13:13 tadzik oh, someone proposed to do this with Perl 6
13:13 tadzik 'afternoon, #perl
13:13 tadzik 6
13:14 jnthn o/ tadzik
13:15 masak tadzik! \o/
13:16 jnthn wtf, I just implemented a basic version of wrap and it worked first time
13:17 tadzik know the feeling, had that during gsoc
13:17 tadzik wtf, no test failures? What did I miss...
13:17 jnthn OK, found something that doesn't work. Phew. :)
13:18 jnthn Underlying idea seems sound though. :)
13:18 jnthn It's by far less horrible than master's wrap implementation too.
13:18 jnthn er, ng's :)
13:18 tadzik ENOMASTER ;)
13:26 masak "Rakudo Perl 6 -- getting less horrible with each iteration"
13:27 dalek rakudo/nom: 5f34902 | jnthn++ | src/Perl6/Actions.pm:
13:27 dalek rakudo/nom: A routine will always need some kind of dispatcher slot, since it may be a wrapper (in fact, we probably need to generalize this to block level).
13:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5f349023b7
13:27 dalek rakudo/nom: f7053be | jnthn++ | tools/build/Makefile.in:
13:27 dalek rakudo/nom: Shuffle Attribute.pm earlier in the bootstrap, since we're going to use a class with attributes in Routine.
13:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f7053be8f5
13:27 dalek rakudo/nom: 4d35f0c | jnthn++ | src/ (2 files):
13:27 dalek rakudo/nom: First cut implementation of Routine.wrap. No unwrap support yet, and the wrappers also need to be rutines until the dispatcher slot gets generalized to blocks.
13:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4d35f0c9ec
13:30 jnthn eek, I caused a fail
13:30 jnthn ah, I fix stuff soon...shopping &
13:56 am0c joined #perl6
14:17 hundskatt joined #perl6
14:19 felher How can i have two classes A,B in files A.pm, B.pm that 'use' each other?
14:20 tadzik class A { ... }; class B {}; class A {}; I think
14:20 tadzik I may be wrong though
14:21 tadzik (literal '...')
14:21 JimmyZ joined #perl6
14:22 colomon joined #perl6
14:24 felher tadzik: I'm not sure i understand your suggestion. The problem is that at the moment if they 'use' each other, they keep including recursively until maximum recursion depth is reached.
14:24 tadzik oh, I see
14:24 masak that sounds wrong.
14:24 masak is this on latest nom?
14:25 felher masak: yes.
14:25 felher masak: well, two-day-ago-nom
14:25 jnthn It should die more gracefully than recursing. This came up within the last week, I think.
14:25 felher i'll recompile nom an check again.
14:25 jnthn felher: I strongly doubt anything will have changed.
14:25 felher maybe its older nom and it already solved :)
14:26 jnthn I'm aware it fails in a bad way, but I didn't get to improving things, and I didn't see any other patches that would.
14:27 felher jnthn: i see :) So for classes in different files that need each other the best thing to do at the moment is to use master instead of nom?
14:27 jnthn felher: er
14:28 jnthn felher: The best thing to do is not design it like that.
14:28 jnthn master allowed things to work that it should not have done, because it didn't do separate compilation properly.
14:33 jnthn Put another way, if two classes are so tightly coupled that they depend on each other by name, then there's never a case where you'd just need to load one of them, so there's no reason not to put them in the same compilation unit (that is, the same file)
14:35 felher jnthn: okay, but if i have a class DLX, that will emulate a DLX-Processor, with a method load-program, that loads a programm (long string). And a grammar DLX-Program and a class DLX-Programm-Actions. I wanted DLX-Program-Actions.TOP 'make' a list of closures that operate on a DLX-Object. So the Action-class needs to know the DLX-Class, while DLX-Class needs to know the Action-Class, so it can have a method
14:35 felher load-program. Is this considered bad design?
14:35 felher I hope it is understandable what i want to achieve
14:42 Trashlord joined #perl6
14:43 felher Well, i write it without the load-program method for a start. This method isn't really needed :)
14:50 jnthn felher: That load-program method does sound a little misplaced. I'm having trouble working out what you mean by DLX-Class vs DLX-Object. Do you just mean there's a class DLX? And you then make instances of it to represent the data to be manipulated?
14:50 jnthn If so it sounds like that class is serving two responsibilities: being the facade to the module's functionality, and being the holder of data.
14:52 jnthn It may also be that load-program has no real reason to be a method at all, but instead a sub exported by the module.
14:54 felher jnthn: first: thanks for your help! :). second: I guess it is harder to explain than to show, so as soon as i got something working, i'll push the few lines on github so one can see instead of decrypting my explanations :)
14:55 jnthn felher: Probably the case :)
15:00 spine joined #perl6
15:05 vinian_ joined #perl6
15:14 abercrombie joined #perl6
15:17 mikemol joined #perl6
15:19 Woodi to get optimized rakudo I need to pass --optimize=3 to rakudo Configure ? or parrot/nqp ?
15:19 jnthn Woodi: To Rakudo itself.
15:19 jnthn perl6 --optimize=3
15:20 Woodi ok
15:20 jnthn Woodi: Note that it uses 2 by default. 3 means "new/experimental optimizations"
15:20 jnthn Woodi: We do compile the core setting with --optimize=3
15:20 jnthn Woodi: Because the spectest suite is big enough to point out the issues
15:22 dorlamm joined #perl6
15:24 Woodi with 3 looks little slower :)
15:24 Woodi I tested on yesterday version of Rakudo
15:25 jnthn Woodi: I found the benchmark had quite a huge variance between runs.
15:25 jnthn Woodi: I guess because it's doing network IO
15:28 Woodi yes, but difference is around 0.0x s
15:29 Woodi will check newer rakudo
15:29 jnthn Woodi: I was seeing a bit wider than that, I think. Disclaimer: I'm on Windows, and also just grabbed a Redis binary and ran it straight out of the ZIP package without installing it or anything :)
15:32 dalek roast: f37fce0 | jnthn++ | S06-advanced/wrap.t:
15:32 dalek roast: Unfudge some todo tests in wrap.t; fudge a test for .callwith, which we don't yet implement.
15:32 dalek roast: review: https://github.com/perl6/roast/commit/f37fce094f
15:37 Chillance joined #perl6
15:38 dalek rakudo/nom: 98b6731 | jnthn++ | src/ops/perl6.ops:
15:38 dalek rakudo/nom: Ensure that dispatch searcher can handle frames with an unpopulated dispatcher slot.
15:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/98b6731165
15:38 dalek rakudo/nom: dcc9495 | jnthn++ | src/Perl6/Actions.pm:
15:38 dalek rakudo/nom: Ensure every block gets a $*DISPATCHER slot, since they could all end up serving as wrappers.
15:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dcc9495907
15:38 dalek rakudo/nom: 927659c | jnthn++ | src/ (2 files):
15:38 dalek rakudo/nom: Get unwrapping in place.
15:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/927659c821
15:38 dalek rakudo/nom: ef81604 | jnthn++ | t/spectest.data:
15:38 dalek rakudo/nom: Turn on wrap.t.
15:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ef81604b93
15:38 dalek roast: 251efb0 | jnthn++ | S06-advanced/wrap.t:
15:38 dalek roast: A bunch more unfudging for wrap.t; think we pass more of this now than ever before.
15:38 dalek roast: review: https://github.com/perl6/roast/commit/251efb061b
15:38 jnthn And an RT down :)
15:39 masak \o/
15:40 jnthn oh
15:40 jnthn the method on the wrap handle should be called restore, not unwrap
15:42 masak unwrap is cuter, and more mnemonic.
15:44 jnthn The one on sub is .unwrap
15:45 jnthn Anyway, I'll make it do what the spec says for the time being :)
15:45 jnthn If somebody wishes to change the spec and patch the name, I'm not going to argue :)
15:45 jnthn ...well, unless they decide to call the method aadvark or something.
15:45 Moukeddar joined #perl6
15:46 dalek roast: 2a3fab4 | jnthn++ | S06-advanced/wrap.t:
15:46 dalek roast: Test for unwrapping using the handle itself.
15:46 dalek roast: review: https://github.com/perl6/roast/commit/2a3fab46c2
15:47 dalek rakudo/nom: 046303e | jnthn++ | src/core/Routine.pm:
15:47 dalek rakudo/nom: Rename method on the wrap handle to match the spec.
15:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/046303e0f1
15:47 masak I'm thinking of renaming the method in the spec instead... :)
15:48 masak though I don't feel extremely strongly about it.
15:48 felher Did i get that right: I need to provide and BUILD-submethod if i want private attributes to be able to be initialized from new()?
15:48 jnthn masak: If you do so, please patch Rakudo to keep it in sync.
15:48 jnthn felher: yes
15:48 masak jnthn: gotcha.
15:48 felher jnthn: good :)
15:48 jnthn masak: It's in Routine.pm
15:48 jnthn masak: You may find the implementation cute too :)
15:48 masak felher: well, or initialize them at declation.
15:48 masak declaration*
15:48 masak jnthn: I'm sure I will :)
15:49 felher masak: yeah, or that :)
15:49 masak I'll wait and see if anyone else has an opinion on 'restore' vs 'unwrap'.
15:50 benabik Unwrap makes sense iff the opposite operation is called wrap.
15:50 * benabik isn't really paying attention, can you tell?
15:50 jnthn benabik: There's a Routine.wrap which returns a handle. You can pass that to Routine.unwrap($the-handle) to remove the wrapping
15:50 jnthn However, the handle is currently spec'd to have a method that will just go ahead and do the unwrapping.
15:51 jnthn Currently it's called restore
15:51 masak oh!
15:51 jnthn So the restore method is the one on the handle itself.
15:51 jnthn Not the one on Routine.
15:51 masak I hadn't realized that there's already a .unwrap method on Routine.
15:51 jnthn masak: yeah
15:51 benabik I'd kinda expect unwrap to be a method on the handle.
15:51 masak yeah, maybe that's a distinction worth keeping, then.
15:51 benabik Not sure, that's odd.
15:51 masak benabik: I wouldn't.
15:52 masak it's the *Routine* that's unwrapped.
15:52 masak the handle is just an indicator to which layer of wrapping is to be removed.
15:52 jnthn There was some handwavey comment in the test file about there being an argumentless unwrap the pops the "latest" wrapper off
15:52 jnthn *that
15:52 rindolf joined #perl6
15:52 rindolf Hi all.
15:52 jnthn But it's neither implemented nor, afaik, spec'd.
15:52 rindolf jnthn: here?
15:52 rindolf Oh, you are.
15:52 jnthn o/ rindolf
15:52 rindolf jnthn: did you take a look at my test failures?
15:52 masak o/ rindolf
15:53 rindolf masak: hi.
15:53 rindolf jnthn: hi.
15:53 masak jnthn: sounds like a double-edged convenience.
15:53 jnthn rindolf: The range.t one is still problematic; believe the others are now resolved.
15:54 jnthn masak: Yeah, I'm not too fond of the idea.
15:54 masak jnthn: I mean, if you can unwrap without specifying the handle, you might "accidentally" unwrap someone else's wrapping, right?
15:54 jnthn masak: Correct.
15:54 jnthn masak: It feels like a bad idea in general.
15:54 masak the nice thing about the current design is that wrappings are "orthogonal" to each other.
15:54 masak which is quite a feat when you think about it.
15:54 jnthn Yes, that's a nice property.
15:54 masak (since they nest)
15:54 jnthn Well, they're called in a certain order
15:55 jnthn But provided you write composable ones, then sure, it's fine.
15:55 masak yeah.
15:55 jnthn What compostability means is quite situation specific though
15:55 jnthn er, composability
15:55 rindolf jnthn: OK, thanks.
15:55 masak I think the handle-less .unwrap would be at odds with the composability, if only indirectly.
15:56 masak but... I agree it might be nice, too :)
15:56 masak maybe it can be made to work only when there's exactly one layer of .wrap applied?
15:56 jnthn masak: maybe :)
15:59 jnthn heh, you can do the self-unwrapping wrapper now
16:00 masak I have forgotten about that one :)
16:00 jnthn > sub flag_first_call(&x) { my $h = &x.wrap(-> |$ { say "called!"; callsame; $h.restore }) }; sub foo() { say 42 }; flag_first_call(&foo); foo(); foo();
16:00 jnthn called!
16:00 jnthn 42
16:00 jnthn 42
16:01 jnthn I'm sure somebody would find a cute use for it some day :)
16:01 benabik Oh.  &foo.wrap doesn't return a new method, it alters &foo.  That makes sense
16:01 jnthn benabik: yes, it's in place
16:01 benabik Vivifying database connections?
16:01 jnthn mebbe
16:02 masak anything that needs to be done exactly once.
16:02 jnthn It may be that state variables are always more convenient for that kinda thing though.
16:02 jnthn We
16:02 jnthn *well
16:02 jnthn This lets you do it from the outside though
16:02 masak feels like the same could be done with a state v... dang :)
16:02 jnthn Where the routine may not be an active participant in the process
16:02 masak right.
16:02 jnthn Of course, you could wrap with state too
16:02 jnthn But then you'd call the outer wrapper every time.
16:03 masak hm, I gotta remember this pattern so I can just reach for it when I need it :>
16:18 Woodi hmm, got 0.5 s improvement on 10k commands and 0.1 s on 10k strings concatenation
16:20 * [Coke] yawns
16:38 hundskatt joined #perl6
16:43 daxim joined #perl6
17:19 Moukeddar joined #perl6
17:21 Trashlord joined #perl6
17:31 masak nom: sub foo { say "unwrapped" }; my $h = &foo.wrap: { say "first call"; $h.restore }; foo; foo; foo
17:31 p6eval nom 046303: OUTPUT«first call␤unwrapped␤unwrapped␤»
17:32 masak \o/
17:32 jnthn The @a = @a bug is a real pain to solve...if you're not pmichaud
17:35 jnthn nom: my @array = <a b c d>; @array .= grep: { $_ ~~ /<[a..c]>/ }; say @array
17:35 p6eval nom 046303: OUTPUT«splice() not implemented in class 'Mu'␤  in method reify at src/gen/CORE.setting:3975␤  in method gimme at src/gen/CORE.setting:4336␤  in method eager at src/gen/CORE.setting:4312␤  in method STORE at src/gen/CORE.setting:4765␤  in method dispatch:<.=> at src/gen/CORE…
17:37 jnthn Fixed that one, but busted other stuff :/
17:46 colomon joined #perl6
17:54 MayDaniel joined #perl6
17:59 dalek rakudo/nom: 08e560e | jnthn++ | src/core/List.pm:
17:59 dalek rakudo/nom: Make unshift handle the case where it's called and $!items is empty.
17:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/08e560e4ed
17:59 dalek rakudo/nom: 99fff11 | jnthn++ | src/core/Array.pm:
17:59 dalek rakudo/nom: Try to fix Array.STORE a bit. This isn't perfect, but an improvement for sure; things like '@a = @a' and '@a .= uniq()' now work. Still something rotten in some of the lazy cases, though.
17:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/99fff110ad
18:08 dalek roast: b67998f | jnthn++ | S (2 files):
18:08 dalek roast: Various unfudges thanks to list fixes.
18:08 dalek roast: review: https://github.com/perl6/roast/commit/b67998f808
18:18 dalek rakudo/nom: de08cc8 | jnthn++ | docs/ChangeLog:
18:18 dalek rakudo/nom: Some ChangeLog entries.
18:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/de08cc8482
18:22 birdwindupbird joined #perl6
18:22 birdwindupbird left #perl6
18:26 sayu joined #perl6
18:38 Guest2721 joined #perl6
18:40 vinian_ joined #perl6
19:08 masak nom: class Pin { method drop { say "<tiny metal sound>" } }; .drop given Pin.new
19:08 p6eval nom de08cc: OUTPUT«<tiny metal sound>␤»
19:13 Sarten-X joined #perl6
19:22 vinian_ joined #perl6
19:31 felher masak: given can be a statement modifier?
19:32 cognominal with masak's onliner, I discovered that too. :)
19:32 felher sweet :)
19:35 masak given is a very nice statement modifier.
19:36 masak what amazes me is that the two of you know the term "statement modifier" without having discovered that "give" could be one :P
19:39 masak there are two kinds of statement modifiers: conditional and loopy.
19:39 masak "given" is the loopy type.
19:39 moritz .oO( like the "if-loop"? )
19:41 jnthn ;)
19:42 felher :D
19:43 masak g'ah, if-loops! :)
19:44 masak the reason that sub-classification matters is that it governs which statement modifiers you can nest without using parentheses.
19:44 masak you can nest if-mods inside loop-mods, but not the other way around.
19:45 masak nom: .say if $_ %% 3 for 1..20
19:45 p6eval nom de08cc: OUTPUT«3␤6␤9␤12␤15␤18␤»
19:45 masak nom: .say if $_ %% 3 given 15
19:45 p6eval nom de08cc: OUTPUT«15␤»
19:45 masak nom: .say given 15 if 2 + 2 == 4
19:45 p6eval nom de08cc: OUTPUT«===SORRY!===␤Missing block at line 1, near ""␤»
19:45 masak std: .say given 15 if 2 + 2 == 4
19:45 p6eval std be1f10e: OUTPUT«[31m===[0mSORRY![31m===[0m�Confused at /tmp/SCQdT97NIK line 1:�------> [32m.say given 15 [33m�[31mif 2 + 2 == 4[0m�Parse failed�FAILED 00:01 120m�»
19:46 masak arguably there could be a better error there.
19:46 felher masak: ah, good to know :)
19:47 masak '<x> if <y> for <z>' is how Perl 6 does list comprehensions :)
19:48 masak like Haskell's [<x> | <z>, <y>] syntax.
19:49 felher yeah :)
19:52 moritz perl6: say(5-7)/2
19:52 p6eval pugs b927740, rakudo de08cc, niecza v11-27-gdaa9117: OUTPUT«-2␤»
19:52 masak nom: sub is-prime { none ($^n %% $_ for 2..$n/2) }; my @primes = ($_ if .&is-prime for 2..100)
19:52 p6eval nom de08cc:  ( no output )
19:52 masak nom: sub is-prime { none ($^n %% $_ for 2..$n/2) }; my @primes = ($_ if .&is-prime for 2..100); .say for @primes
19:52 p6eval nom de08cc: OUTPUT«2␤3␤5␤7␤11␤13␤17␤19␤23␤29␤31␤37␤4​1␤43␤47␤53␤59␤61␤67␤71␤73␤79␤83␤89␤97␤»
19:52 masak \o/
19:55 cognominal nom: grammar A {  token TOP { <a>? }; token a { a } }; $/ = A.parse: "a";  say $/<a>.WHAT
19:55 p6eval nom de08cc: OUTPUT«Parcel()␤»
19:55 moritz nom: say (2 + 2i) > (2 + 3i)
19:56 p6eval nom de08cc: OUTPUT«(timeout)»
19:56 masak o.O
19:56 masak moritz: has that been reported?
19:56 * moritz wonder if that should dispatch-error
19:56 moritz masak: don't thinks so
19:56 cognominal I thought the quantifier ?   now returned a Match instead of a Parcel in case of success
19:57 * masak submits rakudobug
19:58 mj41 joined #perl6
19:58 jnthn nom: die 'foo'
19:58 p6eval nom de08cc: OUTPUT«foo␤  in block <anon> at /tmp/r9UjgElZwj:1␤  in <anon> at /tmp/r9UjgElZwj:1␤»
19:59 jnthn nom: multi foo() { }; foo(1)
19:59 p6eval nom de08cc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (int) (line 1)␤    Expected any of:␤    :()␤»
19:59 jnthn heh
19:59 masak moritz: as far as I'm concerned, it should either return Failure or die outright.
19:59 jnthn nom: multi foo(Rat) { }; foo(1)
19:59 p6eval nom de08cc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (int) (line 1)␤    Expected any of:␤    :(Rat)␤»
19:59 jnthn oh no, it's too smart...
19:59 jnthn nom: multi foo(Rat:U) { }; foo(1)
19:59 p6eval nom de08cc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (int) (line 1)␤    Expected any of:␤    :(Rat)␤»
19:59 jnthn nom: multi foo(Int:U) { }; foo(1)
19:59 p6eval nom de08cc: OUTPUT«No applicable candidates found to dispatch to for 'foo'. Available candidates are:␤:(Int)␤␤  in block <anon> at /tmp/MK7cye80g5:1␤  in <anon> at /tmp/MK7cye80g5:1␤»
19:59 jnthn Hm
19:59 jnthn OK, so it does report dispatch fails. Phew.:)
20:00 jnthn oh, crap
20:01 jnthn phenny: tell mls it seems that any infinite recursion in Rakudo generates a hang when trying to find an exception handler
20:01 phenny jnthn: I'll pass that on when mls is around.
20:01 jnthn moritz: So it's doing infinite recursion for some reason. That then doesn't get reported.
20:02 moritz it probably tries something stupid like converting to .Numeric or so
20:03 molaf joined #perl6
20:10 cognominal S05: "If a subpattern is directly quantified with C<?>, it either produces a single C<Match> object, or C<Nil>. "
20:11 moritz we probably don't do that yet
20:11 moritz (used to be different)
20:12 moritz nom: sub f(Str $x) { }; my Int $y = 3; f($y)
20:12 p6eval nom de08cc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'f' will never work with argument types (Int) (line 1)␤    Expected: :(Str $x)␤»
20:12 moritz so the optimizer knows about variables now?
20:12 Moukeddar joined #perl6
20:18 dalek book: 7117803 | moritz++ | / (5 files):
20:18 dalek book: Several text and markup fixes
20:18 dalek book:
20:18 dalek book: Thanks to flip214++ for the thorough review
20:18 dalek book: review: https://github.com/perl6/book/commit/7117803a90
20:36 * moritz is kinda tired of the well-phrased Perl 6 rants by chromatic, that all seem to contain much wisdom, but never leave me any wiser than before
20:42 jnthn So, what does he want us to do? Give up? Because that's all chromatic ever makes me feel like doing.
20:47 masak seems what made chromatic "give up on Perl 6" was something really trivial, such as, "I'd like to use Perl 6 in production now, in 2011, but none of the implementations are there yet"
20:47 moritz dunno. Get attention, maybe.
20:47 masak and just at the point when the implementations are really shaping up!
20:47 masak now we "just" need thousands of modules :)
20:48 awwaiid only positive thing I got out of it -- it would be a big win to have a perfectly functional magical bridge to perl5 CPAN. Duh.
20:48 arnsholt I feel the quote "[...] I want to solve my problems more than I want a better language." sums it up. Essentially, he's saying "I'm a late adopter"
20:48 arnsholt And he thinks the early adopters are stupid (or however you wanna put it) for not agreeing with him
20:49 masak well, this "I'm a late adopter" attitude is fairly new from him.
20:52 moritz he's a later adopter to being a later adopter
20:52 moritz fits, eh? :-)
20:53 masak RT #104594 is "the same" as that other lexical-related bug we had a few weeks ago.
20:53 jnthn moritz: on the optimizer - it's not worrying too much about variables. It does pay attention to the .type annotation on a node. And iirc the actions make sure lexical variables get marked with one.
20:53 jnthn masak: Yeah, I'm pretty sure it is. Somehow it must be taking a different code path. I can only guess because it's a code block in a quoting language or something...
20:54 jnthn moritz: So it's not so much variable aware, just type aware :)
20:55 masak jnthn: no, it's even the same "symptoms" as with the other ticket. an inner block is required, recursing is needed, etc.
20:56 jnthn masak: huh? I was agreeing with you :)
20:56 jnthn masak: And being a little surprised the last fix didn't cover this one :)
20:57 masak oh, ok.
20:57 moritz $ ./perl6 -e 'say (2+2i) > (2+3i)'
20:57 moritz You can only coerce a Complex to Real if the imaginary part is zero
20:58 masak yes, maybe different code path then.
20:58 masak moritz++
20:59 worr joined #perl6
21:00 jnthn moritz: is https://rt.perl.org/rt3/Tic​ket/Display.html?id=104430 closable now?
21:01 moritz nom: say True.perl
21:01 p6eval nom de08cc: OUTPUT«Bool::True␤»
21:01 moritz jnthn: yes, I think we have tests too
21:03 jnthn moritz: Yeah, I saw various commits to rakudo/tests, but wasn't sure if there was a reason it was still open :)
21:03 jnthn masak: spectesting a patch for it now :)
21:05 vinian_ joined #perl6
21:05 masak \o/
21:09 dalek rakudo/nom: 4a4601d | jnthn++ | src/Perl6/Actions.pm:
21:09 dalek rakudo/nom: Make sure embedded blocks in strings get the correct lexical scope.
21:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4a4601d0c2
21:11 jnthn cognominal: le bug est vraiment fixed :)
21:11 jnthn Hopefully :)
21:11 Guest92238 joined #perl6
21:13 jnthn moritz: I closed it
21:13 jnthn Hmm. We need to recruit more test writers. The testneeded queue is quite big
21:13 jnthn I wonder if we can identify some suitable ones for GCI tasks?
21:16 cognominal jnthn++  #  our $hero
21:24 masak GCI tasks for testneeded is a great idea.
21:32 donri joined #perl6
21:51 mj41 joined #perl6
21:59 Sarten-X joined #perl6
22:13 vmspb joined #perl6
22:13 packetknife joined #perl6
22:20 mdxi joined #perl6
22:40 alvis joined #perl6
22:45 Ingis joined #perl6
23:18 daxim joined #perl6
23:51 masak 'night, #perl6

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

Perl 6 | Reference Documentation | Rakudo