Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-08

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:00 AlexDaniel m: loop (my $x = 0, $x < 10, $x++) {}
00:00 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/UkpsfHYHv1␤Malformed loop spec␤at /tmp/UkpsfHYHv1:1␤------> 3loop (my $x = 0, $x < 10, $x++7⏏5) {}␤»
00:01 AlexDaniel ↑ I wonder if there is any way to create a better error message here
00:01 AlexDaniel although it is not too bad, it is not awesome too
00:06 Xliff_ *sigh*
00:06 Xliff_ Windows paste just died... WTF?
00:06 Xliff_ BRB
00:06 timotimo wtf is windows paste?
00:07 Xliff_ CTRL-V
00:07 timotimo oh
00:09 Majora320 joined #perl6
00:10 Majora320 /join #perl7
00:10 Majora320 left #perl6
00:12 Amnez777 joined #perl6
00:12 AlexDaniel huh?
00:12 labster joined #perl6
00:15 BenGoldberg joined #perl6
00:15 timotimo a funny joke, i guess?
00:18 Xliff joined #perl6
00:18 Xliff Wheee...
00:18 Xliff Rebooting is always fun.
00:19 Xliff OK. Due to metachars, there is no way to get this any cleaner, right?
00:19 Xliff s| \</p\>\v\</body\>\v\</html\>$||;
00:19 Xliff And actually, P6 really wants this:
00:19 Xliff s| \<\/p\>\v\<\/body\>\v\<\/html\>$||;
00:19 timotimo of course it can be cleaner
00:19 AlexDaniel ‘’
00:19 timotimo you can use quotes
00:19 Xliff Even with the Alternative delimeter on the substitution operator.
00:20 AlexDaniel just quote it!
00:20 Xliff s|' </p>\v</body>\v\</html>$'||;    ?
00:20 ZoffixWin s| '</p>' \v '</body>' \v '</html>' $||;
00:20 Xliff OK. Thankee.
00:20 ZoffixWin s| "</p>\v</body>\v</html>" $||; # May work too
00:20 timotimo no, i don't think it would work
00:21 timotimo inside quotes, backslash sequences mean what they mean outside regexes
00:21 ZoffixWin timotimo, right, so won't that mean \v => vertical whitespace?
00:21 timotimo m: say "\v"
00:21 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xlcJeHGjMT␤Unrecognized backslash sequence: '\v'␤at /tmp/xlcJeHGjMT:1␤------> 3say "\7⏏5v"␤    expecting any of:␤        argument list␤        double quotes␤        term␤»
00:21 ZoffixWin Xliff, and here's the mandatory regexes for HTML thing: http://stackoverflow.com/questions/173​2348/regex-match-open-tags-except-xhtm​l-self-contained-tags/1732454#1732454
00:22 ZoffixWin m: say so /\v/
00:22 camelia rakudo-moar 61d231: OUTPUT«False␤»
00:22 ZoffixWin What's a \v?
00:22 timotimo m: "\x01".."\x30" .grep(/\v/).say
00:22 camelia rakudo-moar 61d231: OUTPUT«WARNINGS for /tmp/KlyolXYKZE:␤Useless use of ".." in expression "\"\\x01\"..\"\\x30\" .grep(/\\v/)." in sink context (line 1)␤()␤»
00:22 ZoffixWin I guess vertical whitespace... K... never mind me :D
00:22 AlexDaniel ZoffixWin: but you can parse html with a perl6 grammar, can't you?
00:22 timotimo m: ("\x01".."\x30").grep(/\v/).say
00:22 camelia rakudo-moar 61d231: OUTPUT«(␤
00:22 timotimo m: ("\x01".."\x30").grep(/\v/).&uniname.say
00:22 camelia rakudo-moar 61d231: OUTPUT«Cannot call uniname(Seq); none of these signatures match:␤    (Str:D $str)␤    (Int:D $code)␤  in block <unit> at /tmp/TQCKACclT4 line 1␤␤»
00:23 timotimo m: ("\x01".."\x30").grep(/\v/).map(&uniname).say
00:23 camelia rakudo-moar 61d231: OUTPUT«(LINE FEED (LF) LINE TABULATION FORM FEED (FF) CARRIAGE RETURN (CR))␤»
00:23 timotimo those are \v
00:23 ZoffixWin I get my mistake now.
00:23 Xliff ZoffixWin, ahh! Thanks! Bookmarking now.
00:23 timotimo AlexDaniel: yes, you very much can
00:24 Xliff And I'm not using rexexp to parse HTML. I am using it to REMOVE XML.
00:24 timotimo you can only remove XML properly if you parse it properly :P
00:24 ZoffixWin :P
00:24 timotimo otherwise you'll easily get confused by smileys that include > and <
00:24 ZoffixWin Xliff, sure, that's why I merely mentioned and not shouted at you ^_^
00:25 Xliff If the problem-set requires that the program needs to grok XML.
00:25 Xliff If the XML is just the same as any other text, it isn't parsing.
00:25 Xliff There is a difference, even if it's splitting hairs.
00:25 Xliff And I'm assured that I do not have to worry about smileys.
00:27 AlexDaniel .tell jnthn hey. Perhaps leave this in a terminal for several minutes or something: 「while :; do perl6 -e 'await (start { print ‘x’; sleep 1; } for ^100); say ‘’;'; done」
00:27 yoleaux AlexDaniel: I'll pass your message to jnthn.
00:29 AlexDaniel .tell jnthn also, there's one thing that I've noticed. Maybe that will tell you something, who knows. See this screenshot: https://files.progarm.org/2016-​04-08-032820_664x486_scrot.png . So, it looks like there's a maximum number of threads or something, so these ‘x’-es are appearing in batches. It crashes only during the second batch, hmmm…
00:30 yoleaux AlexDaniel: I'll pass your message to jnthn.
00:30 AlexDaniel .tell jnthn that is, the exception always appears after exactly 32 ‘x’ characters
00:30 yoleaux AlexDaniel: I'll pass your message to jnthn.
00:32 ZoffixWin New post: Perl 6 Is Slower Than My Fat Momma! http://blogs.perl.org/users/zoffix_znet/2016​/04/perl-6-is-slower-than-my-fat-momma.html
00:32 Xliff Directive d not applicable for type Str
00:32 Xliff ???
00:33 ZoffixWin Xliff, forgot .IO?
00:33 Xliff Nope. Not using any of the IO ops.
00:33 Xliff Just filehandles.
00:34 ZoffixWin Are you able to pastebin the code in question?
00:34 Xliff My biggest problem is that's all I'm getting. I'm not getting a location so I can isolate and fix on my code.
00:34 Xliff Yeah. One sec.
00:36 Xliff http://pastebin.com/gWpZaV0e
00:38 Xliff ZoffixWin++ -- Loved that blog post.
00:38 sortiz ZoffixWin++ # blog
00:38 Xliff Heh
00:38 ZoffixWin No idea why that code shows that error :S
00:41 Xliff Yeah. Figured it out.
00:42 Xliff "$newIndexF.defined" was what was throwing the error. Replaced with "$newIndex === Nil" fixed it.
00:42 Xliff Still, I would expect a better error to be emitted for that.
00:55 Xliff ZoffixWin, another datapoint. If I do "if (!$indexF.defined) { ... }" it works as opposed to "{...} if !$indexF.defined"
00:55 ZoffixWin Xliff, it's ... if blah, not { ... } if blah
00:56 ZoffixWin Xliff, or you can use:     do { ... } if blah
00:58 vendethiel- joined #perl6
00:59 Xliff ZoffixWin, Yes.
00:59 Xliff ZoffixWin, (corrected) another datapoint. If I do "if (!$indexF.defined) { ... }" it works as opposed to "... if !$indexF.defined"
00:59 Xliff What I meant was not what I typed...
00:59 ZoffixWin *shrug*
00:59 * Xliff goes for beer.
01:14 Xliff The one thing Windows (with proper utilities) does better than the Linux CLI -- mass renaming.
01:15 timotimo huh? "with proper utilities"?
01:16 timotimo that's not a fair comparison. you can get good utilities for the linux cli, too
01:16 ZoffixWin huh?
01:17 * timotimo goes to bed
01:17 ZoffixWin Xliff, Linux has `rename`... what does Windows have, even with "proper utilities"?
01:17 sortiz timotimo, o/
01:19 Xliff ZoffixWin, BulkRename.
01:19 Xliff It's cumbersome, but powerful.
01:19 ZoffixWin Never heard of it.
01:19 Xliff http://www.bulkrenameutility.co.uk/Main_Intro.php
01:20 BenGoldberg joined #perl6
01:20 ZoffixWin Can't recall a time when Linux's `rename` wasn't powerful enough for me, since it can do directories too
01:20 Xliff Yikes!
01:20 Xliff How did I miss 'rename'?
01:21 Actualeyes joined #perl6
01:21 ZoffixWin ¯\_(ツ)_/¯
01:21 ZoffixWin Takes a while to learn everything.
01:21 Xliff (It's because I'm always translating 'rename' to 'mv' when I'm on a Unix shell.... *sigh*)
01:21 Xliff ¯_(ツ)_/¯
01:21 Xliff indeed!
01:21 Xliff Hmm....
01:21 Xliff Script is borked.
01:22 Xliff ¯\_(ツ)_/¯
01:22 Xliff There we go.
01:34 telex joined #perl6
01:36 ZoffixWin We reached 600 modules in ecosystem! :)
01:38 AlexDaniel now let's remove some!
01:38 Xliff \o/
01:41 skink joined #perl6
01:46 vendethiel joined #perl6
01:46 skids joined #perl6
01:46 kid51 joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:47 skink Is there a performance-optimal means of string concatenation?
01:50 skids Theoretically the "rope" system should prevent reallocs internally.
01:50 skids Not sure how smart it is yet.
01:51 * Xliff ♥s rename.
01:52 skink I've a UUIDv4 implementation. Does 300+ hex strings per second, but two different ways of inserting the dashes reduces it to just over 100 per second
01:54 skids Could be in the splitting as well.
01:58 timotimo a --profile should be able to tell you whether it's in "split" or "join" or "infix:<~>" or what else
01:58 * timotimo AFK for sleep
01:59 Xliff night "timo" x 2
01:59 skids m: 0xde305d5475b4431badb2eb6b9e546014.po​lymod(0x100000000,0x10000,0x10000,0x1​0000).reverse».base(16).join("-").say
01:59 camelia rakudo-moar 61d231: OUTPUT«DE305D5475B4-431B-ADB2-EB6B-9E546014␤»
02:01 skids m: 0x100000000000000000000000000000000.ran​d.polymod(0x100000000,0x10000,0x10000,0​x10000).reverse».base(16).join("-").say
02:01 camelia rakudo-moar 61d231: OUTPUT«58ADBD9D01B-DE80-0-0-0␤»
02:01 skids m: 0x100000000000000000000000000000000.rand.​Int.polymod(0x100000000,0x10000,0x10000,0​x10000).reverse».base(16).join("-").say
02:01 camelia rakudo-moar 61d231: OUTPUT«441CC60BAB09-9800-0-0-0␤»
02:02 Xliff Can you refer to a previously matched pattern in the same regexp?
02:02 Xliff So...
02:03 Xliff m/ '<' (.+? '>' (.+?) '</' $0 '>/
02:03 skids m: (0..^0x100000000000000000000000000000000​).pick.polymod(0x100000000,0x10000,0x100​00,0x10000).reverse».base(16).join("-") for 0..1000; say now - INIT now
02:03 camelia rakudo-moar 61d231: OUTPUT«0.4205267␤»
02:03 Xliff m: "<p>This is a test</p> ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>/
02:03 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kfVTT09G0z␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/kfVTT09G0z:1␤------> 3/p> ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>/7⏏5<EOL>␤    expecting any of:␤        post…»
02:03 TimToady missing )
02:03 Xliff m: "<p>This is a test</p>" ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>/
02:03 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eyOpvFmxGY␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/eyOpvFmxGY:1␤------> 3p>" ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>/7⏏5<EOL>␤    expecting any of:␤        sing…»
02:03 skink --profile's output is so neat
02:04 Xliff m: "<p>This is a test</p>" ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>'/
02:04 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rCzqizYC3t␤Unable to parse expression in metachar:sym<( )>; couldn't find final ')' ␤at /tmp/rCzqizYC3t:1␤------> 3p>" ~~ m/ '<' (.+? '>' (.+?) '</' $0 '>'7⏏5/␤    expecting any of:␤        infi…»
02:04 Xliff m: "<p>This is a test</p>" ~~ m/ '<' (.+?) '>' (.+?) '</' $0 '>'/
02:04 camelia rakudo-moar 61d231: ( no output )
02:04 TimToady you have to say it
02:04 ZoffixWin m: "<p>This is a test</p>" ~~ m/ '<' (.+?) '>' (.+?) '</' $0 '>'/
02:04 camelia rakudo-moar 61d231: ( no output )
02:04 Xliff m: say "<p>This is a test</p>" ~~ m/ '<' (.+?) '>' (.+?) '</' $0 '>'/;
02:04 camelia rakudo-moar 61d231: OUTPUT«「<p>This is a test</p>」␤ 0 => 「p」␤ 1 => 「This is a test」␤»
02:05 Xliff YAY!
02:05 ZoffixWin Xliff, do I have to link to the HTML regex parsing thing again? :D
02:05 Xliff LOL!
02:05 Xliff ZoffixWin, nope. This is pushing the parsing argument, but it really isn't.
02:05 Xliff =-D
02:05 ZoffixWin :)
02:06 Xliff Besides, I don't know what I'd do if I really would need to parse HTML.
02:06 Xliff libxml2?
02:06 araujo joined #perl6
02:06 skids (0..^0x100000000000000000000000000000000)​.pick.polymod(0x100000000,0x10000,0x10000​,0x10000).reverse».base(16).join("-").say for 0..10; # Hrm lots of 0s in there.
02:06 skids m: (0..^0x100000000000000000000000000000000)​.pick.polymod(0x100000000,0x10000,0x10000​,0x10000).reverse».base(16).join("-").say for 0..10; # Hrm lots of 0s in there.
02:06 camelia rakudo-moar 61d231: OUTPUT«320000000118-F168-5000-0-4AD4029B␤6​B00000006FF-D09E-6000-0-2E58B5C9␤F80000000​508-30AC-C000-0-356F0756␤D600000006A6-A2F4​-F000-0-2CD562DE␤D400000000B9-9DD4-4000-0-​42052CC6␤C20000000760-AA36-6000-0-40B801F7​␤47000000057A-5F9F-8000-0-5A354726␤B300…»
02:06 ZoffixWin I see Gumbo in the ecosystem, though personally, I just use Mojo::DOM via Inline::Perl5... It's hard to beat the awesomeness of that module.\
02:07 * Xliff looks at Mojo::DOM.
02:07 ZoffixWin https://metacpan.org/pod/Mojo::DOM
02:07 Xliff Problem is, I am trying to do this as light weight as possible. Including DOM/XML parsing modules add significant weight.
02:07 BenGoldberg joined #perl6
02:08 Xliff Although....
02:08 Xliff ZoffixWin++ # Mojo::DOM
02:09 ZoffixWin use Mojo::DOM:from<Perl5>; say Mojo::DOM.new('<p>This is a test</p>').at('p').all_text
02:09 ZoffixWin beats messing around with regexes that have flaws.
02:10 Xliff Hmph! My regexes don't have flaws! --- after I've fixed them.
02:10 skink skids, Slightly more complicated since I'm actually reading bytes out of a buffer to convert to hex
02:10 skids Ah, are you usin subbuf?
02:12 perlawhirl joined #perl6
02:12 sortiz skink, I'm interested in any solution you find, I need the same in DBIish.
02:13 notostraca joined #perl6
02:13 skink Actually I have a buffer of 16 bytes which I .unpack("H16") and then use .substr-rw() to insert the dashes
02:13 skink Reference implementation used bytes[a..b].fmt ~ "-" and so on
02:13 perlawhirl .tell Ulti Ulti++ for getting Rakudo on glot.io... and a bonus point for ruining the sites perfect 7x4 grid :D
02:13 yoleaux perlawhirl: I'll pass your message to Ulti.
02:13 skids substr-rw is likely to still be a very naive implementation.
02:14 skink Yup :D
02:15 skink sortiz, I'm writing this for the Extra module in Crypt::Random
02:15 skink (Which needs Windows testing, if anyone's interested)
02:16 skink There's also P6-UUID already on the modules list
02:16 skink Unless you were referring to fast concat in general
02:17 sortiz Nope, today only in a fast UUID.Str
02:17 sortiz Need
02:18 sortiz to see the current options.
02:19 kid51 joined #perl6
02:19 jeek joined #perl6
02:20 sortiz For UUID storage the best option is a Buf[uint64], imo.
02:23 skink P6-UUID gives me... exactly the same performance as mine. Interesting.
02:24 skink My base function, crypt_random_buf(), returns Buf[uint8]
02:24 BenGoldberg joined #perl6
02:24 sortiz I'm working on DBIish's type system, and there is a standard SQL UUID type that need to support, but nothing in core.
02:25 sortiz Any Buf is ok.
02:26 cdg joined #perl6
02:27 skink If you just want a Buf, you can call crypt_random_buf(16).
02:27 skink I just imagined most would want an Str.
02:27 skids m: my @dashes = "" xx 16; @dashes[3,5,7,9] = "-" xx *; (flat buf8.new(1..16)».fmt("%2.2x") Z @dashes).join for 1..1000; say now - INIT now;
02:27 camelia rakudo-moar 61d231: OUTPUT«4.8246475␤»
02:28 skink Hm.
02:29 labster joined #perl6
02:36 noganex joined #perl6
02:37 skink skids, That gets 11s on my somewhat older machine
02:37 skids ah so slower.
02:38 skink My substr-rw is actually 2-3s faster for me, funny enough.
02:41 skink Don't suppose I could get the bot to 'use UUID;' for comparison, eh?
02:41 Xliff skink: If you need Windows testers, please let me know.
02:43 skink Xliff, I absolutely do. For *nix I just read from /dev/urandom. Windows I have to use NativeCall for CryptGenRandom()/RtlGenRandom().
02:44 skids hrm.
02:44 skids m: use experimental :pack; buf8.new(1..16).unpack("H16") for 0..1000; say now - INIT now; # just the unpack takes lots of time.
02:44 camelia rakudo-moar 61d231: OUTPUT«4.6388444␤»
02:44 AlexDaniel ZoffixWin: is there anything Mojo::DOM does that you can't do with Gumbo?
02:44 skink I just pushed an RtlGenRandom() bind earlier. Originally I was going to bundle a compiled form of getentropy_win.c from LibreSSL.
02:44 skink https://github.com/skinkade/crypt-random
02:45 AlexDaniel ZoffixWin: Gumbo returns an XML thingy, so you can use any other XML:: module to work with that
02:45 Xliff Cloning.
02:49 Xliff D'oh!
02:49 Xliff No panda in rakudo-star distribution for Win.
02:49 skids m: use experimental :pack; my @dashes = "" xx 16; @dashes[3,5,7,9] = "-" xx *; (flat :256[buf8.new(1..16).values].base(16).comb(/../) Z @dashes).join for 1..1000; say now - INIT now; # use that :256[buf8.new(1..16).values].base(16) with substr-rw maybe.
02:49 camelia rakudo-moar 61d231: OUTPUT«3.1112866␤»
02:49 Xliff Used rakudo-star-2016.01-x86_64 (JIT).msi
02:52 yurivish joined #perl6
02:53 johndau joined #perl6
02:55 Xliff skink, http://pastebin.com/9UwCHYd6
02:55 Xliff No "if" ??? WTH?
02:56 skink Heh.
02:56 skink There's an 'if' module :)
02:56 skink use if;
02:57 skink use Crypt::Random::Win:if($*DISTRO.is-win);
02:57 skink use Crypt::Random::Nix:if(!$*DISTRO.is-win);
02:57 skink That's probably not the best way to do that, I admit.
02:57 Xliff (Windows)$ c:/rakudo/bin/perl6.bat -e 'use experimental :pack; my @dashes = "" xx 16; @dashes[3,5,7,9] = "-" xx *; (flat :256[buf8.new(1..16).values].base(16).comb(/../) Z @dashes).join for 1..1000; say now - INIT now; # use that :256[buf8.new(1..16).values].base(16)'
02:57 Xliff >> 3.701469
02:58 Xliff skids just ran that here and it returned --> <camelia> rakudo-moar 61d231: OUTPUT«3.1112866␤»
02:58 skids m: my @dashes = "" xx 16; @dashes[3,5,7,9] = "-" xx *; (:256[buf8.new((^256).pick xx 16).values].fmt("%32.32x") ~~ /(........)(....)(....)(....​)(............)/).join("-") for 1..1000; say now - INIT now; # who woulda thunk rx would be faster
02:58 camelia rakudo-moar 61d231: OUTPUT«0.80267970␤»
02:59 Xliff skink: Isn't that deployed with rakudo? If not I need to figure out the best way to get a package manager for Windows.
03:00 * Xliff is now playing: Sub Focus - Turn Back Time (Special Request Remix)
03:01 skink Nope
03:02 skink I can probably remove the Subsets::Common dependency. Really only added it to promote that package's use.
03:03 dalek perl6-most-wanted: 1872d8d | (Rich Loveland)++ | most-wanted/modules.md:
03:03 dalek perl6-most-wanted: Update link to File::Find module
03:03 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/1872d8d146
03:03 dalek perl6-most-wanted: fd34725 | azawawi++ | most-wanted/modules.md:
03:03 dalek perl6-most-wanted: Merge pull request #24 from rmloveland/file-find-fix
03:03 dalek perl6-most-wanted:
03:03 dalek perl6-most-wanted: Update link to File::Find module
03:03 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/fd3472511f
03:03 skink The 'if' module stuff I'll happily replace if someone knows a better way.
03:06 * Xliff is now playing: Prince - TIME
03:07 Xliff OMG.... Most underrated Prince song... EVAH!
03:12 Xliff skink, http://pastebin.com/dUDKNKWY
03:12 Xliff I don't seem to have the best Windows environment for Perl6.
03:12 Xliff Probably pathing issues.
03:12 Xliff But that's what I got when I was finally able to run the first test.
03:13 Xliff Looks more like an error in Win.pm6 than in Crypt::Random.
03:13 skink Where it says <HERE>, there's supposed to be a closing paren :)
03:14 skink Woopsie
03:14 Xliff Oh. LOL.
03:14 Xliff D:\SVN\Github\crypt-random\​lib\Crypt\Random\Win.pm6:31 <--- I see now!
03:14 Xliff I will add paren and retest.
03:15 Xliff All tests now complete fine.
03:15 skink Really??
03:15 skink I mean, yeah, they totally should.
03:15 Xliff Will pastebin output.
03:15 skink *cough*
03:15 Xliff LOL!
03:15 Xliff skink++ # That's his story and he's sticking to it!!!
03:16 Xliff Updated with all results - http://pastebin.com/dUDKNKWY
03:18 skink Neat. If you add the api version like it's suggesting, does anything, well, break?
03:18 skink The 'native(Advapi32, v1)' bit
03:19 Actualeyes left #perl6
03:20 skink Else I think that NativeCall message will get to be incessant.
03:21 * Xliff is now playing: Keeno - Nocturne (Frederic Robinson Remix)
03:21 skids There's an underhanded way to get rid of that message, IIRC.
03:21 Xliff skink: Will check. One sec.
03:22 * Xliff is all in for underhandedness.
03:22 skink This is a crypto lib. Let's try to be at least somewhat clean, eh?
03:25 Xliff LOL
03:25 Xliff Nope. Blows up every time I try that or a variant.
03:26 skink Right. iirc when I was doing something with that, adding 'v1' would make it search for lib.so.1 and it'd blow up.
03:26 Xliff However, this worked:
03:26 Xliff sub SystemFunction036(CArray[uint8], uint64)
03:26 Xliff returns Bool
03:26 Xliff is native('Advapi32', v1)
03:26 Xliff { * }
03:26 skids is native('crypto', v0 but False)
03:26 skids I don;t know if that trick still works.
03:27 Xliff And the suggestion is not emitted with that change.
03:27 Xliff This, however... didn't:
03:27 Xliff is native ('Advapi,v1')
03:27 Xliff Lemme try
03:27 Xliff is native ('Advapi32,v1')
03:28 skink No, they're separate params
03:28 Xliff Yeah. That last blew up.
03:28 Xliff So...
03:28 Xliff is native('Advapi32', v1)
03:28 skids If you're good with v1.
03:29 skink The API is the same since Win XP.
03:29 Xliff LOL
03:30 Xliff I am good if you are. :D
03:30 skids Is the lib major also the same?
03:30 Xliff I have no clue.
03:30 Xliff My abilities to "slurp clue" are diminishing by the second.
03:30 Xliff Fuck beer. Got RUM!
03:31 Xliff Dude. If you are able at all...
03:31 Xliff Listen:
03:31 * Xliff is now playing: Keeno - Nocturne (Frederic Robinson Remix)
03:31 * Xliff bops.
03:32 Xliff OK -- question. I assume if an IO::Path object points to a file, you can .open and get an IO::Handle?
03:32 Xliff Will test. One sec.
03:32 skids It's kinda sad if you type "clue" and then any other word into google all the results are for people cheating on crossword puzzles.
03:32 skink skids, The situation with RtlGenRandom() is... odd. It uses the same CSPRNG as CryptGenRandom(), yet isn't defined in any sys headers
03:33 skink It's only available through dynamically loading that dll.
03:33 skink I'm using it for the moment because it's a lot simpler to bind to.
03:34 Xliff I blame you not.
03:34 Xliff Laziness. It's a programmer's virtue.
03:40 Xliff What does the error "Missing block!" mean?
03:40 skink I pushed, btw, Xliff.
03:41 Xliff skink: Cool. I'll sync in a sec.
03:42 Xliff skink: *purrrr* -- Tests complete fine.
03:42 skink Could you run the functions and see if their outputs seem sane?
03:43 Xliff skink: Elaborate, please?
03:43 Xliff Do you want me to run the individual functions and check output rather than run the t/* files?
03:45 Xliff Halp!
03:45 Xliff http://pastebin.com/Mciba552
03:45 Xliff Something THAT simple should not be generating errors.
03:45 dvinciguerra__ joined #perl6
03:46 Xliff Especially errors where the monkey can't clearly point to the line in question.
03:46 skink Yup. Shouldn't be necessary if the tests passed, but I just wanna make sure since I can't set up a Win install for myself atm.
03:46 * Xliff is now playing: DJ CLART/MSDOS - Funk Incentive
03:46 Xliff skink: OK. One sec.
03:47 skink c:/rakudo/bin/perl6.bat -e 'use Crypt::Random; say crypt_random(); say crypt_random_uniform(10000); say crypt_random_buf(16);'
03:47 skink That help?
03:49 Xliff LOL!
03:49 Xliff >perl6 -Ilib -e "use Crypt::Random; say crypt_random_buf(64); say crypt_random_buf(32); say crypt_random_buf(23);"
03:49 Xliff Buf:0x<91 53 26 d4 e2 ab 20 83 35 40 dd 63 25 be 4c 17 03 de 46 08 a4 64 3a 89 c5 55 9c ee f5 c1 ff 79 b2 83 61 a2 0d c3 8e fd b5 bf f6 97 61 02 58 a2 a5 71 c34c 5c 04 cf 70 ff 15 77 b6 04 42 ed c7>
03:49 Xliff Buf:0x<bd d0 d7 2e cd 70 ae be 64 33 46 70 7d 9b 84 8d df d6 56 f3 27 7e 2c 8b e4 66 14 ac b5 95 ba 8a>
03:49 Xliff Buf:0x<e4 d9 9f 46 14 4a 41 36 e5 67 33 40 95 69 d7 9f 0c ed 20 0e 0f 8b 48>
03:49 Xliff Do you really want me to do 10000, skink? ..... R..e..a..l..l..y?
03:49 Xliff I threw in the 23, just to see how it handled a prime.
03:50 Xliff m: say 23.is-prime
03:50 camelia rakudo-moar 61d231: OUTPUT«True␤»
03:50 Xliff OK. Just checking.
03:53 BenGoldberg Shirley a function named crypt_random_uniform(10000) would return a (single) random Num in the range [0,10000), no?
03:53 * BenGoldberg wanders off to go read some docs.
03:54 BenGoldberg Actually, it being past my bedtime, I'd better go sleep, instead.
03:55 skink Xliff, See the README ya silly.
03:55 skink 10000 is the $upper_bound for that function, like Ben was thinking.
03:56 Xliff LOL.
03:56 Xliff I did say "RUM", remember?
03:57 Xliff "RUM".reverse === the first syllable of "MURDER"
03:57 Xliff ¯\_(ツ)_/¯
04:03 Xliff Ahh... using crypt_random_buf() doesn't have that upper limit.
04:04 * Xliff is now playing: The Time - Ice Cream Castles
04:06 skink Originally it had a 256 bytes limit because some syscalls I was thinking of using had that.
04:08 skink RtlGenRandom() actually takes a uint64 for its length option, amazingly.
04:08 Xliff for dir(test => /:i '.' html $/) -> $file { say $file } --> Missing block error. Any ideas?
04:09 skink To quote you: ¯\_(ツ)_/
04:09 Xliff Heh! Fair enough.
04:09 skink That was strangely difficult to copy. Kept morphing as I tried to highlight it.
04:10 Xliff m: for <a b c> -> $l { say $l; }
04:10 camelia rakudo-moar 61d231: OUTPUT«a␤b␤c␤»
04:10 Xliff Odd. When I try to do that locally, I get the Missing Block error.
04:11 Xliff Lemme update rakudo.
04:11 skink While it's an unreasonable hour to do so now, who would I talk to about reviewing Crypt::Random and getting it added?
04:16 Xliff Oh FFS! --- ')' instead of '}'
04:16 Xliff I blame my fonts!
04:25 Cabanossi joined #perl6
04:32 Xliff m: use Mojo::DOM:from<Perl5>; my $m = Mojo::Dom.parse('<p>This is a test</p>'); for $m.find('p') -> $p { say $p; }
04:32 camelia rakudo-moar 61d231: OUTPUT«===SORRY!===␤Please install Inline::Perl5 for Perl 5 support. ␤»
04:32 Xliff Ah.
04:42 Xliff See, THIS is the reason I wanted to use regexes for this.
04:42 Xliff Sometimes even the best modules have quirks that don't have a reasonable solution. Especially when changing object models, ala perl5 -> perl6
04:47 Xliff Crap. I might need the call() format.
04:52 Xliff Or Inline::Perl5::run
04:58 Actualeyes joined #perl6
04:58 dalek perl6-most-wanted: 9766349 | (Rich Loveland)++ | most-wanted/modules.md:
04:58 dalek perl6-most-wanted: Update link to Shell::Command module
04:58 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/9766349fb1
04:58 dalek perl6-most-wanted: 741b7cd | azawawi++ | most-wanted/modules.md:
04:58 dalek perl6-most-wanted: Merge pull request #25 from rmloveland/shell-command-fix
04:58 dalek perl6-most-wanted:
04:58 dalek perl6-most-wanted: Update link to Shell::Command module
04:58 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/741b7cdcbe
05:08 _nadim joined #perl6
05:14 Xliff OK.
05:15 Xliff Looks like we have a really weird situation going on with regexes.
05:15 Xliff 36k file.
05:15 Xliff for $contents ~~  m:g/ '<' (.+?) '>' (.+?) '</' $0 '>'/ -> $t {
05:15 Xliff ... } <--- Seems to be an endless loop.
05:17 AlexDaniel Xliff: maybe you'll finally stop trying to parse html yourself? :D
05:17 Xliff AlexDaniel: I've tried using Mojo::DOM and it didn't work.
05:17 AlexDaniel Xliff: good. Just use Gumbo
05:18 Xliff Gumbo might not work. Mainly because I might not have a good enough understanding of Inline::Perl5.
05:18 Xliff Gumbo is perl6 native though, right?
05:18 Xliff But that's really not the issue.
05:18 Xliff The above for loop never completes and it should.
05:19 Xliff Dropping the length of $contents from 36k to 500, the loop completes immediately.
05:19 AlexDaniel Xliff: Gumbo is a Perl 6 module
05:19 Xliff AlexDaniel, good to know. That's next.
05:19 Xliff Dropping the length of $contents to 5k... the loop still never completes.
05:20 Xliff Could be the regexp? But why work at 500, and not 5k?
05:20 AlexDaniel Xliff: I don't think that it is a bug. Most likely it starts backtracking and it just takes time…
05:20 Xliff OK. Can I turn off backtracking?
05:20 * Xliff looks at docs.
05:21 AlexDaniel Xliff: perhaps you can make its life easier by doing something like '<' (<-['>']>+) '>'
05:21 skids Some of that works.  Like use an empty closure e.g. "{ 1; }" as a sequence point
05:22 Xliff m/ '<' (.+:?) '>' (.+:?) '</' $0 '>'/  <-- ?
05:22 Xliff I'm getting this at the end of execution:
05:22 Xliff "Cannot convert string to number: base-10 number must begin with valid digits or '.' in '...'"
05:23 Xliff Where "..." is the rest of $contents
05:25 Xliff Definitely an improvement --> m:g/ '<' (<-[>]>+) '>' (.+?) '</' $0 '>'/
05:26 cdg joined #perl6
05:31 Xliff OK. Maybe my code was REALLY borked but still parsed.
05:33 Xliff Yup. Seems to be working now. Weird little performance loop due to a single line. Wow.
05:41 Xliff Hrm. Gumbo is just a parser. I was hoping for a DOM manipulation tool.
05:41 Xliff Still might work, though.
05:45 buharin joined #perl6
05:49 Juerd Note that you can also write 'between <>' using the ~ operator: /'<' ~ '>' .+?/
05:50 Juerd Note that you can also write 'between <>' using the ~ operator: /'<' ~ '>' <-[>]>+/  # more fair comparison
05:50 perlawhirl Juerd++ I didn't know that
05:50 Juerd I like it because it keeps the pair of brackets together
05:50 perlawhirl yeah it's nice
05:55 _28_ria joined #perl6
05:59 ufobat tadzik, here is your friendly daily reminder to criticize my PR :D
05:59 CIAvash joined #perl6
05:59 ufobat morning perl6 :D
06:01 geekosaur joined #perl6
06:05 domidumont joined #perl6
06:17 Xliff Juerd: Can you do /'<' (~) '>'/ and have that captured properly?
06:23 domidumont joined #perl6
06:25 domidumont joined #perl6
06:31 nakiro joined #perl6
06:34 geekosaur joined #perl6
06:36 geekosaur joined #perl6
06:52 fireartist joined #perl6
06:55 labster joined #perl6
07:00 dalek DBIish: e3e7d99 | (Salvador Ortiz)++ | / (3 files):
07:00 dalek DBIish: Pg: Add Date and Timestamp (DateTime) support
07:00 dalek DBIish:
07:00 dalek DBIish: See t/37-pg-datetime.t for examples.
07:00 dalek DBIish: Closes #41
07:00 dalek DBIish: review: https://github.com/perl6/DBIish/commit/e3e7d99ee9
07:11 yeahnoob joined #perl6
07:13 wamba joined #perl6
07:16 Xliff Anyone awake?
07:16 moritz Xliff: just us bots
07:17 Xliff LOL
07:17 Xliff Why doesn't this work as expected?
07:17 Xliff http://pastebin.com/npQxBzry
07:17 moritz m: constant %h = 1, 2; say %h.WHAT
07:17 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aSpNlgLrjR␤Type check failed in constant declaration of %h; expected Associative but got List (List)␤at /tmp/aSpNlgLrjR:1␤------> 3constant %h = 1, 27⏏5; say %h.WHAT␤»
07:17 sortiz \o
07:17 Xliff I accept answers from bots.
07:18 Xliff I am a believer in beneficial artificial intelligence.
07:18 moritz diakopter: why did you resolve RT#111944?
07:18 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=111944
07:18 moritz diakopter: the problem (no coercion) still persists
07:19 Xliff I do this because trying to use Mojo::DOM from Perl6 results in undefined values from routines that should return lists.
07:19 Xliff The pastebin code returns:
07:19 Xliff Can't call method "find" on an undefined value at (eval 6) line 3.
07:20 nakiro joined #perl6
07:21 moritz so, what's in $m?
07:21 moritz Xliff: uhm, do you know perl 5? :-)
07:21 sortiz Xliff, In L#21 are you sure that $m is defined?
07:21 moritz sub mojo_find($m, $t) {
07:21 moritz that looks like Perl 6 code, not like Perl 5
07:22 moritz (perl 5 has experimental subroutine signatures in the newest versions, but I believe you have to explicitly enable them, no?)
07:22 moritz sub mojo_find { my ($m, $t) = @_; ... }
07:22 sortiz Yep! Don't see that! (Too much perl6 ;-)
07:24 rindolf joined #perl6
07:24 abraxxa joined #perl6
07:25 Xliff LOL!
07:26 Xliff <--- BEER AND RUM
07:26 Xliff Tha's my excuse and I'm sticking to it!
07:26 Xliff (Yes, I do know P5)
07:28 Xliff OK. Shit just got real. I am going to pastebin.
07:29 Xliff http://pastebin.com/npQxBzry
07:30 Xliff Minor note: If I was sober, I would have long since given up on the frustration.
07:30 Xliff Which is why.... BEER AND RUM!
07:30 Xliff YAZ.
07:30 * Xliff should really be sleep now, even if he has to have a BOOT TO THE HAID!
07:31 Xliff Which, I probably should, since I spelled "HEAD" as "HAID".
07:31 Xliff ( ಠ益ಠ)
07:35 Xliff Cray cra updated: http://pastebin.com/npQxBzry
07:35 fireartist left #perl6
07:36 fireartist joined #perl6
07:36 Xliff Cray cra even moar updated: http://pastebin.com/npQxBzry
07:38 Xliff The reason I am using the p5 sub is because when I try to use $m.find() in a P6 context, I don't get anything back, and I should.
07:38 moritz is that because of list vs. scalar context?
07:38 Xliff Even using $m.children() returns nothing, and I know that there are <p> tags in $content.
07:39 Xliff moritz: An earlier version did "my @tags = $m.children('p')" with no results.
07:40 Timbus the error indicates that, somehow, $m is undefined. at least from perl5's point of view
07:41 Timbus Mojo::DOM source confirms that its trying to do $_[0]->_css
07:41 Xliff Timbus: I can confirm that $m is "Inline::Perl5::Perl5Object.new(ptr => NativeCall::Types::Pointer.new(211119144), perl5 => Inline::Perl5.new)" before the $p5.call()
07:41 Timbus which is what initially failed in find()
07:41 Timbus why not print out what $m is from your perl5 sub
07:41 Xliff OK
07:43 zakharyas joined #perl6
07:43 Timbus at a guess its like.. a blessed undef? because the -> part works..
07:45 Xliff Updated pastebin: http://pastebin.com/npQxBzry
07:45 Xliff the "Inline::Perl5::Perl5Object.new(ptr => NativeCall::Types::Pointer.new(216816896), perl5 => Inline::Perl5.new)" says that $m is not undefined.
07:46 Xliff At least not according to P6
07:46 Timbus i know that part, but yeah, something happens to it when you pass it back
07:46 Timbus garbage collection?
07:47 Xliff OK. Just as long as I am not making an obvious mistake.
07:47 Xliff .....am I?
07:47 Xliff Now H
07:47 Xliff *ggrrrr*
07:47 Xliff Now GC would be non-obvious. I wouldn't expect GC to hit the way the scoping should work.
07:48 Xliff Depends on how Inline::Perl5 works.
07:48 Timbus I mean the perl 5 GC. like you even get some crazy double-free thing going on after it crashes
07:48 Timbus and youre clearly calling methods on undefs, which should definitely be defined
07:48 Xliff Timbus, JINX! --> *punch*]
07:49 Timbus :/
07:49 Xliff LOL
07:49 Xliff Seriously. I appreciate the help.
07:49 Timbus you might wanna uhh.. make your Mojo::DOM in the perl5 sub, or not use .call ?
07:49 Xliff You mean use "Mojo::DOM" in the p5 scope?
07:50 Timbus I mean, that's not really what you should do, but if you have to...
07:50 Xliff Can't NOT use call, since I tried it that way at first and got Nil as a result.
07:51 Timbus Nil seems saner than your other attempts, tbh
07:52 Xliff "$m.children('p')" should have returned a list of Mojo::Collection, but did not. It returned undef.
07:52 Xliff Or Nil, if you want to be technical. But it should not have returned that.
07:53 Xliff I know what the XML/HTML looks like. I did not get the results that I expected.
07:54 domidumont joined #perl6
07:54 Xliff Please note: that does not mean my expectations were correct. Just that they did not match what I got.
07:54 Timbus hmmm. but it doesn't crash. maybe your input string is the problem? I wish I could run this code but my perl is built without a linkable library
07:54 Timbus so I have no inline:p5
07:56 Timbus what even -is- .slurp-rest
07:58 Timbus oh you use it on open handles vs IO's, gotcha.
08:03 Xliff YYes.
08:03 Xliff Err...Yes. That is correct.
08:03 sftp joined #perl6
08:04 Xliff That part seems to work. It is the call to Mojo::DOM::children that does not.
08:04 Timbus yeah just making sure no lazy list magic or something is going on
08:05 Xliff OK.
08:05 Xliff I thought that might be the case, too. Hence the $p5.run() call.
08:10 Xliff Must be something I am missing about Mojo::DOM which I am just now learning.
08:11 zakharyas joined #perl6
08:12 labster joined #perl6
08:13 darutoko joined #perl6
08:18 nadim joined #perl6
08:28 sdo joined #perl6
08:28 sdo hello
08:28 RabidGravy joined #perl6
08:29 sdo I am trying to recompile Perl 6 Racudo. Everything is fine.
08:29 sdo I am on Mac OS X 10.11.4 is the Mac OS version.
08:30 sdo One question struggle me. Why it needs Java 7 at least to compile? I don't understand why it needs Java... Can you tell me why? Thx very much...
08:31 El_Che sdo: you're maybe compiling the jvm backend? you can specify to only compile moarvm
08:32 jnthn sdo: It only needs Java/JVM if you want to build it with support for compiling to the JVM. If you don't want that, just configure with --backend=moar or so
08:32 yoleaux 00:27Z <AlexDaniel> jnthn: hey. Perhaps leave this in a terminal for several minutes or something: 「while :; do perl6 -e 'await (start { print ‘x’; sleep 1; } for ^100); say ‘’;'; done」
08:32 yoleaux 00:30Z <AlexDaniel> jnthn: also, there's one thing that I've noticed. Maybe that will tell you something, who knows. See this screenshot: https://files.progarm.org/2016-​04-08-032820_664x486_scrot.png . So, it looks like there's a maximum number of threads or something, so these ‘x’-es are appearing in batches. It crashes only during the second batch, hmmm…
08:32 yoleaux 00:30Z <AlexDaniel> jnthn: that is, the exception always appears after exactly 32 ‘x’ characters
08:32 sdo thanks
08:33 Ulti out of curiosity what is the reducing bracket [] metaop doing? because its quite often incredibly unreasonably fast compared to loops
08:33 yoleaux 02:13Z <perlawhirl> Ulti: Ulti++ for getting Rakudo on glot.io... and a bonus point for ruining the sites perfect 7x4 grid :D
08:34 Ulti Yeah I felt bad pushing swift out of the grid
08:34 Xliff lol
08:35 Ulti Swift is like the corporate sister to Perl 6 in my mind especially around some of its bigger opinion pieces like unicode support
08:35 jnthn Ulti: It's probable that it's using the iterator API directly and making assumptions a loop cannot and perhaps saving the invocation overhead of the loop body
08:36 Ulti jnthn the difference is almost impossible to believe though like really fast for numeric things over a range
08:36 jnthn Ulti: Oh...for [+] 1..100000 ?
08:36 Ulti yeah
08:36 jnthn I think it calls .sum for that case :P
08:36 Ulti well whats .sum doing??
08:37 jnthn That math trick that lets you add up a contiguous range of integers in O(1)
08:37 Ulti aha
08:37 Ulti that still counts towards my comment to the reddit around zoffix post
08:38 jnthn https://github.com/rakudo/rakudo​/blob/nom/src/core/Range.pm#L653
08:38 jnthn hah, reddit...bet that's a hotbed of positivity :P
08:38 Ulti that Perl 6 where it does have optimisations does really well its just the optimisations haven't been going on for a decade so that they are smooth over the whole language and any possible code path
08:38 Ulti jnthn not really :'(
08:38 pmurias joined #perl6
08:39 Ulti its almost the definition of navel gazing around "why is Perl dead" despite the obvious reality of everyone there using it every day
08:39 jnthn But yeah, we do well in various places that have gotten optimization effort
08:39 Ulti out of curiosity does it have to be a literal?
08:40 * Ulti will read the code
08:40 Ulti dont tell me :)
08:41 Ulti jnthn: this also explains why Rakudo does so well once into the bigint range too :) its not creating the bigints
08:41 Ulti or at least only two of them
08:48 _28_ria joined #perl6
08:49 _28_ria joined #perl6
08:52 grondilu is there an advantage as defining an array constant with the @ sigil?  'constant @a = ...' as opposed to 'constant a = ...'?
09:00 Actualeyes left #perl6
09:04 ely-se joined #perl6
09:04 llfourn joined #perl6
09:05 llfourn o/ #perl6
09:06 RabidGravy erp
09:07 torbjorn joined #perl6
09:20 kid51 joined #perl6
09:21 espadrine joined #perl6
09:21 gfldex m: constant @a = 1,2,3; say " @a ";
09:21 camelia rakudo-moar 61d231: OUTPUT« @a ␤»
09:22 llfourn m: my @a = 1,2,3; say " @a ";
09:22 camelia rakudo-moar 61d231: OUTPUT« @a ␤»
09:23 El_Che is "constant @a" even supported?
09:23 El_Che constant data containers are confusing
09:24 El_Che ok, it works :)
09:25 El_Che although I prefer constants without @
09:25 El_Che (stop me before I say ALL CAPITALS :) )
09:25 * llfourn stops El_Che
09:26 El_Che thx :)
09:27 * grondilu just reported a bug.
09:27 grondilu Once again I've tried to do something in Perl 6 and was stopped by a bug.  :(
09:28 El_Che are you sure it wasn't a feature? :)
09:29 llfourn m: constant @a = map { (1 +< $_) => 1 }, ^3; say @a.perl # +< ?
09:29 camelia rakudo-moar 61d231: OUTPUT«(1 => 1, 2 => 1, 4 => 1)␤»
09:29 grondilu FYI: #127858
09:29 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=127858
09:30 llfourn a bitshift?
09:31 * grondilu just realized the => is not necessary
09:31 grondilu m: constant @a = map { 1 +< $_ }, ^3; say @a.perl
09:31 camelia rakudo-moar 61d231: OUTPUT«(1, 2, 4)␤»
09:32 Xliff_ joined #perl6
09:33 llfourn I reported a similar bug a while ago #127034
09:33 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=127034
09:39 labster joined #perl6
09:42 grondilu hum apparently it's not specific to +<.  {$_**2} would cause the same error.
09:43 grondilu or just {$_*2}
09:44 llfourn grondilu: try it with "no precompilation" I bet it will work
09:44 llfourn there a bunch of bugs related to precomp and constant/BEGIN blocks
09:45 grondilu what's that option?
09:45 llfourn usually they are to do with closures
09:45 llfourn it's a pragma to turn precompilation off
09:45 RabidGravy jnthn, have you tested OO::Monitors recently?  The tests emit "Weird node visited: QAST::BVal" several time
09:45 llfourn so put "no precompilation;" as the first line of the exporting module
09:45 jnthn RabidGravy: I'm aware of that, yeah...
09:46 grondilu llfourn: you're right.  "no precompilation;" makes it work.
09:46 jnthn RabidGravy: Other than spewing the warning, it seemed to work OK though
09:46 RabidGravy yeah, seems fine
09:46 jnthn I tracked it down to the use of macros for the condvar feature
09:47 masak good noon, #perl6
09:49 dalek DBIish: c725f70 | (Salvador Ortiz)++ | / (3 files):
09:49 dalek DBIish: mysql: Add Date and DateTime support
09:49 dalek DBIish: review: https://github.com/perl6/DBIish/commit/c725f70a18
09:50 abraxxa sortiz++
09:50 abraxxa native Date/Datetime is one of the big features in Perl 6 imho
09:52 llfourn grondilu: #125634 is the main ticket for these bugs. They're pretty annoying :\. Your case is the first time I've seen it wrt to a constant = map { ... }. Maybe it's lazy and so is evaluating the closure later.
09:52 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=125634
09:53 sortiz abraxxa, btw, Have you seen the new Oracle OO code?
09:53 abraxxa sortiz: no, haven't had time to look at it
09:53 ocbtec joined #perl6
09:54 sortiz abraxxa, I appreciate your comments.
09:54 abraxxa specific github commits I should look at?
09:56 grondilu llfourn: it's lazy indeed.  The error goes away if I write 'constant @a = eager map {...}'
09:56 llfourn grondilu: \o/ I'm glad I was some help!
09:57 grondilu well my exemple is just a golfed version of what I was trying to do.  I do need an infinite array so making it eager won't help ;)
09:58 grondilu but I can use 'no precomp' until it's fixed.
09:58 sortiz abraxxa, Umm, no, for example see https://github.com/perl6/DBIish/blob/master​/lib/DBDish/Oracle/StatementHandle.pm6#L57
10:01 smls joined #perl6
10:01 smls Hi all
10:01 llfourn grondilu: ah yep that's tricky :\. I would love this bug to be fixed as well.
10:01 smls How does importing individual subs from a module work?
10:02 moritz not at all, at the moment :(
10:02 smls m: module Foo { sub a is export(:ALL) { say 42 } }; import Foo <&a>; a
10:02 camelia rakudo-moar 61d231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/D2UEyD3QKc␤Error while importing from 'Foo':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at /tmp/D2UEyD3QKc:1␤------> 3port(:ALL) { say 42 } }; import Foo <&a>7⏏5; a␤»
10:02 smls moritz: OK, thanks
10:02 smls m: module Foo { sub a is export(:ALL) { say 42 } }; import Foo :ALL; a
10:02 camelia rakudo-moar 61d231: OUTPUT«WARNINGS for /tmp/IxxxVDopSH:␤Useless use of ":ALL" in sink context (line 1)␤42␤»
10:02 smls ^^ btw, strange "Useless use" there, TimToady
10:15 vendethiel- joined #perl6
10:19 beatdown joined #perl6
10:19 sue joined #perl6
10:19 sue left #perl6
10:21 kid51 joined #perl6
10:28 moritz Useless use of "Useless use".
10:36 noganex_ joined #perl6
10:37 cdg joined #perl6
10:48 cdg joined #perl6
10:55 timotimo o/
10:56 RabidGravy rarr!
10:56 timotimo hey mister gravy
10:56 timotimo i've decided against getting a PO. it's a shiny toy, but after i got it and played with it for an hour or two it's likely going to start collecting dust
10:58 RabidGravy I've got loads of those
10:59 noganex joined #perl6
11:04 wamba joined #perl6
11:08 timotimo yeah, but you also make music, so it's kind of okay to have too many music toys
11:09 kaare_ joined #perl6
11:16 perlawhirl joined #perl6
11:20 ZoffixWin .tell AlexDaniel I can't even find any docs for the XML::Document Gumbo returns. By comparison, Mojo::DOM has a polished interface.
11:20 yoleaux ZoffixWin: I'll pass your message to AlexDaniel.
11:28 ZoffixWin Ugh. Last time I tried to read Reddit comments. They're one homophobic joke away from uselessness and negativity of YouTube comments.
11:30 dalek DBIish: 81e71c5 | (Salvador Ortiz)++ | t/27-mysql-datetime.t:
11:30 dalek DBIish: travis-ci: Skip a failing test.
11:30 dalek DBIish: review: https://github.com/perl6/DBIish/commit/81e71c5a55
11:30 dalek DBIish: 98c2400 | (Salvador Ortiz)++ | lib/DBDish/Pg/ (2 files):
11:30 dalek DBIish: Pg: Add type code for NULL
11:30 dalek DBIish: review: https://github.com/perl6/DBIish/commit/98c2400559
11:37 timotimo people on the 'ternets can really be kind of terrible :(
11:43 perlawhirl anonymity and an audience is a potent concoction
11:47 isBEKaml joined #perl6
11:47 dalek DBIish: a8fafac | (Salvador Ortiz)++ | t/27-mysql-datetime.t:
11:47 dalek DBIish: travis-ci: Try 2...
11:47 dalek DBIish: review: https://github.com/perl6/DBIish/commit/a8fafac621
11:48 perlawhirl m: <one one one two two three>.Bag.sort[0].key # <-- seems wordy... is there a nicer way to get the most common element
11:48 camelia rakudo-moar 61d231: ( no output )
11:48 perlawhirl m: say <one one one two two three>.Bag.sort[0].key
11:48 camelia rakudo-moar 61d231: OUTPUT«one␤»
11:48 timotimo m: <one one one two two three>.Bag.max(:by(*.value)).key
11:48 camelia rakudo-moar 61d231: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/4XzW4c96la line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/4XzW4c96la line 1␤␤»
11:48 timotimo whoops?
11:49 timotimo you can exponentiate all values by a big number and then use .pick to pick out one
11:49 timotimo no, actually, use the value as the exponent
11:49 timotimo :P
11:49 psch m: <one one one two two three>.Bag.max
11:49 camelia rakudo-moar 61d231: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/mCwauHeLJe line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/mCwauHeLJe line 1␤␤»
11:50 psch m: <1 2 3>.max
11:50 camelia rakudo-moar 61d231: ( no output )
11:50 psch m: (1,2,3).Bag.max
11:50 camelia rakudo-moar 61d231: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/875N7TA6hu line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/875N7TA6hu line 1␤␤»
11:50 perlawhirl timotimo: huh... it's been a long week and my brain is a little fried. i'm gonna need an example :D
11:50 timotimo i wonder what it's doing there
11:50 psch m: (1 => 1, 2 => 2).max
11:50 camelia rakudo-moar 61d231: ( no output )
11:50 timotimo perlawhirl: i wasn't being serious :D
11:50 perlawhirl haha, thank goodness
11:50 jnthn m: say <one one one two two three>.Bag.pairs.max(*.value)
11:50 camelia rakudo-moar 61d231: OUTPUT«one => 3␤»
11:51 psch m: max Bag.new
11:51 camelia rakudo-moar 61d231: ( no output )
11:51 perlawhirl hmm, maybe my original way wasn't so wordy after all =D
11:51 psch m: max Bag.new(1, 2)
11:51 camelia rakudo-moar 61d231: ( no output )
11:51 psch m: say max Bag.new(1, 2)
11:51 camelia rakudo-moar 61d231: OUTPUT«bag(1, 2)␤»
11:52 jnthn m: say <one one one two two three>.max({ (state %){$_}++ })
11:52 camelia rakudo-moar 61d231: OUTPUT«one␤»
11:53 psch m: say Bag.^can('max')[0].signature.perl
11:53 camelia rakudo-moar 61d231: OUTPUT«:($: | is raw)␤»
11:53 perlawhirl jnthn: nice one... and i suspect more performant than creating a temporary Bag
11:53 jnthn Yeah :)
11:54 psch m: say <one one one two two three>.Bag.maxpairs
11:54 camelia rakudo-moar 61d231: OUTPUT«[one => 3]␤»
11:54 timotimo didn't know we have that built-in. nice.
11:54 perlawhirl psch: *ding ding ding* we have a winner
11:54 jnthn I didn't know about that either :P
11:55 perlawhirl lol
11:55 psch i was really just looking why max doesn't do anything sensible as method on Bag.. vOv
11:55 g4 joined #perl6
11:55 psch but then QuantHash has a method maxpairs...
11:55 timotimo yeah, it should probably not die like that
11:55 jnthn .oO( jnthn00b :) )
11:56 perlawhirl psch: yeah my first stab was just <..>.Bag.max
11:56 psch m: say <1 1 1 2 2 3>.Bag.cache.elems
11:56 camelia rakudo-moar 61d231: OUTPUT«3␤»
11:57 psch m: say <1 1 1 2 2 3>.Bag.AT-POS(1)
11:57 camelia rakudo-moar 61d231: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/bB373Qpebr line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/bB373Qpebr line 1␤␤»
11:57 psch m: say <1 1 1 2 2 3>.Bag.AT-POS(0)
11:57 camelia rakudo-moar 61d231: OUTPUT«bag(1(3), 2(2), 3)␤»
11:57 psch .max only sorts Positional
11:57 timotimo but it doesn't restrict its invocant to that?
11:57 psch yeah
11:57 psch multi method max() {
11:57 timotimo a-ha!
11:58 timotimo hm. should it move to Positional, then?
11:58 psch and Bag confuses it because it says it has 3 elems
11:58 perlawhirl hah ,yeah... the Bag.cache is an interesting approach
11:58 perlawhirl i never looked at what .cache returns
11:58 jnthn On a Bag, I suspect same as .list
11:59 perlawhirl yep
12:00 perlawhirl psch: method most() :D
12:01 psch perlawhirl: is that the new huffmanization of .maxpairs..? :)
12:02 perlawhirl well it would also work on an array, so... kinda :)
12:02 psch m: say [0, 1, 2, 3, 4].maxpairs
12:02 camelia rakudo-moar 61d231: OUTPUT«Method 'maxpairs' not found for invocant of class 'Array'␤  in block <unit> at /tmp/t03dzMOSYc line 1␤␤»
12:03 psch :/
12:04 mr-foobar joined #perl6
12:05 lizmat I guess if we moved out minpairs/maxpairs out of the QuantHash role, into Any-iterable, it would just work
12:05 * lizmat will try that
12:09 El_Che ZoffixWin++: you've been pretty prolific about perl6 marketing lately. I can't open my twitter feed or my rss reader and you're there :)
12:09 * ZoffixWin does work at a Marketing Department...
12:09 ZoffixWin :)
12:10 El_Che you're Perl6 marketing department it seems :)
12:12 timotimo everyone can be the perl6 marketing department. but not everyone can be as good as The Zoffix
12:19 perlawhirl joined #perl6
12:31 perlawhirl joined #perl6
12:33 perlawhirl is there an env var to control whether error messages are coloured or not?
12:33 timotimo yes
12:34 timotimo RAKUDO_ERROR_COLOR
12:34 perlawhirl thanks timo
12:39 perlawhirl was just playing on glot.io and realised when it errors, the ansi escape sequences make things a little unreadable
12:48 Amnez777 joined #perl6
12:59 pmurias joined #perl6
13:04 gregf_ m: say Int.can("rand").^name
13:04 camelia rakudo-moar 0c7818: OUTPUT«List␤»
13:05 gregf_ should'nt this return a method?
13:05 psch m: say Int.can("rand")>>.WHAT.say
13:05 camelia rakudo-moar 0c7818: OUTPUT«(List)␤True␤»
13:05 psch grml
13:05 timotimo >>.WHAT may not work
13:05 gregf_ m: say Int.can("rand")[0]
13:05 camelia rakudo-moar 0c7818: OUTPUT«rand␤»
13:05 psch m: say Int.can("rand").map({$_.WHAT})>>.say
13:05 timotimo you always get a list, because there could be multiple candidates
13:05 camelia rakudo-moar 0c7818: OUTPUT«(Method)␤(Method)␤(True True)␤»
13:06 psch -extra say
13:06 gregf_ hmm
13:07 gregf_ m: say Int.can("sprintf")[0].("%b", 4)
13:07 camelia rakudo-moar 0c7818: OUTPUT«100␤»
13:07 psch m: say Int.can("rand")>>.signature.say
13:07 camelia rakudo-moar 0c7818: OUTPUT«((Int $: *%_) (Cool $: *%_))␤True␤»
13:08 teatime where does the name Cool come from, btw?
13:08 psch C-something O-something Object Loop..?
13:08 psch S99:Cool
13:08 synopsebot6 Link: http://design.perl6.org/S99.html#Cool
13:08 perlpilot convienent OO Loopbacks.
13:08 psch perlpilot++
13:09 teatime ok.  I'm glad it wasn't just because it was a cool feature.
13:09 teatime :)
13:09 timotimo not just, but also :)
13:09 perlpilot or, since we're punny, see S02:1832
13:09 synopsebot6 Link: http://design.perl6.org/S02.html#line_1832
13:10 cdg joined #perl6
13:11 perlpilot "Convenient"  (why is there no bot to correct my spelling?  ;)
13:11 teatime perlpilot: some irc clients support spell checking.
13:11 teatime mine highlights unknown words in bold red, currently :)
13:17 * grondilu updated his Clifford module and made a simpler interface (no signature needed):  https://github.com/grondilu/clifford
13:19 cpage_ joined #perl6
13:28 isBEKaml left #perl6
13:35 sjoshi joined #perl6
13:36 b2gills m: constant @a = 1,2,3; say " @a[] ";
13:36 camelia rakudo-moar 40a953: OUTPUT« 1 2 3 ␤»
13:45 Begi joined #perl6
13:59 dvinciguerra__ joined #perl6
14:01 dvinciguerra__ joined #perl6
14:02 dvinciguerra__ joined #perl6
14:06 khw joined #perl6
14:07 gregf_ hmm, [] is use for forcing interpolation?
14:07 gregf_ s/use/used/
14:08 MadcapJake m: constant @a = 1,2,3; say " {@a} ";
14:08 camelia rakudo-moar 40a953: OUTPUT« 1 2 3 ␤»
14:08 gregf_ m: my %h = Hash.new;for [["foo",1],["bar",2]] ->$a, $b { %h{$a} = $b; };  say "%h{}"
14:08 camelia rakudo-moar 40a953: OUTPUT«foo 1        bar 2␤»
14:09 moritz gregf_: any expression that starts with a sigil and ends in a postcircumfix can interpolate
14:10 gregf_ moritz: postcircumfix as in {} <- 'curly braces' ?
14:10 gregf_ *googles
14:10 gregf_ ooh..  <> or << >>
14:10 gregf_ oh no.. curly braces..
14:11 MadcapJake gregf_: anything that follows something and surrounds something is a postcircumfix
14:11 gregf_ oh...*too many new terms in Perl6*
14:12 MadcapJake [a] <- circumfix; a[b] <- postcircumfix
14:14 psch m: my @a = 1,2,3; say "@a{}" # /o\
14:14 camelia rakudo-moar 40a953: OUTPUT«1 2 3␤»
14:14 gregf_ nice.. moritz MadcapJake thanks
14:14 psch m: sub postcircumfix:<- ->($, $) { }; my @a = ^3; say "@a-2-" # hmm
14:14 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9zB9bmM2lR␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/9zB9bmM2lR:1␤------> 3$, $) { }; my @a = ^3; say "@a-2-" # hmm7⏏5<EOL>␤    expecting any of:␤        doub…»
14:14 psch m: sub postcircumfix:<- ->($, $) { }; my @a = ^3; say "@a-2- " # hmm
14:14 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/I7KlKtJPBj␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/I7KlKtJPBj:1␤------> 3, $) { }; my @a = ^3; say "@a-2- " # hmm7⏏5<EOL>␤    expecting any of:␤        doub…»
14:15 MadcapJake psch: the dash has gotta be protected, it's an allowed char in terms
14:15 grondilu should I start a 'lib/Foo/Bar.pm6' module by 'unit module Bar;' or 'unit module Foo::Bar;'?
14:15 MadcapJake Foo::Bar
14:15 MadcapJake you have to include the folder chain in your module names
14:16 psch m: sub postcircumfix:<´ `>($, $) { }; my @a = ^3; say "@a´1`"
14:16 camelia rakudo-moar 40a953: OUTPUT«@a´1`␤»
14:16 psch m: sub postcircumfix:<´ `>($a, $b) { say "$a and $b" }; my @a = ^3; @a´1`
14:16 camelia rakudo-moar 40a953: OUTPUT«0 1 2 and 1␤»
14:16 MadcapJake m: sub postcircumfix:<´ `>($, $) { }; my @a = ^3 + 2; say "{@a´1`}"
14:16 camelia rakudo-moar 40a953: OUTPUT«Use of Nil in string context  in block <unit> at /tmp/YTzwFvJZHk line 1␤␤»
14:16 psch right, postcircumfix weirdness only happens when it reuses existing somethings i guess
14:17 psch MadcapJake: i was just looking for some bugginess i saw with user defined postcircumfix, fwiw
14:17 grondilu MadcapJake: ok, both works though.  Not sure if that's normal.
14:17 MadcapJake grondilu: not sure either, I thought it was the case that it needed codifying, perhaps it won't work when precomp'd
14:17 psch m: sub postcircumfix:<` ->($, $) { "borked" }; say 1`2-
14:17 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AOlIaENOQe␤Missing required term after infix␤at /tmp/AOlIaENOQe:1␤------> 3umfix:<` ->($, $) { "borked" }; say 1`2-7⏏5<EOL>␤    expecting any of:␤        prefix␤        term␤»
14:17 psch like that
14:17 MadcapJake ahh
14:18 tharkun joined #perl6
14:18 psch that case might be solvable with some parser state along the lines of $*IN_POSTCIRCUMFIX, but that probably doesn't generalize to user defined postcircumfix that *start* with a known op
14:26 MadcapJake is there any way to get a hidden method of a superclass?
14:27 moritz MadcapJake: what's a "hidden method"?
14:27 MadcapJake private
14:27 MadcapJake method !private() { ... }
14:27 moritz MadcapJake: only if the superclass trust its subclass
14:27 MadcapJake how can I gain it's trust? I've already brought it to the movies and bought dinner...
14:28 ufobat :D
14:28 timotimo "trusts MySubClass"
14:28 MadcapJake oh bummer :(
14:28 moritz m: class Subclass { ... }; class Parent { trusts Subclass; method !priv($x) { say $x } }; class Subclass is Parent { method foo() { self.Parent!priv(42) } }; Subclass.new.foo
14:28 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DLHMdCfFOp␤No such private method 'priv' for invocant of type 'Subclass'␤at /tmp/DLHMdCfFOp:1␤------> 3arent { method foo() { self.Parent!priv(7⏏42) } }; Subclass.new.foo␤»
14:28 jnthn self!Parent::priv
14:28 moritz m: class Subclass { ... }; class Parent { trusts Subclass; method !priv($x) { say $x } }; class Subclass is Parent { method foo() { self!Parent::priv(42) } }; Subclass.new.foo
14:28 camelia rakudo-moar 40a953: OUTPUT«42␤»
14:28 moritz jnthn: takk
14:29 jnthn But yeah, if you want to share it between the two then private may not be the right scope for it
14:29 jnthn Alternatives including putting the private method into a role that both classes compose
14:29 gregf_ er, does that not break encapsulation?
14:29 jnthn gregf_: `trusts` *is* breaking encap, yes
14:30 MadcapJake I wanted to use a private method in CompUnit::Repository::FileSystem, so it's a no go all around :P
14:30 jnthn Uh, yeah... :)
14:30 timotimo time for a utility class!
14:30 jnthn One key thing about private methods is that you know you can refactor them and, provided you keep external behavior the same, it's all good.
14:31 MadcapJake truthfully, I probably wouldn't have been able to use it, just got curious if it was possible
14:31 jnthn That is, refactor them without looking beyond the curernt class body
14:31 smls Quick question: Is it safe for multiple threads to await() the same Promise simultaneously?
14:31 jnthn smls: Yes
14:31 smls thanks
14:31 gregf_ jnthn: thanks
14:32 jnthn Note we make you write `trusts` in the class that is having its encapsulation broken, so you only need to read that class to know you're screwed also :)
14:33 jnthn Don't suppose anyone here knows a good amount about file locking on Windows vs POSIX?
14:33 timotimo on linux, mandatory file locking doesn't exist
14:33 timotimo only advisory file locking does
14:34 timotimo that's all i know :\
14:34 jnthn What does that actually mean? :)
14:34 timotimo if you lock a file, and another process doesn't look if there is a lock, it can trample you rlock
14:34 jnthn That if you don't opt in to the locking scheme you can read the file anyway?
14:35 jnthn Ah
14:35 jnthn And on windows...maybe it's mandatory
14:35 jnthn That could explain things
14:40 tadzik joined #perl6
14:41 RabidGravy are there any other ways at getting at a method object at compilation other than in a trait or over-riding the methods in the meta object?
14:42 moritz that's an API "design" that... didn't stood the test of time, if you asked me
14:42 moritz (advisory locking)
14:42 moritz RabidGravy: you can use .^can on the type object, at compile time
14:42 moritz or even .^find_method
14:42 skink joined #perl6
14:44 skids joined #perl6
14:44 teatime "<branjb> anyone able to point me in the right direction, how many 8 letter combinations could i have from the letters A, B, C, if A and C cannot be next to each other?  I got 56, but that seems low."
14:44 teatime sadly this was not the answer #math was looking for: ([X] <a b c> xx 8)».join.grep(* !~~ /ac|ca/).elems
14:45 timotimo m: say ([X] <a b c> xx 8)».join.grep(* !~~ /ac|ca/)
14:45 camelia rakudo-moar 40a953: OUTPUT«(aaaaaaaa aaaaaaab aaaaaaba aaaaaabb aaaaaabc aaaaabaa aaaaabab aaaaabba aaaaabbb aaaaabbc aaaaabcb aaaaabcc aaaabaaa aaaabaab aaaababa aaaababb aaaababc aaaabbaa aaaabbab aaaabbba aaaabbbb aaaabbbc aaaabbcb aaaabbcc aaaabcba aaaabcbb aaaabcbc aaaabccb aaa…»
14:45 moritz m: say ([X] <a b c> xx 8)».join.grep(* !~~ /ac|ca/).elems
14:45 camelia rakudo-moar 40a953: OUTPUT«1393␤»
14:46 psch m: say ([X] <a b c> xx 8)».join.squish.grep(* !~~ /ac|ca/)
14:46 camelia rakudo-moar 40a953: OUTPUT«(aaaaaaaa aaaaaaab aaaaaaba aaaaaabb aaaaaabc aaaaabaa aaaaabab aaaaabba aaaaabbb aaaaabbc aaaaabcb aaaaabcc aaaabaaa aaaabaab aaaababa aaaababb aaaababc aaaabbaa aaaabbab aaaabbba aaaabbbb aaaabbbc aaaabbcb aaaabbcc aaaabcba aaaabcbb aaaabcbc aaaabccb aaa…»
14:46 psch m: say ([X] <a b c> xx 8)».join.squish.grep(* !~~ /ac|ca/).elems
14:46 camelia rakudo-moar 40a953: OUTPUT«1393␤»
14:46 teatime what does squish get you?
14:46 psch it demonstrates my lack of paying attention, i suppose :/
14:46 moritz nothing, the combinations are already unique
14:46 timotimo unless there is a bug :)
14:47 teatime it was useful, in so far as it gives him something to check his ultimate result with
14:47 teatime but it was not useful as a way of figuring out the math or math notation for calculating the same
14:48 RabidGravy moritz, the background to that question was that I think there is a precomp bug regarding wrap(), such that if the result of said wrapping gets precomped then it doesn't work
14:50 perlpilot teatime: then branjb should have asked a better question  ;)
14:50 RabidGravy doesn't work in that WrapDispatcher.enter when it does candidates[0] on the precomped wrapped method doesn't get a callaible object
14:57 zakharyas joined #perl6
14:57 smls jnthn: Given an expensive pure function, is this a sensible way to make it both self-caching and support concurrent calls?  https://gist.github.com/smls/bf​f79cd0b940ffa395261c9126c7ea0b
14:59 moritz smls: looks sensible to me
14:59 grondilu TIL: I can put '*~' in a .gitignore file to mask all Vim's backups.
14:59 jnthn smls: Depeds if you want to defer evaluation until first request
15:00 moritz grondilu: and *.swp and *.swo :-)
15:00 moritz for the swap files as well
15:00 smls jnthn: That's what I'm doing here, isn't it?
15:00 smls or did I make a mistake
15:00 teatime grondilu: or just config vim to keep it's backup and swp files somewhere sane
15:00 grondilu teatime: that looks overkill
15:01 teatime which?
15:01 jnthn smls: Ah, so it is
15:01 smls At first I tried to do it without a Promise, using a Hash of locks. But I couldn't wrap my head around how to avoid all possible race conditions.
15:02 teatime grondilu: here's the relevant part of my vimrc, for inspiration http://paste.debian.net/plain/427372
15:02 grondilu I don't want to hide the swap files, but I'm OK to keep my backups in the same directories.
15:02 teatime I'm not a fan of editors leaving droppings in random places.
15:02 grondilu it's not exactly random since it's where the original file is.
15:02 mcsnolte joined #perl6
15:03 teatime ok then, I'm not a fan of editors leaving random droppings in places :)
15:03 moritz there's also a trick of adding a second trailing slash to the backup dir, but I forgot what exactly that does
15:04 teatime moritz: heh, hence "(trailing slash is NOT a typo)"
15:04 teatime it's documented in the vim help
15:04 smls jnthn: Using   state $lock = Lock.new;   wouldn't be safe because initializing a state var isn't thread-safe in itself, right?
15:08 jnthn smls: Correct
15:08 smls ok
15:09 jnthn smls: I think when we do `is cached` properly we'll want to make it threadsafe...
15:09 smls Sounds good :)
15:09 Actualeyes joined #perl6
15:12 gregf_ static variables can mess up threads as the memory is shared
15:15 gregf_ https://gist.github.com/anonymous​/64a2cc1ee4de1855b8b9314c5b201f4c <== i just tried this *ignore that its ruby*
15:16 ggoebel17 joined #perl6
15:16 smls jnthn: Is there any of documentation/overview on what built-in operations are or are not threadsafe?
15:17 smls In particular,   < reading  writing > X < $scalar  @array  %hash  object.attribute >   ?
15:18 smls Pretty sure that writing to any of those things is NOT safe, but which are safe to read from?
15:18 ptolemarch joined #perl6
15:19 jnthn smls: Not aware that's well covered...it really should be though.
15:19 jnthn smls: In general, scalars (if they're just a boring Perl 6 Scalar, not a Proxy or something) or safe to write. Same goes for Scalar attributes.
15:20 jnthn smls: Concurrent writes, and reading while writing to, an array or hash isn't safe
15:20 jnthn Unless it's a fixed size native array :)
15:23 smls What about concurrent reading of array/hash elements?
15:23 jnthn Fine with a hash
15:24 jnthn With an array - yes provided you're not reading an unevaluated lazy part
15:24 smls makes sense
15:26 smls m: my $x;  for ^1000 { start { sleep 0.1; $x = $_ } };  say $x
15:26 camelia rakudo-moar 40a953: OUTPUT«Memory allocation failed; could not allocate 14520 bytes␤»
15:26 smls Hm, works locally
15:28 skink Is there a faster way to derive Ints from Buf[uint8] or an array than .unpack()?
15:29 jnthn smls: I think memory limit or thread limit maybe
15:31 smls jnthn: But that kind of concurrent assignments to a scalar is what you meant with "safe to write", right?
15:31 smls (i.e. guaranteed not to crash)
15:31 RabidGravy jnthn, want a failing test (which is an example of a bug that I'm about to RT) for OO::Monitors?
15:35 Khisanth joined #perl6
15:36 jnthn smls: You won't get a crash out of that
15:36 jnthn RabidGravy: Yes...could you even PR the failing test?
15:36 jnthn RabidGravy: Or is it a fail in Rakudo rather than OO::Monitors?
15:37 RabidGravy it's a fail caused by a precomp bug
15:37 jnthn smls: At a C level, assigning to a Scalar is basically writing a pointer
15:37 smls ok
15:37 jnthn RabidGravy: ah, ok. Then test very welcome.
15:38 RabidGravy I'm going to RT a smaller example done in two ways, but bottom line is that the way that OO::Monitors wraps the methods doesn't work in a precomped module
15:40 RabidGravy it seems that the WrapDispatcher "loses" the candidates when precompiled
15:41 ptolemarch joined #perl6
15:42 smls jnthn:  Isn't  @x[4]  a simple Scalar as well though (provided that no auto-viv or laziness is happening)?
15:42 smls So shouldn't that be safe to assign to as well?
15:43 jnthn smls: Indeed
15:43 smls ok
15:43 wamba joined #perl6
15:43 jnthn smls: It's the array's body itself that isn't
15:43 smls ?
15:44 jnthn An array is a blob of blob that points to Scalar containers
15:44 jnthn *blob of memroy
15:44 M-tadzik joined #perl6
15:44 timotimo memroooooooy ... blobkins!!!k
15:45 timotimo Characters simplified : 100.34%
15:46 timotimo .... oooooh..kay?
15:46 smls But assigning to an already existing element shouldn't modify the array container's state/metadata at all, should it?
15:47 ZoffixWin Was this grant approved? Jonathan Worthington / Perl 6 performance. http://news.perlfoundation.org/2016/0​2/grant-proposal-perl-6-performa.html
15:49 smls m: my @x = 1, 2, 3;  for ^10 { start { sleep 0.1; @x[1] = $_ } };  say @x
15:49 camelia rakudo-moar 40a953: OUTPUT«[1 2 3]␤»
15:49 kerframil joined #perl6
15:49 gregf_ hmm, i just ran this: y $lock = Lock.new; class Foo { has Hash $.h is rw; method reduce(Str $val){ $!h{$val}-=1; $!h{$val}; } }; my $f = Foo.new(h => {foo => 10000, bar => 10, baz => 60}); my @data; await do (^1000).map({ start  { push @data, $f.reduce("foo") } }); say @data.min # was expecting 900
15:49 gregf_ s/^y/my/
15:50 pmurias ZoffixWin: yes, it's under way
15:50 ZoffixWin Awesome.
15:50 gregf_ s/900/9000/
15:50 gregf_ the mutex should help tho'
15:55 M-matthew joined #perl6
15:55 M-Illandan joined #perl6
15:55 jnthn ZoffixWin: Yeah, my weekly blog posts are my progress reports on that :)
15:55 ZoffixWin Cool.
15:55 ZoffixWin I should read more stuff :)
15:56 timotimo jnthn's blog comes highly recommended, IMO
15:56 mst I highly recommend the bits I actually understand
15:56 El_Che mst: lol
15:56 El_Che the rest of us is to ashamed to say it out loud :)
15:56 smls gregf_: You don't use the $lock at all
15:57 smls gregf_: You do   $!h{$val} -= 1;   simultaneously from multiple threads
15:57 gregf_ smls: yeah, that should return the proper count when used.
15:58 smls I don't think it should
15:58 gregf_ well, then why lock a resource ;)
15:59 smls you *don't* lock anything
15:59 smls you just initialize a lock, but never call .protect
15:59 gregf_ smls: granted, in the code above.. you can stick in a $lock.protect { # access_chared_resources} *cries*
15:59 timotimo why isn't that enough?
16:00 domidumont joined #perl6
16:00 gregf_ smls: my point was to prove that hashes are no thread safe. as jnthn pointed out
16:00 gregf_ s/no/not/
16:00 smls ah
16:00 gregf_ ;)
16:00 teatime charred resources?  is that what you get when you access resources in an unsafe way?  :)
16:01 gregf_ would very well be :|
16:01 gregf_ s/^w/c/
16:01 timotimo :D
16:02 smls gregf_: But I think the  -=  operator is already not atomic, so even with a scalar instead of a hash there, it would not work
16:02 smls m: my $x; for ^10 { start { $x += 1 } }; say $x
16:02 camelia rakudo-moar 40a953: OUTPUT«10␤»
16:03 smls ^^ I get varying results from 8 to 10 for that
16:03 skink Probably a stupid question: if I'm supplying random numbers, should they be Big Endian or Little?
16:04 [Coke] skink: huh?
16:04 skink I'm taking a Buf[uint8] and deriving an Int from it
16:04 [Coke] ah, I missed some backscroll, I guess.
16:05 skink I was .unpack("L") vs ("N")
16:05 skink considering*
16:06 skink Well, rather, I was using "L" and then just found a way of doing it that's an order of magnitude faster but it's big endian
16:08 skids If the random number is over the entire binary field and equally distributed, and nothing sees the original buffer, it should not matter.
16:09 skink skids, That last optimization you pasted last night brought me from ~115 UUID/s to ~725
16:09 sue joined #perl6
16:09 skids glad to help.  I'm sure there must be more to gain.
16:10 RabidGravy if you have four bytes and want to turn then into an Int it's just "my $int = ($buf[0] +< 0x18 ) + ($buf[1] +< 0x10) + ($buf[2] +< 0x08) + $buf[3]
16:10 skink Now I'm optimizing the Int generation and allowing for arbitrary-sized results rather than just 32bit ones.
16:11 skink RabidGravy, That's basically what I'm doing now.
16:11 RabidGravy cool
16:11 skink my Int $count = 0;
16:11 skink ($count +<= 8) += $_ for crypt_random_buf($length).values;
16:20 smls joined #perl6
16:20 skink > crypt_random(32);
16:20 skink 626743696580897473902116381396622998591​86874929303896384935970869933657346211
16:20 skink Yup... I think that'll do.
16:23 RabidGravy :)
16:26 captain-adequate joined #perl6
16:26 skink On my machine .unpack() gave ~900 numbers/s, this method ~3300
16:30 timotimo jnthn: does anything speak against having an op that feeds a buffer directly into an Int?
16:33 sue left #perl6
16:37 buharin joined #perl6
17:05 Khisanth joined #perl6
17:12 Xliff__ joined #perl6
17:12 noganex_ joined #perl6
17:13 grondilu I've invented a word today:
17:13 ZoffixWin it's very short :)
17:13 grondilu ourify (v.): to change a "my" variable into a "our" one.
17:13 kerframil joined #perl6
17:13 grondilu ^I used it in a commit message :P
17:18 grondilu we can do 'my %{Foo};' but why not 'my MixHash ${Foo};'?
17:19 grondilu I mean adding a constraint for the type of the keys of a MixHash?
17:19 hoelzro grondilu: wouldn't that look like `my MixHash[Foo] $hash` or something?
17:20 grondilu m: my MixHash[Str] $;
17:20 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/U8zxQGa1Zy␤An exception occurred while parameterizing MixHash␤at /tmp/U8zxQGa1Zy:1␤Exception details:␤  5===SORRY!5=== Error while compiling /tmp/U8zxQGa1Zy␤  MixHash cannot be parameterized␤  a…»
17:20 grondilu "MixHash cannot be parameterized
17:20 grondilu "
17:22 grondilu MixHash is a cool concept: a collection of stuff with auto-removal of nul quantities.  I have been trying to do that for my CLifford module.  I wish I could use a builtin structure.
17:23 grondilu It's also very close to the concept of linear combinations, which is obviously very useful.
17:23 TimToady to mix in the TypedHash role is probably going to require using real object hashes for Sets etc
17:30 molaf joined #perl6
17:30 TimToady smls: fixed your useless use
17:55 buharin joined #perl6
17:55 ZoffixWin m: Date.new('2016-04-03').year.say
17:55 camelia rakudo-moar 40a953: OUTPUT«2016␤»
17:55 ZoffixWin :S
17:56 ZoffixWin Camelia is messing with me. I just got "(no output)" for that one several times via /msg :S
17:56 ZoffixWin m: Date.new('2016-04-03').year.say
17:56 camelia rakudo-moar 40a953: ( no output )
17:56 jdukart joined #perl6
17:56 ZoffixWin Weird, no?
17:57 TimToady some kind of race with exit() maybe?
17:57 kurahaupo joined #perl6
17:57 ackiejoe joined #perl6
17:57 TimToady I think people have been playing around a bit with output locking lately
17:58 TimToady m: Date.new('2016-04-03').year.say; sleep 1
17:58 camelia rakudo-moar 40a953: OUTPUT«2016␤»
17:58 TimToady m: Date.new('2016-04-03').year.say; sleep 1
17:58 camelia rakudo-moar 40a953: OUTPUT«2016␤»
17:58 TimToady m: Date.new('2016-04-03').year.say; sleep 1
17:58 camelia rakudo-moar 40a953: OUTPUT«2016␤»
17:58 TimToady m: Date.new('2016-04-03').year.say; sleep 1
17:58 camelia rakudo-moar 40a953: OUTPUT«2016␤»
17:58 TimToady seems a likely explanation
17:58 teatime TimToady: stop spamming you might be banned.
17:58 teatime ;)
17:59 ZoffixWin Seems to be. Glad it's not a rakudo bug :)
17:59 TimToady it would be a great relief if I were  :P
17:59 jdukart left #perl6
17:59 perlpilot TimToady: you lack the will power to ignore IRC?
18:00 TimToady I lack the willpower to ignore ignorance.  :)
18:00 teatime thankfully.
18:01 perlpilot TimToady: btw, have you not been around here much lately?  It seems like you're not as active as a couple of months ago, but maybe that's just me.
18:02 TimToady well, we were pushing Christmas pretty hard there for a while...
18:02 TimToady that's not sustainable...
18:03 perlpilot aye.  I was thinking maybe you were feeling under the weather or something.
18:03 TimToady some of that, some of just getting back to doing some things I'd been neglecting to do for 15 years...
18:03 TimToady like cleaning out my garage
18:04 TimToady found some things in there that were left by the previous owner in '91
18:04 ZoffixWin :o
18:04 teatime anything cool?
18:05 Possum joined #perl6
18:05 TimToady a speedometer off a Harvester International tractor
18:05 TimToady well, I don't actually know it was off a tractor...
18:05 RabidGravy excellent
18:05 perlpilot .oO( little does TimToady realize that that's *his* speedometer and he's just forgotten )
18:05 perlpilot ;)
18:06 TimToady but it does have their logo on it
18:06 grondilu m: class Foo { our sub f { rand }; method f { state $ = f } }; say Foo.f;  # wondering if it's a OK to use the same name for a function and a method
18:06 camelia rakudo-moar 40a953: OUTPUT«0.892424967326445␤»
18:06 TimToady and this week is taxes, of course...
18:08 TimToady grondilu: the namespaces are entirely disjoint, by design
18:08 RabidGravy I've spent five days gardening, totally ruined now
18:08 TimToady perlpilot: also been working some on a "new camel"
18:08 grondilu TimToady: I thought so.  I think I will use the same name.  It makes some sense.
18:08 teatime TimToady: book you mean?
18:09 teatime TimToady: I would enjoy that ever so much.
18:09 perlpilot TimToady: ah, how's that coming along?
18:09 TimToady well, I have the intros written for various chapters
18:10 TimToady but I'm not really in book-writing mode yet, or you probably wouldn't see me at all...
18:10 astj joined #perl6
18:10 perlpilot TimToady: if you need any reviewers or other feedback, let me know.  I'll read anything.  :-)
18:10 labster joined #perl6
18:11 perlpilot (though, I did have trouble getting through the Silmarillion, so if reads like that ... I'll let you know you need to start over  ;)
18:11 TimToady also spending some time thinking about various speeches I'll have to give this year
18:12 FROGGS joined #perl6
18:13 TimToady .oO("...after my friends corrected 'little hope' to 'no hope'..." -J.R.R. Tolkien)
18:15 TimToady perlpilot: and to be perfectly honest, I suffer a bit from SAD as well, so I'm glad to see the sunshine coming back
18:15 pierrot joined #perl6
18:19 [Coke] TimToady: welcome back-ish.
18:19 [Coke] (SAD) hopefully winter is now gone for good this year in NY. :P
18:20 perlpilot I thought I saw wintery weather headed that way on the weather channel earlier today
18:23 [Coke] perlpilot: :P
18:24 RabidGravy yeah, it has felt like winter in London today
18:25 ufobat joined #perl6
18:25 RabidGravy it was quite pleasant last weekend
18:25 perlpilot my wife was worried about "all the cold weather" when we moved to north Texas.  Her views on "cold" are a little skewed from spending most of her life in south Texas
18:28 vendethiel joined #perl6
18:29 TimToady [6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6​~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[​6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~​[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6​~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[​6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~​[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6~[6
18:29 [Coke] perlpilot: I interviewed for a job in houston in february. They apologized profusely for the cold.
18:29 perlpilot heh
18:29 TimToady oops
18:30 mst TimToady: I didn't know you had cats
18:30 TimToady I had cats  :'(
18:31 mst ah.
18:31 [Coke] :(
18:32 TimToady not really fair to have cats right now with all the travelling we do
18:32 TimToady so we've not restocked...
18:34 mst if I get another one, I will be significantly dependent on having lots of friends who're cat people locally
18:35 TimToady speaking of restocking, lunch (and taxes) &
18:35 cpage_ joined #perl6
18:35 perlpilot TimToady: have as much fun as possible :)
18:35 teatime Two things in life are inevitable: lunch and taxes.
18:36 teatime wait, that's not quite it..
18:43 ZoffixWin m: sub foo ($x, *%params) {say %params}; my $x = 42; foo 42, $x ?? x => $x !! Empty;
18:43 camelia rakudo-moar 40a953: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in sub foo at /tmp/CqhQ9kVcr7 line 1␤  in block <unit> at /tmp/CqhQ9kVcr7 line 1␤␤»
18:44 ZoffixWin What's the trick to pass a key/value to %params, but only if the value is True?
18:44 cpage_ joined #perl6
18:45 jnthn |(:$x if $x) maybe
18:45 jnthn May have to be |%(:$x if $x)
18:45 ZoffixWin m: sub foo ($x, *%params) {say %params}; my $x = 42; foo 42, |(:$x if $x)
18:45 camelia rakudo-moar 40a953: OUTPUT«{x => 42}␤»
18:45 ZoffixWin Thanks, jnthn++
18:45 jnthn ah, it's a Pair so works out :)
18:46 smls $x
18:46 smls $x? syntax on caller side would be cute ;)
18:46 jnthn :P
18:47 * ufobat is coding with black tea and pizza. who wanna join in! :D
18:47 teatime I'm down for *at least* half of that.
18:48 * jnthn just filled himself up with orange lamb :)
18:48 ufobat yummy!
18:51 * [Coke] may have issues with his job, but they do provide him with lots of toys to work on.
18:53 _nadim joined #perl6
18:56 ufobat is it true that a Routine compared to a Block, must have a signature and it is not possible to create a Routine without a signature??
18:56 Khisanth joined #perl6
18:56 xchg_ joined #perl6
18:56 ufobat so either both "return handling" & signatures or just a Block
18:59 ZoffixWin m: say ({;}).signature
18:59 camelia rakudo-moar 40a953: OUTPUT«(;; $_? is raw)␤»
19:01 nd3i joined #perl6
19:01 ufobat i a to new to understand this as an answer :(
19:02 jnthn ufobat: Block and Routine, if you don't specify a signature, get different default signatures
19:02 jnthn sub foo { } is identical to sub foo() { }
19:02 RabidGravy it's Callable -> Code -> Block -> Routine -> (Method, Sub) in increasing specificity
19:03 ufobat okay got it so far
19:03 ZoffixWin Sorry, that wasn't an answer from me, I just wanted to see what .signature would give from a block.
19:03 RabidGravy and Code has signature
19:03 jnthn And yeah, return is scoped to a Routine
19:03 labster joined #perl6
19:03 labster joined #perl6
19:04 ufobat so a Block does not have a own @_, and return does not leave a block but the outer routine
19:04 ufobat the (only) way to put something inside into a block would be dynamic scoped variables like $*foo
19:05 jnthn No, Block can have a signature
19:05 jnthn m: my $a = -> $x { say 2 * $x }; $a(21)
19:05 camelia rakudo-moar 40a953: OUTPUT«42␤»
19:05 jnthn m: my $a = -> $x { say 2 * $x }; say $a.WHAT
19:05 camelia rakudo-moar 40a953: OUTPUT«(Block)␤»
19:08 dvinciguerra__ joined #perl6
19:08 ufobat soo is the pointy block basically a block with a signature? right?
19:09 jnthn Yeah
19:09 ufobat yay awesome :-)
19:09 ufobat thanks for your help guys!
19:11 AlexDaniel joined #perl6
19:15 ufobat another question
19:15 ufobat is there something like curry in perl6?
19:15 hankache joined #perl6
19:16 hankache hola #perl6
19:17 ufobat heya :)
19:17 moritz ufobat: there is .assuming on code objects
19:17 moritz ufobat: and the Whatever term can also do some form of currying
19:17 moritz m: say &infix:<+>.assuming(40)(2)
19:17 camelia rakudo-moar 40a953: OUTPUT«42␤»
19:18 moritz m: say (* + 40)(2)
19:18 camelia rakudo-moar 40a953: OUTPUT«42␤»
19:23 ufobat m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new;  my $callback = $f.bla.assuming.("you"); $callback()
19:23 camelia rakudo-moar 40a953: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in method bla at /tmp/phbt1kY7BF line 1␤  in block <unit> at /tmp/phbt1kY7BF line 1␤␤»
19:25 ufobat how to get this right?
19:26 hoelzro I'm wondering which would take more work/be smarter - converting linenoise.c to support multi-byte, or just writing a pure perl6 line editor with the help of NativeCall
19:26 sue joined #perl6
19:26 hoelzro the latter does have some advantages, for sure
19:28 moritz m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new; my $callback = { $f.^can('you').assume($f, 'hey there') }; $callback()
19:28 camelia rakudo-moar 40a953: OUTPUT«Method 'assume' not found for invocant of class 'List'␤  in block <unit> at /tmp/MSRr7dt2Z5 line 1␤␤»
19:28 moritz m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new; my $callback = { $f.^find_method('bla').assume($f, 'hey there') }; $callback()
19:28 camelia rakudo-moar 40a953: OUTPUT«Method 'assume' not found for invocant of class 'Method'␤  in block <unit> at /tmp/qSewYLA2NW line 1␤␤»
19:28 moritz m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new; my $callback = { $f.^find_method('bla').assuming($f, 'hey there') }; $callback()
19:28 camelia rakudo-moar 40a953: ( no output )
19:29 moritz m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new; my $callback = $f.^find_method('bla').assuming($f, 'hey there'); $callback()
19:29 camelia rakudo-moar 40a953: OUTPUT«hey hey there␤»
19:29 sortiz joined #perl6
19:29 moritz m: class Foo { method bla ($there) {say "hey $there"}}; my $f = Foo.new; my $callback = {$f.bla('hey there')}; $callback()
19:30 camelia rakudo-moar 40a953: OUTPUT«hey hey there␤»
19:31 moritz the difficulty here is getting the method object without invokiking it
19:31 ufobat lol, the easy way seems to be right, as always ;)
19:32 ufobat cool cool :-)
19:32 ufobat i <3 perl6
19:32 ufobat thanks moritz
19:32 moritz ufobat: you're welcome
19:34 hankache joined #perl6
19:36 Khisanth joined #perl6
19:46 ZoffixWin m: sub foo ($x) { say $x.WHAT }; foo Empty
19:46 camelia rakudo-moar 40a953: OUTPUT«(Slip)␤»
19:47 ZoffixWin m: say so |() === Empty
19:47 camelia rakudo-moar 40a953: OUTPUT«False␤»
19:47 ZoffixWin m: say so |() == Empty
19:47 camelia rakudo-moar 40a953: OUTPUT«True␤»
19:47 moritz m: say so |() eqv Empty
19:47 camelia rakudo-moar 40a953: OUTPUT«True␤»
19:47 moritz ZoffixWin: Empty is just a conveniently named Slip instance
19:47 [Coke] m: Empty ~~ Slip
19:47 camelia rakudo-moar 40a953: ( no output )
19:48 ZoffixWin I see. I was kinda expecting foo Empty to be equivalent to foo()
19:48 [Coke] m: say Empty ~~ Slip
19:48 camelia rakudo-moar 40a953: OUTPUT«True␤»
19:51 ufobat moritz, what about that: class Foo { method bla ($x, $y) {say "hey $x and $y"}}; my $f = Foo.new; my $callback = { $f.bla("you", |@_)} ; $callback("now leave!")
19:52 ufobat doesn't that look more like the curry from perl5 :)
19:53 dalek ecosystem: accc259 | (Zoffix Znet)++ | META.list:
19:53 dalek ecosystem: Add NASA
19:53 dalek ecosystem:
19:53 dalek ecosystem: Implementation of NASA's APIs: https://github.com/zoffixznet/perl6-NASA
19:53 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/accc259983
19:55 Khisanth joined #perl6
19:55 ufobat yeah the nasa api :D
19:58 cpage_ joined #perl6
20:00 jercos joined #perl6
20:01 ZoffixWin Would be really cool if NASA started using Perl 6 :P
20:01 cdg joined #perl6
20:04 ZoffixWin TIL: specifying "key" in .gitignore also blacklists "foo/key" :/
20:12 Begi joined #perl6
20:14 DrForr joined #perl6
20:18 AlexDaniel .
20:18 yoleaux 11:20Z <ZoffixWin> AlexDaniel: I can't even find any docs for the XML::Document Gumbo returns. By comparison, Mojo::DOM has a polished interface.
20:19 ZoffixWin And on that point, IIRC my OS doesn't even have gumbo in repos
20:19 Begi1 joined #perl6
20:19 AlexDaniel ZoffixWin: it is right here: https://github.com/supernovus/exemel
20:19 AlexDaniel ZoffixWin: and what's your OS?
20:19 Hotkeys Is nasa using p6?
20:19 Hotkeys or is that just a hope of zoffix
20:19 ZoffixWin Ah, I was searching for XML::Document (which I'm guessing is part of XML distro :()
20:20 ZoffixWin AlexDaniel, Bodhi Linux, which is a fork of Ubuntu. aptitude search gumbo gives me nothing, and if my memory is correct, the story is the same on debian
20:21 ZoffixWin Hotkeys, just a hope. But they do invite submissions for cool things made with their APIs, so... the door is open :)
20:21 AlexDaniel p
20:21 AlexDaniel ZoffixWin: the package is called libgumbo1
20:21 AlexDaniel ZoffixWin: it is only in debian testing, so indeed, not cool enough
20:23 ZoffixWin There's also an obvious bias that I'm quite familiar with Mojo::DOM, so going to XML::Document is being faced with a wall of new stuff to learn :)
20:24 mst
20:30 TEttinger joined #perl6
20:34 [Coke] O_o;
20:36 skink joined #perl6
20:37 skink sortiz, skids was able to speed up the UUID Str generation 6x
20:41 Khisanth joined #perl6
20:42 nd3i left #perl6
20:45 sortiz skink, \o/ Thanks!
20:46 woodruffw joined #perl6
20:46 sortiz I'll check the backlog.
20:47 skink ctrl+f "thunk"
20:48 kerframil joined #perl6
20:52 sortiz found, thanks.
20:52 sufrostico joined #perl6
20:53 grondilu off topic:  SpaceX did land on a drone ship.
20:53 grondilu like five minutes ago
20:54 skink m: (:256[(0..255).roll(16)].fmt("%32.32x") ~~ /(........)(....)(....)(....​)(............)/).join("-") for 1..1000; say now - INIT now;
20:54 camelia rakudo-moar 40a953: OUTPUT«0.68679003␤»
20:54 skink @ sortiz
20:55 sortiz skink, Yep, thanks again.
20:55 skink That doesn't include version/variant though, mind you.
20:56 ZoffixWin grondilu, awesome
20:56 skink Out of curiosity
20:57 skink m: (:256[(0..255).roll(16)].fmt("%32.32x") ~~ /(........)(....)(....)(....​)(............)/).join("-") for (1..1000).race; say now - INIT now;
20:57 camelia rakudo-moar 40a953: OUTPUT«0.4899288␤»
20:57 ChristopherBotto joined #perl6
20:57 skink On my machine for 10,000, it's 17s vs 10.7s
20:57 ChristopherBotto Hello Perl6!
20:57 perlpilot ChristopherBotto: greetings
20:57 TimToady that...was beautiful...
20:58 TimToady (SpaceX landing)
20:59 * lizmat didn't get the live feed going
20:59 perlpilot ... too beautiful  ;)
20:59 espadrine joined #perl6
20:59 dalek doc: 7881a68 | (John Gabriele)++ | doc/Language/containers.pod:
20:59 dalek doc: fix typo
20:59 dalek doc: review: https://github.com/perl6/doc/commit/7881a6820f
21:00 ChristopherBotto Is the END phaser supposed to run even after a Kill signal?
21:00 lizmat ChristopherBotto: if the kill is not an -9, I guess so  :-)
21:01 lizmat ChristopherBotto: are you saying it didn't and it should?  or vice-versa ?
21:01 ChristopherBotto It didn't, but I thought it should.
21:02 perlpilot I would think it should too.
21:03 Khisanth joined #perl6
21:03 skink sortiz, Are you just gonna include that as a function, or should I make a PR to P6-UUID?
21:04 ChristopherBotto lizmat: perlpilot: I'll double check .......
21:05 perlpilot ChristopherBotto: Though, I note that P5 doesn't seem to run END blocks after a SIGINT or SIGTERM
21:07 sortiz skink, Is a good idea to include it in P6-UUID, try a PR.
21:08 sufrostico joined #perl6
21:14 lizmat indeed, the END block does not appear to be run
21:14 lizmat ChristopherBotto: this is a workaround:
21:14 lizmat signal(SIGTERM).act: { exit 1 }; Nil while 1; END say "this is the end, my friend"
21:15 lizmat m: signal(SIGTERM).act: { exit 1 }; Nil while 1; END say "this is the end, my friend"
21:15 * perlpilot would be surpised if that worked in camelia
21:15 jnthn I'd expect you'd need to install a handler that calls exit
21:15 camelia rakudo-moar 40a953: OUTPUT«(timeout)this is the end, my friend␤»
21:15 diakopter ohhh
21:15 jnthn Oh, exactly as lizmat showed :)
21:15 perlpilot lizmat++
21:16 jnthn <-- nearly too tired to read :)
21:16 lizmat jnthn: would you consider that a work around or not ?
21:17 jnthn lizmat: I don't mind it being that way, I think
21:18 * lizmat neither  :-)
21:18 jnthn Installing that handler by default at present would also be rather costly, though that reason won't be with us forever I hope :)
21:19 perlpilot ChristopherBotto: what did you want to rely on running in the END phaser anyway?
21:19 ChristopherBotto lizmat++
21:20 ChristopherBotto perlpilot: I want to clean up external resources. I'm actually starting a interactive job on the node of one of our clusters and I want the job reservation to be terminated if the interactive session is terminated.
21:21 diakopter m: use MONKEY-SEE-NO-EVAL;  EVAL 1 while 1 # should timeout instead of memeat
21:21 camelia rakudo-moar 40a953: OUTPUT«(timeout)»
21:22 diakopter \o/
21:22 jnthn star: use MONKEY-SEE-NO-EVAL;  EVAL 1 while 1
21:22 camelia star-m 2016.01: OUTPUT«Memory allocation failed; could not allocate 378368 bytes␤»
21:22 jnthn Progress :)
21:23 jnthn Hadn't occured to me you could demonstrate that fix with camelia... :)
21:34 Xliff joined #perl6
21:35 grondilu m: my MixHash $a .= new; my MixHash $b = $a.clone; $a<foo>++; dd $b;
21:35 camelia rakudo-moar 40a953: OUTPUT«MixHash $b = ("foo"=>1).MixHash␤»
21:35 grondilu ^quite unexpected
21:37 grondilu m: my MixHash $a .= new; my MixHash $b = $a.pais; $a<foo>++; dd $b;
21:37 camelia rakudo-moar 40a953: OUTPUT«Method 'pais' not found for invocant of class 'MixHash'␤  in block <unit> at /tmp/ei8J_BUgZI line 1␤␤»
21:37 grondilu m: my MixHash $a .= new; my MixHash $b = $a.pairs; $a<foo>++; dd $b;
21:37 camelia rakudo-moar 40a953: OUTPUT«Type check failed in assignment to $b; expected MixHash but got Seq (().Seq)␤  in block <unit> at /tmp/cHHWRfmwkU line 1␤␤»
21:39 skink sortiz, https://github.com/retupmoca/P6-UUID/pull/1
21:40 grondilu m: my MixHash $a .= new; my MixHash $b = $a.pairs.MixHash; $a<foo>++; dd $b;
21:40 camelia rakudo-moar 40a953: OUTPUT«MixHash $b = ().MixHash␤»
21:41 lizmat grondilu: feels to me it needs an RT ticket
21:42 grondilu lizmat: I'll make one
21:43 ChristopherBotto lizmat: Thanks so much. I've got it implemented now.
21:43 ChristopherBotto lizmat:  I do get a funny error message though: Unhandled exception in code scheduled on thread 3 Cannot call postcircumfix:<[ ]>(Any, Int); none of these signatures match:     (\SELF, Any:U $type, |c is raw)     (\SELF, int $pos) .....
21:44 sortiz skink++ # Work done on UUID
21:44 lizmat ChristopherBotto: is "exit 1" the code in the signal supply ?
21:46 ChristopherBotto lizmat: I have "signal(SIGTERM).act: { exit 1 };" and "signal(SIGINT).act: { exit 1 };"
21:46 dalek DBIish: b65013c | (Salvador Ortiz)++ | / (10 files):
21:46 dalek DBIish: Add $drv.version (actual 'client' version)
21:46 dalek DBIish: review: https://github.com/perl6/DBIish/commit/b65013c631
21:48 ChristopherBotto lizmat: I'm not sure what you mean by "signal supply", now that I think of it. I'm a little new at asynchrony.
21:48 skink Would anyone be willing to do some code review for Crypt::Random?
21:52 grondilu m: say class { method list { <foo bar> } }.new.list
21:52 camelia rakudo-moar 40a953: OUTPUT«(foo bar)␤»
21:52 grondilu m: say class { method list { <foo bar> } }.new[]
21:52 camelia rakudo-moar 40a953: OUTPUT«<anon|66568944>.new␤»
21:53 ChristopherBotto skink: I don't know if I could do a review, but I was just curious, why do you check both $one and $two in this test from "01-buf.t"? ok ($one.elems == $bytes || $two.elems == $bytes), "crypt_random_buf() outputs hold correct number of bytes";
21:53 grondilu doesn't postcircumfix:<[]> point to .list with no arguments?
21:53 * grondilu suddenly vaguely remembers it doesn't.
21:54 ChristopherBotto skink: I meant, why do you check $one OR $two? Shouldn't they both hold the same number of bytes?
21:54 sortiz skink, https://github.com/skinkade/crypt-random/​blob/master/lib/Crypt/Random/Extra.pm6#L4  # Not needed now ;-)
21:56 ChristopherBotto skink: I meant, here (thanks sortiz for showing how to quote line numbers on github). https://github.com/skinkade/crypt-​random/blob/master/t/01-buf.t#L11
21:56 Khisanth joined #perl6
21:57 * grondilu finds out it's ZEN-POS
21:57 grondilu m: say class { method ZEN-POS { <foo bar> } }.new[]
21:57 camelia rakudo-moar 40a953: OUTPUT«(foo bar)␤»
21:58 ZoffixWin :o
21:58 lizmat ChristopherBotto: you can actually do: signal(SIGTERM,SIGINT).act: { exit 1 }
21:59 skink ChristopherBotto, Yeah that should be &&
21:59 lizmat I have no idea what could be causing the spurious error... perhaps running it with --ll-exception might help ?
21:59 skink sortiz, That's in a cleanup commit I forgot to push
22:03 sortiz skink, You can pass a pre-allocated Buf to NC functions and avoid the CArray, for example: sub SystemFunction036(Buf, uint64) is 'native'; my $bytes=Buf.allocate($len); SystemFunction036($bytes,$len).
22:03 dvinciguerra_ joined #perl6
22:05 ChristopherBotto lizmat: Thanks!
22:06 * sortiz I need to add some doc in NC about Blob/Buf uses…
22:07 sufrostico joined #perl6
22:13 skink sortiz, Neat, I'll try it out
22:17 skink sortiz, Which would also render the carray-to-buf unneeded
22:20 sortiz skink, yep. For native types, using preallocated bufs is better that CArray. Think in Buf[foo].allocate as Perl6's calloc.
22:21 skink So Buf[uint8].allocate?
22:21 sortiz Buf by default is Buf[uint8] :-)
22:21 skink Alrighty then
22:22 skink pushed
22:22 lizmat m: dd Buf.allocate(5)
22:22 camelia rakudo-moar 40a953: OUTPUT«Buf.new(0,0,0,0,0)␤»
22:22 lizmat m: dd Buf[int8].allocate(5)
22:22 camelia rakudo-moar 40a953: OUTPUT«Buf[int8].new(0,0,0,0,0)␤»
22:22 lizmat m: dd Buf[uint8].allocate(5)
22:22 camelia rakudo-moar 40a953: OUTPUT«Buf[uint8].new(0,0,0,0,0)␤»
22:22 lizmat hmmm
22:23 * lizmat goes to sleep over this
22:23 lizmat good night, #perl6!
22:23 sortiz o/ lizmat
22:23 sortiz m: Buf.new.of.say;
22:23 camelia rakudo-moar 40a953: OUTPUT«(uint8)␤»
22:26 skink Anything else?
22:28 sortiz Yep, in general native types are faster, so when possible use uint64 over UInt64.
22:29 skink I figured.
22:30 sortiz Moreover UInt and variants are subtypes so even there are more expensive.
22:31 skink I was wondering what the performance impact of those was. Comparison for every value?
22:32 sufrostico joined #perl6
22:33 sortiz See ZoffixWin++ latest blog.
22:34 skink I read that earlier. It has native types but not subsets.
22:35 skink sortiz, Because left-shift adding was faster than .unpack() I had decided to return Int for random(_uniform). Should I change that behavior?
22:35 sortiz Ahh, Are you talking about the subtypes, yes, every assignation should be checked.
22:36 sortiz skink, dunno for that particular case, so you should benchmark that.
22:38 * sortiz need a coffee, bbl
22:42 skink Well that spouts an error trying to <+= and += the uint64, and returning and taking uint64 makes a whopping 1% performance difference
22:43 skids joined #perl6
22:43 Sgeo joined #perl6
22:47 sortiz The error can be a bug, I've seen other. And %1 not worth it.
22:48 skink I'm defaulting to 32bit to mimic arc4random()'s native behavior, but I like the idea of being able to return 8/16/32/64/any from a single short function.
22:50 skink Taking a uint64 is actually optimal though, since that's actually the number of bytes.
22:56 skink sortiz, Think the module's ready to add to the list?
22:57 sortiz Sure!
22:57 dalek DBIish: 3c302e5 | (Salvador Ortiz)++ | t/27-mysql-datetime.t:
22:57 dalek DBIish: travis-ci: Try a different mysql SQL type
22:57 dalek DBIish: review: https://github.com/perl6/DBIish/commit/3c302e5c4c
22:58 skink Sweet :D
22:58 sufrostico joined #perl6
22:59 sortiz skink, Totally unrelated: are you in linux? if so, what distro are you using?
23:00 skink Ubuntu atm
23:00 sortiz Version?
23:00 skink 14.04
23:05 sortiz Thanks, I need help from someone with 12.04 (Precise)
23:06 Timbus how involved is it? i have a VPS using 12.04
23:10 kid51 joined #perl6
23:11 sortiz Timbus, not code related, but mysql related. Seems (via travis-ci) that mysql shipped with Precise don't like DATETIME with precision as a column definition.
23:11 Timbus hmmm let me see if it has mysql. i think i opted for pgsql for my wordpress
23:12 Timbus nope it has mysql. what you need me to copy/paste for ya
23:12 Timbus hopefully SQL?
23:14 sortiz can you successfully create a table like: 'CREATE TABLE test( date DATETIME(6))' ?
23:21 Timbus ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6))' at line 1
23:21 Timbus sorry, was semi-afk
23:21 Timbus hope that helps?
23:25 sortiz Timbus, Yep, that confirm my suspicions. Is version related, my 10.0.23.MariaDB accepts that without problems. Thank you.
23:25 kerframil joined #perl6
23:28 kid511 joined #perl6
23:28 BenGoldberg joined #perl6
23:28 sortiz So no DATETIME with subsecond precision support in DBIish for legacy mysql. :-)
23:32 BenGoldberg joined #perl6
23:35 skink Can someone confirm whether or not I'm crazy?
23:35 skink http://cvsweb.openbsd.org/cgi-bin/cvsweb/~c​heckout~/src/lib/libc/crypt/arc4random_unif​orm.c?rev=1.2&amp;content-type=text/plain
23:35 skink >min = -upper_bound % upper_bound;
23:35 skink Won't that always be 0?
23:37 perlawhirl joined #perl6
23:37 teatime as far as I can see..
23:39 teatime the return for upper_bound < 2 is also weird.. wouldn't 1 be a valid upper bound?
23:40 skink It's exclusive, so if you set upper_bound to 1 it can only possibly return 0
23:40 skink So it just skips the math
23:40 teatime oh ok
23:40 skink And an upper_bound of 0 would just break it
23:41 teatime yeah it does explicitly say [0, upper_bound) doesn't it
23:42 teatime you know, I've seen algos for exactly this that didn't require recursion (non-deterministically-deep recursion, even)
23:44 teatime oh nm
23:44 teatime I quit, I can't read today
23:46 teatime skink: if you say unary - on a uint32 what type does it get upgraded to?
23:47 teatime a longer signed int type?  I don't know the answer, but if it's something unexpected maybe it's just very 'clever' code that does something useful.
23:49 skink m: my uint32 $test = 93; say -$test;
23:49 camelia rakudo-moar 40a953: OUTPUT«-93␤»
23:51 teatime heh, I don't think you can use perl to answer that question.
23:51 Khisanth joined #perl6
23:53 timotimo m: my uint32 $test = 93; my uint32 $other = -$test; say $other
23:53 camelia rakudo-moar 40a953: OUTPUT«4294967203␤»
23:53 teatime apparently unary minus on an unsigned type does something surprising
23:54 teatime ^^
23:54 timotimo we don't keep unsignedness around for you
23:55 skink Hm...
23:56 johndau joined #perl6
23:56 teatime m: my uint32 $test = 93; my uint32 $other = ~ $test; say $other
23:56 camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Unknown coercion case for str; got: 19␤»
23:58 teatime m: my uint32 $test = 93; my uint32 $other = +^ $test; say $other
23:58 camelia rakudo-moar 40a953: OUTPUT«4294967202␤»
23:58 timotimo oh my
23:58 timotimo yeah, for 2's complement you have to add 1
23:58 wamba joined #perl6
23:58 skink So if I wanna use an Int as input I'll have to emulate that behavior in a different way.
23:59 teatime I was actually trying to see if http://www.codingstandard.com/rule/5-3-1-do-not-​apply-unary-minus-to-operands-of-unsigned-type/ were actually equivalent operations.
23:59 timotimo yeah, i think our UInt is just Int with a refinement that complains if it's a negative value
23:59 skink Well, I'm dumb.
23:59 skink /* 2**32 % x == (2**32 - x) % x */
23:59 skink It's right there.
23:59 teatime I saw that comment, but it was insufficient to explain the code to me.
23:59 skink They were using it as a faster shorthand.

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

Perl 6 | Reference Documentation | Rakudo