Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-09

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 teatime maybe if it had said /* -x == 2**32 -x +1 for unsigned x */
00:01 skink So if I wanna do that arbitrary-precision... (2**($size*8) - $upper_bound) % $upper_bound
00:01 teatime apparently C++ 2003 says 'The negative of an unsigned quantity is computed by subtracting its value from 2^n, where n is the number of bits in the promoted operand.'
00:02 teatime so you could probably just go with that.
00:05 skink Thankfully that has almost no performance impact.
00:05 teatime skink: if you're re-implementing this in perl code, I would just skip the optimization and use min = 2^32 % x ?
00:06 teatime well min = max % x anyway, if you're making it support more than 32-bit numbers.
00:06 teatime bah I still can't read... I am going to go get coffee or something.
00:06 skink That introduces modulo bias, which is the whole point :)
00:06 teatime ^^
00:07 skink (2**base - $upper) % $upper is the non-hacky literal translation
00:12 skink Xliff, You around?
00:14 johndau joined #perl6
00:17 Xliff Yup
00:17 skink I pushed some Windows changes earlier. Could you pull and run the tests?
00:18 Xliff Yup
00:19 teatime m: say 2**32 - 93
00:19 camelia rakudo-moar 40a953: OUTPUT«4294967203␤»
00:20 johndau joined #perl6
00:21 Xliff skink: Method 'allocate' not found for invocant of class 'Buf'
00:21 Xliff in sub _crypt_random_bytes at D:\SVN\Github\crypt-random\lib\Crypt\Random\Win.pm6 line 10
00:22 Xliff That was from 01-buf.t
00:22 Xliff My guess is that the rest will fail.
00:23 Xliff Yup. 02-value.t gives same error. Of course it would.
00:24 skink You lied to me sortiz!
00:25 johndau joined #perl6
00:27 skink Xliff, So that's probably going to be my $bytes = Buf.new; $bytes[$len - 1] = 0;
00:30 Xliff This type cannot unbox to a native integer
00:30 Xliff in sub _crypt_random_bytes at D:\SVN\Github\crypt-random\lib\Crypt\Random\Win.
00:30 Xliff pm6 line 19
00:30 Actualeyes joined #perl6
00:30 ZoffixWin Xliff, how old is your perl?
00:30 Xliff ZoffixWin: This is Windows rakudo
00:31 ZoffixWin k
00:31 johndau joined #perl6
00:31 Xliff So 2016.1
00:31 Xliff Can rakudobrew work under Windows?
00:31 ZoffixWin m: my int $x = '42'
00:31 camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native integer␤  in block <unit> at /tmp/aKnfbueB4q line 1␤␤»
00:32 ZoffixWin I tried to have it work a couple of times, but always had some sort of issues.
00:32 Xliff Yeah. Compiling under Windows is always sketchy unless you are in an IDE.
00:32 Xliff One of the reasons I develop under Linux.
00:32 Xliff s/develop/prefer developing/
00:33 Xliff <- Grammar Nazi
00:33 skink I might have to revert that commit then.
00:35 Xliff Oh, and I had a bug in my Mojo::DOM perl6 script that I finally fixed.
00:35 Xliff Now I don't need freaking uninintentionally backtracking regexes.
00:39 johndau joined #perl6
00:39 Timbus oh, howd that work out for you Xliff
00:45 johndau joined #perl6
00:49 teatime $hash{'key'} = $line if $line =~ /^foo/
00:49 teatime ?
00:49 teatime mischan
00:49 sortiz skink, Ups! Sorry, Indeed Buf.allocate is 2016.03+, and Xliff is using 2016.01.
00:50 Xliff sortiz: How difficult is it to compile rakudo under Windows?
00:51 Xliff Timbus: Well, I am now finding the tags I need to find. Now I need to see how well Mojo::DOM can manipulate them.
00:51 sortiz Xliff, dunno, I haven't tried.
00:51 Xliff Should not  be a problem. I am working on the manipulation rules, now.
00:51 Xliff sortiz, kthx
00:53 johndau joined #perl6
00:56 sortiz skink, If you like, I have a nqp trick for back compatibility ;-)
01:01 johndau joined #perl6
01:02 skink That sounds dangerous.
01:04 sortiz bbl &
01:05 johndau joined #perl6
01:06 johndau joined #perl6
01:11 zostay joined #perl6
01:21 skink sortiz, I see you have blob-allocate in NH-Blob
01:21 skink I just dunno what that does over Buf.new; $buf[len-1] = 0;
01:25 _nadim joined #perl6
01:25 skink m: my Int $len = 10; my $bytes = Buf.new; $bytes[$len - 1]; say $bytes;
01:25 camelia rakudo-moar 40a953: OUTPUT«Buf:0x<>␤»
01:25 skink m: my uint64 $len = 10; my $bytes = Buf.new; $bytes[$len - 1]; say $bytes;
01:25 camelia rakudo-moar 40a953: OUTPUT«Buf:0x<>␤»
01:25 Xliff Er.
01:25 skink Interesting.
01:26 Xliff m: say <a b c>.end
01:26 camelia rakudo-moar 40a953: OUTPUT«2␤»
01:26 Xliff m: say <a b c>.first
01:26 camelia rakudo-moar 40a953: OUTPUT«a␤»
01:26 Xliff m: say <a b c>.last
01:26 camelia rakudo-moar 40a953: OUTPUT«Method 'last' not found for invocant of class 'List'␤  in block <unit> at /tmp/HUsoMecgBh line 1␤␤»
01:26 Juerd Xliff: tail
01:26 Xliff m: say <a b c>.tail
01:26 camelia rakudo-moar 40a953: OUTPUT«(c)␤»
01:26 mr-foobar joined #perl6
01:26 skink Shouldn't it be head/tail for consistency?
01:26 Xliff Juerd: Thanks. Why "tail" and not "last"?
01:26 Juerd skink: There's head too.
01:26 Xliff m: say <a b c>.head
01:26 camelia rakudo-moar 40a953: OUTPUT«(a)␤»
01:27 Juerd Head and tail return a list, first returns an item.
01:27 Xliff Or is first a more complex version of head.
01:27 Juerd I don't know if there's an item version of tail.
01:27 Xliff That's just....odd.
01:27 Juerd Or maybe .first is just the filter thingy that defaults to the first thing
01:27 Juerd m: ^15.first: * > 9
01:27 camelia rakudo-moar 40a953: OUTPUT«Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at /tmp/6FeHJY58n9:1␤    ------> 3^157⏏5.first: * > 9␤WARNINGS for /tmp/6FeHJY58n9:␤Useless use of "^" in expression "^15.first: * > 9" in sink …»
01:28 Juerd m: (^15).first: * > 9
01:28 camelia rakudo-moar 40a953: ( no output )
01:28 Juerd m: say (^15).first: * > 9
01:28 camelia rakudo-moar 40a953: OUTPUT«10␤»
01:28 Xliff m: say <a b c>.tail[0]
01:28 camelia rakudo-moar 40a953: OUTPUT«c␤»
01:28 Juerd m: say (^15).first: * %% 2
01:28 camelia rakudo-moar 40a953: OUTPUT«0␤»
01:28 Xliff m: say <a b c>.tail[-1]
01:28 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JdnlBuPqlf␤Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1␤at /tmp/JdnlBuPqlf:1␤------> 3say <a b c>.tail[-1]7⏏5<EOL>␤»
01:28 teatime I was kindof surprised that there weren't direct equivalents to car and cdr
01:29 Juerd m: say <foo bar baz>.first: /^b/
01:29 camelia rakudo-moar 40a953: OUTPUT«bar␤»
01:29 Juerd So first without a condition is just like first(True)
01:29 skink wait what
01:29 skink m: my $buf = Buf.new; $buf[9] = 0; say $buf;
01:29 camelia rakudo-moar 40a953: OUTPUT«Buf:0x<00 00 00 00 00 00 00 00 00 00>␤»
01:29 skink Sometimes that works and sometimes it doesn't and I have no idea why.
01:32 skink Xliff, Replace L19 with
01:32 skink my $bytes = Buf.new();
01:32 skink $bytes[$len - 1] = 0;
01:33 skink er, L18
01:37 Xliff skink:
01:37 Xliff Did that already.
01:46 molaf joined #perl6
01:47 arlenik joined #perl6
01:57 johndau joined #perl6
02:00 cdg joined #perl6
02:03 skink How long until 2016.3+ is on Windows?
02:06 ZoffixWin I'd imagine it's all a matter of just following some procedure to generate the MSI
02:09 skink Would it be bad to not be 6.c-compatible?
02:11 ZoffixWin "it" being what? :) A Perl 6 release? Sure, it'd be terrible.
02:12 skink Nah, this module. sortiz informed me I could passed a .allocate()'d Buf instead to a C bind, instead of passing a CArray and copying it to a Buf
02:13 skink But that's 2016.3+
02:13 skink My English is failing apparently
02:16 Ben_Goldberg joined #perl6
02:17 noganex joined #perl6
02:18 ZoffixWin I know there are use 6.c, use 6.d, use 6.etc constructs to specify language version... but I don't know whether 6.c.1 was released yet or if there's a way to specify required compiler version.
02:19 ZoffixWin I guess this is a good precedent to mention in #perl6-release
02:22 MadcapJake if I pass a : at the beginning of a string argument to MAIN, it fails to match any signatures and triggers the Usage message
02:24 teatime the MAIN sub / usage / etc. behavior is cute but I don't see it seeing a lot of practical use
02:24 teatime unless I understand exactly how it's intended to be used
02:24 skink Easy to add basic command-line options without having to use getopts or something.
02:25 MadcapJake it's not bad, but I think this is a bug
02:25 ZoffixWin MadcapJake, can't reproduce. What's the sig for MAIN you're using and what's the way you're calling the script with?
02:25 teatime yeah, I guess I can actually see a lot of practical use in smaller and personal scripts, which is a lot of value.
02:25 MadcapJake ./bin/rabble -e -d ": addone 1 + ; 1 addone ."
02:26 ZoffixWin MadcapJake, but the usage message tells you to use -d="..." doesn't it? You're missing the equals sign
02:26 MadcapJake no, those are Bools
02:26 ZoffixWin teatime, I see it as a rudimentary way to self-document usage instructions to some basic scripts. It's better than nothing
02:27 MadcapJake /home/jrusso/github/rabble/bin/rabble --expression|-e [--debug|-d] <expr>
02:27 MadcapJake /home/jrusso/github/rabble/bin/rabble [--debug|-d] <file>
02:28 ZoffixWin MadcapJake, confirmed on my box. You should rakudobug this:   perl6 -e 'sub MAIN ($x) {}' ": 42"   <-- triggers usage... perl6 -e 'sub MAIN ($x) {}' "42" <-- no usage
02:28 Xliff m: "This is a test." ~~ /<[ \.\!\?\"\”\— ]> \s* $$/;
02:28 camelia rakudo-moar 40a953: ( no output )
02:28 MadcapJake :(Str $expr, Bool :expression(:$e)!, Bool :debug(:$d)) is the signature I'm trying to match
02:29 ZoffixWin The bug seems to exist with a single positional as well. A ":" as the first char in the positional breaks something
02:29 skink Okay Xliff I undid with Buf.allocate() stuff and kept the other small tweaks I made
02:30 ZoffixWin m: say "This is a test." ~~ /<[ .!?"”— ]> \s* $$/;
02:30 camelia rakudo-moar 40a953: OUTPUT«「.」␤»
02:30 ZoffixWin Xliff, ^ too many backslashes :)
02:33 ZoffixWin MadcapJake, are you rakudobugging it? I found this works: to set $y to 45: perl6 -e 'sub MAIN ($x, :$y) { say $y }' ":y=45" 42
02:34 ZoffixWin In addition it's also impossible to pass "-y=45" to a positional argument, because it gets interpreted as a named arg, it seems
02:34 Xliff ZoffixWin, thx
02:34 MadcapJake crazyness!
02:35 teatime ZoffixWin: even if you do -- first ?
02:35 ZoffixWin teatime, was about to say.... the -- is the way.
02:35 ZoffixWin This is more about the shell than Perl 6, but :y should still be parsed as normal string and not a named arg IMO
02:36 Xliff skink: All tests OK
02:36 ZoffixWin perl6 -e 'sub MAIN ($x) { say $x }' -- ":y=45" works fine
02:36 skink Sweet
02:36 teatime perhaps that syntax was intentional based on Perl6-ish syntax
02:36 ZoffixWin Unless there are some shells where : instead of - on args is used that I'm unaware of.\
02:36 skink Maybe in the future I'll switch to Buf.allocate() for efficiency but not until 2016.3+ is widely used
02:39 skink Alright, now that optimizations and bug-testing have been done and everything works, who can I talk to about including the module on the main list?
02:40 MadcapJake #127864 <-- ZoffixWin
02:40 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127864
02:40 teatime ZoffixWin: it's not a shell thing, just a conventions thing.  windows apps can use - and *nix apps can use /
02:40 ZoffixWin MadcapJake++
02:40 ZoffixWin teatime, but :?
02:41 MadcapJake shells use : to separate values/paths in environment variables, that's all I can think of
02:41 teatime I'm still betting it's intentional because it matches Perl6 syntax for calling subs w/ named params
02:42 ZoffixWin This all may be a matter of documentation.
02:42 MadcapJake I just need a way to turn it off then
02:42 teatime but yeah, it is definitely a surprising thing if you don't expect it.
02:42 ZoffixWin MadcapJake, use -- before positionals
02:42 MadcapJake ZoffixWin: ahh! Yes thank you!
02:42 teatime ^^ any time you don't know their value
02:42 ZoffixWin perl6 -e 'sub MAIN ($x) { say $x }' -- ":y=45"
02:43 teatime echo "$var" # bad    echo -- "$var" # better.
02:43 teatime probably a terrible example because echo -- is probably not portable
02:44 teatime printf "%s" "$var" # best?  I digress.
03:14 kerframil echo -- "$var" is wrong because -- will be treated as a string operand. printf is, indeed, a good idea.
03:44 dj_goku joined #perl6
03:57 _nadim joined #perl6
04:01 BenGoldberg_ joined #perl6
04:02 astj joined #perl6
04:06 cpage_ joined #perl6
04:08 geekosaur joined #perl6
04:10 geekosaur joined #perl6
04:13 teatime kerframil: damn you're right; I was sure that worked in at least bash :/
04:15 teatime it seems printf doesn't take any real options, so printf "%s" "$var" should probably be safe
04:18 kerframil teatime: yeah, it's a confusing exception that's mandated by the open group
04:18 teatime kerframil: which, echo, or printf not taking options?
04:18 teatime I can understand both.
04:19 teatime but I thought echo's portability was a lost cause at this point anyway, so adding -- to echo wouldn't be *that* evil.
04:19 kerframil teatime: "The echo utility shall not recognize the "--" argument in the manner specified by Guideline 10 of the Base Definitions volume of IEEE Std 1003.1-2001 ..."
04:19 kerframil teatime: and guideline 10 is the one that recommends allowing -- as a delimiter indicating end of option processing
04:20 teatime heh I figured :)
04:20 kerframil :)
04:24 Cabanossi joined #perl6
04:46 thowe joined #perl6
04:48 thowe So, ran rakudobrew build moar, and after it suggests to me to "panda install Readline" and other things.
04:48 thowe But running Panda produces an error "Could not find Shell::Command".  How does one proceed in this case?
04:49 hoelzro thowe: how are you running panda?
04:49 thowe I type "panda"
04:50 thowe at a shell
04:50 hoelzro how did you install panda?
04:50 thowe I didn't realize I did.  I'm using rakudobrew
04:51 hoelzro if you didn't run `rakudobrew build panda`, I'm wondering how panda got on your PATH at all
04:51 thowe there is more to the error, it lists various dirs it is not found in.  I guess it is the perl6 equiv of @INC
04:51 hoelzro you should probably run that command =)
04:51 thowe I will.
04:52 teatime and also maybe 'rakudobrew rehash'; I had to do that to get some other stuff linked into ~/.rakudobrew/bin (but not panda)
04:52 thowe things happening
04:52 teatime and make sure you add the stuff to PATH / shell startup per the rakudobrew instructions
04:57 thowe yeah, I have the rakudobrew stuff in path, I have built panda.  Still getting this error..
04:58 thowe should I remove .rakudobrew?
04:58 thowe and start over?
04:59 hoelzro thowe: what does `which panda` say?
05:00 thowe /home/tim/.rakudobrew/bin/panda
05:01 cdg joined #perl6
05:01 hoelzro weird; did you rehash as teatime suggested?
05:01 thowe yeah
05:02 hoelzro I suppose nuke ~/.rakudobrew and start over =/
05:02 thowe OK
05:24 hankache joined #perl6
05:38 cdg joined #perl6
05:45 kanishka joined #perl6
05:51 MadcapJake does $?USAGE work?
06:00 jack_rabbit joined #perl6
06:01 Ben_Goldberg joined #perl6
06:02 Ben_Goldberg joined #perl6
06:04 Ben_Goldberg joined #perl6
06:04 hankache say $?USAGE;
06:04 hankache m: say $?USAGE;
06:04 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6e6iGta9Vo␤Variable '$?USAGE' is not declared␤at /tmp/6e6iGta9Vo:1␤------> 3say 7⏏5$?USAGE;␤»
06:07 Vlavv_ joined #perl6
06:10 hankache in which cases would someone use macros?
06:12 MadcapJake just released rabble v0.3.1, with more words, tests and a repl! https://github.com/MadcapJake/rabble
06:13 hankache MadcapJake++
06:14 geekosaur joined #perl6
06:15 MadcapJake hankache: I found a way that I didn't need to access $?USAGE (had to organize my MAIN multis better)
06:17 hankache aha
06:17 MadcapJake pretty cool that a grammar and an action class can get you a written language in 338 lines of Perl 6 :D
06:18 buharin joined #perl6
06:18 MadcapJake s/written/programming/
06:20 BenGoldberg joined #perl6
06:33 jack_rabbit joined #perl6
06:37 perlawhirl joined #perl6
06:40 nadim joined #perl6
06:43 CIAvash joined #perl6
06:45 perlawhirl joined #perl6
06:46 dalek ecosystem: 2d43eba | (Jake Russo)++ | META.list:
06:46 dalek ecosystem: Add Rabble
06:46 dalek ecosystem:
06:46 dalek ecosystem: [Rabble](https://github.com/MadcapJake/rabble) is a Forth-like language written in Perl 6.
06:46 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/2d43ebaa2e
06:49 Timbus heh. a stack based lang in perl 6. this looks familiar :^)
06:49 MadcapJake familiar? how so?
06:49 Timbus i wrote one, in parrot
06:49 MadcapJake haha nice!
06:50 Timbus it was a bit different, but yeah. fun
06:53 sortiz The last Forth-like language I wrote was in assembler, 30 years ago, fun indeed.
06:53 MadcapJake Timbus: is that the "fun" repo?
06:53 Timbus haha yeah that's the one
06:53 MadcapJake sortiz: nice!
06:54 Timbus i remember dusting off the code and not understanding any of it a little while ago
06:54 MadcapJake Timbus: hehe, never learned Parrot so I have no idea how to read it! XD
06:55 Timbus i wrote some copy-on-write fancy stuff, so the language has no 'state' aside from the stack, which allows it to run out-of-order. it actually runs backwards from the dot
06:56 MadcapJake It's so cool to use grammar and actions to make a language, check out the Rabble::Reader for the grammar and Rabble::Compiler for the actions, if you're interested.
06:56 Timbus i might do
06:56 rindolf joined #perl6
06:57 djbkd joined #perl6
06:57 MadcapJake Timbus: wow! That's quite complex! This one manipulates a shared stack variable and it just does simple array ops on it.
06:58 grondilu so in ./A.pm6 I have 'unit module A; our module B;' in ./A/C.pm6 I have 'unit module A::C; use A; sub f(A::B $) {}' and if I do 'perl6 -I. -e 'use A; use A::C' I get:
06:58 grondilu ===SORRY!=== Error while compiling /home/grondilu/A/C.pm6 (A::C)
06:58 grondilu Invalid typename 'A::B' in parameter declaration.
06:58 MadcapJake off to bed, g'night #perl6
06:59 grondilu what am I missing?
06:59 sortiz o/ MadcapJake
06:59 espadrine joined #perl6
06:59 grondilu oh sorry I meant 'our class B;'
07:02 sortiz grondilu, suppose yes, but has class B a body?
07:03 teatime without a body, I get a different error; *with* a (empty) body, I get grondilu's error message.
07:04 grondilu our class B {}
07:06 grondilu basically I was trying to make a Foo::Bar module that contain additional extra functions to a main Foo module.
07:06 sortiz Umm, that should work
07:10 wamba joined #perl6
07:12 sortiz Reproduced, but works if in A.pm I change module -> package, weird.
07:19 sortiz grondilu, can you test using 'package'?
07:21 grondilu yeah with A as a package it works
07:22 perlawhirl joined #perl6
07:22 * sortiz need to reread the spec for understand what 'module' offers me.
07:26 sortiz btw I try to avoid 'module' 'cus seen other problems like 'duplicate symbol Foo at GLOBAL merging', and 'package' works. ;-)
07:32 hankache_ joined #perl6
07:33 Xliff Does anyone know how to specify multiple conditions in a given/when?
07:34 Xliff m: given 6 { when 6 || 5 { say "Boo"; } }
07:34 camelia rakudo-moar 40a953: OUTPUT«Boo␤»
07:34 Xliff m: given 5 { when 6 || 5 { say "Boo"; } }
07:34 camelia rakudo-moar 40a953: ( no output )
07:34 sortiz m: given 5 { when 6 | 5 { say "Boo"; } }
07:34 camelia rakudo-moar 40a953: OUTPUT«Boo␤»
07:35 * Xliff hugs sortiz
07:35 Xliff thx
07:35 sortiz That a nice use for Junctions.
07:36 sortiz m: if 4 == 3 | 4 | 5 { say "yes" };
07:36 camelia rakudo-moar 40a953: OUTPUT«yes␤»
07:42 Xliff Conjunction junction, what's ya function?
07:42 * Xliff ♥s given/when.
07:44 masak when Perl finally got a switch, it got it real good. :P
07:44 masak morning, #perl6
07:44 sortiz \o masak
07:56 firstdayonthejob joined #perl6
07:57 grondilu I've made the mistake of writing -> $a, $b {...} instead of -> ($a, $b) {...} again.  Weren't both syntax use to be OK?
07:57 masak ok, general web stuff question: if you're a web application serving a normal boring POST, then you want to process and then 302 redirect -- but if you're a REST endpoint, you'll want to send back 200 and some JSON -- correct?
07:57 masak grondilu: it used to be only the former
07:58 masak grondilu: switched to only the latter after GLR
07:58 grondilu oh, that explains a lot.
07:58 masak grondilu: frankly, the latter is slightly more consistent
07:58 masak so I've learned to accept it :>
08:03 darutoko joined #perl6
08:07 cdg joined #perl6
08:09 domidumont joined #perl6
08:15 * masak kinda wishes he had a web development mentor/guru sometimes
08:17 frithnanth joined #perl6
08:20 sortiz masak, maybe I can help you, if you forgive my English :-)
08:21 masak I, I can forgive a lot worse things than English ;)
08:21 masak s/I/oh/, d'oh
08:22 masak sortiz: mainly my question right now is http://irclog.perlgeek.de/perl6/2016-04-09#i_12309938
08:23 sortiz In general you should not return a redirect (302) for a POST, unless you are ignoring the request. Ie, if you has processed the POST, you need to return 200.
08:23 masak oh, but I thought redirecting on POST success was a "best practice" for the web.
08:25 masak https://en.wikipedia.org/wiki/Post/Redirect/Get
08:25 sortiz Thats 'cus by the http spec "If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user"
08:27 masak I'm sorry, that seems rather unrelated to me.
08:28 masak the fact is that a redirect on a POST *does* work in all browsers (so it doesn't matter that the spec says that, does it?)
08:28 masak and the redirect has nothing to do with which verbs accept which redirects; it's to solve another problem, namely accidental POST re-submissions
08:29 sortiz Returning 302 for a POST is a trick to avoid the request to be re-submited on reload or other actions.
08:29 masak right
08:30 masak though what you call a "trick", Wikipedia calls a "web development pattern" :)
08:30 masak or "web development design pattern", even
08:32 sortiz The detail is that the net result depends of the client code, an old fashion web form will cause the browser to ask the user, but a JS request can handle that "pattern".
08:32 RabidGravy joined #perl6
08:33 masak oh! that's a detail I may have overlooked.
08:33 sortiz So, the real question is, who are handling the response client side.
08:34 masak anyway, I'm switching away from <form> elements to just AJAX-in-the-background, so maybe I simply don't need the 302s and this is all a non-issue.
08:34 masak right. it used to be <form>, and will soon be AJAX-only.
08:34 masak AJAX powered by jQuery 3.0 beta, not that it matters much.
08:35 sortiz Ahh, Ok, so you control both, so you don't need to worry.
08:36 sortiz In that case, a simple 200 followed by you JSON is all right.
08:37 masak yes, I think so
08:38 masak considering that the <form> variant is going away completely
08:38 sortiz Yep.
08:38 masak but it did strike me that people (like Gmail's Basic HTML view) who strive to make both work have an even bigger task than I had assumed.
08:38 masak guess that's mainly why I ask. :)
08:39 sortiz Yes.
08:40 sortiz Moreover, in you POST, I assume the BODY is JSON too, so you are sure that the other side is your code. ;-)
08:41 sortiz *your POST
08:43 Hotkeys oh gosh
08:43 Hotkeys I'm writing codejam
08:43 Hotkeys and it's turning into codegolf
08:43 Hotkeys because I'm writing them all in the repl
08:43 Hotkeys this is bad
08:43 Hotkeys can't show examples cause the round is still on
08:43 perlawhirl joined #perl6
08:43 psch o/
08:44 psch i think #127864 is a good reason to try and revive my cliparser-with-grammar branch
08:44 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127864
08:44 psch maybe this time there'll be someone to review it :P
08:44 psch and *maybe* we also find a use for %*OPTS!
08:45 Begi joined #perl6
08:45 masak Hotkeys: show them later! :)
08:46 Hotkeys I will
08:46 masak \o/
08:48 psch oh boy
08:49 psch ZoffixWin++ # there's a lot of wonky in what we currently do with cli args
08:49 Hotkeys map is lazy right?
08:49 Hotkeys if I do @foo.map({...})[3] it'll only do it 3 times?
08:50 psch e.g. < perl6 -e 'sub MAIN(:$a) { }' "--a" > gives the *compiler* USAGE, with -c and --doc and -e and so on... o.o
08:55 sortiz Hotkeys, yes, is lazy and no, you do it four times.
08:55 Hotkeys oops
08:55 Hotkeys right
08:55 Hotkeys I can't count
08:56 Hotkeys I meant to say ^3 probably
08:57 masak m: say list ^3
08:57 camelia rakudo-moar 40a953: OUTPUT«(0 1 2)␤»
08:58 Hotkeys ^3 would be 3 times :p
09:02 ocbtec joined #perl6
09:05 sortiz Hotkeys, btw, in reality the number of time that your code is executed depends of its arity.
09:05 sortiz *times
09:06 Hotkeys ikik
09:06 sortiz ynyn
09:07 Hotkeys I really just wanted to know if it was lazy
09:07 Hotkeys the rest was me being too inspecific
09:07 Hotkeys :p
09:08 * masak .oO( for sufficiently large values of 3... )
09:11 masak m: say "can roles call private methods on a class?"; role R { method foo { self!bar } }; class C does R { method !bar { say "yes, they can!" } }; C.new.foo
09:11 camelia rakudo-moar 40a953: OUTPUT«can roles call private methods on a class?␤yes, they can!␤»
09:11 masak :)
09:11 masak ...that's nice.
09:11 masak jnthn++, probably
09:12 sortiz And the other way too.
09:13 masak (in this particular case, it allows me to layer domain-specific code without either breaking class encapsulation/data hiding or class single-responsibility)
09:13 masak I started doing it in a Wrong way, and then wondered whether the above is an option for me. it is :>
09:15 buharin joined #perl6
09:17 teatime .tell ZoffixWin ah yeah, thought I remembered maybe reading the ":arg" form somewhere:  https://design.perl6.org/S06.html#Declaring_a_MAIN_subroutine
09:17 yoleaux teatime: I'll pass your message to ZoffixWin.
09:17 teatime .tell MadcapJake ah yeah, thought I remembered maybe reading the ":arg" form somewhere:  https://design.perl6.org/S06.html#Declaring_a_MAIN_subroutine
09:17 yoleaux teatime: I'll pass your message to MadcapJake.
09:18 teatime should I drop that link into https://rt.perl.org/rt3//Public/Bug/Display.html?id=127864 or would that be bad form
09:18 psch teatime: check the ticket first ;)
09:20 teatime lol, I got scooped.
09:20 psch i like the last test case i added to the ticket
09:20 psch it's a great WAT
09:22 teatime 'interpreter can't distinguish between quoted arguments that look like switches and non-quoted switches' this is obvious though, yeah?
09:22 psch teatime: yeah, because shells strip quoting afaik
09:22 teatime yeah, absolutely.
09:22 psch teatime: still, the last case is still extra wrong :)
09:22 teatime def. interesting.
09:26 teatime although, and maybe I saw discussion of this earlier, it appears more weirdness happens when using perl6 as the command vs. running a script w/ a shebang
09:28 teatime yeah, those 4 test cases work fine in a script file.
09:28 psch what's "fine" there?  outputting 'named'?
09:31 teatime psch: http://paste.debian.net/plain/429797
09:31 psch teatime: interesting
09:32 psch fwiw, i've rebased an old branch that uses an NQP-level grammar (instead of the state-machine-y thing we have in nom) to parse cli opts and that agrees with your test even without putting it into a script
09:32 teatime they *also* work fine if I run it as:  perl6 script.p6 <args>
09:32 psch ah.  so something is broken with -e as stopper in nom
09:32 teatime so perhaps it is only in the case of -e they break (in which case, perhaps you don't really even need to fix it...)
09:33 teatime I mean, depending on the why, of course.
09:34 psch https://github.com/perl6/nqp/blob/master/src/HLL/CommandLine.nqp#L21
09:34 psch oh, docs
09:34 psch phew :P
09:34 psch i was wondering why that doesn't complain about undeclared '$paser' hah
09:35 psch https://github.com/perl6/nqp/blob/master/src/HLL/CommandLine.nqp#L252 is probably actually at fault
09:35 psch iirc we add '-e' as stopper, but it checks for '--e'
09:35 psch yeah https://github.com/perl6/nqp/blob/master/src/HLL/Compiler.nqp#L326
09:37 teatime welp lol hope I helped a little
09:37 teatime I'm too used to debugging by intuition/guessing followed by testing to confirm
09:38 teatime kindof a pointless exercise when the codebase is nearby and familiar :)
09:38 psch hah, well, i only know that part because i wrote that branch i mentioned some time ago and clearly had to understand what we do now to do it differently... vOv
09:38 psch there's lots of parts in the code base i have no clue about :P
09:39 psch like, almost everything in nqp/src/vm/moar for example
09:43 hankache joined #perl6
10:12 RabidGravy ???????????? ???????????????????? ???????????????????? ???????????? ???????????????????? ???????????????? ???????????? ???????????????? ????????????
10:15 teatime frakteur++
10:20 araujo joined #perl6
10:21 RabidGravy I'm pleasantly surprised that survived the trip from json -> rakudo -> terminal -> clipboard -> xchat
10:33 vike joined #perl6
10:35 ufobat does a if my $foo = $obj.method($something) { ... } have some side effects or is there anything to mention?
10:36 psch m: if my $foo = 0 { }; say $foo
10:36 camelia rakudo-moar 40a953: OUTPUT«0␤»
10:37 ufobat i have a say $foo inside the if, and it prints me "False"
10:37 ufobat i am feeling like loosing my mind
10:37 psch ufobat: my point is it's a mainline declaration, the my isn't scoped to the if (unlike perl5 iirc?)
10:38 ufobat yeah :)
10:38 psch m: if 1 -> $x { }; say $x
10:38 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NncB6wqaeE␤Variable '$x' is not declared␤at /tmp/NncB6wqaeE:1␤------> 3if 1 -> $x { }; say 7⏏5$x»
10:38 psch m: if 1 -> $x { say $x }; say $x
10:38 camelia rakudo-moar 40a953: ( no output )
10:38 ufobat but this could not explain my point, could it?
10:38 psch ...huh
10:39 psch m: class A { method foo { "foo" } }; if my $foo = A.new.foo { say $foo };
10:39 camelia rakudo-moar 40a953: OUTPUT«foo␤»
10:39 psch ufobat: i don't know.  what is your point?
10:39 ufobat http://pastebin.com/mkpdSjma
10:39 ufobat my point is that i get a False
10:40 ufobat in this example
10:40 ufobat if i remove the "for"'s in line 40 an 41 i dont get a False
10:41 psch m: sub f { my $x = "foo" ~~ /\d+/; return $x }; if my $x = f() { say $x }
10:41 camelia rakudo-moar 40a953: ( no output )
10:42 ufobat did you try it out, my example?
10:43 psch yeah, i just did
10:43 ufobat same behaviour?
10:43 psch yeah, a bunch of False from the loop
10:44 ufobat oh thank god!!
10:44 psch hm, interesting
10:45 psch i added 'print $++ ~ " ";' before the 'if my ...'
10:45 psch well, the output is interesting :)
10:46 psch http://pastebin.com/HAfkfQEn
10:47 psch maybe something about shadowing or redeclarations or idk... :/
10:47 ufobat i get 458 false from 484 iterations
10:47 psch point is, don't do 'if my $x = ...' :)
10:47 psch 'cause with 'if $r.match(..) -> $match' it just works
10:48 psch well, where 'just works' means 'doesn't print False' :P
10:48 ufobat ;)
10:49 ufobat is that.. a bug in perl6 or in my code? or how should this be rated?
10:49 psch ufobat: well, 'if my ...' is somewhat of a deprecated pattern afaik
10:50 psch 'cause it doesn't do what anyone who knows it from perl5 would expect
10:52 ufobat well if its allowed, then it must follow a pattern == it must be understandable.. it might also have a sense.. but i dont see both of that
10:53 ufobat anyway
10:53 ufobat it's odd, any i am glad i am not mad :)
10:53 ufobat i need a coffe break :)
10:54 ufobat thanks for helping me out!
10:54 psch yeah, i don't readily see why it gets through the if with $match == False...
11:03 ufobat are the for loops around parallelized and share the same $match? and its some kind of racecondition?
11:03 psch i have no idea... :)
11:05 perlawhirl joined #perl6
11:13 ufobat psch, if you comment in  say "Meth $meth, URI: $uri found: " ~ $r.gist; and have the print $++ ; with the print $++; if ... thingy
11:13 ufobat then you always get the false on the 3th route.. like in your example
11:13 ufobat when you remove the print $++
11:13 ufobat you always get the first route
11:21 perlawhirl hi perlers
11:25 mr-foobar joined #perl6
11:30 sue joined #perl6
11:34 khisanth_ joined #perl6
11:38 rindolf joined #perl6
11:41 kid51 joined #perl6
12:10 timotimo o/
12:10 perlawhirl hi timo
12:11 timotimo hey, how are you?
12:12 perlawhirl remember the 'most common element in list' thing i was looking at yesterday
12:13 perlawhirl it's worse than i thought :D ... this seems to be the best way...
12:13 perlawhirl m: say <1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
12:13 camelia rakudo-moar 40a953: OUTPUT«(2)␤»
12:13 timotimo in what way is that the best?
12:13 perlawhirl works like maxpairs in that it returns a list, in case there's more
12:13 perlawhirl say <1 1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
12:13 perlawhirl m: say <1 1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
12:13 camelia rakudo-moar 40a953: OUTPUT«(1 2)␤»
12:14 perlawhirl well... best as in... so far the most performant method call way of doing it
12:14 perlawhirl faster than going via Bag
12:14 perlawhirl and jnthn's suggestion yesterday doesn't actually work
12:15 perlawhirl because max doesn't work like that
12:16 perlawhirl oh, another kinda related thing is this...
12:16 perlawhirl m: say < 1 1 1 2 2 3 >.classify(*)
12:16 camelia rakudo-moar 40a953: OUTPUT«Doesn't make sense to classify with itself␤  in block <unit> at /tmp/Y6lOTzoShA line 1␤»
12:16 perlawhirl But there is a valid reason to classify with itself sometimes
12:16 perlawhirl m: say < 1 1 1 2 2 3 >.classify({$_})
12:16 camelia rakudo-moar 40a953: OUTPUT«{1 => [1 1 1], 2 => [2 2], 3 => [3]}␤»
12:17 perlawhirl which is what i'm using in my most common element thingy
12:17 perlawhirl in p5 days, we'd create a temporary hash to store the values, but p6 kinda does it for us with classify
12:18 k-man joined #perl6
12:18 hankache joined #perl6
12:18 perlawhirl so anyway.. that's what's on my mind :D how are you?
12:24 timotimo not feeling very productive these last days
12:24 timotimo i've been monitoring an afl-fuzz run against moarvm intently over the last days: http://hack.p6c.org/~timo/
12:25 perlawhirl my understanding of fuzzing is fuzzy... it's for finding bugs?
12:25 timotimo yeah
12:26 timotimo afl in particular instruments the target binary (you compile it with a wrapped gcc or clang) and it watches what branches are taken in what order and only continues with fuzzed inputs when they have something new to contribute
12:27 timotimo on top of that it has a heuristic of some kind to determine when it likes a "path" extra-much
12:27 perlawhirl has the fuzzing identified anything interesting yet?
12:28 timotimo it already found a few places where moar doesn't check values against given ranges or tried to read more in the serialized blob than is there
12:29 timotimo i haven't yet looked at the results of the "left" run; it's currently minimizing results for me, which i'm waiting for
12:29 dalek star: 7a55aad | (Steve Mynott)++ | modules/doc:
12:29 dalek star: sync doc submodule only with master
12:29 dalek star: review: https://github.com/rakudo/star/commit/7a55aade5e
12:29 timotimo even though i don't actually have to wait
12:30 kid51 joined #perl6
12:30 perlawhirl does fuzzing "finish" or it just something that can go on indefinitely?
12:30 timotimo you can stop running afl-fuzz when it hasn't found any new paths for one whole run
12:31 timotimo but in theory, you can run fuzzing until the universe dies
12:31 timotimo some projects have automated fuzz testing as far as i understand
12:31 perlawhirl hah
12:31 astj joined #perl6
12:31 timotimo not sure what the best practices are there
12:32 timotimo i used the whole stage0 of nqp as initial input files, and it turns out that at least one of those files is pretty much gigantic
12:32 perlawhirl ah, so are you thinking of implementing some automated fuzzing for rakudo?
12:32 timotimo the first run i started even tries to actually run the file it gets fed, which means that a) it pulls in its dependencies, b) it tries to then run the bytecode segment
12:33 timotimo maybe; it'd be pretty painful to run a full rakudo against the fuzzer, because it hopes to do multiple hundred executions per second
12:33 bjz joined #perl6
12:34 timotimo and rakudo still has a start-up time of about 0.1 seconds
12:35 perlawhirl ahh right
12:35 timotimo and i'm not sure how useful it'd be to fuzz with the C parts of moarvm instrumented
12:35 timotimo it can tell what branches are taken, still, but it won't know anything about bytecode-level branches
12:35 teatime so, help me understand something... take the example of these operators  https://github.com/rakudo/rakudo/blob/8cbb1efd1d84fd57298e0e0813b64d8dd37140ba/src/core/Duration.pm#L21
12:35 timotimo and those are the really interesting ones
12:36 teatime If these specified 'returns Duration', what would be different?  would some code out there using this class break?
12:36 timotimo it would insert a run-time check to see if the return value is correct
12:36 teatime ahhh, so it would slow things down?
12:36 teatime I had assumed adding type info would speed things up
12:36 timotimo i'm not sure if anything would check that statically
12:37 teatime gotcha.
12:37 timotimo hm, perhaps spesh can optimize the return typecheck - not sure about that
12:38 cognominal joined #perl6
12:38 dalek star: 32ffad8 | (Naoum Hankache)++ | docs/perl6intro.pdf:
12:38 dalek star: Latest snapshot of perl6intro.com
12:38 dalek star: review: https://github.com/rakudo/star/commit/32ffad87c4
12:38 dalek star: 89d54b2 | (Steve Mynott)++ | docs/perl6intro.pdf:
12:38 dalek star: Merge pull request #68 from hankache/master
12:38 dalek star:
12:38 dalek star: Latest snapshot of perl6intro.com
12:38 dalek star: review: https://github.com/rakudo/star/commit/89d54b2729
12:38 nadim joined #perl6
12:38 teatime heh, and sanity check me here: you cannot do multiple-dispatch based on return type, right?
12:38 timotimo perlawhirl: on the other hand, moar has its own instrumentation framework; with the right amount of documentation, we could probably have afl-compatible instrumentation of moar bytecode rather than having the C instrumented
12:38 timotimo that's right, teatime
12:39 timotimo but you can return objects that know how to give differently-typed results and only do the necessary work
12:41 timotimo you can look at how tr is implemented for an example
12:41 timotimo i think StrDistance is the class to look for
12:41 perlawhirl timotimo: that sounds pretty promising... though i must confess a lot of this stuff is going over this network engineers head :D
12:43 timotimo perlawhirl: it may sound promising, but it won't be worth a damn until someone actually does it :)
12:43 timotimo on afl's website, there's a few bugs afl helped find in perl5 by giving it fuzzed strings as input programs
12:46 timotimo % miniperl -ce '/(?7777777777)/'
12:46 timotimo Segmentation fault (core dumped)
12:47 cdg joined #perl6
12:48 timotimo perl -e 's)$0{0h());qx(@0);qx(@0);qx[-]'
12:48 perlawhirl cool, yes i read the p5p updates that filter down and it almost seems like each time i read it there is a handful of new bugs identfied via fuzzing
12:48 timotimo this also used to segfault after outputting all the syntax errors
12:49 timotimo https://lists.gnu.org/archive/html/bug-indent/2015-03/msg00004.html - wow.
12:51 cdg_ joined #perl6
12:51 perlawhirl hah, that first one
12:51 RabidGravy oof
12:51 pmurias joined #perl6
12:52 RabidGravy and gnu indent is a fairly mature program
12:52 timotimo fortunately we're a bit less likely to crash from bogus perl6 program code, as our compiler is written in a high-level language and uses pretty much exclusively "managed" datastructures, like arrays that have index-checks built-in
12:54 teatime lol, not only is there Math::BigRat, there is also FatRat
12:55 RabidGravy clearly there should be a MonsterRat
12:56 timotimo a MonsterRat has Complex for both the numerator and denominator
12:56 timotimo that's clearly useful, right?
12:57 sno joined #perl6
12:58 RabidGravy obviously *waves hands*
12:59 timotimo perlawhirl: are you interested in result sets from the fuzzing run?
13:02 perlawhirl uhm... I wouldn't understand the result sets even if i had them :)
13:02 timotimo it's just .moarvm files that you can feed to moar and see it crash :)
13:03 timotimo and the fun part is that afl-tmin goes to great lengths to make the files simpler. for example, every byte that is deemed non-necessary to trigger the crash gets replaced with "0"
13:05 timotimo anyway, here are the first few hundred minimized crashing files: http://hack.p6c.org/~timo/a_few_minimized_crashes.tar.gz
13:05 perlawhirl lol, thanks
13:05 kid511 joined #perl6
13:06 timotimo you probably have to cd into nqp's vm/moar/stage0 folder to make them work at all
13:07 timotimo because it'll try to load the dependency .moarvm files, too
13:08 timotimo cool, this is a real crash
13:11 timotimo hah, it could be the fuzzer invented a frame that is its own outer and then leaving that frame tries to free something and ends up infini-recursing or something
13:12 sue joined #perl6
13:12 moritz oh, the fun :-)
13:13 timotimo that's just my interpretation from a first brief look at the stack trace and listing
13:14 timotimo there's actually three different "needed" parameters involved in the recursion through "autoclose"
13:17 nowan joined #perl6
13:17 dalek star: 55c5a3a | (Steve Mynott)++ | tools/star/release-guide.pod:
13:17 dalek star: FROGGS did 2016.01
13:17 dalek star: review: https://github.com/rakudo/star/commit/55c5a3a366
13:17 dalek star: 7efb22c | (Steve Mynott)++ | tools/star/release-guide.pod:
13:17 dalek star: put blank nl before every new year
13:17 dalek star: review: https://github.com/rakudo/star/commit/7efb22c4cc
13:17 timotimo sadly, i can't just --dump to see what's going on, because --dump causes strings to be deserialized and it notices early on that some string index is damaged
13:17 timotimo stmuk: thank you for working on Star some more
13:18 stmuk timotimo: no worries! I'm going as far as I can (excluding things like annoucements and uploads where I don't have access)
13:22 RabidGravy ????
13:22 RabidGravy Is it a camel or a brontosaurus?
13:22 timotimo RabidGravy: are you fuzzing the irc? :P
13:22 timotimo oh, an emoji
13:22 timotimo i didn't really get a terminal emulator yet that supports those
13:23 timotimo but i suppose i could be using glowing-bear for irc
13:23 MadcapJake RabidGravy: camel :) IRCCloud converts emoji to a colored emoji font
13:23 yoleaux 09:17Z <teatime> MadcapJake: ah yeah, thought I remembered maybe reading the ":arg" form somewhere:  https://design.perl6.org/S06.html#Declaring_a_MAIN_subroutine
13:25 teatime p.s. I ended up just pasting that to the ticket in case the reference was useful.
13:27 arnsholt timotimo: Oh, that indent bug! And this is why we don't program in C unless we really, really have to =)
13:30 timotimo :)
13:30 timotimo of course our VM can still be buggy
13:34 MadcapJake teatime: I read that, seems weird to me that it reads from quoted things, why not just parse arguments that are unquoted?
13:34 arnsholt Of course!
13:34 teatime MadcapJake: there's no processing of quoted vs. unquoted
13:34 arnsholt But at least the potential surface area for C bugs is smaller when you have less C code
13:34 teatime the shell removes quotes before they get to perl
13:34 MadcapJake teatime: ahh, that's why, I didn't realize that
13:34 teatime (unless they're literal, like if you say "\"")
13:35 timotimo you can tell an argument was quoted if it contains spaces
13:35 teatime timotimo: not really
13:35 timotimo because then it has to have been quoted, otherwise it would have been split by the shell
13:35 teatime timotimo: how about "timo" or timo\ timo
13:35 timotimo OK, "timo" doesn't speak against my claim, but timo\ timo does
13:36 teatime even thinking about 'was this quoted' way over-complicated the kind of processing it makes sense to actually do :)
13:36 timotimo yes
13:36 MadcapJake well at the least, the MAIN arg parser should respect --
13:37 teatime also I could make some hipster shell that doesn't do word splitting, lol
13:37 xinming_ joined #perl6
13:37 MadcapJake ++teatime # for your next-gen hipster shell ;)
13:38 teatime MadcapJake: it does btw if your script is a script file; psch found the bug, it was only affecting -e
13:38 MadcapJake oh good! so my use-case is covered then :D
13:39 teatime --name='spacey value'      :name«'spacey value'»     <-- is this saying the value of $name inside MAIN() will contain actual quote characters
13:40 teatime 'cause.. yeah.. that is weird to me... I dunno why you'd want that over $name="spacey value"
13:41 teatime how binding are synopses?
13:41 timotimo we could inspect the argv of our caller and see if it's a shell script. then we can find the line by inspecting the fds in /proc and seeing if we can find its read position, then we can look it ... you know what, never mind.
13:41 teatime timotimo: lol staaahp
13:42 timotimo Unhandled exception: Invalid frame outer indices; circular 'outer' chain.
13:42 teatime like, is S02 part of the finalized spec of P6
13:42 teatime or is that stuff still open to having rough edges smoothed
13:42 timotimo damn. it gives that error *every time* now :D
13:43 timotimo right
13:43 teatime OH, good, no the quotes aren't literal; I just didn't yet know exactly what « » does
13:43 pmurias teatime: a Perl 6 slang would make a nice hipster shell
13:46 timotimo ugh, my algorithm is crap.
13:47 teatime timotimo: if I had a nickel...
13:49 * teatime notes that the Unicode Consortium seems to be evaluating the addition of new math operators primarily on the basis of how impossible it will be to come up with sensible/memorable/guessable, non-conflicting Compose mappings for them
13:49 timotimo i'll go from having an array that stores bits for every frame to storing that bit in some unused slot inside the frame itself; that'll give me linear instead of quadratic
13:49 teatime e.g. U+2a7f - U+2aa0
13:49 timotimo but for now i'll push the code so we get the fix, i suppose
13:51 teatime can I ask a general p6dev question; I'm trying to *not* ask much about this and use docs etc. instead but this is more about project practices
13:51 timotimo sure, you can
13:52 teatime I'm making an attempt to fix what I think is a simple bug, specifically https://rt.perl.org/Ticket/Display.html?id=127339 which seems to require implementing * and / operators for Duration
13:52 teatime it makes sense to me to add tests for operations on Durations, in fact it's the first thing I'd do, and they'd fail, and I'd code until they pass
13:53 teatime but where would you add those?  rakudo/t/...?  roast?  I can't find a place that seems to have any similar/parallel tests
13:53 teatime so is that granularity of tests not something that's part of the project at all, and it'd be something I'd create to implement my thing, then throw away?
13:53 timotimo the tests would go into roast, because that's a language feature
13:54 timotimo roast ought to already have tests for other arithmetic on Duration objects
13:54 teatime ok; gotcha.  I think that's enough info to point me where I need to go.
13:54 timotimo OK :)
13:54 teatime wasn't sure if roast was kindof frozen or if you could contribute more to it.
13:54 teatime timotimo: it has a little bit.
13:54 timotimo it is frozen by way of a tag or branch; new stuff can go in, still
13:56 teatime thx much.
13:59 smls joined #perl6
14:02 ZoffixWin .
14:02 yoleaux 09:17Z <teatime> ZoffixWin: ah yeah, thought I remembered maybe reading the ":arg" form somewhere:  https://design.perl6.org/S06.html#Declaring_a_MAIN_subroutine
14:02 ZoffixWin teatime++ thanks
14:03 teatime p.s. I dropped that link in the ticket too in case the reference was useful
14:04 spider-mario joined #perl6
14:10 dvinciguerra_ joined #perl6
14:17 mr-foobar joined #perl6
14:18 khw joined #perl6
14:18 tharkun joined #perl6
14:19 ZoffixWin This is curious: https://gist.github.com/zoffixznet/f6d09142041dc2e8ad2f77afa7b7af6b
14:19 ZoffixWin m: say say 0xFFFFFFFFFFFFFFFFF
14:19 camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
14:19 ZoffixWin m: say say 0xFFFFFFFFFFFFFFFFF
14:19 camelia rakudo-moar 40a953: ( no output )
14:20 timotimo wat :)
14:20 ZoffixWin yeah
14:20 ZoffixWin It might be just camelia ending process prematurely. There was something I found yesterday with dates, but adding sleep 1; fixed the issue. Now it's not even fixed
14:20 ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF; sleep 1
14:20 camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
14:20 ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF; sleep 1
14:20 camelia rakudo-moar 40a953: ( no output )
14:21 ZoffixWin camelia, evalbot control restart
14:22 CIAvash joined #perl6
14:22 ZoffixWin Yeah, don't see any issues when executing locally.
14:24 ZoffixWin I guess there's an issue with restarting camelia :/
14:30 mr-fooba_ joined #perl6
14:38 skids joined #perl6
14:46 camelia joined #perl6
14:48 boegel joined #perl6
14:48 stmuk https://github.com/tadzik/Template-Mojo/pull/24
14:53 ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF
14:53 camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
14:53 ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF
14:53 camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
14:53 ZoffixWin \o/
14:53 * timotimo doesn't have access to that :(
14:53 tadzik stmuk: thanks
14:59 RabidGravy gosh nearly mid-april and still no mailling list manager written in Perl 6
14:59 RabidGravy ;-)
15:04 stmuk OK I got to step 11 in tools/star/release-guide.pod and tagged with the result as pl6anet.org/drop/rakudo-star-2016.03.tar.gz if anyone can upload and annouce
15:05 timotimo did anybody test stuff? also, did you grab any of the recent updates? what about bailador? is it in or out?
15:07 stmuk It's not very different from your RC2 (I only bumped docs) and didn't readd bailador (since I don't believe a web framework belongs in a core/stdlib type distro)
15:07 stmuk all the tests past
15:23 BenGoldberg joined #perl6
15:33 bjz_ joined #perl6
15:43 mr-foobar joined #perl6
15:44 djbkd joined #perl6
15:52 buharin joined #perl6
15:53 tharkun joined #perl6
15:54 skink joined #perl6
15:56 pmurias RabidGravy: has anyone started writing one?
15:57 RabidGravy I don't think so
15:59 stmuk I don't think mailing lists are widely used much anymore
15:59 stmuk you should write one of those PHP web fora :)
16:01 timotimo PHP is getting Inline\Perl6?
16:02 bjz joined #perl6
16:06 timotimo cool, the fake unicode consortium retweeted someone's tweet linking to the unicode, perl6, and you advent calendar post
16:07 MadcapJake besides @a[*-1] what are some other ways you might use Whatever inside a subscript?
16:07 timotimo @a[* div 2]
16:07 timotimo https://github.com/timo/SDL2_raw-p6/blob/master/examples/shooter.pl#L289
16:08 MadcapJake @times[* - * div 100] O_o
16:08 timotimo so what?
16:08 MadcapJake what's that mean? take two items, subtract and divide by 100?
16:09 timotimo no, of course not :)
16:09 timotimo postcircumfix will pass the number of elements as many times as there are positional arguments
16:09 MadcapJake @times[* * 3 div 4] oi vey!
16:10 MadcapJake I'm trying to support this in language-perl6fe, but multiple *'s are gonna be really really tricky
16:11 timotimo it will be? :(
16:12 jdv79 there's a fake unicode group?
16:12 MadcapJake Well because I want the WhateverStar to be highlighted differently from the multiplication *
16:12 timotimo jdv79: just a twitter account
16:12 ZoffixWin MadcapJake, BTW, something I noticed last night:   if ( $method eq 'GET' and $bar eq 'meow' ) { }
16:12 timotimo https://twitter.com/FakeUnicode - read it, it's worth it :)
16:13 ZoffixWin the name "method" of the variable apparently confuses the highlighter and the rest of the stuff in () gets blue
16:13 ZoffixWin If I change it to some other name, the issues goes away
16:13 MadcapJake ZoffixWin: ahh I see, thanks! Adding an issue now
16:16 skink timotimo, That to be or not to be one...
16:18 TimToady MadcapJake: @a[$i % *] turns out to be useful sometimes
16:18 timotimo :D
16:19 timotimo oh lord, using the "symbol for BEL" to represent the three letters m)
16:20 psch m: say "un\c[SYMBOL FOR BELL]ievable"
16:20 camelia rakudo-moar 40a953: ( no output )
16:21 psch :/
16:21 ZoffixWin camelia's glitching
16:21 ZoffixWin m: say "un\c[SYMBOL FOR BELL]ievable"; sleep 2
16:21 camelia rakudo-moar 40a953: OUTPUT«un␇ievable␤»
16:21 geekosaur BEL
16:21 geekosaur if tis is the control picture
16:21 psch oh, doesn't render anyway here :|
16:21 ZoffixWin Renders well here :)
16:21 timotimo it renders here, but it's so small it's basically impossible to read
16:21 geekosaur hm
16:22 mcsnolte joined #perl6
16:22 ZoffixWin This is what I see: http://i.imgur.com/F5RGDXo.png
16:23 skink Teeny-tiny for me as well
16:24 ZoffixWin m: say ⑯ + ㊿
16:24 camelia rakudo-moar 40a953: OUTPUT«66␤»
16:24 timotimo wow, what's your screen resolution?
16:24 ZoffixWin :D
16:24 ZoffixWin Mine? 1440p
16:24 timotimo so only like 20 lines of irc fit on your screen at once? :)
16:25 MadcapJake TimToady: at some point I want to sit down and write a sub-grammar just for Whatever blocks, that particular case will need to wait for that :)
16:25 ZoffixWin timotimo, lol, no, I just cropped it. This is full size: http://i.imgur.com/GrQKccl.png
16:26 psch same font size here :)
16:26 psch on 1080p though
16:26 stmuk grrrr the panda bootstrap is reporting a Shell::Command error on FreeBSD 10
16:26 timotimo oh, ok
16:26 psch so, yeah, i only have 20 lines at once and it's perfectly fine, scrollback exists for a reason :P
16:27 timotimo http://t.h8.lv/irc_window.png - mine
16:28 MadcapJake actually I might be able to hack a "* as last term in a subscript" kind of thing :P
16:28 skink timotimo, You have a service auto-downloading image links?
16:28 MadcapJake anytime a * is at the end of a subscript, it would *have* to be a Whatever, right?
16:29 MadcapJake timotimo: So I'm MadcapJak+ :D
16:29 buharin joined #perl6
16:30 timotimo skink: no, it just makes short urls for me
16:30 timotimo sometimes urls get wrapped, and aren't clickable for that reason
16:31 timotimo MadcapJake: i don't think i set this up myself to be like that, but it does help conserve horizontal space
16:31 MadcapJake timotimo: my full nickname must be seen! In all its glory! ;)
16:32 timotimo pff. what's next, you'll be telling me to put the : back between hours, minutes, and seconds?
16:32 zacts hi perl6 nerds
16:32 zacts (%|:-)
16:33 ZoffixWin m: (%|:"Hi").say
16:33 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7hqcn2V9Ns␤Missing required term after infix␤at /tmp/7hqcn2V9Ns:1␤------> 3(%|:7⏏5"Hi").say␤    expecting any of:␤        colon pair␤»
16:33 timotimo greetings, zacts
16:34 zacts hi =)
16:35 MadcapJake timotimo: woah pretty neat with the fading time thingy, didn't even notice :P
16:37 timotimo thanks :)
16:37 timotimo came up with it myself
16:46 telex joined #perl6
16:54 zakharyas joined #perl6
16:59 jjido joined #perl6
17:06 MadcapJake m: my num32 $n = 12.0 # how come you can't do this?
17:06 camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native number␤  in block <unit> at /tmp/so_SgTc54y line 1␤␤»
17:10 geekosaur joined #perl6
17:10 RabidGravy to be honest I thought you could
17:11 geekosaur joined #perl6
17:11 RabidGravy ah
17:11 RabidGravy m: my num32 $n = 12.0e0
17:11 camelia rakudo-moar 40a953: ( no output )
17:12 RabidGravy or any number of other ways of causing it to be a Num on the RHS
17:12 MadcapJake oh just needs the scientific notation
17:12 MadcapJake gotcha
17:12 MadcapJake m: my num32 $n = Num(12)
17:12 camelia rakudo-moar 40a953: ( no output )
17:12 jdv79 joined #perl6
17:12 MadcapJake shouldn't it be able to unbox an Int?
17:13 RabidGravy the unboxing doesn't coerce though
17:14 MadcapJake ok, just curious
17:16 domidumont joined #perl6
17:18 skink Speaking of Int, I just realized something real dumb.
17:19 skink my $prime2048 = Int.new;
17:19 skink loop (;;) { $prime2048 = crypt_random(256); if $prime2048.is-prime { last; } }
17:20 firstdayonthejob joined #perl6
17:21 timotimo how do our hack users feel about the current cpu usage?
17:22 MadcapJake language-perl6fe v1.7.0 released! https://github.com/MadcapJake/language-perl6fe/releases/tag/v1.7.0
17:22 timotimo because i could try afl's parallelization support and occupy an additional cpu core ...
17:22 timotimo of course i'm running my stuff at maximum nice
17:23 teatime m: my $x = "foo"; my $y = "foo"; say $x.WHICH === $y.WHICH
17:23 camelia rakudo-moar 40a953: OUTPUT«True␤»
17:23 teatime m: my $x = Duration(100); my $y = Duration(100); say $x.WHICH === $y.WHICH
17:23 camelia rakudo-moar 40a953: ( no output )
17:23 psch m: my $x = Duration(100); my $y = Duration(100); say $x.WHICH === $y.WHICH; sleep 2
17:23 camelia rakudo-moar 40a953: ( no output )
17:23 timotimo oh, duration isn't a value type?
17:23 psch ffs camelia :<
17:24 teatime timotimo: I think it's supposed to be and I found a bug, yay
17:24 timotimo m: say Duration.new(100).WHICH
17:24 camelia rakudo-moar 40a953: ( no output )
17:24 teatime oh damn wait
17:24 teatime m: my $x = Duration.new(100); my $y = Duration.new(100); say $x.WHICH === $y.WHICH
17:24 camelia rakudo-moar 40a953: ( no output )
17:25 psch m: say "o.o"
17:25 camelia rakudo-moar 40a953: ( no output )
17:25 teatime I broke it..
17:25 teatime fwiw, prints 'False' locally.
17:25 timotimo no, camelia is currently a bit unhealthy
17:25 timotimo we already tried with "evalbot control restart"
17:25 jdv79 wonder how long it'll take to compile on an old celeron with 512M and a slow disk...
17:28 timotimo oh lord
17:30 psch istr rpi2 is at like 20 hours or something..?
17:30 psch RabidGravy has the actual numbers i suppose :)
17:31 psch not sure how those compare, in any case
17:31 psch probably in the vicinity of "meaningless"... :)
17:31 jdv79 i was going to try it on my rpi but maybe not now that i know it takes that long
17:31 jdv79 wonder how hard it is to cross compile or if its possible
17:32 skink If anyone's curious how long it takes to generate a cryptographically random 4096-bit prime in Perl6
17:32 jdv79 7m into stage parse and its begun tapping swap.  i think i'll check back in an hour or so.
17:32 skink The answer is: a really long time.
17:32 timotimo well, just compiling isn't enough for everything
17:33 ZoffixWin skink, is it fast in other languages?
17:33 timotimo you can cross-compile moar easily, but you can't build nqp and rakudo without running the cross-compiled moarvm ... though actually i think you can
17:33 skink ZoffixWin, Not really :D
17:33 ZoffixWin heh, alright :)
17:33 jdv79 its not really important.  just a random thought.
17:34 skink Surprisingly, generating a 2048-bit one was quite fast, all things considered.
17:34 vike joined #perl6
17:35 skink ZoffixWin, .is-prime is definitely the bottleneck, though.
17:36 * psch always thought is-prime is rather fast
17:36 timotimo i thought so, too
17:36 psch i mean, it's one of those fancy probability thingies
17:36 psch skink: you did --profile i assume?
17:37 skink Nah this is just me playing in a repl
17:37 BenGoldberg p56: print "alive\"
17:37 camelia p5-to-p6 : OUTPUT«Can't find string terminator '"' anywhere before EOF at /tmp/3ffk4r017Q line 2 at perlito5.pl line 7541.␤»
17:37 skink > crypt_random(512) for 1..1000; say now - INIT now;
17:37 skink 5.72368025
17:37 BenGoldberg m: "ok".say
17:37 camelia rakudo-moar 40a953: OUTPUT«ok␤»
17:37 skink I left a loop trying to generate a prime one for like five minutes and killed it
17:39 skink >  = crypt_random(256); if $prime2048.is-prime { last; } }; say now - INIT now;
17:39 skink 5.66803949
17:39 skink That got cut off
17:39 buharin joined #perl6
17:42 RabidGravy psch, I think it took about three hours last time I built on an RPi :)
17:42 skink Oh, wait, I may be really dumb.
17:42 jdv79 oh wow.  parse stage took 1061s.  how long will optimize take now?  its stuck there.
17:43 tokomer joined #perl6
17:43 psch RabidGravy: ahh, so i got it quite a bit wrong
17:44 psch might be someone else on an rpi1 or just wrong recall vOv
17:44 RabidGravy jdv79, it may actually fail in mbt with only 512M
17:44 BenGoldberg m: use Crypt::Random :from<perl5>; say makerandom( Size => 4, Strength => 1 );
17:44 camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Could not find Crypt::Random in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repositor…»
17:44 BenGoldberg m: use Crypt::Random:from<perl5>; say makerandom( Size => 4, Strength => 1 );
17:44 camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Could not find Crypt::Random in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repositor…»
17:44 skink Okay either I had really bad luck earlier or I accidentally changing the wrong var due to editing an earlier command.
17:44 jjido joined #perl6
17:45 skink > loop (;;) { $prime4096 = crypt_random(512); if $prime4096.is-prime { last; } }; say now - INIT now;
17:45 skink 31.4628254
17:45 jdv79 what's mbt?
17:46 jdv79 a year or so ago i was able to build on another box that only had 512M
17:46 RabidGravy the stage after optimize
17:46 jdv79 ah.  optimize took 412s
17:46 RabidGravy I'm just building on both a RPi 1 and a RPi 2 for good measure
17:46 jdv79 this is going way faster than i thought!
17:47 jdv79 oh, mast
17:51 stmuk RabidGravy: does the tar.gz in the scrollback build for you on FreeBSD or error on a Shell::Command test on panda bootstrap?
17:52 ZoffixWin m: for ^4 .race: :1batch { .say; last if $_ == 2 }
17:53 camelia rakudo-moar 40a953: OUTPUT«0␤1␤3␤2␤»
17:53 ZoffixWin skink, maybe it can be improved by creating a channel and running several computations in parallel and then stop when you get the first value in the channel?
17:54 stmuk hmmm the Shell::Command tests seem to assume File::Which is installed
17:54 skink Yeah that's what I was thinking.
17:54 skink I didn't realize I could do this until like a half hour ago though :)
17:54 ZoffixWin m: sub racy { for ^4 .race: :1batch { .say; return if $_ == 2 } }; racy
17:54 camelia rakudo-moar 40a953: OUTPUT«1␤0␤2␤Internal error: Unwound entire stack and missed handler␤»
17:54 RabidGravy I thought that was sorted
17:54 ZoffixWin :o
17:55 skink ZoffixWin, Who would I talk to about getting Crypt::Random accepted?
17:55 ZoffixWin skink, accepted to where?
17:55 skink The main modules list
17:55 wamba joined #perl6
17:56 ZoffixWin skink, just follow the instructions here: https://github.com/perl6/ecosystem
17:56 skink It's currently listed as a WIP on Most Wanted
17:56 CIAvash joined #perl6
17:56 RabidGravy just a PR to https://github.com/perl6/ecosystem
17:56 skink Ah!
17:56 skink Okay, didn't realize
17:56 ZoffixWin Basically, add a link to your module's raw META file on this list: https://github.com/perl6/ecosystem/blob/master/META.list
17:57 skink The modules page said to ask in here
17:57 RabidGravy yeah, well if "we" know we can merge the PR quicker
17:57 RabidGravy :)
17:59 jdv79 RabidGravy: didn't die.  stage mast took 770s and ate about 1.1-1.2G of mem
18:00 RabidGravy yeah, it's pretty hand to mouth on the memory
18:01 Begi I've seen that the code of perl6.org is written in Perl. Why not Perl 6 ?
18:01 stmuk Begi++ # going to rewrite in perl 6
18:01 skink Alrighty, put the PR in
18:01 jdv79 man power maybe?
18:01 RabidGravy lots of yaks to shave but probably doable npw
18:02 jdv79 and historical reasons (p6 wasn't ready when it was written)
18:02 dalek ecosystem: cc9a43e | skinkade++ | META.list:
18:02 dalek ecosystem: Add Crypt::Random
18:02 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/cc9a43e338
18:02 dalek ecosystem: 87bc130 | RabidGravy++ | META.list:
18:02 dalek ecosystem: Merge pull request #190 from skinkade/master
18:02 dalek ecosystem:
18:02 dalek ecosystem: Add Crypt::Random
18:02 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/87bc130ae3
18:02 RabidGravy there
18:02 skink ZoffixWin, Now you've made me want to add crypt_random_prime() to Extra
18:02 skink Sweet :)
18:03 ZoffixWin skink, what's "if"? Listed in depends in your META
18:04 skink https://github.com/FROGGS/p6-if
18:04 skink It's also on the modules list, just a bit hard to ctrl+f for :)
18:04 ZoffixWin Ah, I'm blind. Didn't notice it the first time.
18:05 skink I've my Windows-specific in one module and then a *nix module, and use that to pick which to use.
18:05 ZoffixWin m: say '⑯' + ㊿
18:05 camelia rakudo-moar 40a953: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑯' (indicated by ⏏)␤  in block <unit> at /tmp/lvXRYvvsPZ line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/lvXRYvvsPZ line 1␤␤»
18:05 ZoffixWin m: say '3' + ㊿
18:05 camelia rakudo-moar 40a953: OUTPUT«53␤»
18:05 psch .u ⑯
18:05 yoleaux U+246F CIRCLED NUMBER SIXTEEN [No] (⑯)
18:06 * psch marvels at font inconsistency
18:06 psch the circled 50 shows up fine... vOv
18:06 psch m: say '⑯'.Int
18:06 camelia rakudo-moar 40a953: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑯' (indicated by ⏏)␤  in block <unit> at /tmp/wjq38XoArQ line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/wjq38XoArQ line 1␤␤»
18:06 ZoffixWin m: '⑯'.Int.say
18:06 camelia rakudo-moar 40a953: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑯' (indicated by ⏏)␤  in block <unit> at /tmp/K7mLwIYzFe line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/K7mLwIYzFe line 1␤␤»
18:07 psch that's probably 'cause the grammar special cases the bare one
18:07 psch and the P6-level Str doesn't have access to the same special-casing
18:07 RabidGravy ooh FROGGS++ nice one I hadn't seen that
18:07 * psch marvels their own inconsistency in dash-handling
18:07 spider-mario joined #perl6
18:08 Actualeyes1 joined #perl6
18:09 jdv79 so took 83m to build
18:09 jdv79 but bare startup time is ~ 1.25s:(
18:09 jdv79 probably slow disk?
18:10 ZoffixWin m: say '೪'.Int
18:10 camelia rakudo-moar 40a953: OUTPUT«4␤»
18:10 jdv79 meanwhile bare startup on my main box is ~ 5ms
18:10 ZoffixWin .u ೪
18:10 yoleaux U+0CEA KANNADA DIGIT FOUR [Nd] (೪)
18:10 teatime if an operation on two Rat's returns a Num, is that lossy, or will $Num_result.Rat get the exact value (as a Rat)
18:11 jdv79 what's a good simple compute intensive test?
18:11 teatime jdv79: sha1 or sha512sum something big?
18:11 ZoffixWin m: 1111111111111111111111.is-prime.say
18:11 camelia rakudo-moar 40a953: OUTPUT«False␤»
18:11 teatime bzip something big?
18:11 teatime oh, perl-specific; sorry
18:12 teatime jdv79: slow disk you'd only see on the first invocation; after that, the disk data would be cached
18:13 jdv79 oh, its actually 125ms on my main box.  5ms is perl:)  that makes more sense.
18:14 buharin joined #perl6
18:14 jdv79 m: my $i; for 1..1000000 {$i++}; say $i;'
18:14 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/I4Zc76KsKh␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/I4Zc76KsKh:1␤------> 3my $i; for 1..1000000 {$i++}; say $i;'7⏏5<EOL>␤    expecting any of:␤        single…»
18:14 jdv79 m: my $i; for 1..1000000 {$i++}; say $i;
18:14 camelia rakudo-moar 40a953: OUTPUT«1000000␤»
18:15 jdv79 that took .9s on my ok box and 6.3s on the celeron.  ew.
18:15 jdv79 but it works!  yay.
18:15 spider-mario joined #perl6
18:16 AlexDaniel joined #perl6
18:16 ZoffixWin Well, seems it works as it meant to. Str -> Int conversion just doesn't happen on No chars. Like ¾ or ². say ⑯⑯ won't work either, but say 33 will.
18:19 stmuk see comment https://github.com/tadzik/Shell-Command/commit/700b4153edc7ebbfa1f0172e1e659f24ddd84bb6
18:21 spider-mario_ joined #perl6
18:25 teatime If the function that implements an operation on two Rat's, returns a Num, where the operation has an exact Rat answer, was the function lossy?  or is that normalish and Num.Rat can be expected to be the exact answer?
18:26 ZoffixWin I wonder if it should be made to work though. User types ൲ as input, it should work
18:26 ZoffixWin m: say ൲; say '൲'
18:26 camelia rakudo-moar 40a953: OUTPUT«1000␤»
18:26 ZoffixWin umm
18:26 ZoffixWin m: say ൲; say '൲'.Int
18:26 camelia rakudo-moar 40a953: ( no output )
18:26 ZoffixWin ~_~
18:28 psch ZoffixWin: it probably should work, yeah
18:28 * ZoffixWin is rakudobugging it
18:29 psch ZoffixWin++
18:32 znpy joined #perl6
18:33 ZoffixWin Done: https://rt.perl.org/Ticket/Display.html?id=127866
18:34 vendethiel joined #perl6
18:34 BenGoldberg m: ( 0.5 * (1/3) ).perl.say
18:34 camelia rakudo-moar 40a953: OUTPUT«<1/6>␤»
18:35 ZoffixWin m: say ( 0.5 * (1/3) ).WHAT
18:35 camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
18:35 BenGoldberg teatime, Which two-rat operation is returning a num?
18:35 ZoffixWin m: say ( 0.5 * 0.75 ).WHAT
18:35 camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
18:35 BenGoldberg m: ( 0.5 +& (1/3) ).perl.say
18:35 camelia rakudo-moar 40a953: OUTPUT«0␤»
18:36 buharin joined #perl6
18:36 ZoffixWin m: say ( 0.5e0 * 0.75e0 ).Rat.nude
18:36 camelia rakudo-moar 40a953: ( no output )
18:36 ZoffixWin m: say ( 0.5e0 * 0.75e0 ).Rat.nude
18:36 camelia rakudo-moar 40a953: ( no output )
18:36 ZoffixWin camelia--
18:36 BenGoldberg m: ( 0.5 +& (1/3) ).nude.perl.say
18:36 camelia rakudo-moar 40a953: ( no output )
18:36 BenGoldberg m: my @x = ( 0.5 +& (1/3) ).nude; say 'ok';
18:36 camelia rakudo-moar 40a953: OUTPUT«Method 'nude' not found for invocant of class 'Int'␤  in block <unit> at /tmp/72Y7FvszE9 line 1␤␤»
18:36 spider-mario joined #perl6
18:36 BenGoldberg m: my @x = ( 0.5 * (1/3) ).nude; say 'ok';
18:36 camelia rakudo-moar 40a953: OUTPUT«ok␤»
18:36 teatime ok, to avoid what's probably an XY problem, let me cut directly to it
18:36 buharin joined #perl6
18:37 ZoffixWin Awww: https://twitter.com/_kalkin/status/718870219935084545
18:37 BenGoldberg m: my @x = ( 0.5 * (1/3) ).nude; say @x;
18:37 camelia rakudo-moar 40a953: OUTPUT«[1 6]␤»
18:37 buharin joined #perl6
18:37 Begi joined #perl6
18:37 buharin joined #perl6
18:39 teatime bah, nevermind, I seem to have been mistaken :)
18:39 teatime however the answer seems to be yes, if such an operation did exist it would be lossy.
18:41 teatime well, no, it's true, ok:
18:41 teatime m: (Duration.new(10) / Duration.new(1/10000)).WHAT.say
18:41 camelia rakudo-moar 40a953: OUTPUT«(Num)␤»
18:41 teatime shouldn't that be a Rat ?
18:41 psch m: &infix:<+>.candidates[4](1/3, 1/3).WHAT.say
18:41 camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native integer␤  in block <unit> at /tmp/sUTO4KC6zn line 1␤␤»
18:41 psch aww
18:41 ufobat Guys! a guessing game: will this die? ( psch, dont tell anyone )  if my $match = $r.match($meth, $uri) { die "What?!" unless $match }
18:42 ZoffixWin Yes, $r is undeclared :p
18:42 ZoffixWin m: say Duration.new(10).WHAT
18:42 camelia rakudo-moar 40a953: OUTPUT«(Duration)␤»
18:42 ZoffixWin m: (Duration.new(10) / Duration.new(1/10000)).Rat.nude.say
18:42 camelia rakudo-moar 40a953: OUTPUT«(100000 1)␤»
18:42 ufobat no $r is delcared! :p
18:42 mr-foobar joined #perl6
18:42 ZoffixWin m: if my $match = $r.match($meth, $uri) { die "What?!" unless $match }
18:42 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aXlFUiQgBy␤Variable '$meth' is not declared␤at /tmp/aXlFUiQgBy:1␤------> 3if my $match = $r.match(7⏏5$meth, $uri) { die "What?!" unless $matc»
18:43 psch ufobat: i think you're being a little bit silly :P
18:43 teatime ZoffixWin: technically though, since Duration is internally Rat, op(Duration, Duration)→Num is lossy, right?
18:43 ufobat http://pastebin.com/QAKty9EE
18:43 ZoffixWin teatime, no idea :)
18:43 ufobat psch,  i shortend the code
18:43 psch teatime: Duration isn't Rat.  Duration is Cool does Real :)
18:43 psch ufobat: yeah, but you yourself noted that leaving out the loop removes the WAT :)
18:43 teatime so why not does Rational ?
18:44 psch m: say Rat ~~ Real
18:44 camelia rakudo-moar 40a953: OUTPUT«True␤»
18:44 psch m: say Real ~~ Rat
18:44 camelia rakudo-moar 40a953: OUTPUT«False␤»
18:44 ufobat psch, its fragile, indeed!
18:44 teatime is the answer "the lossiness is small enough to disregard" ?
18:45 ZoffixWin Well, I don't see any lossiness yet... Maybe you're overthinking this? :)
18:45 teatime ZoffixWin: maybe I am; solid confirmation of that would be welcome.
18:45 ZoffixWin I'm not familiar with how these things work under the hood.
18:45 teatime and I don't have an example that demonstrates it but I beleive Rat can represent exact values that Real cannot?
18:46 ufobat psch, seems like noone will explain it to us :/
18:46 psch teatime: Real is a role done by Num and Rat
18:46 psch err, no
18:46 psch Rat does Rational
18:46 psch which is parameterized
18:46 psch m: 1/3 ~~ Real # what mislead me
18:46 camelia rakudo-moar 40a953: ( no output )
18:46 psch m: say 1/3 ~~ Real # - ENOSAY
18:46 camelia rakudo-moar 40a953: OUTPUT«True␤»
18:47 psch yeah, and Rational does Real
18:47 teatime yeah, I follow so far.
18:47 psch ufobat: i suspect there's some discussion in the clog, you'll probably find it with search for "if my"
18:47 psch ufobat: beware of false positives though :)
18:47 teatime just curious why Duration, which is internally a Rat, does Real instead of does Rational?
18:47 teatime maybe the answer is in S02 or S32; haven't read all of them yet
18:48 psch teatime: that's the thing, Duration is Cool
18:48 psch teatime: because everyone wants to treat is as Str, Num or Rat
18:48 psch teatime: it does Real instead of Rational because it doesn't want to parameterize itself, i presume
18:49 psch (which is a glaringly untechnical explanation...)
18:49 BenGoldberg joined #perl6
18:49 ufobat i indeed found a false positive so far ;) https://doc.perl6.org/language/5to6-nutshell
18:51 ZoffixWin ufobat, so why do it behave as true in the if() but as false in that die?
18:51 ufobat ZoffixWin, you had a look at http://pastebin.com/QAKty9EE?
18:51 ufobat i have no clue :(
18:51 ufobat but it does
18:51 ufobat i am inside the if block and then i'll die
18:51 * psch maintains that's a DIHWIDT
18:52 kurahaupo joined #perl6
18:52 teatime psch: but isn't (Duration.new(1) / Duration.new(3)).Rat doing Rat / Rat -> Num -> Rat and (sometimes) losing (a small amount) of information in the middle?  And couldn't that be prevented w/o breaking existing uses if it does Rational instead of does Real ?  Or am I still not getting how roles/Cool/etc. work
18:52 ZoffixWin What's that?
18:52 ufobat Doctor, It Hurts When I Do This
18:52 teatime I'm less proposing a change to Duration and more trying to confirm/disprove my understanding
18:52 ZoffixWin teatime, it's doing Duration / Duration -> Num
18:53 psch m: say (Duration.new(1).Rat / Duration(3).Rat).Rat.WHAT
18:53 camelia rakudo-moar 40a953: OUTPUT«Cannot find method 'Duration'␤  in block <unit> at /tmp/UmIEnfTy5B line 1␤␤»
18:53 psch m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat.WHAT
18:53 camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
18:53 psch m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat
18:53 camelia rakudo-moar 40a953: OUTPUT«0.333333␤»
18:53 psch m: say (Duration.new(1) / Duration.new(3)).WHAT
18:53 camelia rakudo-moar 40a953: ( no output )
18:53 ZoffixWin what does "Doctor, It Hurts When I Do This" means?
18:54 teatime ZoffixWin: the doctor says, "Then don't do that!"
18:54 ZoffixWin heh
18:54 teatime groucho marx, I think.
18:54 psch "Doctor, sometimes when I drink tea one of my eyes hurts."
18:55 psch i'll admit that 'if my ...' is not the same kind of missing-the-obvious, especially not with a perl5 background
18:55 ZoffixWin This looks like a bug to me.
18:56 khisanth_ joined #perl6
18:56 psch ZoffixWin: i don't completely disagree, but it's still true that we don't do 'if my ...' in Perl 6, because we do 'if ... -> ...'
18:57 teatime psch: I get that Real(1/3).Rat happens to == Rat(1, 3), but isn't that only because Real(1/3) and Rat(1,3) are less than the default ε = 1e-6 is smaller than the difference between them?
18:57 ZoffixWin Ahhh. Riight. I totally missed that
18:57 ZoffixWin m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat.nude
18:57 camelia rakudo-moar 40a953: OUTPUT«(1 3)␤»
18:58 teatime so, are you guys asserting that there is *not* an implicit conversion and then re-conversion back to Rat taking place?
18:58 * ZoffixWin has no idea
18:59 ZoffixWin m: pi.Rat.nude.say
18:59 camelia rakudo-moar 40a953: OUTPUT«(355 113)␤»
18:59 stmuk its 22/7! everyone knows that!
18:59 ZoffixWin :)
18:59 stmuk its the law in the Southern US :)
19:00 ufobat psch, i wont accept it - what the grammar allows us to do must be understandable or reasonable
19:01 ufobat and i dies with older perl6 i have installed
19:01 psch ufobat: right, then that's your actual bug.  the regression that it doesn't die
19:02 ufobat it dies
19:03 ZoffixWin ufobat, Interesting. If I comment out one return value from .match or the other, it stops dying. It's only when they both are does it die :S
19:03 ufobat ZoffixWin, if you play on the for loops in the bottom is also different or stops
19:03 yqt joined #perl6
19:03 Begi joined #perl6
19:04 ufobat ZoffixWin, if you add more Abc objects to the array
19:04 ZoffixWin wtf... how is lines13/14 not a compile error? you have semicolons instead of commas there
19:04 ufobat and do a print $something++ befor the if, and check what elements from the array you'd pick by accident you see that the print delays it somehow
19:05 ufobat what!
19:05 ufobat yeah but in my original example i had ,
19:06 ufobat http://pastebin.com/mkpdSjma
19:06 * psch has to head out o/
19:06 ZoffixWin m: my @r = (4; 4; 5;); say @r
19:06 camelia rakudo-moar 40a953: OUTPUT«[4 4 5]␤»
19:06 ZoffixWin :S
19:06 ufobat dwim!
19:06 ufobat :D
19:07 teatime ok, here you go; I think this is proof it's lossy:
19:07 teatime m: say (Duration.new(1) / Duration.new(3)).Rat(0.4).nude, (Rat(1) / Rat(3)).Rat(0.4).nude
19:07 camelia rakudo-moar 40a953: OUTPUT«(0 1)(1 3)␤»
19:08 ufobat i am not perfectly sure, but in this example http://pastebin.com/mkpdSjma or in one that i didnt paste online, in line 32, if you comment this in, you have a "normal" behaviour
19:08 teatime And similarly:
19:08 teatime m:  say (Duration.new(1) / Duration.new(1000000000)).Rat.nude, (Rat(1) / Rat(1000000000)).Rat.nude
19:08 camelia rakudo-moar 40a953: OUTPUT«(0 1)(1 1000000000)␤»
19:09 teatime but I will defer this now until later; have reading/thinking to do.
19:09 teatime probably Duration is just spec'd to not be required to hold such small intervals.
19:22 skink ZoffixWin, I'm unsure as to how to await for a single value
19:26 skink Wait, may have gotten it.
19:30 jjido joined #perl6
19:33 ZoffixWin m: https://gist.github.com/zoffixznet/df2899a4d0822de27a209d0592eb7b60
19:33 camelia rakudo-moar 40a953: OUTPUT«(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29)␤0.963076874240507␤»
19:34 ZoffixWin skink, at first I thought of channels, but I think this seems to work ^
19:34 * ZoffixWin forgot what the original problem was
19:34 skink Generating primes in parallel
19:35 ZoffixWin Ah, so basically, inside the promise you'd loop for $batch times trying to find a prime. If you find one, return it, if not, another batch will fin dit
19:35 * ZoffixWin isn't sure if this is the best way to do it, since some work will still be done AFTER the prime is found
19:35 ZoffixWin There's probably a way to avoid that with a Channel, but I'm no expert
19:36 ZoffixWin Oh gawd.
19:37 ZoffixWin I'm not doing anything in parallel in that example ^_^ You're meant to start a few promises for each batch or something
19:37 ZoffixWin Which leads me even more to think this is the wrong solution
19:37 FROGGS joined #perl6
19:38 skink I did...
19:38 skink my $c = Channel.new;
19:38 skink start { $c.send(crypt_random_prime()) for (^Inf).race; }
19:38 skink await $c;
19:38 ZoffixWin :S
19:39 ZoffixWin m: ^Inf .race
19:39 camelia rakudo-moar 40a953: OUTPUT«(signal XCPU)»
19:39 ZoffixWin So your promise won't ever complete there. And I'm not sure what exactly happens when calling .race on infinity
19:39 skink Every time I call await $c there I get a different value back
19:40 ZoffixWin But is it prime?
19:40 skink crypt_random_prime() returns a prime but it has a loop inside itself
19:40 ZoffixWin What's crypt_random_prime()? does it have that infinite loop in it?
19:40 ZoffixWin k, well, the idea is to split that loop over multiple threads.
19:40 skink Maxed out my CPU trying to benchmark the two together
19:40 skink Yup
19:42 rindolf joined #perl6
19:42 danyaprivet joined #perl6
19:43 danyaprivet hey
19:43 danyaprivet ?
19:44 Begi danyaprivet: hey
19:44 ZoffixWin m: https://gist.github.com/zoffixznet/1632bde46cd296a45de0946c6b128907
19:44 camelia rakudo-moar 40a953: OUTPUT«0.739851631580152␤1.00973742␤»
19:45 danyaprivet I'm perl programing learning
19:45 ZoffixWin skink, this is it, I think ^. Inside the start {} block, perform a *single* computation and if it's prime return it, if it isn't return False
19:45 ZoffixWin danyaprivet, great.
19:45 danyaprivet which perl 5 or 6 ?
19:45 skink ZoffixWin, I'll try it out.
19:45 ZoffixWin danyaprivet, why are you learning it?
19:45 ZoffixWin danyaprivet, what purpose?
19:45 danyaprivet web
19:46 ZoffixWin danyaprivet, Perl 5. They have http://mojolicious.com/ framework which is very good
19:46 ZoffixWin danyaprivet, you can also do Perl 6, but we're pretty new.
19:46 Begi We have Bailador ;)
19:46 ZoffixWin There's also Crust.
19:47 ZoffixWin oh, it's .org http://mojolicious.org/
19:48 BenGoldberg joined #perl6
19:49 danyaprivet What is the difference  perl5 perl6?
19:49 Begi Heu... Perl 6 > Perl 5 ? :p
19:50 ZoffixWin danyaprivet, they're two different languages.
19:50 Begi Perl 6 brings a let of new things, new concepts
19:50 ZoffixWin danyaprivet, they share a common philosophy, but I find little similarity.
19:50 danyaprivet okey
19:51 ugexe well, perl6 execution and startup time are certainly > Perl 5
19:51 ZoffixWin danyaprivet, Perl 5 also existed for ages and has much of established and battletested modules. Perl 6 is brand new and has a few rough edges. You could try doing Perl 6 and using Inline::Perl5 module to utilize some of the good Perl 5 modules.
19:51 Begi ugexe: sure. for now. I hope it will be better in the future
19:51 danyaprivet lets go learn perl 5 later 6
19:52 ugexe sure. but do you really think Perl 5 wont get faster itself?
19:52 Garland joined #perl6
19:53 danyaprivet faster
19:53 mst Begi: " Begi> Heu... Perl 6 > Perl 5 ? :p" <- please don't do that.
19:53 teatime ugexe: perl5 has had a lot of production-oriented optimization done on it; perl6 has not.  perl6 will get faster much faster than perl5 will get faster.
19:53 ZoffixWin danyaprivet, #mojo on irc.perl.org is a good place to visit, if you want to do P5 web stuff
19:54 danyaprivet i'm skills ruby , on rails
19:54 ugexe im well aware of where perl 6 is. but im not trying to hide the fact that perl 5 is indeed faster and will also get faster alongside perl 6
19:54 ZoffixWin danyaprivet, Perl 6 is closer to Ruby and Perl 5 is. You may find learning it easier.
19:55 skink Hate to tell ya ZoffixWin but that's 50x slower for medium-sized values :D
19:55 teatime just seems like an inheriently disingenuous statement to me.
19:55 teatime apples and oranges.
19:55 mst ZoffixWin: I dunno, given Moo/Moose both perl5 and perl6 have way more powerful OO than ruby
19:55 ugexe the only disengenous statement was saying Perl 6 > Perl 5
19:56 mst teatime: he was responding to the offensive and stupid comparison Begi made
19:56 Begi Sorry. I've put a smiley
19:56 labster joined #perl6
19:56 ZoffixWin skink, ah, I think you need to do *several* generations inside the promise. Right now it's probably losing any possible speed improvements on spinning up a thread for each
19:56 skink Oh, wait, I'm just really stupid.
19:56 skink Forgot to comment out your sleep 1 :)
19:57 teatime lol, niice.
19:57 ZoffixWin lol
20:00 skink It's slightly faster for smaller values, and slower for larger values, ironically.
20:01 ZoffixWin Try generating multiple values per promise, so it doesn't have to spin up a thread for single value
20:03 BenGoldberg joined #perl6
20:04 skink Might just include a plain function for the time being and explore optimization at a later date.
20:13 novice66 joined #perl6
20:13 ZoffixWin m: '༳'.uniname.say; say ༳
20:13 camelia rakudo-moar 40a953: OUTPUT«TIBETAN DIGIT HALF ZERO␤-0.5␤»
20:13 djbkd joined #perl6
20:13 ZoffixWin "half zero"... what a name.
20:15 TimToady joined #perl6
20:15 * masak .oO( Half Zero™ -- when even Zero feels like a tad too much )
20:16 novice66 I need list @c padded with zeros  after: my @a=1,2,3,4; my @b=9,8,7,6,5,4,3;  my @c = @a Z+ @b;
20:16 timotimo you can reverse both and have flat @a, 0 xx * for one side, then reverse again
20:17 timotimo other than that you can flat (0 xx (@a - @b), @b) or something
20:18 timotimo m: my @a=1,2,3,4; my @b=9,8,7,6,5,4,3; my @c = flat (0 xx (@b - @a)), @a; say @a.perl
20:18 camelia rakudo-moar 40a953: ( no output )
20:18 timotimo oh camelia :(
20:18 timotimo nine: can you figure out what may be wrong with camelia?
20:19 pmurias joined #perl6
20:19 pmurias ugexe: are there any plans for significant improvements to Perl 5 speed?
20:23 mst pmurias: work has been ongoing for a while in various areas
20:23 mst pmurias: MULTIDEREF was the first of a new breed of optimisations
20:24 ZoffixWin "half zero"... what a name.
20:24 ZoffixWin oops
20:24 mst also, why are we dogpiling ugexe for pointing out a fallacy in Begi's trolling?
20:24 lizmat m: say ༳
20:24 camelia rakudo-moar 40a953: ( no output )
20:24 lizmat m: say "༳".Int
20:24 camelia rakudo-moar 40a953: ( no output )
20:25 mst this is #perl6. I of all people should not be the person saying "you seem to be being uncharitable and unnice"
20:25 timotimo what is multideref all about?
20:25 timotimo is it at all something perl6 can steal?
20:25 mst doubtful, it's basically "fold a complex deref into a single op to avoid all the stackwhackery"
20:26 timotimo ho-hum
20:26 ZoffixWin lizmat, camelia is sick.
20:26 mst it's nothing particularly lever, just a lot of very precise grunt work by somebody with a careful eye
20:26 lizmat ZoffixWin: yeah, got that now
20:26 mst (by which I mean it was probably more hard and less fun than a clever thing, and I was impressed)
20:27 novice66 p6: my @a=1,2,3,4,4,5,6,7,8,9,0; my @b=9,8,7,6,5,4,3; my @c= @a Z+ @b; @c.append(0 xx abs(@b-@a)); say @c
20:27 camelia rakudo-moar 40a953: ( no output )
20:27 lizmat $ 6 'say "༳".Int'
20:27 lizmat -0.5
20:27 skink m: say "hello";
20:27 camelia rakudo-moar 40a953: ( no output )
20:27 lizmat ZoffixWin: hmmm... that doesn't feel right  :-)
20:28 zakharyas joined #perl6
20:28 ZoffixWin .u ༳
20:28 yoleaux U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
20:28 ZoffixWin lizmat, that's the correct output. It's negative half
20:28 masak lizmat: in Swedish, when we say "half x", it does indeed mean x - 0.5
20:28 grondilu say I have a role Foo in a compunit somewhere (I mean a file), and I use this role as an interface.  Then I have a compunit class Bar in an other file that implements Foo.  How can I have the symbols exported by Foo be also exported by Bar?  That is for instace if there is a method 'sub talk is export { say "hi" }' in Foo, how can I have 'use Bar; talk();' work?
20:28 masak lizmat: we do that for clock time, for example. "half four" is 3:30.
20:28 lizmat ZoffixWin: but -0.5 is *not* an Int  :-)
20:28 ZoffixWin Oh, HAH
20:28 masak oh!
20:28 masak lizmat++ :)
20:28 timotimo novice66: camelia is having trouble, so it's hard to show stuff to others right now :(
20:29 masak lizmat: should probably truncate down to -1, then ;)
20:29 ZoffixWin m: say -0.5.Int
20:29 camelia rakudo-moar 40a953: OUTPUT«0␤»
20:29 RabidGravy is badness going to ensue if I have a sub that has a "take" and possibly will call itself recursively (to a limited depth)>
20:29 masak er, truncate up to 0, of course
20:29 masak truncation is towards zero, always
20:30 masak and so, half zero turns out to be 0 after all, at least after truncation :P
20:30 lizmat RabidGravy: pretty sure that should be ok
20:31 grondilu to clarify: in Foo.pm6: 'unit role Foo; sub talk is export { say "hi" };'  in Bar.pm6:  'use Foo; unit class Bar does Foo;' and then how could I make 'use Bar; foo();' work?
20:31 RabidGravy lizmat, cheers :) I'll give it a try
20:31 grondilu ah I meant: 'use Bar; talk();'
20:33 masak RabidGravy: yes, that's OK. (and explicitly designed-for)
20:33 RabidGravy cool
20:33 masak RabidGravy: the slogan is "gather is dynamic (not lexical)"
20:33 masak dynamic, like exceptions, not lexical, like variable lookup
20:35 Garland I tried to compile perl6 using rakudobrew on Microsoft's subsystem for Linux. Everything compiles correctly, but make install fails with "Failed to write string to stream: bad file descriptor" from tools/build/install-core-dist.pl line 13.
20:36 grondilu which prefix did you chose?
20:37 Garland I left it blank.
20:37 grondilu try to pick a directory where you have full file access rights.
20:38 grondilu (that would be my guess anyway)
20:39 Ven joined #perl6
20:40 skink RabidGravy, Would it be appropriate to remove RNG-TrulyRandom from Most Wanted now?
20:41 RabidGravy I don't see why not, it stops people from implementing it without checking the modules list first
20:41 RabidGravy :)
20:42 skink Well there's also a WIP for Math::TrulyRandom, but I started Crypt::Random because its dev didn't respond to my comments / fork of it
20:43 RabidGravy I was sure I had a clone of most wanted locally
20:44 * RabidGravy is getting senile
20:44 ZoffixWin grondilu, maybe try something with the penultimate example in this section? Dynamically inspect what subs Foo exports and reexport them from bar? http://docs.perl6.org/language/modules#UNIT%3A%3AEXPORT%3A%3A%2A
20:45 ZoffixWin I tried a few things, but I think my install is glitching :/
20:45 ZoffixWin perl6 -I. -IBar -e '' wasn't find it Bar.pm6; I moved it to lib/ and did -Ilib and then it found it :S
20:46 skink Just sent a PR
20:46 dalek perl6-most-wanted: a0b3e1c | skinkade++ | most-wanted/modules.md:
20:46 dalek perl6-most-wanted: Remove TrulyRandom from Most Wanted
20:46 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/a0b3e1ca11
20:46 dalek perl6-most-wanted: ae1f1d2 | (Zoffix Znet)++ | most-wanted/modules.md:
20:46 dalek perl6-most-wanted: Merge pull request #26 from skinkade/master
20:46 dalek perl6-most-wanted:
20:46 dalek perl6-most-wanted: Remove TrulyRandom from Most Wanted
20:46 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/ae1f1d2d94
20:47 _28_ria joined #perl6
20:47 RabidGravy hah, and I *did* have a local clone
20:48 RabidGravy (I'd just moved it "somewhere sensible")
20:50 AlexDaniel what is -o flag?
20:50 raoulvdberge joined #perl6
20:51 AlexDaniel no, seriously. How does that work?
20:51 nine camelia seems to be recompiling?
20:51 AlexDaniel perl6 -e 'say ‘hello perl6’' -o 'test' # does nothing
20:51 nine m: say "test"
20:51 camelia rakudo-moar 40a953: OUTPUT«test␤»
20:53 nadim joined #perl6
20:54 RabidGravy poor, poor camelia
20:56 ZoffixWin m: say "test"
20:56 camelia rakudo-moar 40a953: ( no output )
20:58 spider-mario joined #perl6
20:58 RabidGravy in the right channel this time
20:58 RabidGravy If I made a module "Algorithm::Euclid" what would you expect it to do?
20:58 Garland grondilu: I gave it a shot with a prefix inside of my Windows user home folder, and also tried it with an admin level bash shell. Both give the same error still.
20:58 AlexDaniel anybody?
20:58 nine m: say "test"
20:58 camelia rakudo-moar 40a953: OUTPUT«test␤»
20:58 nine Seems like camelia likes me more :)
20:59 pmurias ugexe: sorry if I came across as dogpiling
21:01 grondilu m: role A { method abs {..
21:01 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wZcpv44zrZ␤Preceding context expects a term, but found infix .. instead␤at /tmp/wZcpv44zrZ:1␤------> 3role A { method abs {..7⏏5<EOL>»
21:02 grondilu bad paste, sorry
21:02 grondilu m: role A { method abs {..
21:02 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/RKOZ5JnPZ7␤Preceding context expects a term, but found infix .. instead␤at /tmp/RKOZ5JnPZ7:1␤------> 3role A { method abs {..7⏏5<EOL>»
21:02 RabidGravy AlexDaniel, it specifies the output filename for stages that produce output, such as mbc
21:03 RabidGravy so "perl6 --target=mbc -o foo.moarvm -e "say 'foo'"
21:03 AlexDaniel RabidGravy: oh…
21:03 AlexDaniel RabidGravy: okay, thanks
21:04 RabidGravy which may or may not make something sensible
21:04 grondilu m: role A { method abs {...}}; class B does A { has $.x handles <abs> };
21:04 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oFNTTNvSzB␤Method 'abs' must be implemented by B because it is required by a role␤at /tmp/oFNTTNvSzB:1»
21:04 grondilu doesn't delegation means implementation?
21:05 grondilu *mean
21:05 skink D'oh!
21:06 skink Coulda just added a prime param to crypt_random() instead of it being its own function.
21:06 RabidGravy grondilu, no.
21:07 RabidGravy "handles" in this case means the object in the $.x provides a method <abs> which appears as a method in the class
21:08 RabidGravy and as it doesn't know what that object is at the point of compilation it fails like that
21:08 ZoffixWin m: class A { method abs {...}}; class B { has $.x handles <abs> }; B.new( x => A.new ).abs
21:08 camelia rakudo-moar 40a953: OUTPUT«Stub code executed␤  in method abs at /tmp/rcK2c1FR4W line 1␤  in block <unit> at /tmp/rcK2c1FR4W line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/rcK2c1FR4W line 1␤␤»
21:08 BenGoldberg joined #perl6
21:09 grondilu m: role A { method abs {...}}; class B does A { has Real $.x handles <abs> };
21:09 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ziqaWgmTQ_␤Method 'abs' must be implemented by B because it is required by a role␤at /tmp/ziqaWgmTQ_:1␤»
21:09 RabidGravy tricky
21:09 ZoffixWin Ah, I see what you're trying to do.
21:10 RabidGravy the role composition part where that check is done is possibly sooner than the attribute being built
21:12 ZoffixWin m: role A { multi method abs {...}}; class B does A { has $x handles <abs> };
21:12 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Pt5POZ1F5h␤Multi method 'abs' with signature :(B $: *%_) must be implemented by B because it is required by a role␤at /tmp/Pt5POZ1F5h:1␤»
21:13 jnthn "handles" is a trait on attributes, the effects come at attribute composition time, and since roles can also introduce attributes then attribute composition happens after role composition, thus methods added thanks to `handles` are too late.
21:14 grondilu so I must make a wrapper?  Like 'method abs { $!x.abs }'.  That's lame.
21:15 ZoffixWin m: role A { multi method abs (Mu $: |c is raw) {...}}; class B does A { has $.x handles <abs> };
21:15 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AqkSdihTFR␤Multi method 'abs' with signature :(Mu $: |c is raw) must be implemented by B because it is required by a role␤at /tmp/AqkSdihTFR:1␤»
21:15 ZoffixWin ehe
21:17 grondilu well, the check should give the class a second chance after attribute composition time.
21:17 jnthn That's probably a bad way to fix it.
21:18 grondilu well, you're the implementator, it's your problem ;P
21:18 Hotkeys I've got two codejam solutions that run fast and are nice looking
21:18 Hotkeys and another that is a horrible mess
21:18 Hotkeys and runs probably way too slow
21:18 Hotkeys will share them when the round is over
21:20 jnthn grondilu: Too bad for you I'm more inclined to deal with people's problems when they aren't busy shouting "lame!" :P
21:20 jnthn Anyway, the better approach is probably to just have trusts add the methods right off
21:20 jnthn I don't know why it isn't done that way right now
21:20 grondilu just to be clear:  I was not serious of course.  Keep on the good work and feel free to ignore my whinings.
21:20 RabidGravy karma's a bugger like that
21:21 jnthn I wonder if it wasn't done that way for historical reasons that are no more...or just because it seemed like a good idea at the time.
21:21 * grondilu will remember to use 'LTA' instead of 'lame' in the future.
21:22 jnthn grondilu: Don't worry, I'm just tired :)
21:22 mst grondilu: or 'less space than a nomad'
21:23 jnthn heh :)
21:23 RabidGravy pfui, I'm going to call this module Algorithm::Euclid and someone who cares that it is actually a specialised case can suggest a better name later
21:23 * jnthn goes to rest :)
21:23 mst RabidGravy: Algorithm::MostlyEuclidian::IThink
21:25 masak it should be illegal to shout "lame!" in a crowded bus number
21:25 RabidGravy it's sort of Euclid by Bjorklund by Toussaint
21:26 timotimo what does it sort?
21:26 RabidGravy nothing
21:26 masak how... nihilist
21:27 timotimo it whispers sweet nothings in your stdear
21:27 perturbation joined #perl6
21:27 masak reminds me of https://github.com/catseye/Specs-on-Spec/blob/master/sartre/sartre.markdown
21:28 Hotkeys the whole being able to split methods across multiple lines thing is really nice
21:28 Hotkeys without using \ or whatever it was
21:33 RabidGravy rather than sorting anything it implements the thing described in http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf
21:33 masak RabidGravy: I would expect a module called Algorithm::Euclid to do this: https://github.com/masak/007/blob/master/examples/euclid-gcd.007
21:34 lizmat good night, #perl6!
21:36 masak 'night, lizmat
21:38 RabidGravy yeah, it does do that *under the hood* to distribute the n fills into m slots
21:39 RabidGravy maybe EuclideanRhythm or something like tat
21:42 RabidGravy wouldn't want any mathematicians getting confused
21:49 masak 'night, #perl6
21:49 BenGoldberg joined #perl6
21:51 vendethiel joined #perl6
21:54 BenGoldberg joined #perl6
22:02 spider-mario_ joined #perl6
22:10 ZoffixLappy joined #perl6
22:13 BenGoldberg joined #perl6
22:17 Sgeo joined #perl6
22:19 dvinciguerra_ joined #perl6
22:23 nadim joined #perl6
22:27 MadcapJake I'm seriously debating dropping everything I'm doing for the next week to get either a allegro or GLFW module written for Ludum Dare 35
22:29 ZoffixLappy Do it!
22:29 ZoffixLappy I can then do Dice Poker game I wanted to make :P
22:30 MadcapJake sounds neat! I have some basics already done for both libraries, and I'd have just under a week to get them up-to-par, I think it's doable
22:30 boegel joined #perl6
22:31 MadcapJake maybe I'll even live-stream the coding :D
22:31 ZoffixLappy :)
22:32 MadcapJake the only problem is, I'm sure most LD'ers will already be preparing using their preferred tools, it's unlikely to get any use this round, but still could be a nice publicity stunt! xD
22:35 timotimo MadcapJake: why not contribute to the sdl2 binding?
22:59 timotimo what makes allegro better to you compared to sdl2?
22:59 timotimo i had found this kind of neat library "sdl_gpu" (which is also available in a sdl2 version) which i've made a binding for (with gptrixie) that lets you do lots of stuff sdl2 itself is lacking, like arbitrary 2d geometry with textures applied
22:59 ZoffixLappy Why does this end up splitting `name` and `content` into two separate hashes:
22:59 ZoffixLappy m: my $content = {files => [{name => 'main', content => 'blah', }], }; say to-json $content;
22:59 camelia rakudo-moar 40a953: OUTPUT«{␤  "files" : [␤    {␤      "name" : "main"␤    },␤    {␤      "content" : "blah"␤    }␤  ]␤}␤»
23:00 ZoffixLappy I want just one
23:00 timotimo oh, that can't be right
23:00 ZoffixLappy [␤    {␤      "name" : "main", "content" : "blah"␤    }]
23:00 ZoffixLappy JSON::Fast seems to do the same thing
23:00 timotimo m: my $content = {files => [{name => 'main', content => 'blah', }], }; say $content.perl
23:00 camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
23:01 ZoffixLappy (assuming it replaces the default to-json when I `use` it)
23:01 timotimo that's just pairs
23:01 timotimo not actually a hash
23:01 ZoffixLappy hmm
23:01 timotimo m: my $content = {files => [{name => 'main', content => 'blah'}], }; say $content.perl
23:01 camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
23:01 ZoffixLappy Why are the braces ignored?
23:01 timotimo m: my $content = {files => [%(name => 'main', content => 'blah')], }; say $content.perl
23:01 camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
23:01 timotimo oh
23:01 timotimo haha
23:01 timotimo you have [ ] with a single argument
23:01 ZoffixLappy Ahh :D
23:01 timotimo m: my $content = {files => [{name => 'main', content => 'blah'},], }; say $content.perl
23:01 camelia rakudo-moar 40a953: OUTPUT«${:files($[{:content("blah"), :name("main")},])}␤»
23:01 ZoffixLappy Thanks, timotimo++
23:02 timotimo YW
23:03 ZoffixLappy Perl 6 is such a pleasure to program in.
23:04 Hotkeys true
23:05 MadcapJake amen!
23:05 timotimo hmm
23:07 MadcapJake timotimo: That's a good idea! I've always just enjoyed making new things partly to practice and learn. Let me take a look at the SDL repo.
23:07 MadcapJake The repo hasn't been updated in some time.
23:08 ZoffixLappy MadcapJake, there's SDL2::Raw https://github.com/timo/SDL2_raw-p6
23:09 MadcapJake Ahh! xD
23:12 Xliff multi method new(Int(Real) :$x!, Int(Real) :$y!) { self.bless(:$x, :$y) }
23:12 Xliff ?!?
23:12 Xliff Int(Real)
23:13 nadim joined #perl6
23:14 geekosaur coercion type?
23:14 novice666 joined #perl6
23:15 ZoffixLappy m: class Foo { multi method new(Int(Real) :$x!, Int(Real) :$y!) { self.bless(:$x, :$y) } }; Foo.new(:4x, :5x).perl.say
23:15 camelia rakudo-moar 40a953: ( no output )
23:15 ZoffixLappy ~_~
23:16 ZoffixLappy m: class Foo { multi method new(Int(Real) :$x!, Int(Real) :$y!) { self.bless(:$x, :$y) } }; Foo.new(:4x, :5x).perl.say
23:16 camelia rakudo-moar 40a953: OUTPUT«Foo.new␤»
23:16 skink joined #perl6
23:16 skink Didn't realize I closed this window, heh
23:17 Xliff So.... A(B) means "Can take A but coerce into B?
23:17 Xliff Or is it the other way around?
23:19 RabidGravy the other way round
23:19 ZoffixLappy m: sub foo ( Int(Real) $x ){ say $x }; foo 4.5
23:19 camelia rakudo-moar 40a953: OUTPUT«4␤»
23:20 ZoffixLappy m: sub foo ( Int(Real|Str) $x ){ say $x }; foo '4.5'
23:20 camelia rakudo-moar 40a953: ( no output )
23:20 ZoffixLappy This is annoying.
23:22 ZoffixLappy m: sub foo ( Str $x, Pair @array  ){ say "$x @array[]" }; foo 'bar', [meow => 'moo'];
23:22 camelia rakudo-moar 40a953: ( no output )
23:22 ZoffixLappy Why does this fail? I want to specify I want a list of pairs as an arg
23:23 skink Hm. Could someone tell me if Crypt::Bcrypt passes its for them?
23:23 timotimo because you didn't give it a List of Pair
23:23 timotimo you gave it just a List
23:24 timotimo if you want that to work, you have to "my Pair @ = meow => 'moo'" or something simila
23:25 ZoffixLappy m: say [meow => 'moo', bar => 'ber'][0].WHAT
23:25 camelia rakudo-moar 40a953: OUTPUT«(Pair)␤»
23:25 ZoffixLappy mkay
23:25 timotimo our types are nominal, not ... the other thing
23:26 ZoffixLappy m: sub foo ( Str $x, @array where all(*) ~~ Pair ){ say "$x @array[]" }; foo 'bar', [meow => 'moo'];
23:26 camelia rakudo-moar 40a953: OUTPUT«Constraint type check failed for parameter '@array'␤  in sub foo at /tmp/gojSbLAF2X line 1␤  in block <unit> at /tmp/gojSbLAF2X line 1␤»
23:26 skink I cloned Crypt::Bcrypt, ran panda-build and panda-test, and all the tests came up 'Dubious' (not actually failing), with their subtests failing
23:26 ZoffixLappy screw it... Will use just @array
23:27 timotimo hm, are panda-build and panda-test actually working right at the moment?
23:27 timotimo with the "recent" changes?
23:27 ZoffixLappy skink, fails: https://gist.github.com/zoffixznet/293e411d0f0c54a9c8ab76b7983123d9
23:27 timotimo skink: you could use "panda install ." instead
23:28 timotimo uh oh
23:28 skink timotimo, Well I forked it because I was gonna work on it
23:28 ZoffixLappy skink, well, they're dubious because they're dying: "read bytes requires an object with REPR MVMOSHandle"
23:28 skink I'm also getting that for some of them
23:29 skink Also some "Dynamic variable @*INC not found"
23:29 timotimo oh, yeah, that'd be very outdated
23:29 timotimo should have already been "use lib" instead of manipulating @*INC
23:29 skink Well, it hasn't been updated since two months before actual release :)
23:30 ZoffixLappy m:  my @files = foo => 'bar'; my %content; %content<files> = @files.map: { {name => .key, content => .value }, }; say to-json %content
23:30 camelia rakudo-moar 40a953: OUTPUT«Can't serialize an object of type Block␤  in block <unit> at /tmp/maktceyQ6k line 1␤␤»
23:30 skink timotimo, It's manipulating @*INC in attempt to bind
23:31 ZoffixLappy Interesting. On my local version of perl6 it just hands
23:31 skink a C lib
23:31 timotimo bind??
23:31 timotimo oh, a C lib
23:31 timotimo we have %*RESOURCES or what's it called
23:31 timotimo for exactly that purpose
23:31 ZoffixLappy m:  my @files = foo => 'bar'; my %content; %content<files> = @files.map: { {name => .key, content => .value } }; say to-json %content
23:31 camelia rakudo-moar 40a953: OUTPUT«{␤  "files" : [␤    [␤      {␤        "name" : "foo"␤      },␤      {␤        "content" : "bar"␤      }␤    ]␤  ]␤}␤»
23:31 timotimo and the helper module Native::Resources or something
23:31 ZoffixLappy So how do I avoid the single-arg thing in this case? I want `name` and `content` in the same hash
23:32 skink https://github.com/skinkade/p6-Crypt-Bcrypt/blob/master/lib/Crypt/Bcrypt.pm6#L22
23:32 timotimo i think you're getting the inner { } interpreted as a code block because it uses $_
23:32 timotimo known edge case
23:32 ZoffixLappy m:  my @files = foo => 'bar'; my %content; %content<files> = @files.map: { %(name => .key, content => .value) }; say to-json %content
23:32 camelia rakudo-moar 40a953: OUTPUT«{␤  "files" : [␤    {␤      "name" : "foo",␤      "content" : "bar"␤    }␤  ]␤}␤»
23:32 ZoffixLappy aha
23:33 timotimo someone should go look to make sure it's in the docs as an example
23:34 skink timotimo, I know the OpenSSL bind does something like he's trying to do here
23:35 skink I'll see what I can do
23:35 timotimo cool!
23:41 ZoffixLappy Looks like there's a problem with latest rakudo with including modules from '.' directory: https://gist.github.com/zoffixznet/915cfd876c94242415c0ed1891076ad6
23:41 ZoffixLappy I'm having the same problem with glot.io version too
23:41 timotimo is it also b0rken without using the -M flag?
23:41 ZoffixLappy Oh, wait, I didn't do is export
23:41 * ZoffixLappy tries again
23:41 timotimo :D
23:41 timotimo well done :)
23:42 timotimo i didn't even look at the source itself :|
23:42 timotimo shame on me
23:42 timotimo i ought to go to bed
23:42 ZoffixLappy Works :(
23:42 timotimo sorry about that!
23:42 ZoffixLappy I mean :)
23:42 timotimo we'll make sure to get you some fresh bugs come monday evening!
23:42 ZoffixLappy hehe
23:47 Herby_ joined #perl6
23:47 Herby_ Evening, everyone!
23:48 ZoffixLappy \o
23:48 skink Can someone point me at the docs for %?RESOURCE? Little hard to search for.
23:48 Herby_ o/
23:49 Xliff \o skink'\
23:49 skink Hey Xliff
23:49 Xliff s/\'\\//
23:49 skink bbl
23:49 Xliff LOL
23:50 Xliff o7
23:50 ZoffixLappy skink, there's some mention of it in: http://docs.perl6.org/language/modules#Distributing_Modules
23:59 MadcapJake timotimo: what of SDL2::Raw needs work?

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

Perl 6 | Reference Documentation | Rakudo