Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-07-28

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:04 mcmillhj joined #perl6
00:05 sufrostico joined #perl6
00:12 Sgeo joined #perl6
00:23 cyphase joined #perl6
00:24 xenu joined #perl6
00:25 xenu code examples at perl6.org have messed up formatting
00:26 xenu i can fix it, i have a commit bit
00:26 xenu but the question is 4 spaces or 2 spaces?
00:27 xenu before commit that broke it, first example had two spaces and third one had four spaces
00:27 xenu (second doesn't need any indenation)
00:27 xenu indentation*
00:27 MasterDuke average it out then, 3
00:28 xenu nah, (4+2+0)/3 == 2
00:29 MasterDuke well, my non-joking vote is 4
00:29 mcmillhj joined #perl6
00:41 mcmillhj joined #perl6
00:42 BenGoldberg joined #perl6
00:42 mantovani joined #perl6
00:47 dainis joined #perl6
00:50 wamba joined #perl6
00:52 mcmillhj joined #perl6
00:56 dalek perl6.org: 5617d84 | (Tomasz Konojacki)++ | source/index.html:
00:56 dalek perl6.org: normalize code snippets indentation (4 spaces)
00:56 dalek perl6.org: review: https://github.com/perl6/p​erl6.org/commit/5617d84a14
00:56 xenu went with 4 spaces, i prefer it that way too
01:02 bob777 joined #perl6
01:03 labster joined #perl6
01:03 webstrand joined #perl6
01:08 Actualeyes joined #perl6
01:09 adu joined #perl6
01:09 mcmillhj joined #perl6
01:15 BenGoldberg m: gather { take 42 }; 43;
01:15 camelia rakudo-moar 8ede35: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 43 in sink context (line 1)␤»
01:15 BenGoldberg Why doesn't gather in sink context warn?
01:23 cibs joined #perl6
01:24 TEttinger joined #perl6
01:24 cyphase joined #perl6
01:24 mohae_ joined #perl6
01:26 cognominal joined #perl6
01:31 timotimo m: gather { say "hi"; take 1; say "boo"; take 2; }; 99;
01:31 camelia rakudo-moar 8ede35: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 99 in sink context (line 1)␤hi␤boo␤»
01:31 timotimo ^- because sinking a gather executes its contents
01:32 canopus joined #perl6
01:33 zacts joined #perl6
01:40 mcmillhj joined #perl6
01:50 johndau joined #perl6
01:52 mcmillhj joined #perl6
02:08 holyghost joined #perl6
02:35 mcmillhj joined #perl6
02:39 noganex_ joined #perl6
02:49 mcmillhj joined #perl6
02:57 kaare__ joined #perl6
03:01 adu joined #perl6
03:02 molaf joined #perl6
03:05 mcmillhj joined #perl6
03:07 holyghost joined #perl6
03:20 Hotkeys p6 doesn't have TCO does it?
03:21 Hotkeys or rather rakudo
03:22 mcmillhj joined #perl6
03:51 Actualeyes joined #perl6
03:55 itaipu joined #perl6
03:56 nic joined #perl6
03:57 nicq Is anyone on ATM?
03:58 nicq Anyone know if there is an effort to add Rakudo with the moarVM to a package repo for Ubuntu or other distro?
04:07 mcmillhj joined #perl6
04:11 johndau joined #perl6
04:19 mcmillhj joined #perl6
04:20 tx0h joined #perl6
04:20 tx0h hello
04:20 gfldex m: say "ohai tx0h!"
04:20 camelia rakudo-moar 8ede35: OUTPUT«ohai tx0h!␤»
04:22 tx0h is there a way to check if a dbiish connection is still alive? i like to keep my connection persistent open but it may happen that the database server needs to restart but the $dbh isn't connected after the restart (of cause)
04:23 konobi query with SELECT 1 every so often =0)
04:24 tx0h ok, but is this select cheaper than setting up a new connection?
04:27 konobi yup
04:33 tx0h oh, but a do('select 1') also throws an error, error handling on dbiish isn't documented.
04:39 geekosaur .u 61612
04:39 yoleaux No characters found
04:48 Cabanossi joined #perl6
04:49 AlexDaniel joined #perl6
04:49 AlexDaniel please don't get angry about FAQ issues that I submit. I find it funny, hope you have a good laugh too.
04:54 tx0h ok, try..CATCH works well
04:56 tx0h i try to do my first perl6 web project :-)
05:00 xinming joined #perl6
05:05 labster joined #perl6
05:07 avis joined #perl6
05:13 mcmillhj joined #perl6
05:14 stmuk AlexDaniel: your comments are useful but I'm not keen on things being described as "weird".
05:20 AlexDaniel stmuk: Couldn't find any better word. Didn't try harder because I thought that the word choice there is not important
05:20 stmuk github seems totally broken anyway :/
05:20 AlexDaniel yeah, down
05:42 Roamer` hmm, is there any appreciable difference between for %hash{*}:kv and for %hash.kv?
05:43 TimToady the latter is likely to be a bit faster
05:45 TimToady (I could be wrong about that, of course.)
05:46 psch m: my %h = :1a, :2b, :3c; say %h{*}.kv eqv %h.kv
05:46 camelia rakudo-moar 8ede35: OUTPUT«False␤»
05:46 psch m: my %h = :1a, :2b, :3c; say %h{*}.kv.perl; say %h.kv.perl
05:46 camelia rakudo-moar 8ede35: OUTPUT«(0, 1, 1, 3, 2, 2).Seq␤("a", 1, "c", 3, "b", 2).Seq␤»
05:46 Roamer` erm, psch, {*}:kv, not {*}.kv
05:46 psch oh
05:46 psch my bad
05:46 TimToady oh, {*} is a list
05:46 psch m: my %h = :1a, :2b, :3c; say (%h{*}:kv).perl; say %h.kv.perl
05:46 camelia rakudo-moar 8ede35: OUTPUT«("a", 1, "c", 3, "b", 2)␤("a", 1, "c", 3, "b", 2).Seq␤»
05:47 Roamer` TimToady, would that be because the {*} has to build a list of the pairs first and then iterate over them, and the .kv just starts iterating?
05:47 Roamer` yeah, looks that way, thanks to you both
05:48 TimToady :kv may have to check each key to see that it exists, unless it's smart about * producing all existing keys
05:48 ufobat joined #perl6
05:48 TimToady it it's smart enough, it could just translate {*}:kv to .kv though
05:51 ufobat good morning p6 :-)
05:52 TimToady o/
05:52 agent_white joined #perl6
06:02 tx0h what i really don't like are the nuance differences between p5 and p6. the space between if and ( for instance, or the asterisk in %*ENV...
06:04 TimToady it's all in the interests of namespace management for extensibility
06:04 TimToady keywords are not functions, so you may not call a keyword as if it were one
06:04 CIAvash joined #perl6
06:04 TimToady that let's us add keywords or functions independently
06:05 TimToady *lets
06:05 TimToady likewise you don't have to know that ENV is special, the * tells you that it's a dynamic/global variable
06:05 TimToady in p5 you have to memorize the list of special symbols
06:07 tx0h but you have to agree that these differences are annoying. especially if you you program in both languages parallel
06:07 TimToady everything is annoying, if you let it :)
06:09 canopus joined #perl6
06:10 tx0h i hope for a epic6 or such alike module for eclipse, that would be great.
06:14 flaviusb joined #perl6
06:17 dogbert2 joined #perl6
06:24 nemo joined #perl6
06:24 domidumont joined #perl6
06:27 mcmillhj joined #perl6
06:28 firstdayonthejob joined #perl6
06:28 labster joined #perl6
06:29 darutoko joined #perl6
06:33 stmuk I always found if( annoying in perl 5
06:36 tx0h stmuk: you didn't got forced to don't use a whitespace
06:38 tx0h use or not use whitespaces is part of freedom of expression. thats why i don't like the python block concept, where whitespaces are part of the syntax. now p6 follows this idiocracy
06:42 mcmillhj joined #perl6
06:42 johndau joined #perl6
06:44 stmuk https://github.com/FROGGS/p6-Slang-Tuxic may be of interest
06:44 domidumont joined #perl6
06:48 domidumont joined #perl6
06:50 tx0h yepp, there are some approaches
06:50 tx0h ty
06:51 tx0h this already shows that there is a problem (even if it is a psychological)
06:51 * TimToady yawns
06:52 johndau joined #perl6
06:56 tx0h sry
06:57 mcmillhj joined #perl6
06:59 canopus joined #perl6
07:08 domidumont joined #perl6
07:09 mcmillhj joined #perl6
07:18 canopus joined #perl6
07:20 rindolf joined #perl6
07:23 avis joined #perl6
07:24 mcmillhj joined #perl6
07:29 abraxxa joined #perl6
07:35 domidumont joined #perl6
07:36 avis left #perl6
07:37 cyphase joined #perl6
07:39 freeside joined #perl6
07:39 mcmillhj joined #perl6
07:43 RabidGravy joined #perl6
07:47 wamba joined #perl6
07:51 Roamer` I guess there wouldn't really be a way to uninstall a single installed module (or even a module and everything that depends on it) from a repository
07:51 Roamer` is there then a way to blow away everything that has been installed by panda?
07:51 Roamer` of course I can rakudobrew nuke and then build again, but is there a faster way?
07:52 DrForr That's more of a package-manager thing.
07:56 moritz Roamer`: I think zef supports uninstallation, or something
07:58 dakkar joined #perl6
07:59 Roamer` moritz, ahh, I guess it's time I actually tried a different package manager.  Okay, thanks
07:59 mcmillhj joined #perl6
08:04 lizmat TimToady: so $supply.emit --> Nil, what about sub emit ?
08:04 lizmat Making that also --> Nil breaks some expectations, I'm afraid
08:05 lizmat however, I would be all for it, as it would allow for easier / better optimisations
08:09 ufobat joined #perl6
08:09 mcmillhj joined #perl6
08:10 pmqs joined #perl6
08:16 dj_goku joined #perl6
08:16 dj_goku joined #perl6
08:21 stmuk Roamer`: zef has module uninstall
08:21 stmuk as moritz says
08:21 mcmillhj joined #perl6
08:22 stmuk me-- # not fully reading scrollback
08:25 zakharyas joined #perl6
08:26 vendethiel joined #perl6
08:34 mcmillhj joined #perl6
08:36 ParsonsNose joined #perl6
08:46 mcmillhj joined #perl6
08:46 sno joined #perl6
08:47 nowan_ joined #perl6
08:52 mr-foobar joined #perl6
08:53 mr-fooba_ joined #perl6
08:54 domidumont joined #perl6
09:00 Poisson joined #perl6
09:01 salv0 joined #perl6
09:16 telex joined #perl6
09:32 kurahaupo joined #perl6
09:35 kurahaupo joined #perl6
09:37 ribasushi joined #perl6
09:41 domidumont joined #perl6
09:43 zakharyas joined #perl6
09:45 ChoHag joined #perl6
10:02 zakharyas1 joined #perl6
10:12 ismailarilik joined #perl6
10:12 ismailarilik Hi!
10:12 ismailarilik I has seen this error message:
10:12 ismailarilik ===SORRY!=== Unable to write bytecode to 'C:\Users\ismail\Öğretmen\lib\.precomp\03419F43B​FFCE0AEDE2CD622AE91E8513382EF49.1468939074.63395​\A3\A3416250288174506BE179C4BE847ECCB7196C9A.bc'
10:14 xescugc joined #perl6
10:14 ismailarilik I have two related files: lib\model.pm6 and bin\komut-arayüzü.p6
10:14 ismailarilik The first line of lib\model.pm6: unit module Model;
10:15 ismailarilik The first line of bin\komut-arayüzü.p6: use Model;
10:15 tx0h joined #perl6
10:16 ismailarilik I run bin\komut-arayüzü.p6 file on the project directory with this command: perl6 -I "lib" bin\komut-arayüzü.p6
10:16 ismailarilik Where am I wrong?
10:18 molaf joined #perl6
10:18 psch ismailarilik: the problem is that the perl6 executable can't open the file for writing
10:19 psch ismailarilik: that's more likely to be a permission problem in your operating system than a bug in your Perl 6 code
10:19 ismailarilik The project directory is in my home directory
10:19 ismailarilik C:\Users\ismail\Öğretmen>perl6 -I "lib" bin\komut-arayüzü.p6
10:20 ismailarilik Is it related with a encoding problem?
10:20 psch possibly
10:21 psch i don't know how windows/ntfs encodes paths
10:21 ismailarilik Okay, I will use ASCII for files and directories and try again
10:21 psch in any case, the error you're getting is from the VM backend and happens if the call to fopen fails
10:21 hwcomcn joined #perl6
10:23 ismailarilik Command has worked on this directory: C:\Users\ismail\Ogretmen
10:23 ismailarilik So it is related with an encoding problem.
10:23 ismailarilik Thanks a lot. =)
10:27 psch ismailarilik: what's your filesystem?
10:27 ismailarilik I guess it is NTFS
10:28 ismailarilik How I can learn it precisely?
10:29 psch right click on the partition and click "Properties"
10:29 psch your system encoding probably also plays a role
10:30 psch ntfs internally encodes as utf16, and we encode the filename as utf8, so that might be it already
10:30 psch we do have a dev on windows, but i assume they're pretty anglocentric in path and filenames :)
10:36 ismailarilik I have looked up
10:36 ismailarilik It is NTFS
10:37 ismailarilik I created all these files, not fetched from a VCS host, for ex. GitHub.
10:43 Vazyla joined #perl6
10:58 mniip $ perl6 test.pl6
10:58 mniip Segmentation fault (core dumped)
10:58 mniip I suppose that's not something that's supposed to happen
11:00 gfldex ismailarilik: git and shares don't mix well. Make sure you don't got any anything, including the temp dir on a share, before you write a bug report.
11:00 masak mniip: you suppose correctly
11:00 gfldex mniip: please rakudobug
11:01 jnthn Well, unless you did something silly with nativecall :)
11:02 mniip nah I was doing a some pretty primitive messing around
11:02 mniip and I think I accidentally multi'ed a builtin
11:02 jnthn hm, most of 'em are multis. But yeah, file it :)
11:06 mniip https://bpaste.net/show/25676c934f42
11:07 gfldex https://gist.github.com/gfldex/4​91d637082df050f825f8a7adcd2746c
11:08 gfldex m: https://gist.github.com/gfldex/4​91d637082df050f825f8a7adcd2746c
11:08 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:09 gfldex m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @ (), @ys) { (); }
11:09 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:09 gfldex m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @, @ys) { (); }
11:09 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:09 gfldex m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @, @ys) {}
11:09 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:10 gfldex m: multi cross(&f, @ ($x, *@xs), @ys) {}; multi cross(&f, @, @ys) {}
11:10 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:10 gfldex m: multi cross() {}; multi cross() {}
11:10 camelia rakudo-moar 7f9623: OUTPUT«(signal SEGV)»
11:10 gfldex m: multi cross() {};
11:10 camelia rakudo-moar e87752: OUTPUT«(signal SEGV)»
11:11 mniip haha
11:11 gfldex that may be the shortest segfault we ever had :)
11:16 masak no, I think we've had shorter ones
11:17 masak diakopter++ holds some hard-to-beat records in that department
11:17 gfldex mniip: please rakudobug the golfed version
11:18 cibs joined #perl6
11:18 mniip I guess I can golf it a but further
11:18 mniip m: multi cross{}
11:18 camelia rakudo-moar e87752: OUTPUT«(signal SEGV)»
11:20 masak src/core/List.pm:my &cross = &infix:<X>;
11:20 masak that's the declaration
11:20 masak hm...
11:20 masak m: my &foo = &infix:<X>; multi foo{}
11:20 camelia rakudo-moar e87752: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Redeclaration of routine foo␤at <tmp>:1␤------> 3my &foo = &infix:<X>; multi foo{}7⏏5<EOL>␤»
11:20 masak m: my &foo = &infix:<X>; { multi foo{} }
11:20 camelia rakudo-moar e87752: ( no output )
11:21 masak ok, hypothesis disproved
11:21 mniip um
11:21 mniip crashes over here
11:21 masak not here
11:22 masak This is Rakudo version 2016.07.1-57-g0419194 built on MoarVM version 2016.07-3-gc01472d
11:22 mniip This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
11:22 masak bisectable: my &foo = &infix:<X>; { multi foo{} }
11:22 bisectable masak: On both starting points the exit code is 0 and the output is identical as well
11:22 bisectable masak: Output on both points:
11:22 masak bisectable says it works always :)
11:22 bisectable masak: On both starting points the exit code is 1 and the output is identical as well
11:22 bisectable masak: Output on both points: ===SORRY!=== Error while compiling /tmp/NsiSKwsZ9p␤Preceding context expects a term, but found infix : instead␤at /tmp/NsiSKwsZ9p:1␤------> says it works always :<HERE>)
11:22 masak oh come on, bisectable
11:23 masak bisectable: help
11:23 bisectable masak: Like this: bisectable: good=2015.12 bad=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # RT128181
11:23 masak bisectable: url?
11:23 bisectable masak: On both starting points the exit code is 1 and the output is identical as well
11:23 bisectable masak: https://gist.github.com/1417​c4b529e8c813d693d0e45f8e4df6
11:23 * masak finds https://github.com/perl6/bisectbot
11:24 mniip !
11:24 mniip it crashes if you enter it as two lines into the repl
11:25 TEttinger joined #perl6
11:26 lizmat fwiw, I'm testing a fix on the segv
11:29 masak aha -- https://metacpan.org/source/HINRIK/Bot-​BasicBot-0.89/lib/Bot/BasicBot.pm#L669 means that the ":" is optional after "bisectbot"
11:29 masak I think I have what I need to put together a patch
11:32 lizmat 998a1ef has a fix for the "multi cross" segv
11:44 mniip gfldex, perhaps I'm eligible for "least time spent with perl to make it crash" because I literally only started figuring out the language yesterday
11:46 El_Che mniip: you figured out perl? :)
11:47 masak yes, do tell :P
11:47 lizmat mniip++  # but now it doesn't crash anymore  :-)
11:47 mniip El_Che, I can't say I did that yet
11:48 mniip so far I'm not seeing the large scale idea
11:48 mantovani joined #perl6
11:55 maddingue joined #perl6
11:57 Actualeyes joined #perl6
12:00 kid51 joined #perl6
12:00 mantovani joined #perl6
12:00 gfldex mniip: quite a few things are not implemented yet. You can't have autothreading if your threading stuff produces odd behaviour including segfaults.
12:03 jkramer joined #perl6
12:03 jkramer Ahoy!
12:03 kid511 joined #perl6
12:04 jkramer How can I re-export used modules from a module? Or just some stuff from a module? Is there something like 'use SomeModule is export;'?
12:05 gfldex jkramer: see: https://docs.perl6.org/language/modules#EXPORT
12:06 itaipu joined #perl6
12:07 dalek doc: bd72f04 | (Wenzel P. P. Peppmeyer)++ | doc/Language/modules.pod6:
12:07 dalek doc: add sub EXPORT to index
12:07 dalek doc: review: https://github.com/perl6/doc/commit/bd72f04ff6
12:13 mniip lizmat, hmm, are those builtin modules somehow special?
12:14 mniip is there something preventing us from doing a similar setup with something different from cross
12:16 mniip ah I see you created an issue on moarvm
12:18 [Coke] table of contents hide/show is broken for me on chrome, os x, https://docs.perl6.org/type/AST
12:19 mantovani joined #perl6
12:21 Ulti if I wanted a sliding window over a list is there a nice builtin for it? so the list (1,2,3,4) I would want returned for a window of 2 ((1,2),(2,3),(3,4))
12:21 Ulti rotor but on a position rather than value is sort of that thing
12:22 [Coke] ok, reload makes it work, but now the hide is silly - it just blanks it out, doesn't free up any space.
12:22 * [Coke] finds/opens a ticket. :|
12:24 * [Coke] bumps https://github.com/perl6/doc/pull/767 - my recommendation is to revert for now.
12:24 jnthn m: say (1,2,3,4).rotor(2, -1)
12:24 camelia rakudo-moar aa5e49: OUTPUT«===SORRY!===␤Cannot have elems < 1, did you mean to specify a Pair with => -1?␤»
12:24 jnthn m: say (1,2,3,4).rotor(2 => -1)
12:24 camelia rakudo-moar aa5e49: OUTPUT«((1 2) (2 3) (3 4))␤»
12:24 jnthn Ulti: ^^
12:27 Ulti thats neat
12:27 Ulti I just came up with one that invokes a scary error! :D
12:27 Ulti m: say (2,3,4).combinations.grep: 1 < *.elems < 3
12:27 camelia rakudo-moar aa5e49: OUTPUT«===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
12:27 Ulti wat
12:27 Ulti m: say (2,3,4).combinations.grep: 1 < *.elems
12:27 camelia rakudo-moar aa5e49: OUTPUT«((2 3) (2 4) (3 4) (2 3 4))␤»
12:28 Ulti not what I wanted
12:28 Ulti but its an interesting error
12:28 Ulti thanks jnthn
12:28 jnthn wat
12:28 jnthn Yeah, indeed it is
12:28 Ulti I'll take your solution and give you a bug ;)
12:28 Ulti feels fair
12:28 jnthn Dammit :P
12:28 jnthn otoh, at least it's not another concurrency bug :)
12:28 shillo joined #perl6
12:28 Ulti yeah and it came ready golfed
12:29 jnthn :)
12:29 jnthn m: 1 < *.elems < 3
12:29 camelia rakudo-moar aa5e49: OUTPUT«===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
12:29 jnthn Golfeder
12:29 Ulti golfest
12:29 shillo Hey, is this a known problem? Pushing into large arrays (>4M elemenets) seems to have square complexity
12:30 shillo For instance, small arrays:
12:30 shillo perl6 -e 'my @a; @a.push($_) for ^1000000'  0.99s user 0.06s system 99% cpu 1.052 total
12:30 shillo perl6 -e 'my @a; @a.push($_) for ^2000000'  2.08s user 0.08s system 99% cpu 2.163 total
12:30 shillo perl6 -e 'my @a; @a.push($_) for ^4000000'  4.72s user 0.12s system 99% cpu 4.845 total
12:30 shillo .. and then larger ones:
12:30 shillo perl6 -e 'my @a; @a.push($_) for ^8000000'  12.25s user 0.22s system 99% cpu 12.482 total
12:30 jnthn shillo: Yes, every time it resizes it has to copy. It doens't know how many elements you're going to have up front.
12:30 shillo perl6 -e 'my @a; @a.push($_) for ^16000000'  36.75s user 0.53s system 99% cpu 37.346 total
12:31 shillo perl6 -e 'my @a; @a.push($_) for ^32000000'  124.53s user 1.17s system 99% cpu 2:05.91 total
12:31 shillo yeah, but if you allocate double size from the original, that gives you linear amortized
12:31 shillo ... and it'd happen for small arrays, too, unless you start resizing into smaller sizes than double
12:33 jnthn I don't think it doubles every time.
12:33 jnthn I think it does that up to a point
12:33 jnthn And then goes in smaller increments
12:33 * jnthn checks
12:33 TEttinger joined #perl6
12:34 jnthn https://github.com/MoarVM/MoarVM/blob/m​aster/src/6model/reprs/MVMArray.c#L318
12:35 jnthn We *could* change it to just double every time, though that is of course a trade-off.
12:36 shillo yeah, I think it's the right choice because if you've gone up to 10M, what's the chance you'll stop anytime soon? But YMMv.
12:36 itaipu joined #perl6
12:36 shillo ... OTOH, one way to optimize would be to know what's the chunk size that malloc can accomodate without its own overhead
12:36 shillo ... Moar uses system malloc, though? Or its own?
12:37 jnthn System malloc once you're at that size.
12:37 shillo ok :)
12:38 mniip at that size it's time to call mmap though
12:38 shillo ... by choosing I mean something that's double, then round to closest that fits malloc prefered chunk size (which tends to be mmap page size - malloc headers size)
12:39 shillo ... the mallocs I looked at do just that, mniip. They just substract a few words for headers.
12:40 mniip I wrote an allocator that did nothing but mmap once
12:40 shillo a number of mallocs will mmap when they run out, and will return the completely empty mmaped pages to the OS
12:41 mniip it was fun to see lua consume hundreds of megabytes for simple tasks
12:42 shillo Oh, just pure mmap? Fun :)
12:42 mniip yeah, whole page for even 1 byte allocations
12:42 trnh joined #perl6
12:42 trnh joined #perl6
12:44 shillo jnthn: about doubling always, statistically you'll only be wasting 25% memory on average. Because the first half arrived from copy, and will be full, then (if the array sizes are random) the second half will end at a random spot
12:44 jnthn I'm not sure what the full history on that code is. I know that I took it from the QRPA implementation that pmichaud did on Parrot, but I don't know what that was inspired by. I've no idea what Perl 5 does, though somebody here probably does. :)
12:44 shillo jnthn: So the fill will be 50%-100%, with not-that-much waste.
12:45 jnthn I'd be fine with a patch to change it, if somebody wants to try tweaking it and do measurements to see if it's an improvement.
12:45 timotimo the problem about "always double" is when you reach half the size of your user's RAM
12:46 timotimo you'll try to double, but hit the ceiling, and stay at only half
12:46 jnthn tbh, if you're dealing with that much data you maybe want to think your problem through a tad more than using a dynamic array. ;)
12:46 timotimo right; like for the code above you'd probably want a native array to conserve some more memory
12:46 jnthn Yeah, the heap analyzer uses native arrays to good effect :) It's good if your data is integers.
12:47 jnthn Or floats
12:47 TEttinger joined #perl6
12:47 timotimo also, pushing a bunch of boxed values into the same array is pessimal for our GC, as the amount of objects that go on to the gen2 is far too large
12:47 shillo .... just looking at benchmark, it's not quadratic, in any case.
12:47 shillo timotimo: Well, yes, but with quadratic complexity, you'll run out of time long before you run out of RAM
12:47 jnthn timotimo: Yeah, there is that, though GC only runs so often :)
12:47 timotimo does realloc allow you to recover when it couldn't malloc enough space?
12:48 jnthn But yeah, pre-tenuring is an interesting thing for the future.
12:48 timotimo yup
12:49 timotimo using @a.push($_) for ^1_000_000 gives me 46 GC runs, 3 of which are full
12:49 shillo jnthn: I think I remember you made GC always double the last generation size, so GC is not the problem
12:49 timotimo 14.62% spent in GC :)
12:49 shillo (... and I read the GC source, so...)
12:49 Actualeyes left #perl6
12:50 jnthn shillo: Yes, but the first generation is fixed in size and because everything gets a second stay in GC before promotion, then you'll end up with a collection that frees little, then one that promotes a lot, and vice versa
12:50 jnthn um, vice versa wasn't what I wanted
12:50 shillo yeah, I know
12:50 jnthn But anyway, that pattern.
12:50 shillo ... but that's normal for generational GCs when you allocate a lot
12:50 jnthn Yup
12:50 shillo ... I don't see that as a problem
12:51 timotimo http://imgur.com/TBSr6fQ
12:51 gregf_ where does the sub/method 'cross' get picked from?
12:51 timotimo "picked"?
12:52 shillo jnthn: Mind you, I don't see a series of pushes to be the best pattern for most applications, but it will be idiomatic for people coming from either perl5 or C++/STL
12:52 gregf_ i thought that the same sefault should get thrown for evey global function thats overridden :|
12:52 gregf_ er, picked == "called" # :/ sorry, my bad
12:52 gregf_ s/evey/every/
12:53 gregf_ s/sefault/segfault/
12:53 jnthn shillo: Yeah, the interesting work in this area is dynamic profiling of allocation sites, to see which things tend to end up getting promoted reliably and then compiling their allocations to always be directly in the old generation.
12:53 timotimo gregf_: you should be able to figure it out by looking at the commit that fixed the problem
12:53 shillo jnthn: Interesting. :)
12:53 timotimo https://github.com/rakudo/rakudo/commit/998a1ef168
12:54 gregf_ timotimo: cool, ta
12:54 shillo timotimo: I'm still not sure it's good to slow down very badly for arrays of ~10M elements in order to not run out of memory with arrays around 200M-1000M elements.
12:55 jnthn We could just pick a much larger threshold
12:56 jnthn 8K elements isn't really very many given the memory size of modern computers :)
12:56 shillo timotimo: I mean, if you look at this as 'How much data I can handle before I need to change my program?', well.
12:56 timotimo If realloc() fails, the original  block  is
12:56 timotimo left untouched; it is not freed or moved.
12:56 timotimo ^- we should be able to compare the previous pointer value with the returned value and try smaller increases before giving up and throwing our hands in the air
12:57 timotimo if that's something you consider worth trying, anyway
13:00 shillo What exactly is ssize in that code? Because it doesn't seem to be a number of elements
13:00 shillo ... Had to go into milions before it started to slow down
13:00 jnthn storage size
13:00 jnthn The number of elements we can hold
13:01 mcmillhj joined #perl6
13:01 jnthn When we unshift, we ++ start, and -- elems
13:01 jnthn So unshift doesn't involve a memcpy
13:01 jnthn And can be cheap
13:01 perlpilot sounds just like Perl 5
13:01 shillo Uh, so why doesn't it slow down much sooner?
13:01 RabidGravy joined #perl6
13:01 jnthn Cache boundaries maybe?
13:02 jkramer What's the equivalent of $some_object->$method_name_in_variable in P6?
13:02 timotimo $some_object."$method_name_in_var"()
13:02 jkramer Thanks :)
13:02 timotimo YW
13:02 jnthn Once you get into the millions, then the memory associated with the array won't fit in any of the CPU caches any more
13:02 shillo True
13:03 jnthn And trips to main memory cost up to 100 times more than cache hits
13:03 timotimo and when you're copying stuff over, you're probably holding two arrays in cache
13:03 jnthn (For L1...for L3 "only" 5-10 times I guess...)
13:03 timotimo unless memcpy is clever enough somehow to skip writing to the cache and somehow writes directly to main memory?
13:03 timotimo or maybe it causes some DMA coprocessor to run?
13:03 timotimo i really have no idea how modern machines do such things
13:04 shillo Wait, no, I mean, it doesn't slow down at all. I just tried replacing 8192 with 81920000. The smallish case doesn't speed up even slightly.
13:04 jnthn How are you measruing?
13:04 jnthn *measuring
13:04 shillo Or wait, I'm blind. It does. :p
13:04 timotimo measruing wrnog, clearly
13:04 jnthn ah :)
13:05 shillo perl -e 'my @a; push @a, $_ for 0..20000000'  1.38s user 0.18s system 99% cpu 1.563 total
13:05 timotimo clraelry?
13:05 shillo No, that's perl5
13:05 shillo Duh, I pulled a wrong line from history
13:05 ptolemarch joined #perl6
13:07 timotimo m: $_ = "measuring wrong, clearly"; s[ <:Letter>+ ] = $/.comb.pick(*).join; .say
13:07 camelia rakudo-moar aa5e49: OUTPUT«geusrnami wrong, clearly␤»
13:07 timotimo m: $_ = "measuring wrong, clearly"; s:g[ <:Letter>+ ] = $/.comb.pick(*).join; .say
13:07 camelia rakudo-moar aa5e49: OUTPUT«agsmirnue ngwor, elyracl␤»
13:07 timotimo that's .. a bit radical :)
13:07 shillo jnthn: I think that realloc was the wrong place to look
13:07 timotimo m: $_ = "measuring wrong, clearly"; s:g[ <:Letter> ** 1..3 ] = $/.comb.pick(*).join; .say
13:07 camelia rakudo-moar aa5e49: OUTPUT«maeusrgin worgn, leclray␤»
13:07 shillo ... no speedup in any cases
13:08 shillo perl6 -e 'my @a; @a.push($_) for ^4000000'  4.76s user 0.12s system 99% cpu 4.883 total
13:08 shillo perl6 -e 'my @a; @a.push($_) for ^8000000'  12.29s user 0.24s system 99% cpu 12.536 total
13:08 jnthn No shenanigans like "forgot to make install"?
13:08 shillo (that's with if (ssize < 819200000) {)
13:09 shillo No, but I only did make install on Moar
13:09 timotimo you know when i said "14.62% spent in GC"?
13:09 shillo ... I assume I don't need to rebuild nqp/rakudo?
13:09 jnthn That should be enough
13:09 timotimo i 10x'd the amount of pushes and gc went up to 35.02%
13:09 AndyBotwin joined #perl6
13:09 timotimo The average nursery collection time was 23.4ms. The average full collection time was 145.93ms.
13:09 timotimo the last full collection took 371 ms
13:11 timotimo that wouldn't cause the time to go quadratic, but it's kinda bad :)
13:11 unmatched} m: sub foo { say <foo bar ber>.map: * ~ "_" x $++ }; foo; foo; foo
13:11 camelia rakudo-moar aa5e49: OUTPUT«(foo bar_ ber__)␤(foo___ bar____ ber_____)␤(foo______ bar_______ ber________)␤»
13:12 unmatched} m: sub foo { say <foo bar ber>.map: { $_ ~ "_" x $++ } }; foo; foo; foo
13:12 camelia rakudo-moar aa5e49: OUTPUT«(foo bar_ ber__)␤(foo bar_ ber__)␤(foo bar_ ber__)␤»
13:12 perlpilot timotimo: What's it look like for unshift rather than push?
13:12 skids joined #perl6
13:12 * perlpilot guesses it's worse
13:12 timotimo for GC? should be the same
13:12 shillo Oh, *facepalm*
13:12 unmatched} So the WhateverCode doesn't get treated as its own block for the anon vars?
13:12 jnthn Doubt it
13:12 timotimo unmatched}: there's no curlies, so there's no lexical scope, nor a block
13:12 moritz correct
13:12 shillo ... this is fast because realloc reserves a *lot* more than you asked
13:12 unmatched} Thanks
13:13 shillo ... and in most cases doesn't trigger a copy
13:13 timotimo it's valuable to keep that as a simple rule
13:14 shillo I put a printf("%ld %ld %ld\n", ssize, slots, slots_old); after realloc (and saved slots into slots_old) and got that it copies... rarely. Basically when you double the size, until it hits a limit size
13:15 shillo I mean, when you hit double the size of the last copy, until a limit set in realloc implementation.
13:15 timotimo cool
13:16 literal is there a way to force Panda to use https as the git protocol when building Rakudo Star?
13:16 timotimo i think we have GIT_PROTOCOL support in some places
13:16 timotimo however, rakudo star is supposed to install stuff from the files we ship along with it
13:16 literal both NQP and Rakudo default to https, but Panda doesn't for some modules
13:17 timotimo without hitting the 'net
13:17 literal my build is dying because it's trying to clone a git:// repository from github (moritz/svg.git)
13:17 shillo timotimo: Not really cool, because this relies on a particular malloc implementation to work in linear time for even smallish arrays.
13:18 timotimo oh
13:18 timotimo well, fair enough
13:19 * timotimo installed 8 gigs of swap space so the next 10x can hopefully finish
13:20 gfldex literal: you can force git to do that, ask google how
13:21 perlpilot pretty sure panda groks GIT_PROTOCOL
13:23 timotimo here comes the swap
13:23 timotimo my music is suffering from it already
13:24 tadzik pretty sure panda coined it :)
13:25 dalek doc/revert-767-animated_css: feb4798 | Altai-man++ | / (2 files):
13:25 dalek doc/revert-767-animated_css: Revert "Css-based TOC animation"
13:25 dalek doc/revert-767-animated_css: review: https://github.com/perl6/doc/commit/feb479880c
13:25 [Coke] perlpilot: yes it does, I use it all the time
13:27 dalek doc: feb4798 | Altai-man++ | / (2 files):
13:27 dalek doc: Revert "Css-based TOC animation"
13:27 dalek doc: review: https://github.com/perl6/doc/commit/feb479880c
13:27 dalek doc: 5f09019 | Altai-man++ | / (2 files):
13:27 dalek doc: Merge pull request #774 from perl6/revert-767-animated_css
13:27 dalek doc:
13:27 dalek doc: Revert "Css-based TOC animation"
13:27 dalek doc: review: https://github.com/perl6/doc/commit/5f0901939c
13:28 BronsonFlorence joined #perl6
13:28 dalek doc: f151451 | Altai-man++ | html/css/style.css:
13:28 dalek doc: Delete remainder of https://github.com/perl6/doc/pull/774
13:28 dalek doc: review: https://github.com/perl6/doc/commit/f151451427
13:29 timotimo wow, the 100_000_000 items array push run finished
13:29 * [Coke] wonders how he can get back to a working doc build on os x. :|
13:29 ismailarilik gfldex: I don't think I understand you...
13:29 timotimo 80% time spent in GC :)
13:30 timotimo the last full run it did took a measly 13.8 seconds
13:30 timotimo probably due to swapping?
13:30 timotimo so i suppose i can throw that test result into the bin
13:31 gfldex ismailarilik: just make sure you don't got anything on a share because rakudo can't do anything about problems that arise from shares
13:33 sena_kun joined #perl6
13:35 timotimo OK, with 40_000_000 items GC is down to 64%, which is fine ...
13:36 shillo timotimo: ... and I just remembered the real tradeoff with doubling-before-calling-realloc: if you reserve your own space by doubling, and realloc reserves its own space by, basically, ignoring your request,
13:36 timotimo yup
13:36 shillo You end up with two independent chunks of wasted space, only one of which is usable by your application for array growth
13:37 shillo ... which is why I think that the correct thing to do here is to double always (until you run out) but have a known malloc implementation so you know which numbers to double to
13:37 shillo ... so that realloc doesn't waste extra space for you
13:37 shillo ... OR
13:38 MilkmanDan joined #perl6
13:38 shillo ... double manually but call malloc / memcpy on your own
13:38 shillo ... and hope malloc won't reserve space like that.
13:38 TEttinger joined #perl6
13:38 shillo (most mallocs are very tight and actually won't)
13:39 timotimo btw, for 40_000_000 elements but using a native array, you get 3% GC time and only 19 seconds (instead of 3:58 minutes) on my machine
13:39 perlpilot Perl 5 grows its arrays by doubling last time I checked ... I wonder how it does that.
13:40 shillo perl5, 160,000,000, 11 sec
13:40 shillo ... normal array
13:40 shillo perl -e 'my @a; push @a, $_ for 0..160000000'  10.26s user 1.06s system 99% cpu 11.331 total
13:41 timotimo well, perl6 is known to be a bit slower than perl5 for many things :)
13:41 timotimo oh, that was also with --profile, which adds a bit of extra overhead to every call and allocation
13:42 timotimo i get that in 49 seconds. 5x slower than perl5 isn't that bad, really.
13:43 timotimo FWIW, when i use "my int @a = ^160_000_000", it's done in only 2.5 seconds
13:43 shillo pypy -c 'a=[] for i in xrange(160000000): a.append(i)'  1.92s user 1.04s system 99% cpu 2.973 total
13:43 timotimo oh come on, now. that's just unfair! :)
13:44 timotimo pypy is 100% space technology from space
13:44 shillo Yeah. pypy is evil :)
13:44 shillo It also hates threading, otherwise it'd be a go-to solution for implementing.. anything.
13:45 shillo (meaning, any language)
13:45 timotimo we lose about 30% time through invocation overhead for the push + for thing
13:45 shillo ... oh, today I benchmarked push specifically to see if it gained anything from declared return Nil
13:46 timotimo i count frame_invoke, fixed_size_alloc, try_return, allocate_frame, alloc_zeroed, fixed_size_free, frame_destroy, args_proc_init, args_set_result_obj, and frame_find_invokee_multi_ok as those things
13:47 travis-ci joined #perl6
13:47 travis-ci Doc build passed. Altai-man 'Revert "Css-based TOC animation"'
13:47 travis-ci https://travis-ci.org/perl6/doc/builds/148033822 https://github.com/perl6/doc/commit/feb479880cd5
13:47 travis-ci left #perl6
13:47 shillo ... and also, apology to everyone for bringing up a microbenchmark - I realise this is not the kind of thing that should be the primary opt target :)
13:47 timotimo nah, it's fine
13:49 timotimo it's a bit surprising to me that spesh doesn't inline the push call there
13:49 shillo Like I said the other day, the only more practical code I wrote is slowed down by IO.basename, and that one waits on regexp search/replace. I suspect that p6 web frameworks that use grammars for routing will probably wait on the parsers to finish
13:50 timotimo yeah, probably
13:50 timotimo invocation of regexes isn't optimized enough
13:52 ab6tract joined #perl6
13:53 timotimo huh, it's not even turning the invoke into a fastinvoke
13:55 [Coke] so, I can't get a clean install of Pod::To::BigPage due to various dependency failures on sergot's and cosimo's modules.
13:57 gfldex [Coke]: disable the test that is getting IO::Socket::SSL involved and see if that fixes your problem. If it does, send a PR.
14:02 shillo timotimo: how do you look into spesh output? By turning on spesh log or?
14:02 timotimo yes, MVM_SPESH_LOG=/tmp/foo.txt
14:02 timotimo and then just start reading from the bottom :D
14:05 pyrimidine joined #perl6
14:06 TEttinger joined #perl6
14:14 unmatched} So I got this line of code: dd [$_, $s.channels] for |$s.channels;  And it outputs [("#zofbot", "#perl6"), Array[<anon>].new($("#zofbot", "#perl6"))]  How come it doesn't flatten the @.channels attribute's value? I want to iterate over each item
14:16 TEttinger joined #perl6
14:16 timotimo if it's an array, you probably want to .List (or .list?) that
14:17 unmatched} dd [$_, $s.channels] for |$s.channels.List; gives the same result.
14:17 * unmatched} is really pissed off.
14:18 unmatched} Just spent 20 minutes wrestling with a :%arg not being passed as an Associative and now this ~_~
14:18 timotimo oh
14:18 gfldex unmatched}: looks like $s.channels is 2 levels deep
14:20 gfldex we do have .deepmap but we don't got .deepiterator. I found myself wanting the latter a few times.
14:20 unmatched} gfldex++ thanks that was it.
14:21 unmatched} Man, the % and @ sigils are warps of Perl 6.
14:21 unmatched} I'm gonna avoid them from now on whenever I can
14:21 unmatched} *warts
14:26 jkramer I think I came up with the most cleverest epic web framework ideas ever, made possible by perl6! http://dpaste.com/2BSBVFB
14:26 gfldex m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; my @l = [1,[2,3,[4,5,6]]]; .say for deep @l;
14:26 camelia rakudo-moar aa5e49: OUTPUT«1␤2␤3␤4␤5␤6␤»
14:26 gfldex unmatched}: ^^^
14:27 Juerd jkramer: Translating user input to internal identifiers. What could possibly go wrong?
14:27 jkramer I don't want to brag, but I think I'm a genius
14:27 Juerd jkramer: It should at least match against some kind of whitelist to make sure that those methods were intended to be called externally.
14:27 jkramer Juerd: it does
14:28 * Juerd rereads
14:28 sufrostico joined #perl6
14:28 jkramer Juerd: return $.bad-request unless $method ~~ any(<get post head put delete>);
14:28 Juerd Oh, it does
14:28 * Juerd thinks of something better to nag about
14:28 Juerd I got it! Whitelists suck! :)
14:28 jkramer :D
14:29 Juerd Instead, would there be a way to indicate this at the method itself?
14:30 Juerd multi method get (...) is web { ... }
14:30 gfldex jkramer: matching against a string literal with a signatuer is quite clever indeed. You may actually have invented that.
14:30 jkramer Juerd: I was playing with traits first, but I think since we know what HTTP methods exist it's easier/more conclusive to do it like this. Also having a get method that's supposed to be called and other get methods that are not doesn't really make sense
14:30 Juerd jkramer: Good point
14:31 jkramer Also I want to use traits for stuff like get(...) is memcached later. It's gonna be awesome :D
14:31 Juerd I like the idea
14:31 Juerd I wonder if some kind of relative paths could be used
14:32 Juerd So you can load (mount?) an application and stick it on a custom path prefix
14:32 jkramer Yeah, I'm thinking about that right now. Something like "class Foo does Blurgh has Prefix(...)" or whatever you can do with traits
14:32 jkramer Also I need a better name
14:33 Juerd Well, if you use instances instead of classes, you can mount the same application twice with different parameters
14:33 unmatched} jkramer: it's neat. Another point of awesomeness with that interface:   multi method get ('blog', |c) { self.blog: |c }; multi method blog ('read', $id) {...}; multi method blog ('create', ... ) { ... }
14:34 unmatched} Similar to Mojolicious's under()
14:34 Juerd I wonder, can roles have parameters?
14:34 cibs joined #perl6
14:34 timotimo of course they can
14:34 timotimo we have roles so that we can have parameterized types
14:34 psch m: role R[::T] { method foo { T.new() } }; class A does R[Int] { }.foo.say
14:34 camelia rakudo-moar aa5e49: OUTPUT«0␤»
14:35 Juerd timotimo: But can I load a role twice in the same class? :)
14:35 jkramer unmatched}: What is |c? Never seen that
14:35 unmatched} jkramer: a capture
14:35 unmatched} hug[tab][tab] Capture
14:35 unmatched} damn bot
14:35 timotimo the role bodies will probably conflict, but if the role bodies are empty that should work
14:35 timotimo well ... it might
14:36 psch m: role R[::T] { multi method foo(T $a) { $a.succ } }; class A does R[Int] does R[Str] { }.foo("foo").say
14:36 camelia rakudo-moar aa5e49: OUTPUT«fop␤»
14:36 huggable joined #perl6
14:36 unmatched} huggable: Capture
14:36 huggable unmatched}, Argument list suitable for passing to a: https://docs.perl6.org/type/Capture
14:36 psch m: role R[::T] { multi method foo(T $a) { $a.succ } }; my $a class A does R[Int] does R[Str] { }; $a.foo("foo").say; $a.foo(1).say
14:36 camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3ti method foo(T $a) { $a.succ } }; my $a7⏏5 class A does R[Int] does R[Str] { }; $a␤    expecting any of:␤        infix␤        infix stopper␤        …»
14:36 huggable joined #perl6
14:36 psch m: role R[::T] { multi method foo(T $a) { $a.succ } }; my $a = class A does R[Int] does R[Str] { }; $a.foo("foo").say; $a.foo(1).say
14:36 camelia rakudo-moar aa5e49: OUTPUT«fop␤2␤»
14:37 psch Juerd: ^^^ looks good from here
14:37 kurahaupo joined #perl6
14:38 tadzik unmatched}: that reminds me of my old idea of using grammars for routing :D
14:39 unmatched} :D
14:39 unmatched} tadzik: sounds cool. How did it work out?
14:39 tadzik https://ttjjss.wordpress.com/2010/11/
14:40 tadzik Hacker News liked it :P
14:41 unmatched} tadzik++ that's awesome :D
14:41 tadzik :)
14:42 gregf_ m: say [1,"a"].map(*.succ)
14:42 camelia rakudo-moar aa5e49: OUTPUT«(2 b)␤»
14:42 tadzik holy batman that was over 5 years ago
14:48 khw joined #perl6
14:51 jkramer When I have an attribute in a role, can I set a default value for that attribute in a class that does the role?
14:52 jkramer Just overriding has $attribute = 123 gives me an error.
14:53 timotimo you'll have to make the default value a parameter of the role, or make your BUILD do the right thing
14:53 jkramer How does the syntax for the role parameter look like?
14:53 timotimo see psch's eval a quarter-hour ago
14:54 timotimo the ::T was a type capture, so instead of giving you the value, it'll give you the type
14:54 timotimo so just use $defval instead
14:54 psch m: role R[$def] { has $.a = $def }; class C does R[10] {}.new.a.say
14:54 camelia rakudo-moar aa5e49: OUTPUT«10␤»
14:54 jkramer Ah right, I though that was for type parameters only. Thanks!
14:57 timotimo nope, ::T is a thing in any signature, and role parameters go via signatures
14:57 timotimo you should be able to do anything a regular signature can do in there
14:59 vendethiel joined #perl6
15:00 psch m: role R[&c:(Int $, Str $ --> Bool)] { has &.c = &c }; class C does R[sub (Int $a, Str $b --> Bool) { $a < 10 && $b.chars < 10 }] { }; C.new.c()(1, "foo").say
15:00 camelia rakudo-moar aa5e49: OUTPUT«True␤»
15:01 * psch hadn't known that its a Signature in the brackets
15:02 dalek ecosystem: c4040ad | (Brian Duggan)++ | META.list:
15:02 dalek ecosystem: added oauth2-client-google
15:02 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/c4040ad639
15:02 dalek ecosystem: 75a8370 | Altai-man++ | META.list:
15:02 dalek ecosystem: Merge pull request #230 from bduggan/oauth2-client-google
15:02 dalek ecosystem:
15:02 dalek ecosystem: added oauth2-client-google
15:02 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/75a83708ef
15:02 sena_kun joined #perl6
15:03 jkramer I have an error that I don't really understand. This line:  @path.first($.prefix.arity) ~~ $.prefix (where $.prefix is a Signature :('post') and @path is ['post', 1] gives me this: Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏post'
15:03 psch m: <foo bar baz>.first(2).say
15:03 camelia rakudo-moar aa5e49: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:03 timotimo the @path.first($.prefix.arity) runs a smart match against the number over all the things
15:03 timotimo yeah, what psch showed
15:04 psch m: <foo bar baz>.first("bar").say
15:04 camelia rakudo-moar aa5e49: OUTPUT«bar␤»
15:05 psch m: <foo 1>.first("1").say
15:05 camelia rakudo-moar aa5e49: OUTPUT«1␤»
15:05 jkramer Ah damn, I should start reading the actual description of methods in the docs
15:05 timotimo perhaps
15:05 jkramer .head is what I wanted
15:05 yoleaux jkramer: Sorry, that command (.head) crashed.
15:05 timotimo ah, hehe
15:06 * gfldex .oO( Make the docs telepathic. )
15:06 perlpilot that's one way to head-desk
15:08 mohae joined #perl6
15:08 cdg joined #perl6
15:10 sufrostico joined #perl6
15:10 jkramer Not sure if this is the best way to do it, but I added signature prefixes: http://dpaste.com/1PHD6CN
15:11 jkramer I guess next I should add nested routes, ie. route classes inside other route classes with dispatching to nested routes using their prefixes or something.
15:13 gfldex jkramer: you may be able to do that and more with MOP and .assuming
15:17 ab6tract jkramer: nice :)
15:17 gfldex jkramer: also, while considering different solutions you may want to measure the request/s you can achieve. It doesn't help you much the have A Most Elegant Webframework that is slow as fuck.
15:19 mst actually, for real world use I find benchmarking requests/second of a raw framework is stupid
15:19 mst it doesn't help you much to have spent hours micro-optimising your web framework when it turns out the bottleneck isn't in the framework
15:20 tadzik "our JS UI toolkit doesn't do jack shit but hell is it fast!"
15:20 mst gfldex: anyway, if I wanted to ricer, I'd build a gentoo stage 1 install and then write golang :D
15:24 gfldex tadzik: "our JS UI toolkit does literally everything but wont finish until tomorrow" Does that sound better?
15:25 TEttinger joined #perl6
15:27 jkramer gfldex: Currently there's no way of benchmarking anyway because HTTP::Server::Async crashes after a few requests :) Guess I should use something else or use something more generic/pluggable
15:28 mst gfldex: yes, because then you profile it to find the parts that are *actually* slow
15:28 jkramer Right now it's just a POC of the idea anyway, don't know how far I'll take it
15:28 mst jkramer: your example has a 'get /foo/new/123' that changes data
15:29 mst jkramer: GET requests that change data: not even once. not even in examples. please.
15:29 jkramer Pff yeah whatever mom
15:32 Actualeyes joined #perl6
15:33 timotimo Mom Said To  ==  mst
15:36 jkramer ;)
15:37 petercommand joined #perl6
15:38 sunnavy joined #perl6
15:39 TEttinger joined #perl6
15:42 ssqq joined #perl6
15:49 ssqq joined #perl6
15:56 Actualeyes joined #perl6
15:57 jkramer Can I use type parameters for Hash to restrict the types of both the keys and the values? I tried Hash[Int, Str] but it does weird stuff
15:57 jkramer Although I was just guessing the syntax
15:58 timotimo you can, but the parameters are the other way around from what you expect
15:59 hoelzro it would nice if we had named parameters for parameterized roles
15:59 timotimo we ...  we don't?
15:59 hoelzro eg. Hash[:key(Int), :value(Str)]
15:59 * hoelzro shrugs
15:59 hoelzro maybe we do
15:59 * perlpilot thought we did
15:59 hoelzro oh, awesome!
15:59 jkramer timotimo: I tried both ways but complains about the values type either way
15:59 perlpilot (I had exactly the same reaction in my head as timotimo)
15:59 hoelzro shows how much Perl 6 I've done recently =S
15:59 hoelzro I can't wait until this house thing is done - then I can hack again \o/
16:00 jkramer m: my Hash[Int,Str] %x; %x{123} = 'foo'
16:00 camelia rakudo-moar aa5e49: OUTPUT«Type check failed in assignment to %x; expected Hash[Int,Str] but got Str ("foo")␤  in block <unit> at <tmp> line 1␤␤»
16:00 timotimo jkramer: can you write a small test case for your stuff?
16:00 jkramer m: my Hash[Int,Str] %x; %x{'foo'} = 123
16:00 camelia rakudo-moar aa5e49: OUTPUT«Type check failed in assignment to %x; expected Hash[Int,Str] but got Int (123)␤  in block <unit> at <tmp> line 1␤␤»
16:00 timotimo aha!
16:00 timotimo you're declaring that you want a hash of hashes of int and str
16:01 timotimo m: my %x is Hash[Int, Str]; %x{'foo'} = 123
16:01 camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is ' in a variable declaration.␤at <tmp>:1␤------> 3my %x is Hash[Int, Str]7⏏5; %x{'foo'} = 123␤    expecting any of:␤        TypeObject␤        default␤        dyn…»
16:01 jkramer Oh shit, wrong sigil I guess
16:01 timotimo okay, is is wrong there
16:01 gfldex m: my Int %h{Str}; %h{'abc'} = 10; dd %h;
16:01 camelia rakudo-moar aa5e49: OUTPUT«Hash[Int,Str] %h = (my Int %{Str} = :abc(10))␤»
16:01 timotimo yeah, what gfldex just showed is the proper way
16:01 jkramer Ah, thanks!
16:04 gfldex we seam not to doc the value time in https://docs.perl6.org/type/Hash
16:04 gfldex or am i just blind?
16:04 hoelzro do we have a "
16:04 hoelzro ugh, finger slipped
16:04 TEttinger joined #perl6
16:04 hoelzro do we have a "Perl 5 -> Perl 6 pitfalls" section on docs.perl6.org?
16:04 hoelzro I noticed we have a "traps" section
16:05 TimToady isn't a pitfall a kind of trap?
16:05 gfldex hoelzro: there are some pitfalls stated in the 5to6 sections
16:05 MahBot joined #perl6
16:05 MahBot gfldex, Message forwarded
16:05 unmatched} oops
16:06 gfldex EUNKNOWNBOT
16:06 MahBot joined #perl6
16:06 MahBot Hey, everybody! ZoffixW over at local/#perl6 says I ♥ you!
16:06 unmatched} :D Multi-server tunnel with Perl 6 IRC::Client :D
16:07 timotimo cute.
16:08 unmatched} This is the code that dun it: https://gist.github.com/zoffixznet​/0d37221a1ae824bebce461c61091bf0d
16:08 hoelzro TimToady: sure enough =)
16:09 hoelzro gfldex: should the traps section link to that Perl 5 traps section?
16:10 zakharyas joined #perl6
16:11 mantovani joined #perl6
16:12 hoelzro oh good, the trap I thought of is already in there =)
16:12 gfldex hoelzro: there is no explicit Perl 5 trap sections. Links would go all over the place.
16:12 hoelzro ok
16:12 unmatched} This trap gets me frequently:
16:12 unmatched} m: my %h = :42foo :45bar; dd %h
16:12 camelia rakudo-moar aa5e49: OUTPUT«Hash %h = {:foo(42)}␤»
16:13 TEttinger joined #perl6
16:14 unmatched} m: class { method bar (:$foo, :$bar){ dd[ $foo, $bar ] } }.bar: :42foo :45bar
16:14 camelia rakudo-moar aa5e49: OUTPUT«method bar␤»
16:14 unmatched} wat?
16:15 unmatched} The space is missing between dd and [, but what's with the output? :S
16:16 dalek ecosystem: 8866514 | (Peter Pentchev)++ | META.list:
16:16 dalek ecosystem: Add Getopt::Std - POSIX getopt(3) options processing.
16:16 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/886651405a
16:16 dalek ecosystem: 1393b78 | (Steve Mynott)++ | META.list:
16:16 dalek ecosystem: Merge pull request #231 from ppentchev/roam-getopt-std
16:16 dalek ecosystem:
16:16 dalek ecosystem: Add Getopt::Std - POSIX getopt(3) options processing.
16:16 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/1393b78d7e
16:16 jnthn m: dd
16:16 camelia rakudo-moar aa5e49: OUTPUT«block <unit>␤»
16:16 jnthn m: sub foo() { dd }
16:16 camelia rakudo-moar aa5e49: ( no output )
16:16 jnthn m: sub foo() { dd }; foo
16:16 camelia rakudo-moar aa5e49: OUTPUT«sub foo␤»
16:17 unmatched} Ah. jnthn++
16:17 jnthn Heh, TIL. :)
16:17 timotimo i didn't even know about that
16:17 jnthn Did anyone else know about that? :P
16:17 jnthn I guess lizmat must have :)
16:18 dalek doc: e19bb99 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Hash.pod6:
16:18 dalek doc: show value constraints on Hash
16:18 dalek doc: review: https://github.com/perl6/doc/commit/e19bb993b6
16:18 gfldex i'm very pleased with the example i found for that one
16:21 adu joined #perl6
16:22 timotimo great :)
16:26 unmatched} .&dd shouldn't really be in the docs. It's Rakudo-specific helper
16:26 unmatched} m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; %h{'Goku'} = 9001;
16:26 camelia rakudo-moar aa5e49: ( no output )
16:26 unmatched} :S
16:26 unmatched} oh
16:27 unmatched} m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; %h{'Goku'} = 900;
16:27 camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to assignval; expected Powerfull but got Int (900)␤  in block <unit> at <tmp> line 1␤␤»
16:30 gfldex unmatched}: the ecosystem may disagree with you when it comes to dd
16:32 TimToady the ecosystem does not define Perl 6
16:32 mst unmatched}: Powerful
16:32 TimToady and roast doesn't test dd
16:32 unmatched} gfldex: no, the ecosystem uses a Rakudo-specific helper that's not part of the Perl 6 specification
16:36 TEttinger joined #perl6
16:36 dalek doc: 9b1ca52 | (Zoffix Znet)++ | doc/Type/Hash.pod6:
16:36 dalek doc: s/Powerfull/Powerful/
16:36 dalek doc:
16:36 dalek doc: mst++
16:36 dalek doc: review: https://github.com/perl6/doc/commit/9b1ca521d9
16:36 zakharyas joined #perl6
16:45 mcmillhj joined #perl6
16:46 gfldex TimToady: the ecosystem defines how Perl 6 is used. I'm very unhappy with all those says in the docs because it gives the impression that say is a good default. Data will be lost, tears will be shed.
16:52 [Coke] I agree that dd shouldn't be in the doc site.
16:52 [Coke] I'm OK with say being used for things that have trivial .gists, but would be fine if more complicated things used put.
16:53 [Coke] (I'm also ok if we just use put everywhere)
16:55 user9 joined #perl6
16:56 unmatched} put's not really the same thing tho
16:56 unmatched} m: put IO::Socket::Async
16:56 camelia rakudo-moar aa5e49: OUTPUT«Use of uninitialized value of type IO::Socket::Async in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at <tmp> line 1␤␤»
16:56 unmatched} m: say IO::Socket::Async
16:56 camelia rakudo-moar aa5e49: OUTPUT«(Async)␤»
16:56 unmatched} This is curious:
16:56 stmuk say :$foo.perl is a little like dd
16:57 unmatched} m: put -∞..∞; say -∞..∞
16:57 camelia rakudo-moar aa5e49: OUTPUT«*..*␤-Inf..Inf␤»
16:57 timotimo it not being the same thing is the whole point, isn't it?
16:57 unmatched} Sure, but it's not suitable to replace all of `say`s in the docs.
16:58 timotimo not all of it, of course
16:58 [Coke] m: my $a = -∞..∞; say ~$a; say $a;
16:58 camelia rakudo-moar aa5e49: OUTPUT«*..*␤-Inf..Inf␤»
16:58 timotimo i thought the problem was that say tends to abbreviate lists and such?
16:58 [Coke] unmatched}: we can't *just* replace say with put, no
17:02 vendethiel joined #perl6
17:03 dalek doc: 2bd91a5 | (Zoffix Znet)++ | doc/Type/Hash.pod6:
17:03 dalek doc: Simplify example
17:03 dalek doc: review: https://github.com/perl6/doc/commit/2bd91a5570
17:05 [Coke] yay, got make test working again locally for perl6/doc
17:05 dalek doc: 267c0ad | (Zoffix Znet)++ | doc/Type/Hash.pod6:
17:05 dalek doc: Add missing comment marker
17:05 dalek doc: review: https://github.com/perl6/doc/commit/267c0ad562
17:14 firstdayonthejob joined #perl6
17:15 gfldex m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { say $_ } }
17:15 camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to assignval; expected Powerfull but got Int (900)␤  in block <unit> at <tmp> line 1␤␤Type check failed in binding to assignval; expected Powerfull but got Int (900)␤  in block <unit> at <tmp> line 1␤␤Actually throw…»
17:16 domidumont joined #perl6
17:16 gfldex the reason I use dd there is that I got the fully quallified name of the exception for free
17:18 gfldex unmatched}: if you remove the type of the exception from the example please add that type in the descriptive text
17:21 gfldex m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { say $_.WHAT } }
17:21 camelia rakudo-moar aa5e49: OUTPUT«(Binding)␤Type check failed in binding to assignval; expected Powerfull but got Int (900)␤  in block <unit> at <tmp> line 1␤␤»
17:21 unmatched} .^name
17:23 gfldex m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { when X::TypeCheck::Binding { put .^name } } }; say 'alive';
17:23 camelia rakudo-moar aa5e49: OUTPUT«X::TypeCheck::Binding␤alive␤»
17:25 dalek doc: 46e69e3 | (Zoffix Znet)++ | doc/Type/Hash.pod6:
17:25 dalek doc: Restore exception message into code example
17:25 dalek doc: review: https://github.com/perl6/doc/commit/46e69e3312
17:32 mcmillhj joined #perl6
17:50 trnh joined #perl6
17:50 trnh joined #perl6
17:55 telex joined #perl6
17:56 girafe joined #perl6
17:58 matt_ joined #perl6
17:58 FROGGS joined #perl6
18:02 unmatched} .oO( a "chat" section on perl.org that lets you chat on this channel... )
18:02 spider-mario joined #perl6
18:02 AlexDaniel joined #perl6
18:03 gfldex unmatched}: i had the wild idea to have http://webchat.freenode.net/ on docs.perl6.org
18:03 gfldex "if you have any further questions ..."
18:04 gfldex or some easy way to seach the irclogs
18:04 gfldex ENEEDMORETEA
18:04 mst that would be wesome
18:04 sena_kun m: say say Int.^methods(:all).pick.name;
18:04 camelia rakudo-moar aa5e49: OUTPUT«sech␤True␤»
18:04 mst awesome
18:04 mst DBIx::Class pioneered that with mibbit, it's been very nice
18:04 unmatched} Yeah, I like the "Questions? Chat with us" button (on the left, middle) here: https://metacpan.org/pod/Moose
18:05 sena_kun m: say Int.^methods(:all).pick.name;
18:05 camelia rakudo-moar aa5e49: OUTPUT«fmt␤»
18:05 * mst actually got the 'other' box added to mibbit specifically so irc.perl.org could use it
18:05 unmatched} :o
18:05 mst sadly they threw an epic tantrum at the freenode opers a few years back and got very banned
18:06 unmatched} wow
18:06 mst culminating in them saying "no, we won't guarantee that we won't mine users' chat history to serve better converting ads"
18:07 unmatched} I was thinking of more a rolling chat. You don't have to log in or anything. You just load the site and you can see humans talking and you can talk too
18:07 mst hm
18:07 gfldex_www joined #perl6
18:07 mst oooh, what you'd want for that is something like a convos instance, except one that maintained a bot, so it only had to actually connect a nick when you started trying to speak
18:08 unmatched} I've never used convos. I'm thinking it doesn't even need to connect a nick. The bot would make up a nick based on IP address and would prefix messages with that nick, talking on behalf of that person.
18:08 unmatched} I think #go-lang has this sort of thing
18:10 unmatched} Well, maybe not the via their site, but I've seen a bot talk on behalf of people
18:10 mst oh, you mean more like the XMPP bridge in #tcl
18:10 Tonik joined #perl6
18:11 unmatched} Probably
18:12 dalek ecosystem: ba55f31 | (Matt Oates)++ | META.list:
18:12 dalek ecosystem: Add Math::FourierTransform
18:12 dalek ecosystem:
18:12 dalek ecosystem: First features for FourierTransform
18:12 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/ba55f3163c
18:14 Ulti ^ was surprisingly slick to write in P6
18:15 Ulti looks nicer than the python just because maths functions for complex numbers are already there and you don't need a complex numbers import
18:15 unmatched} My first full draft of IRC::Client blog post is 5325 words >_<
18:15 Ulti blag golf
18:16 unmatched} https://github.com/MattOat​es/Math--FourierTransform
18:16 TimToady flog galb
18:18 TimToady m: complex
18:18 camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    complex used at line 1␤␤»
18:18 TimToady pity we don't have native complex yet
18:19 sena_kun m: say ((1, 2), <a b>).flatmap(&uc).join('|'); # 1|2|A|B
18:19 camelia rakudo-moar aa5e49: OUTPUT«1 2|A B␤»
18:19 TimToady oh, I guess Complex is compact nums though already
18:20 Ulti is it? I assumed it was two Rats or something underneath?
18:21 TimToady well, most complex computations don't come out exact anyway
18:21 TimToady so Rats would be mostly wasted
18:21 TimToady and turn into nums anyway
18:21 Ulti yeah I noticed my code didn't really match other langs functions 100%
18:22 Ulti should probably do an actual numeric test using sin()
18:22 Ulti feels like maths functions someone should write a general testing framework for everyone to test against
18:24 TEttinger joined #perl6
18:29 mantovani (stupid, stupid, stupid question) why does you guys created MoarVM and just used jvm as backend ?
18:29 mantovani and not just used jvm*
18:30 mantovani a friend of my ask it, and I didn't know what to answer
18:31 mantovani oh I found, sorry
18:31 mantovani https://perl6advent.wordpress.com/201​4/12/01/the-state-of-perl-6-in-2014/
18:31 japhb mantovani: A few different reasons, but for *me* the most important is that JVM has really slow startup.  Sucks for interactive tools.
18:31 mantovani "MoarVM provides much lower memory usage, faster startup time, and is significantly faster than parrot at runtime"
18:32 sufrostico joined #perl6
18:32 japhb Parrot has gone "biologically stable"
18:32 unmatched} Also, we can modify MoarVM for Perl 6 needs :)
18:33 mantovani since perl 6 run on jvm I thought it satisfy all perl 6 needs
18:33 geekosaur well, it sort-of runs...
18:34 unmatched} Well, you can drive a screw in with a hammer, but it's much better to have a screw driver.
18:34 * mantovani understood
18:35 arnsholt To expand a bit on it, the JVM conception of classes and dispatch and such isn't quite the same as the Perl 6 one
18:35 arnsholt So it's not just a matter of compiling to JVM classes and invoking JVM methods directly on those objects
18:36 arnsholt So the Rakudo/JVM runtime code has to do a fair bit of legwork to translate between the different models, leading to increased overhead
18:38 huggable joined #perl6
18:38 mantovani so the jvm implementation was just to learn/for fun ?
18:38 dwarring joined #perl6
18:39 dalek doc: a8bb893 | (Wenzel P. P. Peppmeyer)++ | html (2 files):
18:39 dalek doc: add link to webchat
18:39 dalek doc: review: https://github.com/perl6/doc/commit/a8bb893569
18:39 unmatched} mantovani: no, to run on JVM. Some organizations, for example, require the projects must run on JVM, not on some arbitrary platform
18:39 [Coke] a big selling point for running on the JVM for me was that I could run it in a managed j2ee container. this became much less relevant with docker.
18:39 mantovani so jvm implementation will be stable as MoarVM ?
18:39 [Coke] but up to about six months ago, rakudo on jvm was going to be the only way to get perl 6 running here at work.
18:40 [Coke] mantovani: that's the goal, but we're not there.
18:40 arnsholt Also, the JVM backend was implemented before Moar was started
18:40 arnsholt In the beginning, there was Parrot
18:41 mantovani ok, because I come here in the channel few days ago ... because the best of java are the libraries and since perl 6 run it on jvm should not be hard use jar libraries in perl as I do in scala.
18:41 arnsholt Then jnthn++ implemented multi-backend, and Rakudo ran on both Parrot and JVM
18:41 arnsholt Then, later on (a year or two, I think) MoarVM was implemented
18:41 sena_kun Is `yada` method name an abbreviation or it just comes from "いやだ"?
18:42 unmatched} sena_kun: I'd think this http://www.dictionary.com/browse/yada--yada?s=t
18:43 sena_kun unmatched}, thanks. How interesting.
18:45 setty1 joined #perl6
18:47 arnsholt mantovani: I think we have at least partial JVM interop
18:47 arnsholt But the exact translation of Perl 6 method invocations to Java invocations are a bit tricky, because method resolution is different in Java and Perl 6
18:47 sena_kun m: my ($a, $b) = SetHash.new(1, 2, 3), SetHash.new(2, 4); say $a (^) $b;
18:47 camelia rakudo-moar aa5e49: OUTPUT«set(4, 3, 1)␤»
18:48 sena_kun Is this elements order machine-specific?
18:49 timotimo our hashes don't keep order around
18:49 perlpilot sena_kun: sets aren't ordered
18:49 gfldex pitty the irclog doesn't show that the webchat was used to join. Would be interresting to see if the link on docs.perl6.org actually lures folk in.
18:50 harmil_wk joined #perl6
18:50 sena_kun Thanks.
18:51 hoelzro gfldex: we could change the link to redirect to the webchat, and see how many people hit that redirect link
18:51 psch arnsholt: mmd on Java classes is mostly solved.  we do lack marshalling for Positional and Associative to corresponding Collection classes though
18:51 psch arnsholt: what i'm anticipating to be the hardest part is translating between interfaces and Roles though
18:52 unmatched} m: https://gist.github.com/zoffixznet​/729acd14c65a3bc89f99df9619eba91f
18:52 gfldex hoelzro: it's in the apache logs. But so is every spider and bot that hits the site. I somehow doubt the bots would solve the captcha to talk to us.
18:53 arnsholt psch: Oh, cool! I've been away long enough that so many of the things that were hard to fix have been figured out \o/
18:53 camelia rakudo-moar aa5e49: OUTPUT«(timeout)Starting irc.freenode.net␤Starting localhost␤irc.freenode.net: IO::Socket::Async<139743539025240>␤Got stuff! :kornbluth.freenode.net NOTICE * :*** Looking up your hostname...
18:53 unmatched} I guess expecting redo inside a promise to redo a loop is expecting too much?
18:53 unmatched} I'm trying to pop open a bunch of sockets and reconnect them when they disconnect :/
18:54 hoelzro ahhh
18:54 psch j: use java::lang::System:from<JavaRuntime>; System.get_out.println("foo")
18:54 camelia rakudo-jvm cd19db: OUTPUT«foo␤»
18:54 unmatched} gfldex: match IPs between chat logs and apache logs
18:54 psch arnsholt: fields aren't wrapped in Proxies yet, which is also hard, but Perl 6 level hard, not codegen hard.  hence 'get_out' above :)
18:55 gfldex unmatched}: the irclogs that i can see don't got ips
18:55 unmatched} Maybe someone here has more detailed logs
18:57 sena_kun m: my $n = bag "a" => 0, "b" => 1, "c" => 2, "c" => 2; say $n.keys.perl; # ("a" => 0, "b" => 1, "c" => 2, "c" => 2).list
18:57 camelia rakudo-moar aa5e49: OUTPUT«(:c(2), :b(1), :a(0)).Seq␤»
18:57 sena_kun Wow.
18:58 gfldex @gateway/web/freenode/ip is the string to grep for
18:59 unmatched} Hm, I'm gonna try to reimagine my problem as a supply with socket disconnection events
19:08 andrzejku joined #perl6
19:10 labster joined #perl6
19:12 unmatched} m: react { whenever supply { start { emit 42 }; } { .say } }; sleep 2
19:12 camelia rakudo-moar aa5e49: ( no output )
19:12 unmatched} I can't emit into a supply from within a Promise?
19:13 avar Does anyone here know offhand whether Inline::Perl6 embedded in a perl without multiplicity or threading is capable of : perl5 -> perl6 -> *call subs in perl5*
19:14 TimToady m: my $n = ("a" => 0, "b" => 1, "c" => 2, "c" => 2).Bag; say $n.perl
19:14 camelia rakudo-moar aa5e49: OUTPUT«("c"=>4,"b"=>1).Bag␤»
19:15 TimToady sena_kun: ^^^ looking for that?
19:15 TimToady this is why the composer is different from the coercer
19:16 sena_kun TimToady, not really. I'm just checking correctness of example's output in our docs. And it seems our real compiler behavoir is slightly different from what documentation says.
19:17 TimToady m: my $n = bag "a" => 0, "b" => 1, "c" => 2, "c" => 2; say $n.perl
19:17 camelia rakudo-moar aa5e49: OUTPUT«(:c(2)=>2,:b(1)=>1,:a(0)=>1).Bag␤»
19:17 pmqs joined #perl6
19:17 TimToady well, keys should never list "c" => 2 twice
19:18 sena_kun TimToady, it really should. That's because I check and fix it now. :)
19:20 sena_kun Or rather "Because of that", oh.
19:23 richi235 joined #perl6
19:30 canopus joined #perl6
19:40 unmatched} Solved my problem with a Channel. Rough version: https://gist.github.com/zoffixznet​/24d292df0ad3b2728eed1af8d2754e03
19:45 harmil_wk m: sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3
19:45 camelia rakudo-moar aa5e49: OUTPUT«WARNINGS for <tmp>:␤Useless use of $a in sink context (lines 1, 1, 1)␤7625597484987␤»
19:45 harmil_wk Am I missing something, there? Seems like there should be no warning.
19:47 unmatched} bisect: m: sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3
19:47 [Coke] it doesn't warn for me locally on 2016.07.1
19:48 bisectable unmatched}: Exit code is 0 on both starting points, bisecting by using the output
19:48 bisectable unmatched}: bisect log: https://gist.github.com/3694​12d2b8ff352b2e8545b35f89846f
19:48 bisectable unmatched}: (2016-07-26) https://github.com/rakudo/rakudo/commit/5334cb7
19:48 unmatched} harmil_wk: would you please open a ticket for it?
19:48 harmil_wk Sure
19:48 unmatched} huggable: rakudobug
19:48 huggable unmatched}, To report a bug, email detailed description and any test cases to rakudobug@perl.org or use perl6 query on http://rt.perl.org ; see https://github.com/rakudo/rakudo/#reporting-bugs
19:49 harmil_wk I've been pretty prolific with the bug reports of late. I'm worried I'm going on a list ;)
19:49 unmatched} :)
19:49 [Coke] harmil_wk: you'll never catch up with masak, so dont' worry. :)
19:50 unmatched} harmil_wk: oh and would you include the link to the commit that bisectable gave above?
19:50 unmatched} TimToady: if you're around and have time, seems it points to the sinkiness propagation: https://github.com/rakudo/rakudo/commit/5334cb7
19:50 [Coke] unmatched}: note that, in general, we want files attached to tickets, not links to pastebots.
19:51 [Coke] but I realize that's a pita in general.
19:51 unmatched} [Coke]: I mean the link to the commit
19:51 * unmatched} & bus
19:51 [Coke] \o/ Spinning up a perl 6 docker container at work for a CI solution.
19:51 [Coke] unmatched}: WHOOPS, my bad, sorry
19:52 AlexDaniel [Coke]: generally, is there any need to provide bisect log at all? If one doubts that this is the right commit, he can always build on commit^ and check it himself.
19:53 [Coke] on the ticket? not required, but can't hurt, I'd wager.
19:53 * [Coke] finds -13- perl 6 docker containers on docker registry. huh
19:55 harmil_wk rakudobugged it. Also, can I just say that being able to define ↑↑↑↑ so trivially makes me feel awe, joy and horror all at the same time.
19:56 AlexDaniel commit 5334cb7 sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3
19:56 committable AlexDaniel: ¦«5334cb7»: WARNINGS for /tmp/Mzi8nSUmqf:␤Useless use of $a in sink context (lines 1, 1, 1)␤7625597484987
19:56 AlexDaniel commit 5334cb7^ sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3
19:56 committable AlexDaniel: ¦«5334cb7»: 7625597484987
19:56 AlexDaniel just wanted to make sure because there's some “timed out after 10 seconds” warning in the bisect log…
19:56 wbill joined #perl6
19:58 AlexDaniel MasterDuke: oh uh! Did I break it? :)
19:59 [Coke] hoelzro: what is your docker perl6 instance? mj41's?
19:59 [Coke] oh, I can just build my own, let me do that. :)
20:14 adu joined #perl6
20:15 zacts_raincity joined #perl6
20:22 cdg joined #perl6
20:23 cdg joined #perl6
20:40 zacts___ joined #perl6
20:45 gfldex we have map and deepmap but grep and <insert-missing-sub-here>. Is there a reason for the gap?
20:46 masak gfldex: do you see a use case? my guess is someone did for deepmap
20:48 gfldex masak: we get the question why flat doesn't flatten recursively quite often. And my suspicion is that they actually ask for deepgrep (because deepmap is already there).
20:50 jnthn Wouldn't they want deepflat? :)
20:50 mst oooh, deepgrep would be really cool
20:51 masak so, deepgrep would traverse things in pre-order, omitting whole subtrees when it got falsy from its callback?
20:51 gfldex we do have flatmap, but that doesn't recurse
20:51 jnthn Right, nor does flat
20:51 jnthn Well
20:51 jnthn It does until it sees a Scalar container
20:52 gfldex m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; my @l = [1,[2,3,[4,5,6]]]; .say for deep @l;
20:52 camelia rakudo-moar aa5e49: OUTPUT«1␤2␤3␤4␤5␤6␤»
20:52 jnthn Which is fine, but then an Array is a bunch of Scalar containers, so .flat on an array is just identity
20:52 * masak .oO( "Finally, just deepzip your Supply with a HyperBag. As you can see, it's easy once you see the trick!" )
20:52 gfldex deep would be a recurseing iterator
20:53 jnthn Something along those lines would deal with the boilerplate. deep isn't verb, alas.
20:53 gfldex we don't got that in core either (and lizmat would like make it faster then I did)
20:54 geekosaur spelunk? :p
20:54 jnthn So it'd need to be something like visit or walk or something better. :)
20:55 gfldex visit or I would have to change a module :->
20:55 jnthn Oh no, naming...time to run away. :-)
20:55 gfldex for descend @a {}
20:57 dalek doc/literal_examples: 405fd02 | Altai-man++ | doc/ (30 files):
20:57 dalek doc/literal_examples: Almost all example outputs were changed to literal versions
20:57 dalek doc/literal_examples: review: https://github.com/perl6/doc/commit/405fd02599
20:58 masak descend++
20:58 gfldex m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; say [+] deep (1,2) Z (3,4);
20:58 camelia rakudo-moar aa5e49: OUTPUT«10␤»
20:58 gfldex masak: ^^^ usecase (because we dont got |Z)
21:00 gfldex slippy metaops might kill most of the usecases tho
21:05 labster joined #perl6
21:13 kurahaupo joined #perl6
21:16 sufrostico joined #perl6
21:27 ab6tract joined #perl6
21:29 canopus joined #perl6
21:29 avar Suggestion for a namespace to package perl6 modules under perl5 namespaces? 6Wrap::* ?
21:30 avar Maybe just Six::*
21:30 wbill joined #perl6
21:31 kurahaupo a namespace in perl5 that starts with a digit is going to be entertaining to use
21:31 inkjetunito joined #perl6
21:36 timotimo how about roman numeral 6?
21:37 avar I think I'll go for Six::*, easy to say, not in use
21:37 sno joined #perl6
21:41 Sgeo joined #perl6
21:43 canopus joined #perl6
21:44 Ulti geekosaur: spelunk more like dive :P
21:44 Ulti or maybe delve
21:50 AlexDaniel sena_kun: wow, what a lovely job you did
21:51 sena_kun AlexDaniel, thanks. We have one more question to resolve, look my last comment on the issue page.
21:52 timotimo where do i have to look to see what you're talking about?
21:53 sena_kun Let's see...
21:53 AlexDaniel https://github.com/perl6/doc/issues/761 https://github.com/perl6/doc/pull/775
21:53 sena_kun Ah, already ansered.
21:56 dalek doc: 405fd02 | Altai-man++ | doc/ (30 files):
21:56 dalek doc: Almost all example outputs were changed to literal versions
21:56 dalek doc: review: https://github.com/perl6/doc/commit/405fd02599
21:56 dalek doc: 34f2b67 | (Wenzel P. P. Peppmeyer)++ | doc/ (30 files):
21:56 dalek doc: Merge pull request #775 from perl6/literal_examples
21:56 dalek doc:
21:56 dalek doc: Almost all example outputs were changed to literal versions
21:56 dalek doc: review: https://github.com/perl6/doc/commit/34f2b67eeb
21:59 AlexDaniel sena_kun: we need more options
22:00 sena_kun AlexDaniel, I'll update my answer then. Perhaps it's reasonable to close this issue(since it's solved) and file new?
22:01 AlexDaniel sena_kun: yes
22:01 sena_kun AlexDaniel, okay.
22:03 timotimo cool
22:03 niceperl joined #perl6
22:03 mcmillhj joined #perl6
22:08 sena_kun New issue - https://github.com/perl6/doc/issues/776
22:16 mcmillhj joined #perl6
22:24 maddingue joined #perl6
22:27 mcmillhj joined #perl6
22:28 canopus joined #perl6
22:30 mantovani joined #perl6
22:39 dainis joined #perl6
22:45 mcmillhj joined #perl6
22:45 harmil_wk Have to go eat, but thought this would amuse: https://github.com/ajs/perl6-Math-Arrow
22:55 mcmillhj joined #perl6
23:08 wamba joined #perl6
23:09 mcmillhj joined #perl6
23:10 AlexDaniel sena_kun: not sure if I understand your point. camelia already runs the latest rakudo, and you can use star: to run it on the latest Star release. I do agree that you should not depend on camelia for writing docs (you probably want to configure your setup so that you can type such characters), but I still did not get what you mean…
23:10 zacts joined #perl6
23:11 ARM9 joined #perl6
23:11 sena_kun AlexDaniel, eeeh, it seems my grammar gets worse and worse with time... I'll try to explain now.
23:12 sena_kun But firstly, one question. I cannot have camellia-like output if I only have rakudo built on my machine?
23:13 sena_kun My point is that if I cannot, then it will be hard to type characters like newline and "<<"/">>" everytime. If I have camelia on my localhost with default rakudo - it's easy to just copy-paste output. But if not, then I need to type such characters everytime.
23:14 timotimo oh, you don't have a compose key or something?
23:15 AlexDaniel sena_kun: I am kinda playing devil's advocate here, but why don't you just PM real camelia on freenode? :)
23:15 timotimo might not always have internet connectivity
23:16 AlexDaniel and to fix that you are ready to run camelia locally with a your own local irc server just to not have to type unicode characters? I don't know, it sounds weird…
23:16 AlexDaniel -a
23:16 sena_kun timotimo, nope. And I, to be honest, don't want it too much. But it's my problems and I doubt it relevant to question.
23:17 sena_kun Just as a pure example, I suppose. I cannot be docs writer, so it's just hypothetical here.
23:17 sena_kun It's only plain old me, so if majority thinks unicode formatting is cool - I'm okay with it.
23:18 sena_kun *think
23:18 sena_kun Ah.
23:19 sena_kun I'll make a note to my comment now.
23:20 timotimo i'm a bit annoyed that i can't easily type most emoji on my keyboard
23:20 AlexDaniel m: my $output = “hello world\ntest\nfoo”; say “OUTPUT: «$output.subst(:g, “\n”, ‘␤’)»”
23:20 camelia rakudo-moar aa5e49: OUTPUT«OUTPUT: «hello world␤test␤foo»␤»
23:20 AlexDaniel sena_kun: what about this ↑ ?
23:21 zacts joined #perl6
23:23 sena_kun AlexDaniel, hmm. Is it formatting function for an author to use or you propose to lie it on repository shoulders? If first, I'm okay with it.
23:24 AlexDaniel sena_kun: I mean that you can replicate what camelia does with a simple one-liner, it's not a big problem
23:25 sufrostico joined #perl6
23:25 sena_kun AlexDaniel, ah, that's what it is. Yes, then it's no problem. And even if you're without internet connection, you can just copy characters from some another page. Okay, this point is solved.
23:26 mcmillhj joined #perl6
23:26 sena_kun I've updated my comment.
23:27 AlexDaniel I'm still against «» just because a lot of examples in the docs tend to have (), and «()» is OK but less than awesome. But I really think that typability of some characters should not be the main deciding factor in this case
23:28 sena_kun Sorry, guys, but I'm done already for today. Good night, #perl6.
23:47 mcmillhj joined #perl6
23:58 mcmillhj joined #perl6

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

Perl 6 | Reference Documentation | Rakudo