»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
teatime I saw that comment, but it was insufficient to explain the code to me. 00:00
skink They were using it as a faster shorthand.
teatime maybe if it had said /* -x == 2**32 -x +1 for unsigned x */
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.'
so you could probably just go with that. 00:02
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 ?
well min = max % x anyway, if you're making it support more than 32-bit numbers. 00:06
bah I still can't read... I am going to go get coffee or something.
skink That introduces modulo bias, which is the whole point :)
teatime ^^
skink (2**base - $upper) % $upper is the non-hacky literal translation 00:07
Xliff, You around? 00:12
00:13 johndau left 00:14 johndau joined 00:17 perlawhirl left
Xliff Yup 00:17
skink I pushed some Windows changes earlier. Could you pull and run the tests?
Xliff Yup 00:18
00:19 johndau left
teatime m: say 2**32 - 93 00:19
camelia rakudo-moar 40a953: OUTPUT«4294967203␤»
00:20 johndau joined
Xliff skink: Method 'allocate' not found for invocant of class 'Buf' 00:21
in sub _crypt_random_bytes at D:\SVN\Github\crypt-random\lib\Crypt\Random\Win.pm6 line 10
That was from 01-buf.t 00:22
My guess is that the rest will fail.
Yup. 02-value.t gives same error. Of course it would. 00:23
00:24 johndau left
skink You lied to me sortiz! 00:24
00:25 johndau joined
skink Xliff, So that's probably going to be my $bytes = Buf.new; $bytes[$len - 1] = 0; 00:27
00:30 johndau left
Xliff This type cannot unbox to a native integer 00:30
in sub _crypt_random_bytes at D:\SVN\Github\crypt-random\lib\Crypt\Random\Win.
pm6 line 19
00:30 Actualeyes joined
ZoffixWin Xliff, how old is your perl? 00:30
Xliff ZoffixWin: This is Windows rakudo
ZoffixWin k 00:31
00:31 johndau joined
Xliff So 2016.1 00:31
Can rakudobrew work under Windows?
ZoffixWin m: my int $x = '42'
camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native integer␤ in block <unit> at /tmp/aKnfbueB4q line 1␤␤»
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.
One of the reasons I develop under Linux.
s/develop/prefer developing/
<- Grammar Nazi 00:33
skink I might have to revert that commit then.
Xliff Oh, and I had a bug in my Mojo::DOM perl6 script that I finally fixed. 00:35
Now I don't need freaking uninintentionally backtracking regexes.
00:38 johndau left 00:39 johndau joined
Timbus oh, howd that work out for you Xliff 00:39
00:43 johndau left 00:45 johndau joined, dvinciguerra_ left
teatime $hash{'key'} = $line if $line =~ /^foo/ 00:49
?
mischan
sortiz skink, Ups! Sorry, Indeed Buf.allocate is 2016.03+, and Xliff is using 2016.01.
Xliff sortiz: How difficult is it to compile rakudo under Windows? 00:50
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.
Xliff Should not be a problem. I am working on the manipulation rules, now.
00:51 johndau left
Xliff sortiz, kthx 00:51
00:53 johndau joined
sortiz skink, If you like, I have a nqp trick for back compatibility ;-) 00:56
00:59 johndau left 01:01 johndau joined
skink That sounds dangerous. 01:02
01:04 johndau left
sortiz bbl & 01:04
01:05 johndau joined, johndau left 01:06 johndau joined 01:07 johndau left, wamba left 01:11 zostay left, zostay joined
skink sortiz, I see you have blob-allocate in NH-Blob 01:21
I just dunno what that does over Buf.new; $buf[len-1] = 0;
01:24 _nadim left 01:25 _nadim joined
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 mr-foobar left
skink m: my uint64 $len = 10; my $bytes = Buf.new; $bytes[$len - 1]; say $bytes; 01:25
camelia rakudo-moar 40a953: OUTPUT«Buf:0x<>␤»
Xliff Er.
skink Interesting.
Xliff m: say <a b c>.end 01:26
camelia rakudo-moar 40a953: OUTPUT«2␤»
Xliff m: say <a b c>.first
camelia rakudo-moar 40a953: OUTPUT«a␤»
Xliff m: say <a b c>.last
camelia rakudo-moar 40a953: OUTPUT«Method 'last' not found for invocant of class 'List'␤ in block <unit> at /tmp/HUsoMecgBh line 1␤␤»
Juerd Xliff: tail
Xliff m: say <a b c>.tail
camelia rakudo-moar 40a953: OUTPUT«(c)␤»
01:26 mr-foobar joined
skink Shouldn't it be head/tail for consistency? 01:26
Xliff Juerd: Thanks. Why "tail" and not "last"?
Juerd skink: There's head too.
Xliff m: say <a b c>.head
camelia rakudo-moar 40a953: OUTPUT«(a)␤»
Juerd Head and tail return a list, first returns an item. 01:27
Xliff Or is first a more complex version of head.
Juerd I don't know if there's an item version of tail.
Xliff That's just....odd.
Juerd Or maybe .first is just the filter thingy that defaults to the first thing
m: ^15.first: * > 9
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 …»
Juerd m: (^15).first: * > 9 01:28
camelia ( no output )
Juerd m: say (^15).first: * > 9
camelia rakudo-moar 40a953: OUTPUT«10␤»
Xliff m: say <a b c>.tail[0]
camelia rakudo-moar 40a953: OUTPUT«c␤»
Juerd m: say (^15).first: * %% 2
camelia rakudo-moar 40a953: OUTPUT«0␤»
Xliff m: say <a b c>.tail[-1]
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>␤»
teatime I was kindof surprised that there weren't direct equivalents to car and cdr
Juerd m: say <foo bar baz>.first: /^b/ 01:29
camelia rakudo-moar 40a953: OUTPUT«bar␤»
Juerd So first without a condition is just like first(True)
skink wait what
m: my $buf = Buf.new; $buf[9] = 0; say $buf;
camelia rakudo-moar 40a953: OUTPUT«Buf:0x<00 00 00 00 00 00 00 00 00 00>␤»
skink Sometimes that works and sometimes it doesn't and I have no idea why.
01:30 molaf left
skink Xliff, Replace L19 with 01:32
my $bytes = Buf.new();
$bytes[$len - 1] = 0;
er, L18 01:33
Xliff skink: 01:37
Did that already.
01:43 molaf joined 01:47 arlenik joined 01:53 arlenik left 01:55 kid511 left 01:57 johndau joined 02:00 cdg joined
skink How long until 2016.3+ is on Windows? 02:04
ZoffixWin I'd imagine it's all a matter of just following some procedure to generate the MSI 02:06
skink Would it be bad to not be 6.c-compatible? 02:09
ZoffixWin "it" being what? :) A Perl 6 release? Sure, it'd be terrible. 02:11
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:12
But that's 2016.3+ 02:13
My English is failing apparently
02:16 Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 02:17 noganex joined
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:18
I guess this is a good precedent to mention in #perl6-release 02:19
02:20 noganex_ left
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:22
02:22 sufrostico left
teatime the MAIN sub / usage / etc. behavior is cute but I don't see it seeing a lot of practical use 02:24
unless I understand exactly how it's intended to be used
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
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?
teatime yeah, I guess I can actually see a lot of practical use in smaller and personal scripts, which is a lot of value.
MadcapJake ./bin/rabble -e -d ": addone 1 + ; 1 addone ."
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
ZoffixWin teatime, I see it as a rudimentary way to self-document usage instructions to some basic scripts. It's better than nothing
MadcapJake /home/jrusso/github/rabble/bin/rabble --expression|-e [--debug|-d] <expr> 02:27
/home/jrusso/github/rabble/bin/rabble [--debug|-d] <file>
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* $$/;
camelia ( no output )
MadcapJake :(Str $expr, Bool :expression(:$e)!, Bool :debug(:$d)) is the signature I'm trying to match
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
ZoffixWin m: say "This is a test." ~~ /<[ .!?"”— ]> \s* $$/; 02:30
camelia rakudo-moar 40a953: OUTPUT«「.」␤»
ZoffixWin Xliff, ^ too many backslashes :)
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:33
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
MadcapJake crazyness!
teatime ZoffixWin: even if you do -- first ? 02:35
ZoffixWin teatime, was about to say.... the -- is the way.
This is more about the shell than Perl 6, but :y should still be parsed as normal string and not a named arg IMO
Xliff skink: All tests OK 02:36
ZoffixWin perl6 -e 'sub MAIN ($x) { say $x }' -- ":y=45" works fine
skink Sweet
teatime perhaps that syntax was intentional based on Perl6-ish syntax
ZoffixWin Unless there are some shells where : instead of - on args is used that I'm unaware of.\
skink Maybe in the future I'll switch to Buf.allocate() for efficiency but not until 2016.3+ is widely used
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:39
MadcapJake #127864 <-- ZoffixWin 02:40
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127864
teatime ZoffixWin: it's not a shell thing, just a conventions thing. windows apps can use - and *nix apps can use /
ZoffixWin MadcapJake++
teatime, but :?
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:41 BenGoldberg left
ZoffixWin This all may be a matter of documentation. 02:42
MadcapJake I just need a way to turn it off then
teatime but yeah, it is definitely a surprising thing if you don't expect it.
ZoffixWin MadcapJake, use -- before positionals
MadcapJake ZoffixWin: ahh! Yes thank you!
teatime ^^ any time you don't know their value
ZoffixWin perl6 -e 'sub MAIN ($x) { say $x }' -- ":y=45"
teatime echo "$var" # bad echo -- "$var" # better. 02:43
probably a terrible example because echo -- is probably not portable
printf "%s" "$var" # best? I digress. 02:44
03:10 cdg left
kerframil echo -- "$var" is wrong because -- will be treated as a string operand. printf is, indeed, a good idea. 03:14
03:20 cpage_ left 03:34 skink left 03:36 kurahaupo left 03:44 dj_goku joined 03:47 khw left 03:55 _nadim left 03:57 _nadim joined 04:01 BenGoldberg_ joined, BenGoldberg_ is now known as BenGoldberg 04:02 astj joined 04:06 cpage_ joined 04:07 geekosaur left 04:08 geekosaur joined 04:10 geekosaur left, geekosaur joined
teatime kerframil: damn you're right; I was sure that worked in at least bash :/ 04:13
it seems printf doesn't take any real options, so printf "%s" "$var" should probably be safe 04:15
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?
I can understand both.
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 ..."
teatime: and guideline 10 is the one that recommends allowing -- as a delimiter indicating end of option processing
teatime heh I figured :) 04:20
kerframil :)
04:21 Cabanossi left 04:24 Cabanossi joined 04:46 thowe joined
thowe So, ran rakudobrew build moar, and after it suggests to me to "panda install Readline" and other things. 04:48
But running Panda produces an error "Could not find Shell::Command". How does one proceed in this case?
hoelzro thowe: how are you running panda? 04:49
thowe I type "panda" 04:50
at a shell
hoelzro how did you install panda?
thowe I didn't realize I did. I'm using rakudobrew
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
hoelzro you should probably run that command =)
thowe I will.
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
teatime and make sure you add the stuff to PATH / shell startup per the rakudobrew instructions
thowe yeah, I have the rakudobrew stuff in path, I have built panda. Still getting this error.. 04:57
should I remove .rakudobrew? 04:58
and start over?
hoelzro thowe: what does `which panda` say? 04:59
thowe /home/tim/.rakudobrew/bin/panda 05:00
05:01 cdg joined
hoelzro weird; did you rehash as teatime suggested? 05:01
thowe yeah
hoelzro I suppose nuke ~/.rakudobrew and start over =/ 05:02
thowe OK
05:06 cdg left 05:18 kerframil left 05:24 hankache joined 05:38 cdg joined 05:45 kanishka joined
MadcapJake does $?USAGE work? 05:51
05:55 Vlavv_ left 06:00 jack_rabbit left, jack_rabbit joined 06:01 Ben_Goldberg joined, Ben_Goldberg left 06:02 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 06:04 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
hankache say $?USAGE; 06:04
m: say $?USAGE;
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
hankache in which cases would someone use macros? 06:10
MadcapJake just released rabble v0.3.1, with more words, tests and a repl! github.com/MadcapJake/rabble 06:12
06:12 geekosaur left
hankache MadcapJake++ 06:13
06:13 jack_rabbit left 06:14 geekosaur joined 06:15 BenGoldberg left
MadcapJake hankache: I found a way that I didn't need to access $?USAGE (had to organize my MAIN multis better) 06:15
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
MadcapJake s/written/programming/ 06:18
06:20 BenGoldberg joined, BenGoldberg left 06:33 jack_rabbit joined 06:37 perlawhirl joined 06:40 nadim joined 06:42 _nadim left, perlawhirl left 06:43 CIAvash joined 06:45 perlawhirl joined
dalek osystem: 2d43eba | (Jake Russo)++ | META.list:
Add Rabble

  [Rabble](github.com/MadcapJake/rabble) is a Forth-like language written in Perl 6.
06:46
Timbus heh. a stack based lang in perl 6. this looks familiar :^) 06:49
MadcapJake familiar? how so?
Timbus i wrote one, in parrot
MadcapJake haha nice!
Timbus it was a bit different, but yeah. fun 06:50
06:51 djbkd left 06:52 perlawhirl left
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?
Timbus haha yeah that's the one
MadcapJake sortiz: nice!
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
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:55
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 06:57 djbkd joined
MadcapJake Timbus: wow! That's quite complex! This one manipulates a shared stack variable and it just does simple array ops on it. 06:57
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
===SORRY!=== Error while compiling /home/grondilu/A/C.pm6 (A::C)
Invalid typename 'A::B' in parameter declaration.
MadcapJake off to bed, g'night #perl6
grondilu what am I missing? 06:59
sortiz o/ MadcapJake
06:59 espadrine joined
grondilu oh sorry I meant 'our class B;' 06:59
07:00 skids left
sortiz grondilu, suppose yes, but has class B a body? 07:02
teatime without a body, I get a different error; *with* a (empty) body, I get grondilu's error message. 07:03
grondilu our class B {} 07:04
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 jack_rabbit left, wamba joined 07:11 djbkd left
sortiz Reproduced, but works if in A.pm I change module -> package, weird. 07:12
grondilu, can you test using 'package'? 07:19
grondilu yeah with A as a package it works 07:21
07:22 perlawhirl joined
sortiz need to reread the spec for understand what 'module' offers me. 07:22
btw I try to avoid 'module' 'cus seen other problems like 'duplicate symbol Foo at GLOBAL merging', and 'package' works. ;-) 07:26
07:32 hankache_ joined
Xliff Does anyone know how to specify multiple conditions in a given/when? 07:33
m: given 6 { when 6 || 5 { say "Boo"; } } 07:34
camelia rakudo-moar 40a953: OUTPUT«Boo␤»
Xliff m: given 5 { when 6 || 5 { say "Boo"; } }
camelia ( no output )
sortiz m: given 5 { when 6 | 5 { say "Boo"; } }
camelia rakudo-moar 40a953: OUTPUT«Boo␤»
Xliff hugs sortiz 07:35
thx
07:35 hankache left
sortiz That a nice use for Junctions. 07:35
07:36 cdg left, hankache_ left
sortiz m: if 4 == 3 | 4 | 5 { say "yes" }; 07:36
camelia rakudo-moar 40a953: OUTPUT«yes␤»
Xliff Conjunction junction, what's ya function? 07:42
Xliff ♥s given/when.
masak when Perl finally got a switch, it got it real good. :P 07:44
morning, #perl6
sortiz \o masak
07:50 kanishka left, perlawhirl left 07:56 firstdayonthejob joined
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?
grondilu: it used to be only the former
grondilu: switched to only the latter after GLR 07:58
grondilu oh, that explains a lot.
masak grondilu: frankly, the latter is slightly more consistent
so I've learned to accept it :>
08:00 astj left 08:03 darutoko joined 08:07 cdg joined 08:09 domidumont joined 08:11 cdg left
masak kinda wishes he had a web development mentor/guru sometimes 08:15
08:17 frithnanth joined 08:18 domidumont left, frithnanth left
sortiz masak, maybe I can help you, if you forgive my English :-) 08:20
masak I, I can forgive a lot worse things than English ;) 08:21
s/I/oh/, d'oh
sortiz: mainly my question right now is irclog.perlgeek.de/perl6/2016-04-09#i_12309938 08:22
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.
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"
masak I'm sorry, that seems rather unrelated to me. 08:27
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
and the redirect has nothing to do with which verbs accept which redirects; it's to solve another problem, namely accidental POST re-submissions
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
though what you call a "trick", Wikipedia calls a "web development pattern" :) 08:30
or "web development design pattern", even
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
08:32 RabidGravy joined
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.
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
right. it used to be <form>, and will soon be AJAX-only.
AJAX powered by jQuery 3.0 beta, not that it matters much.
sortiz Ahh, Ok, so you control both, so you don't need to worry. 08:35
In that case, a simple 200 followed by you JSON is all right. 08:36
masak yes, I think so 08:37
considering that the <form> variant is going away completely 08:38
sortiz Yep.
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.
guess that's mainly why I ask. :)
sortiz Yes. 08:39
Moreover, in you POST, I assume the BODY is JSON too, so you are sure that the other side is your code. ;-) 08:40
*your POST 08:41
Hotkeys oh gosh 08:43
I'm writing codejam
and it's turning into codegolf
because I'm writing them all in the repl
this is bad
can't show examples cause the round is still on
08:43 perlawhirl joined
psch o/ 08:43
i think #127864 is a good reason to try and revive my cliparser-with-grammar branch 08:44
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127864
psch maybe this time there'll be someone to review it :P
and *maybe* we also find a use for %*OPTS!
08:45 Begi joined
masak Hotkeys: show them later! :) 08:45
Hotkeys I will 08:46
masak \o/
psch oh boy 08:48
ZoffixWin++ # there's a lot of wonky in what we currently do with cli args 08:49
Hotkeys map is lazy right?
if I do @foo.map({...})[3] it'll only do it 3 times?
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:50
08:53 perlawhirl left
sortiz Hotkeys, yes, is lazy and no, you do it four times. 08:55
Hotkeys oops
right
I can't count
I meant to say ^3 probably 08:56
masak m: say list ^3 08:57
camelia rakudo-moar 40a953: OUTPUT«(0 1 2)␤»
Hotkeys ^3 would be 3 times :p 08:58
09:02 ocbtec joined
sortiz Hotkeys, btw, in reality the number of time that your code is executed depends of its arity. 09:05
*times
Hotkeys ikik 09:06
sortiz ynyn
Hotkeys I really just wanted to know if it was lazy 09:07
the rest was me being too inspecific
:p
masak .oO( for sufficiently large values of 3... ) 09:08
09:10 buharin left
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!␤»
masak :)
...that's nice.
jnthn++, probably
sortiz And the other way too. 09:12
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
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
teatime .tell ZoffixWin ah yeah, thought I remembered maybe reading the ":arg" form somewhere: design.perl6.org/S06.html#Declarin...subroutine 09:17
yoleaux teatime: I'll pass your message to ZoffixWin.
teatime .tell MadcapJake ah yeah, thought I remembered maybe reading the ":arg" form somewhere: design.perl6.org/S06.html#Declarin...subroutine
yoleaux teatime: I'll pass your message to MadcapJake.
teatime should I drop that link into rt.perl.org/rt3//Public/Bug/Displa...?id=127864 or would that be bad form 09:18
psch teatime: check the ticket first ;)
teatime lol, I got scooped. 09:20
psch i like the last test case i added to the ticket
it's a great WAT
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
teatime yeah, absolutely.
psch teatime: still, the last case is still extra wrong :)
teatime def. interesting. 09:23
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:26
yeah, those 4 test cases work fine in a script file. 09:28
psch what's "fine" there? outputting 'named'?
teatime psch: paste.debian.net/plain/429797 09:31
psch teatime: interesting
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>
psch ah. so something is broken with -e as stopper in nom
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...)
I mean, depending on the why, of course. 09:33
psch github.com/perl6/nqp/blob/master/s...ne.nqp#L21 09:34
oh, docs
phew :P
i was wondering why that doesn't complain about undeclared '$paser' hah
github.com/perl6/nqp/blob/master/s...e.nqp#L252 is probably actually at fault 09:35
iirc we add '-e' as stopper, but it checks for '--e'
yeah github.com/perl6/nqp/blob/master/s...r.nqp#L326
teatime welp lol hope I helped a little 09:37
I'm too used to debugging by intuition/guessing followed by testing to confirm
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
there's lots of parts in the code base i have no clue about :P
like, almost everything in nqp/src/vm/moar for example 09:39
09:43 hankache joined 09:47 johndau left 09:48 sortiz left 09:55 TEttinger left
RabidGravy 𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌 10:12
teatime frakteur++ 10:15
10:20 araujo joined
RabidGravy I'm pleasantly surprised that survived the trip from json -> rakudo -> terminal -> clipboard -> xchat 10:21
10:24 labster left 10:33 vike joined
ufobat does a if my $foo = $obj.method($something) { ... } have some side effects or is there anything to mention? 10:35
psch m: if my $foo = 0 { }; say $foo 10:36
camelia rakudo-moar 40a953: OUTPUT«0␤»
ufobat i have a say $foo inside the if, and it prints me "False" 10:37
i am feeling like loosing my mind
psch ufobat: my point is it's a mainline declaration, the my isn't scoped to the if (unlike perl5 iirc?)
ufobat yeah :) 10:38
psch m: if 1 -> $x { }; say $x
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»
psch m: if 1 -> $x { say $x }; say $x
camelia ( no output )
ufobat but this could not explain my point, could it?
psch ...huh
m: class A { method foo { "foo" } }; if my $foo = A.new.foo { say $foo }; 10:39
camelia rakudo-moar 40a953: OUTPUT«foo␤»
psch ufobat: i don't know. what is your point?
ufobat pastebin.com/mkpdSjma
my point is that i get a False
in this example 10:40
if i remove the "for"'s in line 40 an 41 i dont get a False
psch m: sub f { my $x = "foo" ~~ /\d+/; return $x }; if my $x = f() { say $x } 10:41
camelia ( no output )
ufobat did you try it out, my example? 10:42
psch yeah, i just did 10:43
ufobat same behaviour?
psch yeah, a bunch of False from the loop
ufobat oh thank god!! 10:44
psch hm, interesting
i added 'print $++ ~ " ";' before the 'if my ...' 10:45
well, the output is interesting :)
pastebin.com/HAfkfQEn 10:46
maybe something about shadowing or redeclarations or idk... :/ 10:47
ufobat i get 458 false from 484 iterations
psch point is, don't do 'if my $x = ...' :)
'cause with 'if $r.match(..) -> $match' it just works
well, where 'just works' means 'doesn't print False' :P 10:48
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
'cause it doesn't do what anyone who knows it from perl5 would expect 10:50
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:52
anyway 10:53
it's odd, any i am glad i am not mad :)
i need a coffe break :)
thanks for helping me out! 10:54
psch yeah, i don't readily see why it gets through the if with $match == False...
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
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
then you always get the false on the 3th route.. like in your example
when you remove the print $++
you always get the first route
perlawhirl hi perlers 11:21
11:24 mr-foobar left 11:25 mr-foobar joined 11:29 rindolf left 11:30 sue joined 11:34 khisanth_ joined 11:38 Khisanth left, rindolf joined 11:41 kid51 joined 11:45 kid51 left 11:47 nadim left 12:05 hankache left
timotimo o/ 12:10
perlawhirl hi timo
timotimo hey, how are you? 12:11
perlawhirl remember the 'most common element in list' thing i was looking at yesterday 12:12
it's worse than i thought :D ... this seems to be the best way... 12:13
m: say <1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
camelia rakudo-moar 40a953: OUTPUT«(2)␤»
timotimo in what way is that the best?
perlawhirl works like maxpairs in that it returns a list, in case there's more
say <1 1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
m: say <1 1 1 2 2 2 3 >.classify({$_}).maxpairs.map({|$_.keys})
camelia rakudo-moar 40a953: OUTPUT«(1 2)␤»
perlawhirl well... best as in... so far the most performant method call way of doing it 12:14
faster than going via Bag
and jnthn's suggestion yesterday doesn't actually work
because max doesn't work like that 12:15
12:15 k-man left
perlawhirl oh, another kinda related thing is this... 12:16
m: say < 1 1 1 2 2 3 >.classify(*)
camelia rakudo-moar 40a953: OUTPUT«Doesn't make sense to classify with itself␤ in block <unit> at /tmp/Y6lOTzoShA line 1␤»
perlawhirl But there is a valid reason to classify with itself sometimes
m: say < 1 1 1 2 2 3 >.classify({$_})
camelia rakudo-moar 40a953: OUTPUT«{1 => [1 1 1], 2 => [2 2], 3 => [3]}␤»
perlawhirl which is what i'm using in my most common element thingy 12:17
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, hankache joined
perlawhirl so anyway.. that's what's on my mind :D how are you? 12:18
timotimo not feeling very productive these last days 12:24
i've been monitoring an afl-fuzz run against moarvm intently over the last days: hack.p6c.org/~timo/
perlawhirl my understanding of fuzzing is fuzzy... it's for finding bugs? 12:25
timotimo yeah
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:26
on top of that it has a heuristic of some kind to determine when it likes a "path" extra-much 12:27
12:27 cognominal left
perlawhirl has the fuzzing identified anything interesting yet? 12:27
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:28
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 ar: 7a55aad | (Steve Mynott)++ | modules/doc:
sync doc submodule only with master
timotimo even though i don't actually have to wait
12:30 kid51 joined
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
but in theory, you can run fuzzing until the universe dies 12:31
some projects have automated fuzz testing as far as i understand
perlawhirl hah
12:31 astj joined
timotimo not sure what the best practices are there 12:31
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?
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
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
12:33 bjz joined
timotimo and rakudo still has a start-up time of about 0.1 seconds 12:34
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
it can tell what branches are taken, still, but it won't know anything about bytecode-level branches
teatime so, help me understand something... take the example of these operators github.com/rakudo/rakudo/blob/8cbb...ion.pm#L21
timotimo and those are the really interesting ones
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
teatime ahhh, so it would slow things down?
I had assumed adding type info would speed things up
timotimo i'm not sure if anything would check that statically
teatime gotcha. 12:37
timotimo hm, perhaps spesh can optimize the return typecheck - not sure about that
12:38 cognominal joined
dalek ar: 32ffad8 | (Naoum Hankache)++ | docs/perl6intro.pdf:
Latest snapshot of perl6intro.com
12:38
ar: 89d54b2 | (Steve Mynott)++ | docs/perl6intro.pdf:
Merge pull request #68 from hankache/master

Latest snapshot of perl6intro.com
12:38 nadim joined
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
that's right, teatime
but you can return objects that know how to give differently-typed results and only do the necessary work 12:39
you can look at how tr is implemented for an example 12:41
i think StrDistance is the class to look for
perlawhirl timotimo: that sounds pretty promising... though i must confess a lot of this stuff is going over this network engineers head :D
timotimo perlawhirl: it may sound promising, but it won't be worth a damn until someone actually does it :) 12:43
on afl's website, there's a few bugs afl helped find in perl5 by giving it fuzzed strings as input programs
% miniperl -ce '/(?7777777777)/' 12:46
Segmentation fault (core dumped)
12:47 cdg joined
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
timotimo this also used to segfault after outputting all the syntax errors
lists.gnu.org/archive/html/bug-ind...00004.html - wow. 12:49
12:50 hankache left 12:51 cdg_ joined
perlawhirl hah, that first one 12:51
RabidGravy oof
12:51 pmurias joined
RabidGravy and gnu indent is a fairly mature program 12:52
12:52 sue left
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:52
12:52 cdg left
teatime lol, not only is there Math::BigRat, there is also FatRat 12:54
RabidGravy clearly there should be a MonsterRat 12:55
timotimo a MonsterRat has Complex for both the numerator and denominator 12:56
that's clearly useful, right?
12:57 sno joined
RabidGravy obviously *waves hands* 12:58
timotimo perlawhirl: are you interested in result sets from the fuzzing run? 12:59
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 CIAvash left
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:03
anyway, here are the first few hundred minimized crashing files: hack.p6c.org/~timo/a_few_minimized_...hes.tar.gz 13:05
perlawhirl lol, thanks
13:05 kid511 joined 13:06 kid51 left
timotimo you probably have to cd into nqp's vm/moar/stage0 folder to make them work at all 13:06
because it'll try to load the dependency .moarvm files, too 13:07
cool, this is a real crash 13:08
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:11
13:12 sue joined
moritz oh, the fun :-) 13:12
timotimo that's just my interpretation from a first brief look at the stack trace and listing 13:13
there's actually three different "needed" parameters involved in the recursion through "autoclose" 13:14
13:15 astj left, nowan left 13:17 nowan joined
dalek ar: 55c5a3a | (Steve Mynott)++ | tools/star/release-guide.pod:
FROGGS did 2016.01
13:17
ar: 7efb22c | (Steve Mynott)++ | tools/star/release-guide.pod:
put blank nl before every new year
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
stmuk: thank you for working on Star some more
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:18
RabidGravy 🐫 13:22
Is it a camel or a brontosaurus?
timotimo RabidGravy: are you fuzzing the irc? :P
oh, an emoji
i didn't really get a terminal emulator yet that supports those
but i suppose i could be using glowing-bear for irc 13:23
MadcapJake RabidGravy: camel :) IRCCloud converts emoji to a colored emoji font
yoleaux 09:17Z <teatime> MadcapJake: ah yeah, thought I remembered maybe reading the ":arg" form somewhere: design.perl6.org/S06.html#Declarin...subroutine
teatime p.s. I ended up just pasting that to the ticket in case the reference was useful. 13:25
arnsholt timotimo: Oh, that indent bug! And this is why we don't program in C unless we really, really have to =) 13:27
timotimo :) 13:30
of course our VM can still be buggy
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!
teatime MadcapJake: there's no processing of quoted vs. unquoted
arnsholt But at least the potential surface area for C bugs is smaller when you have less C code
teatime the shell removes quotes before they get to perl
MadcapJake teatime: ahh, that's why, I didn't realize that
teatime (unless they're literal, like if you say "\"")
timotimo you can tell an argument was quoted if it contains spaces 13:35
teatime timotimo: not really
timotimo because then it has to have been quoted, otherwise it would have been split by the shell
teatime timotimo: how about "timo" or timo\ timo
timotimo OK, "timo" doesn't speak against my claim, but timo\ timo does
teatime even thinking about 'was this quoted' way over-complicated the kind of processing it makes sense to actually do :) 13:36
timotimo yes
MadcapJake well at the least, the MAIN arg parser should respect --
teatime also I could make some hipster shell that doesn't do word splitting, lol 13:37
13:37 xinming_ joined
MadcapJake ++teatime # for your next-gen hipster shell ;) 13:37
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
teatime --name='spacey value' :name«'spacey value'» <-- is this saying the value of $name inside MAIN() will contain actual quote characters 13:39
'cause.. yeah.. that is weird to me... I dunno why you'd want that over $name="spacey value" 13:40
13:40 xinming left
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.
teatime timotimo: lol staaahp
timotimo Unhandled exception: Invalid frame outer indices; circular 'outer' chain. 13:42
teatime like, is S02 part of the finalized spec of P6
or is that stuff still open to having rough edges smoothed
timotimo damn. it gives that error *every time* now :D
right 13:43
teatime OH, good, no the quotes aren't literal; I just didn't yet know exactly what « » does
pmurias teatime: a Perl 6 slang would make a nice hipster shell
timotimo ugh, my algorithm is crap. 13:46
teatime timotimo: if I had a nickel... 13:47
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
teatime e.g. U+2a7f - U+2aa0
timotimo but for now i'll push the code so we get the fix, i suppose
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 rt.perl.org/Ticket/Display.html?id=127339 which seems to require implementing * and / operators for Duration
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
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
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?
timotimo the tests would go into roast, because that's a language feature
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.
timotimo OK :)
teatime wasn't sure if roast was kindof frozen or if you could contribute more to it.
timotimo: it has a little bit.
timotimo it is frozen by way of a tag or branch; new stuff can go in, still
teatime thx much. 13:56
13:59 smls joined
ZoffixWin . 14:02
yoleaux 09:17Z <teatime> ZoffixWin: ah yeah, thought I remembered maybe reading the ":arg" form somewhere: design.perl6.org/S06.html#Declarin...subroutine
ZoffixWin teatime++ thanks
teatime p.s. I dropped that link in the ticket too in case the reference was useful 14:03
14:04 spider-mario joined 14:10 dvinciguerra_ joined 14:12 vendethiel left 14:16 tharkun left 14:17 mr-foobar left, mr-foobar joined 14:18 khw joined, tharkun joined
ZoffixWin This is curious: gist.github.com/zoffixznet/f6d0914...afa7b7af6b 14:19
m: say say 0xFFFFFFFFFFFFFFFFF
camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
ZoffixWin m: say say 0xFFFFFFFFFFFFFFFFF
camelia ( no output )
timotimo wat :) 14:20
ZoffixWin yeah
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
m: say 0xFFFFFFFFFFFFFFFFF; sleep 1
camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF; sleep 1
camelia ( no output )
ZoffixWin camelia, evalbot control restart 14:21
14:22 CIAvash joined
ZoffixWin Yeah, don't see any issues when executing locally. 14:22
I guess there's an issue with restarting camelia :/ 14:24
14:30 mr-foobar left, mr-fooba_ joined 14:38 skids joined 14:46 camelia joined 14:48 ChanServ sets mode: +v camelia, boegel joined
stmuk github.com/tadzik/Template-Mojo/pull/24 14:48
14:50 perlawhirl left
ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF 14:53
camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
ZoffixWin m: say 0xFFFFFFFFFFFFFFFFF
camelia rakudo-moar 40a953: OUTPUT«295147905179352825855␤»
ZoffixWin \o/
timotimo doesn't have access to that :(
tadzik stmuk: thanks
RabidGravy gosh nearly mid-april and still no mailling list manager written in Perl 6 14:59
;-)
15:00 skids left
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:04
timotimo did anybody test stuff? also, did you grab any of the recent updates? what about bailador? is it in or out? 15:05
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
all the tests past
15:18 CIAvash left 15:23 BenGoldberg joined 15:33 bjz_ joined, bjz left 15:40 mr-fooba_ left 15:43 mr-foobar joined 15:44 djbkd joined 15:47 buharin left 15:52 buharin joined 15:53 tharkun left, tharkun joined 15:54 skink joined
pmurias RabidGravy: has anyone started writing one? 15:56
RabidGravy I don't think so 15:57
stmuk I don't think mailing lists are widely used much anymore 15:59
you should write one of those PHP web fora :)
timotimo PHP is getting Inline\Perl6? 16:01
16:01 bjz_ left 16:02 bjz joined
timotimo cool, the fake unicode consortium retweeted someone's tweet linking to the unicode, perl6, and you advent calendar post 16:06
MadcapJake besides @a[*-1] what are some other ways you might use Whatever inside a subscript? 16:07
timotimo @a[* div 2]
github.com/timo/SDL2_raw-p6/blob/m...er.pl#L289
MadcapJake @times[* - * div 100] O_o 16:08
timotimo so what?
MadcapJake what's that mean? take two items, subtract and divide by 100? 16:09
timotimo no, of course not :)
postcircumfix will pass the number of elements as many times as there are positional arguments
MadcapJake @times[* * 3 div 4] oi vey!
I'm trying to support this in language-perl6fe, but multiple *'s are gonna be really really tricky 16:10
16:10 dvinciguerra_ left
timotimo it will be? :( 16:11
jdv79 there's a fake unicode group? 16:12
MadcapJake Well because I want the WhateverStar to be highlighted differently from the multiplication *
timotimo jdv79: just a twitter account
ZoffixWin MadcapJake, BTW, something I noticed last night: if ( $method eq 'GET' and $bar eq 'meow' ) { }
timotimo twitter.com/FakeUnicode - read it, it's worth it :)
ZoffixWin the name "method" of the variable apparently confuses the highlighter and the rest of the stuff in () gets blue 16:13
If I change it to some other name, the issues goes away
MadcapJake ZoffixWin: ahh I see, thanks! Adding an issue now
skink timotimo, That to be or not to be one... 16:16
TimToady MadcapJake: @a[$i % *] turns out to be useful sometimes 16:18
timotimo :D
oh lord, using the "symbol for BEL" to represent the three letters m) 16:19
16:20 smls left
psch m: say "un\c[SYMBOL FOR BELL]ievable" 16:20
camelia ( no output )
psch :/ 16:21
ZoffixWin camelia's glitching
m: say "un\c[SYMBOL FOR BELL]ievable"; sleep 2
camelia rakudo-moar 40a953: OUTPUT«un␇ievable␤»
geekosaur BEL
if tis is the control picture
psch oh, doesn't render anyway here :|
ZoffixWin Renders well here :)
timotimo it renders here, but it's so small it's basically impossible to read
geekosaur hm
16:22 mcsnolte joined
ZoffixWin This is what I see: i.imgur.com/F5RGDXo.png 16:22
skink Teeny-tiny for me as well 16:23
ZoffixWin m: say ⑯ + ㊿ 16:24
camelia rakudo-moar 40a953: OUTPUT«66␤»
timotimo wow, what's your screen resolution?
ZoffixWin :D
16:24 buharin left
ZoffixWin Mine? 1440p 16:24
timotimo so only like 20 lines of irc fit on your screen at once? :)
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: i.imgur.com/GrQKccl.png
psch same font size here :) 16:26
on 1080p though
stmuk grrrr the panda bootstrap is reporting a Shell::Command error on FreeBSD 10
timotimo oh, ok
psch so, yeah, i only have 20 lines at once and it's perfectly fine, scrollback exists for a reason :P
timotimo t.h8.lv/irc_window.png - mine 16:27
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?
MadcapJake anytime a * is at the end of a subscript, it would *have* to be a Whatever, right?
timotimo: So I'm MadcapJak+ :D 16:29
16:29 buharin joined
timotimo skink: no, it just makes short urls for me 16:30
sometimes urls get wrapped, and aren't clickable for that reason
MadcapJake: i don't think i set this up myself to be like that, but it does help conserve horizontal space 16:31
16:31 wamba left
MadcapJake timotimo: my full nickname must be seen! In all its glory! ;) 16:31
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
(%|:-)
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␤»
timotimo greetings, zacts
zacts hi =) 16:34
MadcapJake timotimo: woah pretty neat with the fading time thingy, didn't even notice :P 16:35
timotimo thanks :) 16:37
came up with it myself
16:45 telex left 16:46 telex joined 16:54 zakharyas joined 16:59 jjido joined
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:07 jdv79 left 17:08 firstdayonthejob left 17:09 geekosaur left 17:10 geekosaur joined, geekosaur left
RabidGravy to be honest I thought you could 17:10
17:11 geekosaur joined
RabidGravy ah 17:11
m: my num32 $n = 12.0e0
camelia ( no output )
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
gotcha
m: my num32 $n = Num(12)
camelia ( no output )
17:12 jdv79 joined
MadcapJake shouldn't it be able to unbox an Int? 17:12
RabidGravy the unboxing doesn't coerce though 17:13
MadcapJake ok, just curious 17:14
17:14 pmurias left 17:16 domidumont joined
skink Speaking of Int, I just realized something real dumb. 17:18
my $prime2048 = Int.new; 17:19
loop (;;) { $prime2048 = crypt_random(256); if $prime2048.is-prime { last; } }
17:20 firstdayonthejob joined
timotimo how do our hack users feel about the current cpu usage? 17:21
MadcapJake language-perl6fe v1.7.0 released! github.com/MadcapJake/language-per...tag/v1.7.0 17:22
timotimo because i could try afl's parallelization support and occupy an additional cpu core ...
of course i'm running my stuff at maximum nice
teatime m: my $x = "foo"; my $y = "foo"; say $x.WHICH === $y.WHICH 17:23
camelia rakudo-moar 40a953: OUTPUT«True␤»
teatime m: my $x = Duration(100); my $y = Duration(100); say $x.WHICH === $y.WHICH
camelia ( no output )
psch m: my $x = Duration(100); my $y = Duration(100); say $x.WHICH === $y.WHICH; sleep 2
camelia ( no output )
timotimo oh, duration isn't a value type?
psch ffs camelia :<
teatime timotimo: I think it's supposed to be and I found a bug, yay 17:24
timotimo m: say Duration.new(100).WHICH
camelia ( no output )
teatime oh damn wait
m: my $x = Duration.new(100); my $y = Duration.new(100); say $x.WHICH === $y.WHICH
camelia ( no output )
psch m: say "o.o" 17:25
camelia ( no output )
teatime I broke it..
fwiw, prints 'False' locally.
timotimo no, camelia is currently a bit unhealthy
we already tried with "evalbot control restart"
jdv79 wonder how long it'll take to compile on an old celeron with 512M and a slow disk...
17:26 domidumont left
timotimo oh lord 17:28
psch istr rpi2 is at like 20 hours or something..? 17:30
RabidGravy has the actual numbers i suppose :)
not sure how those compare, in any case 17:31
17:31 jjido left
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
wonder how hard it is to cross compile or if its possible
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.
skink The answer is: a really long time.
timotimo well, just compiling isn't enough for everything
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
skink ZoffixWin, Not really :D
ZoffixWin heh, alright :)
jdv79 its not really important. just a random thought.
17:34 vike left, zakharyas left
skink Surprisingly, generating a 2048-bit one was quite fast, all things considered. 17:34
17:34 vike joined
skink ZoffixWin, .is-prime is definitely the bottleneck, though. 17:35
17:35 buharin left
psch always thought is-prime is rather fast 17:36
timotimo i thought so, too
psch i mean, it's one of those fancy probability thingies
skink: you did --profile i assume?
skink Nah this is just me playing in a repl 17:37
BenGoldberg p56: print "alive\"
camelia p5-to-p6 : OUTPUT«Can't find string terminator '"' anywhere before EOF at /tmp/3ffk4r017Q line 2 at perlito5.pl line 7541.␤»
skink > crypt_random(512) for 1..1000; say now - INIT now;
5.72368025
BenGoldberg m: "ok".say
camelia rakudo-moar 40a953: OUTPUT«ok␤»
skink I left a loop trying to generate a prime one for like five minutes and killed it
> = crypt_random(256); if $prime2048.is-prime { last; } }; say now - INIT now; 17:39
5.66803949
That got cut off
17:39 buharin joined
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.
jdv79 oh wow. parse stage took 1061s. how long will optimize take now? its stuck there.
17:43 tokomer joined
psch RabidGravy: ahh, so i got it quite a bit wrong 17:43
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
BenGoldberg m: use Crypt::Random :from<perl5>; say makerandom( Size => 4, Strength => 1 );
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…»
BenGoldberg m: use Crypt::Random:from<perl5>; say makerandom( Size => 4, Strength => 1 );
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…»
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
skink > loop (;;) { $prime4096 = crypt_random(512); if $prime4096.is-prime { last; } }; say now - INIT now; 17:45
31.4628254
jdv79 what's mbt?
a year or so ago i was able to build on another box that only had 512M 17:46
RabidGravy the stage after optimize
jdv79 ah. optimize took 412s
RabidGravy I'm just building on both a RPi 1 and a RPi 2 for good measure
jdv79 this is going way faster than i thought!
oh, mast 17:47
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:51
ZoffixWin m: for ^4 .race: :1batch { .say; last if $_ == 2 } 17:52
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?
stmuk hmmm the Shell::Command tests seem to assume File::Which is installed 17:54
skink Yeah that's what I was thinking.
I didn't realize I could do this until like a half hour ago though :)
ZoffixWin m: sub racy { for ^4 .race: :1batch { .say; return if $_ == 2 } }; racy
camelia rakudo-moar 40a953: OUTPUT«1␤0␤2␤Internal error: Unwound entire stack and missed handler␤»
RabidGravy I thought that was sorted
ZoffixWin :o
skink ZoffixWin, Who would I talk to about getting Crypt::Random accepted? 17:55
ZoffixWin skink, accepted to where?
skink The main modules list
17:56 wamba joined
ZoffixWin skink, just follow the instructions here: github.com/perl6/ecosystem 17:56
skink It's currently listed as a WIP on Most Wanted
17:56 CIAvash joined
RabidGravy just a PR to github.com/perl6/ecosystem 17:56
skink Ah!
Okay, didn't realize
ZoffixWin Basically, add a link to your module's raw META file on this list: github.com/perl6/ecosystem/blob/ma.../META.list
skink The modules page said to ask in here 17:57
RabidGravy yeah, well if "we" know we can merge the PR quicker
:)
jdv79 RabidGravy: didn't die. stage mast took 770s and ate about 1.1-1.2G of mem 17:59
RabidGravy yeah, it's pretty hand to mouth on the memory 18:00
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
skink Alrighty, put the PR in
jdv79 man power maybe?
RabidGravy lots of yaks to shave but probably doable npw
jdv79 and historical reasons (p6 wasn't ready when it was written) 18:02
dalek osystem: cc9a43e | skinkade++ | META.list:
Add Crypt::Random
osystem: 87bc130 | RabidGravy++ | META.list:
Merge pull request #190 from skinkade/master

Add Crypt::Random
RabidGravy there
skink ZoffixWin, Now you've made me want to add crypt_random_prime() to Extra
Sweet :)
ZoffixWin skink, what's "if"? Listed in depends in your META 18:03
18:03 espadrine left
skink github.com/FROGGS/p6-if 18:04
It's also on the modules list, just a bit hard to ctrl+f for :)
ZoffixWin Ah, I'm blind. Didn't notice it the first time.
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 '⑯' + ㊿
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␤␤»
ZoffixWin m: say '3' + ㊿
camelia rakudo-moar 40a953: OUTPUT«53␤»
psch .u ⑯
yoleaux U+246F CIRCLED NUMBER SIXTEEN [No] (⑯)
18:06 spider-mario left
psch marvels at font inconsistency 18:06
the circled 50 shows up fine... vOv
m: say '⑯'.Int
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␤␤»
ZoffixWin m: '⑯'.Int.say
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␤␤»
psch that's probably 'cause the grammar special cases the bare one 18:07
and the P6-level Str doesn't have access to the same special-casing
RabidGravy ooh FROGGS++ nice one I hadn't seen that
psch marvels their own inconsistency in dash-handling
18:07 spider-mario joined 18:08 Actualeyes1 joined
jdv79 so took 83m to build 18:09
18:09 buharin left
jdv79 but bare startup time is ~ 1.25s:( 18:09
probably slow disk?
ZoffixWin m: say '೪'.Int 18:10
camelia rakudo-moar 40a953: OUTPUT«4␤»
jdv79 meanwhile bare startup on my main box is ~ 5ms
ZoffixWin .u ೪
yoleaux U+0CEA KANNADA DIGIT FOUR [Nd] (೪)
18:10 Actualeyes left
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:10
jdv79 what's a good simple compute intensive test? 18:11
teatime jdv79: sha1 or sha512sum something big?
ZoffixWin m: 1111111111111111111111.is-prime.say
camelia rakudo-moar 40a953: OUTPUT«False␤»
teatime bzip something big?
oh, perl-specific; sorry
jdv79: slow disk you'd only see on the first invocation; after that, the disk data would be cached 18:12
jdv79 oh, its actually 125ms on my main box. 5ms is perl:) that makes more sense. 18:13
18:14 buharin joined
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…»
jdv79 m: my $i; for 1..1000000 {$i++}; say $i;
camelia rakudo-moar 40a953: OUTPUT«1000000␤»
jdv79 that took .9s on my ok box and 6.3s on the celeron. ew. 18:15
18:15 spider-mario left
jdv79 but it works! yay. 18:15
18:15 spider-mario joined 18:16 AlexDaniel joined
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:16
stmuk see comment github.com/tadzik/Shell-Command/co...24ddd84bb6 18:19
18:21 spider-mario_ joined, spider-mario left 18:24 CIAvash left 18:25 spider-mario_ left
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:25
ZoffixWin I wonder if it should be made to work though. User types ൲ as input, it should work 18:26
m: say ൲; say '൲'
camelia rakudo-moar 40a953: OUTPUT«1000␤»
ZoffixWin umm
m: say ൲; say '൲'.Int
camelia ( no output )
ZoffixWin ~_~
psch ZoffixWin: it probably should work, yeah 18:28
ZoffixWin is rakudobugging it
psch ZoffixWin++ 18:29
18:32 znpy joined
ZoffixWin Done: rt.perl.org/Ticket/Display.html?id=127866 18:33
18:34 vendethiel joined
BenGoldberg m: ( 0.5 * (1/3) ).perl.say 18:34
camelia rakudo-moar 40a953: OUTPUT«<1/6>␤»
ZoffixWin m: say ( 0.5 * (1/3) ).WHAT 18:35
camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
BenGoldberg teatime, Which two-rat operation is returning a num?
ZoffixWin m: say ( 0.5 * 0.75 ).WHAT
camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
18:35 buharin left
BenGoldberg m: ( 0.5 +& (1/3) ).perl.say 18:35
camelia rakudo-moar 40a953: OUTPUT«0␤»
18:36 buharin joined
ZoffixWin m: say ( 0.5e0 * 0.75e0 ).Rat.nude 18:36
camelia ( no output )
ZoffixWin m: say ( 0.5e0 * 0.75e0 ).Rat.nude
camelia ( no output )
ZoffixWin camelia--
BenGoldberg m: ( 0.5 +& (1/3) ).nude.perl.say
camelia ( no output )
18:36 buharin left
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
BenGoldberg m: my @x = ( 0.5 * (1/3) ).nude; say 'ok'; 18:36
camelia rakudo-moar 40a953: OUTPUT«ok␤»
teatime ok, to avoid what's probably an XY problem, let me cut directly to it
18:36 buharin joined
ZoffixWin Awww: twitter.com/_kalkin/status/718870219935084545 18:37
18:37 buharin left
BenGoldberg m: my @x = ( 0.5 * (1/3) ).nude; say @x; 18:37
camelia rakudo-moar 40a953: OUTPUT«[1 6]␤»
18:37 Begi left, buharin joined, Begi joined, buharin left, Actualeyes1 left, buharin joined 18:39 tokomer left
teatime bah, nevermind, I seem to have been mistaken :) 18:39
however the answer seems to be yes, if such an operation did exist it would be lossy.
18:39 mr-foobar left
teatime well, no, it's true, ok: 18:41
m: (Duration.new(10) / Duration.new(1/10000)).WHAT.say
camelia rakudo-moar 40a953: OUTPUT«(Num)␤»
teatime shouldn't that be a Rat ?
psch m: &infix:<+>.candidates[4](1/3, 1/3).WHAT.say
camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native integer␤ in block <unit> at /tmp/sUTO4KC6zn line 1␤␤»
psch aww
ufobat Guys! a guessing game: will this die? ( psch, dont tell anyone ) if my $match = $r.match($meth, $uri) { die "What?!" unless $match }
ZoffixWin Yes, $r is undeclared :p 18:42
m: say Duration.new(10).WHAT
camelia rakudo-moar 40a953: OUTPUT«(Duration)␤»
ZoffixWin m: (Duration.new(10) / Duration.new(1/10000)).Rat.nude.say
camelia rakudo-moar 40a953: OUTPUT«(100000 1)␤»
ufobat no $r is delcared! :p
18:42 mr-foobar joined
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»
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?
ufobat pastebin.com/QAKty9EE
ZoffixWin teatime, no idea :)
ufobat psch, i shortend the code
psch teatime: Duration isn't Rat. Duration is Cool does Real :)
ufobat: yeah, but you yourself noted that leaving out the loop removes the WAT :)
teatime so why not does Rational ?
18:43 buharin left 18:44 khisanth_ left
psch m: say Rat ~~ Real 18:44
camelia rakudo-moar 40a953: OUTPUT«True␤»
psch m: say Real ~~ Rat
camelia rakudo-moar 40a953: OUTPUT«False␤»
ufobat psch, its fragile, indeed!
teatime is the answer "the lossiness is small enough to disregard" ?
ZoffixWin Well, I don't see any lossiness yet... Maybe you're overthinking this? :) 18:45
18:45 Begi left
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.
teatime and I don't have an example that demonstrates it but I beleive Rat can represent exact values that Real cannot?
ufobat psch, seems like noone will explain it to us :/ 18:46
psch teatime: Real is a role done by Num and Rat
err, no
Rat does Rational
which is parameterized
m: 1/3 ~~ Real # what mislead me
camelia ( no output )
psch m: say 1/3 ~~ Real # - ENOSAY
camelia rakudo-moar 40a953: OUTPUT«True␤»
psch yeah, and Rational does Real 18:47
teatime yeah, I follow so far.
psch ufobat: i suspect there's some discussion in the clog, you'll probably find it with search for "if my"
ufobat: beware of false positives though :)
teatime just curious why Duration, which is internally a Rat, does Real instead of does Rational?
maybe the answer is in S02 or S32; haven't read all of them yet
18:48 BenGoldberg left
psch teatime: that's the thing, Duration is Cool 18:48
teatime: because everyone wants to treat is as Str, Num or Rat
teatime: it does Real instead of Rational because it doesn't want to parameterize itself, i presume
(which is a glaringly untechnical explanation...) 18:49
18:49 BenGoldberg joined
ufobat i indeed found a false positive so far ;) doc.perl6.org/language/5to6-nutshell 18:49
18:50 mcsnolte left
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 pastebin.com/QAKty9EE?
i have no clue :(
but it does
i am inside the if block and then i'll die
psch maintains that's a DIHWIDT
18:52 kurahaupo joined
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?
ufobat Doctor, It Hurts When I Do This
teatime I'm less proposing a change to Duration and more trying to confirm/disprove my understanding
ZoffixWin teatime, it's doing Duration / Duration -> Num
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␤␤»
psch m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat.WHAT
camelia rakudo-moar 40a953: OUTPUT«(Rat)␤»
psch m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat
camelia rakudo-moar 40a953: OUTPUT«0.333333␤»
psch m: say (Duration.new(1) / Duration.new(3)).WHAT
camelia ( no output )
ZoffixWin what does "Doctor, It Hurts When I Do This" means?
teatime ZoffixWin: the doctor says, "Then don't do that!" 18:54
ZoffixWin heh
teatime groucho marx, I think.
psch "Doctor, sometimes when I drink tea one of my eyes hurts."
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
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:56
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 jjido left
ZoffixWin m: say (Duration.new(1).Rat / Duration.new(3).Rat).Rat.nude 18:57
camelia rakudo-moar 40a953: OUTPUT«(1 3)␤»
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
m: pi.Rat.nude.say 18:59
camelia rakudo-moar 40a953: OUTPUT«(355 113)␤»
stmuk its 22/7! everyone knows that!
ZoffixWin :)
stmuk its the law in the Southern US :)
ufobat psch, i wont accept it - what the grammar allows us to do must be understandable or reasonable 19:00
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
ufobat it dies 19:02
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, Begi joined, sue left
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
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
what! 19:05
yeah but in my original example i had ,
pastebin.com/mkpdSjma 19:06
psch has to head out o/
ZoffixWin m: my @r = (4; 4; 5;); say @r
camelia rakudo-moar 40a953: OUTPUT«[4 4 5]␤»
ZoffixWin :S
ufobat dwim!
:D
teatime ok, here you go; I think this is proof it's lossy: 19:07
m: say (Duration.new(1) / Duration.new(3)).Rat(0.4).nude, (Rat(1) / Rat(3)).Rat(0.4).nude
camelia rakudo-moar 40a953: OUTPUT«(0 1)(1 3)␤»
ufobat i am not perfectly sure, but in this example 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:
m: say (Duration.new(1) / Duration.new(1000000000)).Rat.nude, (Rat(1) / Rat(1000000000)).Rat.nude
camelia rakudo-moar 40a953: OUTPUT«(0 1)(1 1000000000)␤»
teatime but I will defer this now until later; have reading/thinking to do. 19:09
probably Duration is just spec'd to not be required to hold such small intervals.
19:17 djbkd left
skink ZoffixWin, I'm unsure as to how to await for a single value 19:22
Wait, may have gotten it. 19:26
19:30 jjido joined
ZoffixWin m: gist.github.com/zoffixznet/df2899a...0592eb7b60 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␤»
ZoffixWin skink, at first I thought of channels, but I think this seems to work ^ 19:34
ZoffixWin forgot what the original problem was
skink Generating primes in parallel
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
There's probably a way to avoid that with a Channel, but I'm no expert
Oh gawd. 19:36
19:37 rindolf left
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
Which leads me even more to think this is the wrong solution
19:37 FROGGS joined
skink I did... 19:38
my $c = Channel.new;
start { $c.send(crypt_random_prime()) for (^Inf).race; }
await $c;
ZoffixWin :S
m: ^Inf .race 19:39
camelia rakudo-moar 40a953: OUTPUT«(signal XCPU)»
ZoffixWin So your promise won't ever complete there. And I'm not sure what exactly happens when calling .race on infinity
skink Every time I call await $c there I get a different value back
ZoffixWin But is it prime? 19:40
skink crypt_random_prime() returns a prime but it has a loop inside itself
ZoffixWin What's crypt_random_prime()? does it have that infinite loop in it?
k, well, the idea is to split that loop over multiple threads.
skink Maxed out my CPU trying to benchmark the two together
Yup
19:42 rindolf joined, danyaprivet joined
danyaprivet hey 19:43
?
Begi danyaprivet: hey 19:44
ZoffixWin m: gist.github.com/zoffixznet/1632bde...6c6b128907
camelia rakudo-moar 40a953: OUTPUT«0.739851631580152␤1.00973742␤»
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
danyaprivet, great.
danyaprivet which perl 5 or 6 ?
skink ZoffixWin, I'll try it out.
ZoffixWin danyaprivet, why are you learning it?
danyaprivet, what purpose?
danyaprivet web
ZoffixWin danyaprivet, Perl 5. They have mojolicious.com/ framework which is very good 19:46
danyaprivet, you can also do Perl 6, but we're pretty new.
Begi We have Bailador ;)
ZoffixWin There's also Crust.
19:46 BenGoldberg left
ZoffixWin oh, it's .org mojolicious.org/ 19:47
19:47 Sgeo left 19:48 BenGoldberg joined
danyaprivet What is the difference perl5 perl6? 19:49
Begi Heu... Perl 6 > Perl 5 ? :p
ZoffixWin danyaprivet, they're two different languages. 19:50
Begi Perl 6 brings a let of new things, new concepts
ZoffixWin danyaprivet, they share a common philosophy, but I find little similarity.
danyaprivet okey
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.
Begi ugexe: sure. for now. I hope it will be better in the future
danyaprivet lets go learn perl 5 later 6
ugexe sure. but do you really think Perl 5 wont get faster itself? 19:52
19:52 Garland joined
danyaprivet faster 19:53
mst Begi: " Begi> Heu... Perl 6 > Perl 5 ? :p" <- please don't do that.
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.
ZoffixWin danyaprivet, #mojo on irc.perl.org is a good place to visit, if you want to do P5 web stuff
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
ZoffixWin danyaprivet, Perl 6 is closer to Ruby and Perl 5 is. You may find learning it easier.
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.
apples and oranges.
mst ZoffixWin: I dunno, given Moo/Moose both perl5 and perl6 have way more powerful OO than ruby
ugexe the only disengenous statement was saying Perl 6 > Perl 5
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
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.
Forgot to comment out your sleep 1 :)
teatime lol, niice. 19:57
ZoffixWin lol
skink It's slightly faster for smaller values, and slower for larger values, ironically. 20:00
ZoffixWin Try generating multiple values per promise, so it doesn't have to spin up a thread for single value 20:01
20:01 nadim left, BenGoldberg left 20:03 BenGoldberg joined
skink Might just include a plain function for the time being and explore optimization at a later date. 20:04
20:05 danyaprivet left 20:11 Begi left 20:13 novice66 joined
ZoffixWin m: '༳'.uniname.say; say ༳ 20:13
camelia rakudo-moar 40a953: OUTPUT«TIBETAN DIGIT HALF ZERO␤-0.5␤»
20:13 TimToady left, djbkd joined
ZoffixWin "half zero"... what a name. 20:13
20:15 TimToady joined
masak .oO( Half Zero™ -- when even Zero feels like a tad too much ) 20:15
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
other than that you can flat (0 xx (@a - @b), @b) or something 20:17
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 ( no output )
timotimo oh camelia :(
nine: can you figure out what may be wrong with camelia?
20:19 pmurias joined
pmurias ugexe: are there any plans for significant improvements to Perl 5 speed? 20:19
mst pmurias: work has been ongoing for a while in various areas 20:23
pmurias: MULTIDEREF was the first of a new breed of optimisations
ZoffixWin "half zero"... what a name. 20:24
oops
mst also, why are we dogpiling ugexe for pointing out a fallacy in Begi's trolling?
lizmat m: say ༳
camelia ( no output )
lizmat m: say "༳".Int
camelia ( no output )
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?
is it at all something perl6 can steal?
mst doubtful, it's basically "fold a complex deref into a single op to avoid all the stackwhackery"
timotimo ho-hum 20:26
ZoffixWin lizmat, camelia is sick.
mst it's nothing particularly lever, just a lot of very precise grunt work by somebody with a careful eye
lizmat ZoffixWin: yeah, got that now
mst (by which I mean it was probably more hard and less fun than a clever thing, and I was impressed)
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 ( no output )
lizmat $ 6 'say "༳".Int'
-0.5
skink m: say "hello";
camelia ( no output )
lizmat ZoffixWin: hmmm... that doesn't feel right :-)
20:28 zakharyas joined
ZoffixWin .u ༳ 20:28
yoleaux U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
ZoffixWin lizmat, that's the correct output. It's negative half
20:28 darutoko left
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?
masak lizmat: we do that for clock time, for example. "half four" is 3:30.
lizmat ZoffixWin: but -0.5 is *not* an Int :-)
ZoffixWin Oh, HAH
masak oh!
lizmat++ :)
timotimo novice66: camelia is having trouble, so it's hard to show stuff to others right now :(
masak lizmat: should probably truncate down to -1, then ;) 20:29
ZoffixWin m: say -0.5.Int
camelia rakudo-moar 40a953: OUTPUT«0␤»
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)>
masak er, truncate up to 0, of course
truncation is towards zero, always
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
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 novice66 left
grondilu ah I meant: 'use Bar; talk();' 20:31
masak RabidGravy: yes, that's OK. (and explicitly designed-for) 20:33
RabidGravy cool
masak RabidGravy: the slogan is "gather is dynamic (not lexical)"
dynamic, like exceptions, not lexical, like variable lookup
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:35
grondilu which prefix did you chose? 20:36
Garland I left it blank. 20:37
grondilu try to pick a directory where you have full file access rights.
20:38 znpy left
grondilu (that would be my guess anyway) 20:38
20:39 Ven joined
skink RabidGravy, Would it be appropriate to remove RNG-TrulyRandom from Most Wanted now? 20:40
RabidGravy I don't see why not, it stops people from implementing it without checking the modules list first 20:41
:)
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:42
RabidGravy I was sure I had a clone of most wanted locally 20:43
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? docs.perl6.org/language/modules#UNI...T%3A%3A%2A
I tried a few things, but I think my install is glitching :/ 20:45
perl6 -I. -IBar -e '' wasn't find it Bar.pm6; I moved it to lib/ and did -Ilib and then it found it :S
skink Just sent a PR 20:46
20:46 _28_ria left
dalek rl6-most-wanted: a0b3e1c | skinkade++ | most-wanted/modules.md:
Remove TrulyRandom from Most Wanted
20:46
rl6-most-wanted: ae1f1d2 | (Zoffix Znet)++ | most-wanted/modules.md:
Merge pull request #26 from skinkade/master

Remove TrulyRandom from Most Wanted
20:46 rindolf left
20:47 _28_ria joined
RabidGravy hah, and I *did* have a local clone 20:47
(I'd just moved it "somewhere sensible") 20:48
AlexDaniel what is -o flag? 20:50
20:50 raoulvdberge joined
AlexDaniel no, seriously. How does that work? 20:51
nine camelia seems to be recompiling?
AlexDaniel perl6 -e 'say ‘hello perl6’' -o 'test' # does nothing
nine m: say "test"
camelia rakudo-moar 40a953: OUTPUT«test␤»
20:53 nadim joined
RabidGravy poor, poor camelia 20:54
ZoffixWin m: say "test" 20:56
camelia ( no output )
20:57 spider-mario left 20:58 spider-mario joined
RabidGravy in the right channel this time 20:58
If I made a module "Algorithm::Euclid" what would you expect it to do?
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.
AlexDaniel anybody?
nine m: say "test"
camelia rakudo-moar 40a953: OUTPUT«test␤»
nine Seems like camelia likes me more :)
pmurias ugexe: sorry if I came across as dogpiling 20:59
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>»
grondilu bad paste, sorry 21:02
m: role A { method abs {..
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>»
RabidGravy AlexDaniel, it specifies the output filename for stages that produce output, such as mbc
so "perl6 --target=mbc -o foo.moarvm -e "say 'foo'" 21:03
AlexDaniel RabidGravy: oh…
RabidGravy: okay, thanks
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> };
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»
grondilu doesn't delegation means implementation?
*mean 21:05
skink D'oh!
Coulda just added a prime param to crypt_random() instead of it being its own function. 21:06
RabidGravy grondilu, no.
"handles" in this case means the object in the $.x provides a method <abs> which appears as a method in the class 21:07
21:07 BenGoldberg left
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
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
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␤»
RabidGravy tricky
ZoffixWin Ah, I see what you're trying to do.
RabidGravy the role composition part where that check is done is possibly sooner than the attribute being built 21:10
21:10 Garland left
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␤»
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:13
grondilu so I must make a wrapper? Like 'method abs { $!x.abs }'. That's lame. 21:14
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␤»
ZoffixWin ehe 21:16
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 kaare_ left
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
and another that is a horrible mess
and runs probably way too slow
will share them when the round is over
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
Anyway, the better approach is probably to just have trusts add the methods right off
I don't know why it isn't done that way right now
grondilu just to be clear: I was not serious of course. Keep on the good work and feel free to ignore my whinings.
RabidGravy karma's a bugger like that
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.
jnthn grondilu: Don't worry, I'm just tired :) 21:22
mst grondilu: or 'less space than a nomad'
21:23 nadim left
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
jnthn goes to rest :)
mst RabidGravy: Algorithm::MostlyEuclidian::IThink
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
timotimo what does it sort? 21:26
RabidGravy nothing
masak how... nihilist
timotimo it whispers sweet nothings in your stdear 21:27
21:27 perturbation joined
masak reminds me of github.com/catseye/Specs-on-Spec/b...e.markdown 21:27
Hotkeys the whole being able to split methods across multiple lines thing is really nice 21:28
without using \ or whatever it was
RabidGravy rather than sorting anything it implements the thing described in cgm.cs.mcgill.ca/~godfried/publicat.../banff.pdf 21:33
masak RabidGravy: I would expect a module called Algorithm::Euclid to do this: github.com/masak/007/blob/master/e...id-gcd.007
lizmat good night, #perl6! 21:34
21:35 bpmedley left
masak 'night, lizmat 21:36
RabidGravy yeah, it does do that *under the hood* to distribute the n fills into m slots 21:38
maybe EuclideanRhythm or something like tat 21:39
wouldn't want any mathematicians getting confused 21:42
21:43 Ven left 21:46 BenGoldberg left 21:49 pmurias left
masak 'night, #perl6 21:49
21:49 BenGoldberg joined 21:50 vendethiel left, cdg_ left 21:51 vendethiel joined 21:53 BenGoldberg left 21:54 BenGoldberg joined 22:00 jjido left 22:02 spider-mario_ joined 22:03 spider-mario left 22:04 spider-mario_ is now known as spider-mario 22:05 zakharyas left 22:10 ZoffixLappy joined 22:11 BenGoldberg left 22:13 BenGoldberg joined 22:17 Sgeo joined 22:18 ocbtec left 22:19 dvinciguerra_ joined 22:23 nadim joined 22:26 boegel left
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:28
ZoffixLappy Do it! 22:29
I can then do Dice Poker game I wanted to make :P
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
22:30 boegel joined
MadcapJake maybe I'll even live-stream the coding :D 22:31
ZoffixLappy :)
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:32
timotimo MadcapJake: why not contribute to the sdl2 binding? 22:35
22:52 nadim left
timotimo what makes allegro better to you compared to sdl2? 22:59
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
ZoffixLappy Why does this end up splitting `name` and `content` into two separate hashes:
m: my $content = {files => [{name => 'main', content => 'blah', }], }; say to-json $content; 23:00
camelia rakudo-moar 40a953: OUTPUT«{␤ "files" : [␤ {␤ "name" : "main"␤ },␤ {␤ "content" : "blah"␤ }␤ ]␤}␤»
ZoffixLappy I want just one
timotimo oh, that can't be right
ZoffixLappy [␤ {␤ "name" : "main", "content" : "blah"␤ }]
JSON::Fast seems to do the same thing
timotimo m: my $content = {files => [{name => 'main', content => 'blah', }], }; say $content.perl
camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
ZoffixLappy (assuming it replaces the default to-json when I `use` it) 23:01
timotimo that's just pairs
not actually a hash
ZoffixLappy hmm
timotimo m: my $content = {files => [{name => 'main', content => 'blah'}], }; say $content.perl
camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
ZoffixLappy Why are the braces ignored?
timotimo m: my $content = {files => [%(name => 'main', content => 'blah')], }; say $content.perl
camelia rakudo-moar 40a953: OUTPUT«${:files($[:name("main"), :content("blah")])}␤»
timotimo oh
haha
you have [ ] with a single argument
ZoffixLappy Ahh :D
timotimo m: my $content = {files => [{name => 'main', content => 'blah'},], }; say $content.perl
camelia rakudo-moar 40a953: OUTPUT«${:files($[{:content("blah"), :name("main")},])}␤»
ZoffixLappy Thanks, timotimo++
timotimo YW 23:02
23:02 firstdayonthejob left
ZoffixLappy Perl 6 is such a pleasure to program in. 23:03
Hotkeys true 23:04
MadcapJake amen! 23:05
timotimo hmm
23:06 skink left
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
The repo hasn't been updated in some time.
23:08 raoulvdberge left
ZoffixLappy MadcapJake, there's SDL2::Raw github.com/timo/SDL2_raw-p6 23:08
MadcapJake Ahh! xD 23:09
Xliff multi method new(Int(Real) :$x!, Int(Real) :$y!) { self.bless(:$x, :$y) } 23:12
?!?
Int(Real)
23:13 nadim joined
geekosaur coercion type? 23:14
23:14 novice666 joined
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 ( no output )
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 spider-mario left, skink joined
skink Didn't realize I closed this window, heh 23:16
Xliff So.... A(B) means "Can take A but coerce into B? 23:17
Or is it the other way around?
RabidGravy the other way round 23:19
ZoffixLappy m: sub foo ( Int(Real) $x ){ say $x }; foo 4.5
camelia rakudo-moar 40a953: OUTPUT«4␤»
ZoffixLappy m: sub foo ( Int(Real|Str) $x ){ say $x }; foo '4.5' 23:20
camelia ( no output )
ZoffixLappy This is annoying.
m: sub foo ( Str $x, Pair @array ){ say "$x @array[]" }; foo 'bar', [meow => 'moo']; 23:22
camelia ( no output )
ZoffixLappy Why does this fail? I want to specify I want a list of pairs as an arg
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
you gave it just a List
if you want that to work, you have to "my Pair @ = meow => 'moo'" or something simila 23:24
ZoffixLappy m: say [meow => 'moo', bar => 'ber'][0].WHAT 23:25
camelia rakudo-moar 40a953: OUTPUT«(Pair)␤»
ZoffixLappy mkay
timotimo our types are nominal, not ... the other thing
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␤»
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
ZoffixLappy screw it... Will use just @array
timotimo hm, are panda-build and panda-test actually working right at the moment? 23:27
with the "recent" changes?
ZoffixLappy skink, fails: gist.github.com/zoffixznet/293e411...b7983123d9
timotimo skink: you could use "panda install ." instead
uh oh 23:28
skink timotimo, Well I forked it because I was gonna work on it
ZoffixLappy skink, well, they're dubious because they're dying: "read bytes requires an object with REPR MVMOSHandle"
skink I'm also getting that for some of them
Also some "Dynamic variable @*INC not found" 23:29
timotimo oh, yeah, that'd be very outdated
should have already been "use lib" instead of manipulating @*INC
skink Well, it hasn't been updated since two months before actual release :)
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␤␤»
skink timotimo, It's manipulating @*INC in attempt to bind
ZoffixLappy Interesting. On my local version of perl6 it just hands 23:31
skink a C lib
timotimo bind??
oh, a C lib
we have %*RESOURCES or what's it called
for exactly that purpose
ZoffixLappy m: my @files = foo => 'bar'; my %content; %content<files> = @files.map: { {name => .key, content => .value } }; say to-json %content
camelia rakudo-moar 40a953: OUTPUT«{␤ "files" : [␤ [␤ {␤ "name" : "foo"␤ },␤ {␤ "content" : "bar"␤ }␤ ]␤ ]␤}␤»
timotimo and the helper module Native::Resources or something
ZoffixLappy So how do I avoid the single-arg thing in this case? I want `name` and `content` in the same hash
skink github.com/skinkade/p6-Crypt-Bcryp...pt.pm6#L22 23:32
timotimo i think you're getting the inner { } interpreted as a code block because it uses $_
known edge case
ZoffixLappy m: my @files = foo => 'bar'; my %content; %content<files> = @files.map: { %(name => .key, content => .value) }; say to-json %content
camelia rakudo-moar 40a953: OUTPUT«{␤ "files" : [␤ {␤ "name" : "foo",␤ "content" : "bar"␤ }␤ ]␤}␤»
ZoffixLappy aha
timotimo someone should go look to make sure it's in the docs as an example 23:33
skink timotimo, I know the OpenSSL bind does something like he's trying to do here 23:34
I'll see what I can do 23:35
timotimo cool!
ZoffixLappy Looks like there's a problem with latest rakudo with including modules from '.' directory: gist.github.com/zoffixznet/915cfd8...1891076ad6 23:41
I'm having the same problem with glot.io version too
timotimo is it also b0rken without using the -M flag?
ZoffixLappy Oh, wait, I didn't do is export
ZoffixLappy tries again
timotimo :D
well done :)
i didn't even look at the source itself :| 23:42
shame on me
i ought to go to bed
ZoffixLappy Works :(
timotimo sorry about that!
ZoffixLappy I mean :)
timotimo we'll make sure to get you some fresh bugs come monday evening!
ZoffixLappy hehe
23:42 RabidGravy left 23:47 Herby_ joined
Herby_ Evening, everyone! 23:47
ZoffixLappy \o 23:48
skink Can someone point me at the docs for %?RESOURCE? Little hard to search for.
Herby_ o/
Xliff \o skink'\ 23:49
skink Hey Xliff
Xliff s/\'\\//
skink bbl
Xliff LOL 23:50
o7
ZoffixLappy skink, there's some mention of it in: docs.perl6.org/language/modules#Dis...ng_Modules
MadcapJake timotimo: what of SDL2::Raw needs work? 23:59