Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-11

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 AlexDaniel Xliff: not really, show us some code!
00:08 raiph joined #perl6
00:09 labster joined #perl6
00:09 pyrimidine joined #perl6
00:13 Actualeyes joined #perl6
00:18 pyrimidine joined #perl6
00:19 cpage_ joined #perl6
00:21 kyclark_ joined #perl6
00:28 pyrimidine joined #perl6
00:34 dataf3l_ joined #perl6
00:38 pyrimidine joined #perl6
00:42 Xliff AlexDanie: https://gist.github.com/Xliff/4a5418933efcf4a2e2c1a710a6c45a6a
00:43 BenGoldberg joined #perl6
00:47 AlexDaniel Xliff: and the input file?
00:48 pyrimidine joined #perl6
00:51 Xliff Look at this gist for an example. Check the string at the bottom. https://gist.github.com/Xliff/fef6642960e6bccf67b3b842d9b71914
00:52 Xliff input file is filtered for blocks of that form and then passed to the grammar.
00:52 Xliff s/and/and the results/
00:55 AlexDaniel committable6: stdin https://gist.githubusercontent.com/AlexDaniel/b050edbf64f424ab27ba4de015e96295/raw/9dd7270680aa1061ea77ce4fc90f01ef63aaf17c/input
00:55 chris2 joined #perl6
00:55 committable6 AlexDaniel, STDIN is set to «XSLTPUBFUN void XSLTCALL␤    xsltApplyAttributeSet       (xsltTransformContextPtr ctxt,␤                     xmlNodePtr node,␤                     xmlNodePtr inst,␤                     const xmlChar *attributes);»
00:55 committable6 AlexDaniel, Successfully fetched the code from the provided URL.
00:55 AlexDaniel committable6: https://gist.githubusercontent.com/AlexDaniel/b050edbf64f424ab27ba4de015e96295/raw/9dd7270680aa1061ea77ce4fc90f01ef63aaf17c/code.p6
00:55 AlexDaniel committable6: HEAD https://gist.githubusercontent.com/AlexDaniel/b050edbf64f424ab27ba4de015e96295/raw/9dd7270680aa1061ea77ce4fc90f01ef63aaf17c/code.p6
00:55 committable6 AlexDaniel, Successfully fetched the code from the provided URL.
00:55 committable6 AlexDaniel, https://gist.github.com/2a0a5dc93e030e0be86f604ba14bf2ff
00:55 AlexDaniel dang it
00:56 AlexDaniel committable6: HEAD https://gist.githubusercontent.com/AlexDaniel/b050edbf64f424ab27ba4de015e96295/raw/c26b6670ec445f567a5337a3826b9b4766992f9e/code.p6
00:56 committable6 AlexDaniel, Successfully fetched the code from the provided URL.
00:56 committable6 AlexDaniel, https://gist.github.com/efecfbbf285055e8cabe83da59b1cabd
00:56 AlexDaniel so the first error is about Nil…
00:57 pyrimidine joined #perl6
00:58 AlexDaniel Xliff: $<typePrefix> is nill
00:58 AlexDaniel Nil*
00:59 AlexDaniel I know it's not relevant, but come on… it's the first error :)
01:02 AlexDaniel Xliff: to fix it I guess you have to use @!params
01:03 AlexDaniel but I'm not sure why
01:03 pyrimidine joined #perl6
01:05 aborazmeh joined #perl6
01:05 aborazmeh joined #perl6
01:06 labster joined #perl6
01:08 kent\n joined #perl6
01:21 Vynce_ joined #perl6
01:22 Vynce_ perl6: say so <a b c>.any eqv all(<b y>.any, <c z>.any)
01:22 camelia rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«True␤»
01:22 Vynce_ perl6: say so <a b c>.any eqv any(all(<b y>.any, <c z>.any))
01:22 camelia rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«False␤»
01:22 Vynce_ wtf
01:24 Vynce joined #perl6
01:26 Vynce perldoc junctions traps
01:27 pyrimidine joined #perl6
01:33 pyrimidine joined #perl6
01:34 labster joined #perl6
01:36 itaipu joined #perl6
01:42 Vynce welp. will document, i guess.
01:46 pyrimidine joined #perl6
01:52 MasterDuke Vynce: some discussion with TimToady about junctions that might be relevant: https://irclog.perlgeek.de/perl6/2016-08-21#i_13061694
01:56 pyrimidine joined #perl6
01:59 kyclark_ joined #perl6
01:59 Vynce i'm aware of not-raising (which is also counterinuitive to me in code, fwiw) but this isn't that.
02:13 BenGoldberg perl6: dd <a b c>.any eqv any(all(<b y>.any, <c z>.any))
02:13 camelia rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«any(any(all(any(Bool::False, Bool::False), any(Bool::False, Bool::False))), any(all(any(Bool::True, Bool::False), any(Bool::False, Bool::False))), any(all(any(Bool::False, Bool::False), any(Bool::True, Bool::False))))␤»
02:14 Vynce does that help? ( :
02:15 BenGoldberg On the one hand, I can see why that boolifies to False.
02:16 * BenGoldberg 's not sure why the other boolified to True, yet, still thinking.
02:16 BenGoldberg perl6: dd <a b c>.any eqv all(<b y>.any, <c z>.any)
02:16 camelia rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«all(any(any(Bool::False, Bool::False), any(Bool::True, Bool::False), any(Bool::False, Bool::False)), any(any(Bool::False, Bool::False), any(Bool::False, Bool::False), any(Bool::True, Bool::False)))␤»
02:16 Vynce False is the expectation, to my brain.
02:17 Vynce but  $X ~~ $Y !== $X ~~ any($Y) is ... counterintuitive.
02:17 BenGoldberg perl6: dd .eqv all(<b y>.any, <c z>.any) for <a b c>
02:17 camelia rakudo-jvm 8d357a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3dd .eqv7⏏5 all(<b y>.any, <c z>.any) for <a b c>␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤  …»
02:17 camelia ..rakudo-moar d989d9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3dd .eqv7⏏5 all(<b y>.any, <c z>.any) for <a b c>␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤ …»
02:18 BenGoldberg m: dd .eqv: all(<b y>.any, <c z>.any) for <a b c>
02:18 camelia rakudo-moar d989d9: OUTPUT«No such method 'eqv' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
02:18 BenGoldberg m: dd $_ eqv all(<b y>.any, <c z>.any) for <a b c>
02:18 camelia rakudo-moar d989d9: OUTPUT«all(any(Bool::False, Bool::False), any(Bool::False, Bool::False))␤all(any(Bool::True, Bool::False), any(Bool::False, Bool::False))␤all(any(Bool::False, Bool::False), any(Bool::True, Bool::False))␤»
02:18 BenGoldberg m: say so $_ eqv all(<b y>.any, <c z>.any) for <a b c>
02:18 camelia rakudo-moar d989d9: OUTPUT«False␤False␤False␤»
02:20 BenGoldberg m: say so <a b c>.any eqv $_ for <b y>.any, <c z>.any
02:20 camelia rakudo-moar d989d9: OUTPUT«True␤True␤»
02:21 BenGoldberg Aha, the right side of eqv is autothreading before the left side, and since all(True, True) is true, the output is true.
02:21 Vynce i don't know what you mean by "before" here.
02:22 BenGoldberg m: say so <a b c>.any eqv all(<b y>.any, <c z>.any)
02:22 camelia rakudo-moar d989d9: OUTPUT«True␤»
02:22 BenGoldberg m: say so all(<b y>.any, <c z>.any) eqv <a b c>.any
02:22 camelia rakudo-moar d989d9: OUTPUT«True␤»
02:22 BenGoldberg Hmm, or maybe not.
02:22 BenGoldberg I'm confused.
02:23 Vynce I kindof understand what's going on. I don't understand it well enough to explain it in terms of the language, though. ( :
02:25 Vynce the real surprise to me was that adding a pointyblock with the all in it didn't "fix" my problem; I had to -> Str $letter {} wrap it, because the pointy is perfectly happy to accept the junction as the implicit argument
02:27 Vynce but yes, this is equivalent to "ALL(<abc> overlap <by>, <abc> overlap <cz>)" vs "some one (or more) of <abc> overlap ALL(<by>, <cz>)"
02:37 Xliff AlexDaniel: Dammit. I missed the Nil message because it was mixed in with the output from Grammar::Tracer
02:37 Xliff Thanks.
02:39 Xliff m: my $a; say $a:v;
02:39 camelia rakudo-moar d989d9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a:v' is not declared␤at <tmp>:1␤------> 3my $a; say 7⏏5$a:v;␤»
02:46 Xliff Is there a way to combine a Nil check and string compare in an elegant manner without having to use .defined?
02:46 perlawhirl joined #perl6
02:49 geekosaur m: say so (Nil // 'a') eq 'a'
02:49 camelia rakudo-moar d989d9: OUTPUT«True␤»
02:49 geekosaur m: say so ('c' // 'a') eq 'a'
02:49 camelia rakudo-moar d989d9: OUTPUT«False␤»
02:50 Xliff AH! I keep forgetting //
02:50 Xliff geekosaur++
02:50 Xliff AlexDaniel: OK, so I have fixed the Nil issue, but I am still getting the positionals error.
02:53 dataf3l_ joined #perl6
02:54 Xliff The problem here is the magic in Grammars. I cannot see what is getting passed to the action method, so I can't effectively debug the issue.
02:56 Xliff According to everything I've read, methods on Action classes always have signature ($/), and grammars always call the method name that corresponds to the matching rule.
02:56 AlexDaniel Xliff: it's not related to grammars
02:56 Xliff Then what is it related to.
02:56 AlexDaniel Xliff: your problem is with accessing @!params
02:56 AlexDaniel https://irclog.perlgeek.de/perl6/2016-11-11#i_13548322
02:57 AlexDaniel change @.params to @!params and the problem goes away, but I have no idea why to be hones
02:57 AlexDaniel t
02:57 Xliff :-O
02:57 Xliff Oh that is soooo LTA.
02:58 AlexDaniel yes maybe it is
02:58 Xliff AlexDaniel++
02:58 AlexDaniel I mean, it definitely is…
02:58 Xliff That error message has me chasing the wrong thing.
02:58 Xliff Which is seriously bad.
02:58 Xliff But problem solved. Thank you.
03:03 AlexDaniel Xliff: it would've been cool if you figured out why is this happening
03:03 AlexDaniel m: grammar Foommar { rule TOP { ‘a’ } }; class Fooctions { has @.blah; method TOP($/) { push @.blah, 42 } }; say Foommar.parse(‘a’, :actions(Fooctions.new))
03:03 camelia rakudo-moar d989d9: OUTPUT«「a」␤»
03:03 AlexDaniel that seems to work
03:04 Xliff AlexDaniel: I will circle back and try, but I have another priority.
03:04 Xliff Namely getting this working.
03:12 Xliff Another piece of weirdness. I have this at the top of a method: my $tp = $/<typePrefix>.defined ?? $/<typePrefix>.made !! '';
03:13 Xliff Yet there are code paths where $tp is Any
03:13 Xliff O I C
03:23 erdic joined #perl6
03:27 Xliff OK. Its working now. Still trying to figure out why I need to do $/[0].Str to extract the value from a Match object.
03:34 Juerd As opposed to what else?
03:36 cibs joined #perl6
03:46 noganex joined #perl6
03:48 mayathecat joined #perl6
04:01 mayathecat joined #perl6
04:14 pyrimidine joined #perl6
04:17 Actualeyes joined #perl6
04:21 pierre_ joined #perl6
04:24 pyrimidine joined #perl6
04:30 pierre_ joined #perl6
04:38 Vynce joined #perl6
04:39 Actualeyes joined #perl6
04:41 pyrimidine joined #perl6
04:42 MasterDuke nqp: if "a1b2" ~~ /(.)/ { say("matched: " ~ $/[0]) }
04:42 camelia nqp-moarvm: OUTPUT«matched: ␤»
04:42 MasterDuke ^^^ what am i doing wrong?
04:43 grondilu joined #perl6
04:46 geekosaur nqp doesn't appear to set $/ at all
04:50 perlawhirl m: say (:this(3.5) :that(5.3))
04:50 camelia rakudo-moar d989d9: OUTPUT«===SORRY!===␤Unknown QAST node type NQPMu␤»
04:50 yoleaux 4 Nov 2016 12:51Z <gfldex> perlawhirl: objects can be made aware of being subscripted with class C { method subscript(|c){ say "subscript of: ", c.perl } }; multi sub postcircumfix:<[ ]>(C:D \SELF, \pos){ SELF.subscript(pos) }; C.new.[1,42];
04:50 perlawhirl interesting bug
04:50 perlawhirl m: say (:this(3) :that(5)) # works fine with ints
04:50 camelia rakudo-moar d989d9: OUTPUT«(this => 3 that => 5)␤»
04:50 perlawhirl m: say (:this(3.5), :that(5.3)) # worsk fine with comma
04:50 camelia rakudo-moar d989d9: OUTPUT«(this => 3.5 that => 5.3)␤»
04:53 vendethiel joined #perl6
05:03 pyrimidine joined #perl6
05:11 seatek anyone know if any of the module http servers can handle https?
05:11 MasterDuke geekosaur: it doesn't seem to do so for regexes, but it does for grammars, it's used in the nqp source itself
05:12 MasterDuke (however i just want to use a quick regex)
05:13 pyrimidine joined #perl6
05:23 pyrimidine joined #perl6
05:28 Cabanossi joined #perl6
05:30 lizmat joined #perl6
05:32 pyrimidine joined #perl6
05:33 dalek doc: 8c05697 | coke++ | xt/code.pws:
05:33 dalek doc: ignore new code
05:33 dalek doc: review: https://github.com/perl6/doc/commit/8c05697c03
05:35 perlawhirl FYI: I rakudobug'd the above #130069
05:35 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130069
05:43 pyrimidine joined #perl6
05:46 pierre_ joined #perl6
05:54 pyrimidine joined #perl6
05:57 pierre_ joined #perl6
06:00 rurban joined #perl6
06:07 pyrimidine joined #perl6
06:14 Vynce joined #perl6
06:17 wamba joined #perl6
06:18 dataf3l_ joined #perl6
06:21 Tonik joined #perl6
06:24 pyrimidine joined #perl6
06:26 rurban joined #perl6
06:36 pierre_ joined #perl6
06:38 nadim joined #perl6
06:40 pyrimidine joined #perl6
06:46 ufobat joined #perl6
06:49 RabidGravy joined #perl6
06:51 pyrimidine joined #perl6
06:53 seatek wow - Using Crust modules - HTTP::Server::Tiny getting ~80 requests/sec (just printing hello).. but when using SCGI getting about 340 requests/sec
06:56 seatek Concurrent requests on HTTP::Server::Tiny kill it if you have more than 15 ...
07:00 ChoHag joined #perl6
07:02 pyrimidine joined #perl6
07:06 labster joined #perl6
07:08 Xliff Hrm. How do I specify a literal '$' in a qq:TO// heredoc?
07:08 seatek Is the '\' not working?
07:09 pyrimidine joined #perl6
07:10 Xliff Nope.
07:12 Xliff The entire heredoc is breaking my code. Weird.
07:13 seatek I just tried it and it works
07:13 seatek Maybe you're doing something funny?
07:14 seatek qq:to/HERE/;
07:14 seatek Then whatever \$you want
07:14 seatek HERE
07:16 seatek I think you have to watch out for mustaches too
07:16 seatek can't remember all the qq qw combos ;)
07:17 Xliff Well. I will have to gist and let you see what I am talking about.
07:20 Xliff https://gist.github.com/Xliff/517baac50d57629616b37f3a9af11c9f
07:20 Xliff I am too tired to convert that into a standalone.
07:20 Xliff I will update it later with a better use case.
07:20 Xliff Now I must sleep.
07:21 Xliff BTW - seatek: qq == Double quoted heredoc.
07:21 seatek you've got lots of $'s that you didn't \$ on!
07:21 seatek oh that's what you want
07:21 Xliff Those are supposed to be there.
07:21 Xliff Yes! ;)
07:21 seatek where' sit go bad?
07:21 pyrimidine joined #perl6
07:25 Xliff Just about everywhere.
07:25 Xliff parser treats much of the heredoc as code instead of... a heredoc.
07:25 seatek I think you have to put <> hash stuff in {} blocks
07:25 Xliff Hmm....
07:25 Xliff I do that, then the parser comes back with "Confused"
07:26 Xliff Yup.
07:26 obra joined #perl6
07:26 Xliff And there is no reason it should be confused.
07:26 Xliff Let me rakudobrew and see if there was a fixed bug in the parser.
07:27 obra left #perl6
07:28 seatek that's pretty weird. i've been playing with it, assigning some of those variables...
07:29 abraxxa joined #perl6
07:29 vendethiel- joined #perl6
07:31 Xliff seatek: Are you seeing it too, then?
07:31 seatek yes it's like ignoring the qq:to// thang
07:31 Xliff Yup!
07:32 seatek you broke perl
07:32 Xliff Even replacing the qq:to// with " will generate the same errors!!!
07:32 * Xliff points to himself and says "YOU BASTARD!"
07:32 seatek it's like magic words that can't be ignored
07:32 firstdayonthejob joined #perl6
07:33 Xliff So yeah. I'mma call it a night.
07:33 Xliff Take care, seatek.
07:33 seatek k - nite Xliff
07:35 pyrimidine joined #perl6
07:44 imcsk8 joined #perl6
07:45 abraxxa joined #perl6
07:47 pyrimidine joined #perl6
07:52 pierre_ joined #perl6
07:57 Ulti kyclark if you wanted more structure in there you could maybe create a markov chain of the probability of one kmer following another
07:59 pyrimidine joined #perl6
08:00 bjz joined #perl6
08:07 neuraload joined #perl6
08:11 pyrimidine joined #perl6
08:15 cyphase joined #perl6
08:20 pyrimidine joined #perl6
08:30 pyrimidine joined #perl6
08:31 bjz joined #perl6
08:34 zakharyas joined #perl6
08:37 domidumont joined #perl6
08:40 pyrimidine joined #perl6
08:41 domidumont joined #perl6
08:42 AlexDaniel joined #perl6
08:46 rindolf joined #perl6
08:54 pyrimidine joined #perl6
09:02 Vynce joined #perl6
09:02 ocbtec joined #perl6
09:05 BigBear joined #perl6
09:10 pyrimidine joined #perl6
09:11 bjz_ joined #perl6
09:19 pyrimidine joined #perl6
09:31 pyrimidine joined #perl6
09:36 neuron joined #perl6
09:49 pyrimidine joined #perl6
09:54 itaipu joined #perl6
09:57 dataf3l joined #perl6
09:58 dataf3l after some googling, I’m still confused as to how to define a variable with type: array of strings, something like an ArrayList<String> in java. is that even possible?
09:58 DrForr my Str @arr;
09:59 pyrimidine joined #perl6
09:59 dataf3l COOL! :)
10:00 seatek m: my Str @a; @a[1] = False;
10:00 camelia rakudo-moar d989d9: OUTPUT«Type check failed in assignment to @a; expected Str but got Bool (Bool::False)␤  in block <unit> at <tmp> line 1␤␤»
10:00 dataf3l Thank you, DrForr
10:00 obra joined #perl6
10:01 DrForr Man, I've got a bad sense of timing. Howdy, obra
10:01 obra Hey DrForr (irssi died. autojoin ftw)
10:02 darutoko joined #perl6
10:03 DrForr Finally decided to check out the dark side, eh? I've got to get lunch but I'll be back in a few.
10:03 obra heh. nah. this is my usual setup. just bad luck
10:04 DrForr Right, no worries.
10:04 obra :)
10:09 maybekoo2 joined #perl6
10:09 dataf3l_ joined #perl6
10:12 araujo joined #perl6
10:18 pyrimidine joined #perl6
10:22 itaipu joined #perl6
10:24 Rawriful joined #perl6
10:38 pyrimidine joined #perl6
10:48 pyrimidine joined #perl6
10:57 seatek Dealing with this "circular module loading" is not always easy!
10:57 seatek it's not circular... it's... thorough... ;)
11:04 seatek m: class A::B::C { has $.d }; my $z = A::B::C.new; say so $z.^name ~~ /A\:\:B/;
11:04 camelia rakudo-moar d989d9: OUTPUT«True␤»
11:05 seatek anyone know of a better way to do that? I can't use just the ~~ against the raw base class name, because it requires that you "use" that module, and that results in the horrifying "circularity"
11:05 dataf3l joined #perl6
11:06 timotimo you can .isa("Foo"
11:06 timotimo )
11:06 timotimo it's extremely slow
11:06 timotimo but it should to be right
11:06 seatek think it would be slower than that regex?
11:06 timotimo no
11:07 seatek hehe ok
11:07 seatek i'll try that thanks timotimo++ :)
11:10 domidumont joined #perl6
11:14 TimToady Xliff: qq interpolates {} as well as $ so maybe you want qs instead, or use q and then force interpolation with \qq[$f]
11:17 timotimo oh hey TimToady. any clue on whether .chrs should also support lists of Strs-that-look-like-Ints?
11:18 timotimo (like what you'd get if you >>.base(16)'d a bunch of Ints
11:18 timotimo for example)
11:21 aindilis joined #perl6
11:21 TimToady with what semantics?
11:22 timotimo it'd .Int.chr elements that can't be nqp::chr'd immediately
11:23 TimToady oh, you said chrs, not chr...not awake yet...
11:23 TimToady sure, it'd be fine if chrs coerced each value to integer
11:23 timotimo yay
11:23 timotimo i have Word Of God and now can start implementing
11:24 timotimo when it asplodes, should it "fail" instead of throwing exceptions, just like it currently does when something's not-an-int?
11:24 timotimo well, prefix-+ already fails. so i just return that if it's a failure
11:26 TimToady seems reasonable here; it's not like we're likely to blow up someone's parallel algorithm this way
11:29 timotimo i haven't worked with roast much since the errata/non-errata split ... where do i put tests for this new behaviour?
11:32 timotimo oh, another thing: :16(*) producing a WhateverCode equivalent to {:16($_)}, yea or nay?
11:35 moritz timotimo: tests for new behvior go iint the master branch
11:36 itaipu joined #perl6
11:39 * timotimo looks if an existing spec test breaks
11:42 timotimo cool, it's cleant
11:42 timotimo clean*
11:42 timotimo er, but i'm on the master branch probably
11:42 espadrine joined #perl6
11:43 timotimo how should i run these? spectest.data would probably have to be different, no?
11:43 lizmat timotimo: no
11:44 lizmat just do make spectest  :-)
11:44 lizmat still, new behaviour, isn't that supposed to be 6.d ?
11:44 lizmat just playing devil's advocate (again)
11:44 timotimo *shrug*
11:45 lizmat because it feels to me we're getting further and further away from a language spec and jfdi  :-)
11:45 lizmat *instead
11:45 timotimo seems like, yeah
11:46 timotimo really, to get all these things that have since been added, you ought to be using something like 6.d.1 or what we call those
11:47 bjz joined #perl6
11:53 dalek doc: bae5700 | timotimo++ | doc/Language/5to6-perlfunc.pod6:
11:53 dalek doc: mention prefix:<+> alternative for perl5:<oct>
11:53 synopsebot6 Link: http://doc.perl6.org/language/5to6-perlfunc
11:53 dalek doc: review: https://github.com/perl6/doc/commit/bae57001eb
11:54 jnthn Language versions are just snapshots of the spectest suite. So whenever you add a test to master, you're writing part of the spec that will make up the next language version.
11:54 Lucas_One joined #perl6
11:56 dalek doc: f6daf45 | timotimo++ | doc/Type/Int.pod6:
11:56 dalek doc: mention :16("f00") and :100[1,2,3] in Int's class doc
11:56 synopsebot6 Link: http://doc.perl6.org/type/Int
11:56 dalek doc: review: https://github.com/perl6/doc/commit/f6daf459ce
11:57 jnthn It'll always be the case that implementation and bleading edge use will precede having a "use 6.x" to write in order to be sure that feature is present.
11:58 jnthn Right now, there's just a high incentive to use bleading edge versions due to improving performance, many fixes, etc.
11:58 timotimo mhm
12:06 timotimo it seems we don't have a perl6 specified thingie for UNBASE aka radix notation with variable radix ":$foo($bar)"
12:07 timotimo well, we do have +":$foo\<$bar>"
12:07 timotimo but ... ugh :)
12:18 rurban joined #perl6
12:31 masak today's mini-challenge: read in a bunch of numbers; output mean value and standard deviation.
12:31 masak handling edge cases (such as too few numbers) is optional.
12:32 masak strive towards clear, elegant code more than anything else.
12:32 masak (and I won't mind it if we end up in a discussion about whether it should be `$N` or `$N - 1` in the denominator) :P
12:32 masak hi, #perl6
12:33 timotimo m: my @nums = <1 4 9 8 7 6 0 1 9 4 5>; say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev."
12:33 camelia rakudo-moar 9a6ad4: OUTPUT«mean: 4.909091␤median: 5␤i don't do std dev.␤»
12:33 timotimo m: my @nums = <1>; say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev."
12:33 camelia rakudo-moar 9a6ad4: OUTPUT«mean: 1␤median: 1␤i don't do std dev.␤»
12:33 timotimo m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev."
12:33 camelia rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:33 timotimo m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems || 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev."
12:33 camelia rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:33 timotimo m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems orelse say 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev."
12:33 camelia rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:34 timotimo i can't defuse it? :\
12:34 masak that's unexpected.
12:35 * timotimo BBL
12:36 jnthn orelse is low prec, maybe it needs more parents
12:36 jnthn *parens
12:36 MasterDuke https://github.com/MattOates/Stats
12:39 masak m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt(1/(@t - 1) * [+] @t.map: { ($_ - mean) * ($_ - mean) })
12:39 camelia rakudo-moar 9a6ad4: OUTPUT«72.9517␤0.828451708510118␤»
12:39 masak my submission :)
12:39 masak hm...
12:39 masak m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt 1/(@t - 1) * [+] @t.map: { ($_ - mean) * ($_ - mean) } # fewer parens
12:39 camelia rakudo-moar 9a6ad4: OUTPUT«72.9517␤0.828451708510118␤»
12:46 jnthn Why ($_ - mean) * ($_ - mean) instead of ($_ - mean) ** 2 ? :)
12:46 masak jnthn: some kind of superstition, I think
12:46 jnthn Just felt nice to me using explicit squaring then sqrt is also being used :)
12:47 jnthn Also means you can probably write @t.map: (* - mean) ** 2
12:47 jnthn To declutter it some further :)
12:47 masak m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt 1/(@t - 1) * [+] @t.map: (* - mean) ** 2
12:47 camelia rakudo-moar 9a6ad4: OUTPUT«72.9517␤0.828451708510118␤»
12:47 masak lookitthat
12:47 masak getting really nice now :)
12:48 masak yeah, that's really not a lot of code for stddev. cool.
12:49 masak that statement does the listop thing 4 times, if I count correctly :)
12:50 arnsholt Perl 6 hasn't specced a mean function, has it?
12:51 masak no, but somehow I don't mind defining it every time
12:51 masak "mean value" is one of those concepts that can be argued many ways
12:51 masak or at least "average" is
12:51 arnsholt Well, arithmetic mean then, if you will =)
12:52 arnsholt Apparently the algorithm for calculating it accurately with floats is *not* sum(@values)/+@values
12:52 moritz m: my @a = 1..5; say sum(@a) / @a
12:52 camelia rakudo-moar c541b3: OUTPUT«3␤»
12:52 arnsholt Because numerical stability
12:52 moritz fuck those floats
12:52 arnsholt Quite =D
12:52 masak lately I've come to the opposite conclusion
12:52 masak after having used floats a bit more
12:53 masak floats are *massively* misunderstood
12:53 arnsholt Yeah, that's more than likely
12:53 masak and people end up in trouble for many reasons, but most often because they shouldn't have used floats in the first place
12:53 masak it's like, people enter a contract which they don't read
12:53 arnsholt Yeah, that's definitely true
12:53 masak and then they're upset when the terms are upheld like the contract states
12:54 moritz which we don't even do, in real life, right?
12:54 arnsholt Heh
12:54 masak :)
12:54 moritz like, do you always read the TOS when you sign for your credit or debit card?
12:54 * masak .oO( never! -- never? -- well, hardly ever! )
12:55 * masak .oO( arithmetic meanness )
12:55 moritz if I were just a bit more contrarian, I'd *always* pay with debit card, and *always* read the whole thing before signing
12:56 masak it doesn't take much to conclude that reading through the whole thing is actually the right thing to do, even though basically no-one does
12:56 moritz just to annoy the cashier and the people behind me in the line
12:56 moritz masak: there are valid arguments against that. Consumer protection laws, for example
12:56 masak "no no, wait, this is important! I'm on page 24."
12:57 moritz (I'm talking about the case where you sign the bill, not where you sign up for a new credit card)
12:57 moritz also there is some kind of agency that coordinates all Electronic Cash payments in .de, and it imposes rules on the participating shops
12:58 arnsholt You get a ToS document when paying by card in Germany?
12:58 arnsholt Pretty sure we don't get that here
12:58 moritz one of them being that you can't have a lower limit for EC transactions, but I hope they also have rules that you can't screw over people when they pay
12:59 moritz arnsholt: here it's a legal disclaimer on the back of the receipt
12:59 arnsholt Ah
12:59 moritz arnsholt: and if you pay with debit card, you either have to enter a PIN or sign
12:59 moritz (but not your choice, it's the shop's choice)
13:00 moritz http://bilder.t-online.de/b/41/56/13/42/id_41561342/610/tid_da/index.jpg that's what it looks like
13:00 itaipu joined #perl6
13:00 arnsholt I'm not sure who chooses here. But signature is basically never used, except when the payment terminal can't reach the bank servers
13:01 arnsholt Yeah, we don't do that
13:05 masak interesting. I like in a country much like arnsholt's :P
13:05 arnsholt Who'd a thunk it? =D
13:22 mscha joined #perl6
13:23 mscha m: say 4 ~~ 1,3...Inf; # that's odd...
13:23 camelia rakudo-moar c541b3: OUTPUT«(...)␤»
13:23 mscha m: say "yes" if 4 ~~ 1,3...Inf; # that's odd...
13:23 camelia rakudo-moar c541b3: OUTPUT«yes␤»
13:23 masak mscha: precedence
13:23 masak infix:<...> is very loose
13:24 masak m: say "yes" if 4 ~~ (1,3...Inf)
13:24 camelia rakudo-moar c541b3: ( no output )
13:24 mscha m: say "yes" if 4 ~~ (1,3...Inf); # that's even...
13:24 camelia rakudo-moar c541b3: ( no output )
13:24 masak needs parentheses for a lot of things
13:26 ggoebel joined #perl6
13:29 masak m: class C { method fool-me() { state $fooled-once = False; die "fool me can't fool me again" if $fooled-once++; say "fool me once, shame on me" } }; C.fool-me for ^2
13:29 camelia rakudo-moar c541b3: OUTPUT«fool me once, shame on me␤fool me can't fool me again␤  in method fool-me at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
13:29 masak just had some use for this pattern
13:29 masak kind of a singleton method call :>
13:29 viki timotimo, FWIW, ISAGN for radix sub/method. It'd just be two lines of code caaling nqp::radix or whatever it is too.
13:30 viki The :16(x) thing feels very awkward as a generic way to conver and more of a way to write a literal
13:31 kurahaupo joined #perl6
13:35 moritz masak: as a safeguard to the destroy-earth method?
13:36 moritz :-)
13:38 tushar joined #perl6
13:39 cibs joined #perl6
13:44 masak moritz: the method in question is called .bootstrap, on a small MOP I'm writing
13:45 viki m: "42".base: 3
13:45 camelia rakudo-moar c541b3: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
13:45 masak moritz: though I ended up doing it on a different criterion (whether the type registry is empty)
13:45 masak m: 42.base: 3
13:45 camelia rakudo-moar c541b3: ( no output )
13:45 masak m: say 42.base: 3
13:45 camelia rakudo-moar c541b3: OUTPUT«1120␤»
13:46 masak viki: there's a bit of a "resistance" in place for .base, so that people don't accidentally re-base strings which are already in some base
13:46 masak i.e. .base wants to make sure the user realizes that this is Real --> Str, not Str --> Str or something else
13:47 viki I see
13:49 viki m: say :16<FF>
13:49 camelia rakudo-moar c541b3: OUTPUT«255␤»
13:49 viki "FF".base(16) -> 255
13:49 viki Is that too confusing?
13:50 masak viki: oh yes
13:50 viki OK :)
13:50 masak see, that's not what .base does at all
13:50 * viki hasn't woken up yet
13:51 masak disregarding non-Ints for a while,
13:51 masak .base takes an *Int* (which you can think of as having no intrinsic base representation) and renders it as a Str in some base
13:52 viki Takes a Real
13:52 viki m: say pi.base: 16
13:52 camelia rakudo-moar c541b3: OUTPUT«3.243F6B␤»
13:52 masak point still holds for Reals
13:52 viki which is pretty weird
13:52 masak one of the quirks of Perl 5 base conversion -- which I'm glad we avoided to a large extent -- is that `bin()`, `oct()` and `hex()` tempt you into thinking of them as `to_bin()` etc
13:53 masak but they're actually `from_bin()` etc
13:53 arnsholt viki: Why is that weird? Positional notation is the same regardless of base
13:53 masak in Perl 6, converting *from* a base is a special syntax, and converting to a base is a method conveniently called `.base`
13:54 viki masak: I'd say in Perl 6, converting *from* a base—as a generic thing—is a *hack* that involves abusing string interpolation.
13:54 viki We don't have anything to convert $x in radix $r to, say, base 10 representation.,
13:56 viki m: my $x = "FF"; my $r = 16; say +":$r\<$x>"
13:56 camelia rakudo-moar c541b3: OUTPUT«255␤»
13:57 MasterDuke m: my $x = "FF"; my $r = 16; say :$r<<$x>>
13:57 camelia rakudo-moar c541b3: OUTPUT«((Mu))␤»
13:57 skids joined #perl6
13:58 viki m: say .15.base: 16
13:58 camelia rakudo-moar c541b3: OUTPUT«0.266666␤»
13:58 viki arnsholt: dunno, just doesn't fit my brain :)
13:58 masak viki: for the few cases when this is needed, how about putting the hack in a local sub? I see what you're saying, and yes it *is* a hack, but it's one of those <1% things that maybe doesn't need fixing globally
13:58 viki .1 is what... "one sixteenth"?
13:58 MasterDuke m: my $x = "FF"; my $r = 16; say :$r«$x»
13:58 camelia rakudo-moar c541b3: OUTPUT«((Mu))␤»
13:59 masak MasterDuke: :$r«$x» doesn't mean what you think it does
13:59 masak MasterDuke: so, yes, viki is right as far as that goes
14:00 MasterDuke masak: yeah, i thought there was some way that didn't involve that string interpolation, but i guess not
14:00 pyrimidi_ joined #perl6
14:00 viki masak: I think your <1% is underestimating the real numbers. I wrote little Perl 6 code in my life and I have a module that needs that feature. I've seen at least a couple of people ask for it on IRC. And there's a Twitter thread mocking our hack: https://twitter.com/wonkden/status/797011467530801152
14:00 arnsholt viki: 3.244F6B is simply 3 + 2*16**-1 + 4*16**-2 + 4*16**-3 + :16<F>*16**-5 ...
14:00 viki masak: I'd think it's as common as .base
14:02 viki arnsholt: ok, now it kinda fell into place and I understand why base 16 pie is "larger" than base 10
14:02 aborazmeh joined #perl6
14:02 aborazmeh joined #perl6
14:03 viki masak: I mean, even the hack aside, the :16<FF> notation is weird and jarring. There's little to compare to it with the rest of Perl 6 code.
14:03 masak viki: I can't recall ever having an actual use case where I needed the base to vary
14:03 viki It wants to be a method on Str.
14:04 viki masak: I use it in my Color module to convert dec to hex and back
14:04 masak viki: agree as far as that goes. I don't think I'd mind if it were a method on Str -- as long as it doesn't increase the confusion I meantioned above
14:04 viki "FF" -> 255
14:04 viki masak: what would be a good name? What do you think of Str.radix?
14:04 masak viki: but there the base takes on two fixed values
14:05 viki vike: right, true. I misremembered about needing the hack, but I recall the :16($str) being a weird thing to write.
14:05 masak viki: .base and .radix don't have anything to distinguish them -- you can't tell which one is Str --> Real and which is Real --> Str
14:05 moritz .format-base
14:05 viki masak: fair enough
14:05 masak viki: it's weird; the syntax has been "stolen" for that use. but once you get over that, it does fit quite nicely.
14:05 moritz .parse-base
14:05 viki +1 on .parse-base
14:05 moritz masak: the problem with the syntax is that it doesn't work well if your base is in a variable
14:06 moritz Str.parse-base, Int.format-base
14:07 masak moritz: yes, as discussed above :)
14:07 masak moritz: I like those two suggestions.
14:08 viki With .format-base being a replacement for .base?
14:09 moritz or an alias
14:09 tushar joined #perl6
14:10 masak AngularJS has a pair of things that it calls format/parse, so it's instantly recognizable to me.
14:17 kyclark_ joined #perl6
14:38 tadzik ...spherical earth sucks
14:38 timotimo you don't have to believe the earth is spherical
14:39 timotimo c'mon, you don't want to be a Globetard, do you?
14:39 tadzik it's worse, I'm a programmer :(
14:39 tadzik I'm writing a geocaching app
14:39 tadzik doing the "get the bearing from my position to a place X" and so
14:39 eythian great circle distance and bearing calculation functions are surely all over the palce
14:40 tadzik and it sometimes comes out off, like when I'm south of something it'll tell me to go south to reach it
14:40 tadzik and I keep checking the order of arguments and so, and now it hit me: it's not wrong
14:40 eythian I suppose that works if you don't mind taking the scenic route :)
14:40 tadzik it may take me a few years to go all around the earth, but it's not wrong
14:41 tadzik now I am impressed that it's ever actually right, since really any bearing would be correct unless it's a right angle
14:42 tadzik eythian: yes, exactly :o how do you deal with this?
14:43 eythian depends on your algorithm I guess. I've never implemented one myself, so I not really speaking from a position of expertise :)
14:43 tadzik I'm ripping off wikipedia tbh :P https://en.wikipedia.org/wiki/Azimuth#Calculating_azimuth
14:44 masak tadzik: I've been thinking a lot about spheres lately too
14:44 mspo https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm ?
14:46 tadzik mspo: well, that'd require representing earth as a graph
14:46 kyclark_ joined #perl6
14:46 masak mspo: that's one of the most unexpected suggestions I've heard :P
14:47 jnthn Just cover the globe in a graph of lattitude/longitude lines. :P
14:48 * moritz thought of a node for each atom, and edges for k nearest neighbours
14:48 timotimo that'll help
14:48 jnthn Their intersections are graph nodes :P
14:48 jnthn But yeah, there's surely a better way :)
14:48 masak tadzik: I think you would enjoy the "Hairy ball theorem" :)
14:48 timotimo :D
14:49 perlpilot Math::Trig has great circle distance and related stuffs
14:50 tadzik I think for this one time I'm gonna be the flat earthist
14:50 tadzik but hey, I learned something today
14:51 tadzik once again, trying to make your programming actually reflect reality is a path to pain and suffering
14:53 masak +1
14:54 tadzik also, now I can replace all this complicated math with one atan() :>
14:55 cibs joined #perl6
14:55 eythian there _must_ be a library somewhere that you can use or port that will do the stuff for you, including dealing with corner cases.
14:56 tadzik I think so, but is it worth the effort?
14:57 tadzik when people pull out a map and rotate it so that they face the right direction, they're doing pathfinding on a flat earth too, pretty much
14:57 viki m: my \term:<∏> = ^∞ .grep: *.is-prime; say ([*] ∏[2*2, 2*2, 11, 11*3]).base: ∏[3*3]
14:57 camelia rakudo-moar c541b3: OUTPUT«PERL␤»
14:57 viki Perl constructed with nothing but prime numbers \o/
14:57 viki Yes, yes I do have too much time on my hands :)
14:58 DrForr Gaussian field FTW?
15:00 tadzik :D
15:06 tadzik now that I think of it, on a naive flat earth model it'd still show you the "long way around" for anything past
15:07 tadzik * past 90/-90 longitude
15:11 dataf3l joined #perl6
15:12 davido joined #perl6
15:14 tushar joined #perl6
15:16 mattn_jp joined #perl6
15:17 viki Divide it into three equal parts and calculate three calculations and pick the shortest one?
15:17 tadzik I figure: if the delta of longitudes is over 180 I can sort of "flip them around"
15:17 DrForr masak: WRT Brouwer Fixed-Point you have my attention as well.
15:18 tadzik subtract 180 from the bigger, add 180 to the smaller
15:18 tadzik and pretend that I'm looking at the other half of the earth now
15:19 DrForr Maybe looking at them in radians?
15:19 wamba joined #perl6
15:19 DrForr Damn, an interesting math discussion *had* to start when I have to get going...
15:19 timotimo have a good one, DrForr
15:20 cyphase joined #perl6
15:21 tadzik I don't think we're at the angles part yet
15:22 tadzik it's like, if you take a flat map of the earth, the way to get from australia to brazil will always be "to the left"
15:22 tadzik because the world ends if you walk "to the right"
15:22 DrForr If you're doing distances as well you'll need spherical geometry; might make an interesting test of the hyperbolic trig methods.
15:22 tadzik I guess you have to glue the map back together and tear it somewhere else, pretty much
15:23 DrForr Flip one of the edges over and create a Klein map.
15:23 grondilu Fun fact: if you look at it with enough speed, the Earth is indeed flat.
15:23 tadzik I have my math for distances and it's doing the right thing(for now, but now that you mention it I'm scared)
15:24 DrForr grondilu: Lorentz contraction?
15:24 grondilu DrForr: yes
15:24 raiph joined #perl6
15:26 skids joined #perl6
15:37 neuron joined #perl6
15:37 mattn_jp joined #perl6
15:38 mattn_jp joined #perl6
15:41 mattn_jp_ joined #perl6
15:41 mattn_jp joined #perl6
15:44 viki m: say "34\x[308]5".Int
15:44 camelia rakudo-moar c541b3: OUTPUT«3␤»
15:45 viki m: say +"34\x[308]5"
15:45 camelia rakudo-moar c541b3: OUTPUT«Cannot convert string to number: trailing characters after number in '3⏏4̈5' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:45 viki wc
15:45 dj_goku joined #perl6
15:50 raiph joined #perl6
15:50 dataf3l joined #perl6
15:54 raiph joined #perl6
16:00 dataf3l joined #perl6
16:04 dalek doc: d9f1d14 | timotimo++ | doc/Type/Int.pod6:
16:04 dalek doc: make possibility of using variables more obvious
16:04 synopsebot6 Link: http://doc.perl6.org/type/Int
16:04 dalek doc: review: https://github.com/perl6/doc/commit/d9f1d14c58
16:06 Cole_ns m: class C { has str $.s }; my %h; my $c = C.new; %h{$c.s} = $c; say 'done'
16:06 camelia rakudo-moar c541b3: OUTPUT«(signal SEGV)»
16:07 viki heh
16:07 moritz Cole_ns: wow, that's a nice short one!
16:07 Cole_ns Uh, yay?
16:07 dataf3l joined #perl6
16:07 Cole_ns :D
16:08 neuron Yay, I made perl6 working on Solaris :)
16:08 neuron Actually not that much work necessary, only some configuration issues
16:09 stmuk_ neuron++
16:10 dalek doc: 6ffc43a | moritz++ | doc/Language/objects.pod6:
16:10 synopsebot6 Link: http://doc.perl6.org/language/objects
16:10 dalek doc: Mention that TWEAK is a new feature
16:10 dalek doc: review: https://github.com/perl6/doc/commit/6ffc43ad8a
16:10 viki Cole_ns: I'll raise you:
16:10 Cole_ns neuron++;  # solarising? solarisising? solarisizing?
16:10 viki m: my %h{class { has str $.s }.new.s} = 1
16:10 camelia rakudo-moar c541b3: OUTPUT«===SORRY!===␤QAST::Block with cuid 2 has not appeared␤»
16:10 viki :)
16:11 viki m: my %h; %h{class { has str $.s }.new.s} = 1
16:11 camelia rakudo-moar c541b3: OUTPUT«(signal SEGV)»
16:11 viki Golfed segv
16:12 viki Cole_ns: would you rakudobug it? Just email to rakudobug@perl.org
16:12 Cole_ns I'll do that.
16:12 viki Cole_ns++ thanks
16:12 timotimo m: my str $a; my %h; %h{$a} = 1
16:12 camelia rakudo-moar c541b3: ( no output )
16:12 timotimo kind of interesting
16:12 timotimo we'd expect that to give the same semantics as if the string had been "", right?
16:13 neuron Cole_ns: I wanted to give some short presentation about perl 6 for colleagues, but they insisted on having a native library available :)
16:13 viki Possibly. The segv goes away if you give the attribute a default
16:13 viki OTOH, other natives require a default
16:13 viki m: my int $x
16:13 camelia rakudo-moar c541b3: ( no output )
16:13 viki oh wait. I'm confusing things
16:13 neuron p6: say "$OSNAME"
16:14 camelia rakudo-moar c541b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$OSNAME' is not declared␤at <tmp>:1␤------> 3say "7⏏5$OSNAME"␤»
16:14 timotimo yeah, it's getting a low-level null as the value for the key
16:14 neuron Hmmm, shouldn't that be set according to https://docs.perl6.org/language/5to6-perlvar?
16:14 viki m: say $*DISTRO
16:14 camelia rakudo-moar c541b3: OUTPUT«opensuse (13.2.Harlequin)␤»
16:14 cibs joined #perl6
16:15 timotimo no, the text below $^O is the explanation
16:15 viki neuron: no, $OSNAME is listed there as Perl 5 thing, and the paragraph under it tells you what the Perl 6's variants are
16:15 timotimo the presentation of that stuff is ... weird
16:15 viki Yeah
16:16 neuron viki, timotimo : ah, I didn't catch that
16:17 timotimo yeah, can't blame you
16:18 rurban joined #perl6
16:18 neuron Well, technically you can ... :)
16:18 timotimo okay. i blame you for that!
16:19 viki neuron: all those vars are listed here: https://docs.perl6.org/language/variables#Compile-time_variables
16:19 viki And the next section: https://docs.perl6.org/language/variables#Dynamic_variables
16:19 neuron viki, thanks, that's what I was looking for
16:26 isacloud joined #perl6
16:28 matt_ joined #perl6
16:29 leedo joined #perl6
16:29 neuron ./perl6 ./t/01-sanity/53-transpose.t
16:29 neuron Segmentation Fault (core dumped)
16:30 neuron meh :)
16:31 dataf3l joined #perl6
16:33 dataf3l joined #perl6
16:42 domidumont joined #perl6
16:42 grondilu neuron: can't reproduce it on my install
16:42 dataf3l joined #perl6
16:42 grondilu $ perl6 --version
16:42 grondilu This is Rakudo version 2016.10-254-gd989d96 built on MoarVM version 2016.10-43-gb4cd2a6
16:43 grondilu implementing Perl 6.c.
16:44 neuron grondilu: Do you use solaris?
16:45 neuron Also I'm on development version of solaris, so I can't really blame noone but me
16:57 timotimo perl6 -e 'my %h; %h{class { has str $.s }.new.s} = 1'
16:57 timotimo MVMHash representation requires MVMString keys
16:57 timotimo better than a crash
16:57 timotimo though i'll put "definite" or "defined" in there.
16:58 FROGGS joined #perl6
16:59 Rawriful joined #perl6
16:59 timotimo i don't feel like writing a test because it segfaults and i don't want to do the bump dance
17:05 Cole_ns timotimo: What's the bump dance?
17:05 viki Cole_ns: bumping MoarVM version used by nqp and then bumping NQP version used by Rakudo
17:06 timotimo yep, one commit to nqp, and another commit to rakudo
17:07 viki .oO( sounds like a job for a simple alias.... )
17:08 timotimo no, i don't have trouble making the stuff
17:08 timotimo i don't want to push the commits
17:09 viki ¯\_(ツ)_/¯
17:10 viki Makes bumps more atomic... "Bump version to bring a bunch of MoarVM fixes" is kinda meh
17:10 MasterDuke Zoffix! to the botmakingmobile! we need a bump dancing bot!
17:11 neuron what is the best way to create patches against rakudo, nqp and moarvm?
17:11 neuron github pull requests?
17:11 viki neuron: yes
17:11 neuron perfect, thanks viki
17:11 neuron see you later guys
17:12 viki neuron: for Rakudo, ensure the PR passes the spectest. You can run it as TEST_JOBS=4 make spectest; You can also run a longer, but more comprehensive test: TEST_JOBS=4 make stresstest
17:12 viki Increate TEST_JOBS value to about $number-of-your-processor-cores*1.2
17:12 pmurias joined #perl6
17:13 neuron viki: Is it described somewhere?
17:13 viki m: 30/24
17:13 camelia rakudo-moar d540fc: OUTPUT«WARNINGS for <tmp>:␤Useless use of "/" in expression "30/24" in sink context (line 1)␤»
17:13 viki m: say 30/24
17:13 camelia rakudo-moar d540fc: OUTPUT«1.25␤»
17:13 viki neuron: umm... nothing that sticks in my mind. I keep planning to write a proper blog post for all this stuff. You can get it piece-meal if you read the "Perl 6 Core Hacking" posts on perl6.party
17:14 viki But they go over specific bugs, so the procedure isn't generic.
17:14 viki neuron: I see we have CONTRIBUTING.md, maybe it's in there: https://github.com/rakudo/rakudo/blob/nom/CONTRIBUTING.md
17:14 neuron viki: is there a way to ask someone to run the tests for me? I have fixes to make perl6 compile on solaris, but the tests are failig so far there (core files mostly)
17:15 neuron Or maybe I should get myself virtual linux machine and run the tests there with my fixes
17:16 viki neuron: you can just mention on the pull request that someone needs to run the spectest.
17:17 neuron That would be great
17:17 neuron Many thanks
17:17 neuron bye
17:28 viki God dammit... I've just learned all of Canada, EXCEPT for my province and the neighbouring one have a day off today.
17:28 viki You just had to be different, Ontario, eh?!
17:30 canopus joined #perl6
17:30 cibs joined #perl6
17:31 viki "Americans eat about 1.25 billion chicken wings annually during Super Bowl Sunday." https://en.wikipedia.org/wiki/Public_holidays_in_the_United_States#Holidays_most_commonly_celebrated
17:31 viki That's like 675 million chickens!
17:31 viki In one day.
17:34 dataf3l joined #perl6
17:42 kyclark_ joined #perl6
17:46 ufobat joined #perl6
17:49 Louis_ joined #perl6
17:58 timotimo holy shick
18:07 pyrimidine joined #perl6
18:10 labster joined #perl6
18:10 labster joined #perl6
18:14 tushar joined #perl6
18:25 viki NeuralAnomaly: blockers
18:25 NeuralAnomaly viki, There is 1 release blocker. See http://perl6.fail/release/blockers
18:25 NeuralAnomaly viki, http://perl6.fail/130031 : gmake install step fails under Windows for 2016.10 with the Strawberry Perl buildchain
18:25 viki .ask stmuk_ would you be able to retest RT#130031 with HEAD rakudo? I believe that bug has been fixed
18:25 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130031
18:25 yoleaux viki: I'll pass your message to stmuk_.
18:26 Actualeyes joined #perl6
18:31 raiph joined #perl6
18:36 raiph joined #perl6
18:37 raiph joined #perl6
18:37 firstdayonthejob joined #perl6
18:39 RabidGravy Harr!
18:39 RabidGravy Finally Friday evening
18:39 viki Is it?
18:39 viki Seems to be still afternoon :P
18:41 mst that's because you're in an inferior timezone
18:41 RabidGravy we live in the Mother Of All Timezones
18:42 viki :)
18:42 RabidGravy I could almost walk to the meridian if I could be arsed
18:42 RabidGravy there may be something weird going on with the order of the modules on http://modules.perl6.org/
18:43 viki yeah
18:46 pyrimidine joined #perl6
18:46 viki prolly something due to this: https://github.com/perl6/modules.perl6.org/commit/5bdb297efefdcf3ccb55a7607df1db50cab7eb65
18:46 * viki leaves to do a designer emergency :'(
18:46 viki Perfect end to a Friday work day :(
18:46 cognominal joined #perl6
18:47 RabidGravy I actually refused to merge a change this afternoon
18:59 pyrimidine joined #perl6
18:59 itcharlie joined #perl6
19:03 raiph joined #perl6
19:06 raiph joined #perl6
19:08 firstdayonthejob joined #perl6
19:09 pyrimidine joined #perl6
19:11 mohae joined #perl6
19:13 raiph joined #perl6
19:15 raiph joined #perl6
19:15 itcharlie left #perl6
19:17 raiph joined #perl6
19:22 bjz joined #perl6
19:26 nowan joined #perl6
19:28 Actualeyes joined #perl6
19:28 pyrimidine joined #perl6
19:35 tushar joined #perl6
19:38 pyrimidine joined #perl6
19:53 seatek joined #perl6
19:54 ocbtec joined #perl6
19:57 pyrimidine joined #perl6
20:07 cyphase joined #perl6
20:07 pyrimidine joined #perl6
20:13 seatek Interesting - doing this $obj.isa('Class::Name') ?? appears to be execute just as fast as $obj.^name ~~ /Class\:\:Name/ ?? yet the second gives you much more flexibility
20:14 geekosaur seatek, until you are working with a subclass of Class::Name
20:14 seatek using a giant cludge mallet timer ;)
20:14 seatek geekosaur: I was!
20:15 rindolf joined #perl6
20:15 pyrimidine joined #perl6
20:15 viki Well, then your regex match is bupkis
20:15 seatek Just 1 subclass down though
20:15 viki You're conflating a name with subclassing
20:16 seatek i'm being practical ;)
20:16 viki m: class Foo::Bar {}; class Some::Other is Foo::Bar {}; dd [ Some::Other.isa('Foo::Bar'), Some::Other.^name ~~ /'Foo::Bar'/ ]
20:16 camelia rakudo-moar 4ae3f2: OUTPUT«[Bool::True, Any]␤»
20:17 viki If by practical you're introducing hard to find bugs, sure ;)
20:17 viki *you mean...
20:17 viki Job security, amiright? :)
20:17 geekosaur seatek, IO::Socket is a subclass of IO::Handle
20:18 geekosaur (in p5, and I think p6)
20:18 geekosaur think about this
20:18 seatek I understand the difference between them completely
20:18 seatek I'm talking about heavily loaded requests happening, and the speed at which they can happen
20:19 viki Though to be fair, we have some iffy things in core on this topic :P
20:20 seatek It was surpsing to me because I always hear about how horrificly slow using regexes make things
20:20 seatek yet there was no difference using the name with regex, and calling .isa
20:20 seatek (in timing the application which is a big of a big club ;))
20:20 viki seatek: there's .contains() FWIW
20:21 FROGGS regexes arnt that slow... interpolation in regexes is
20:22 seatek yeah, this came up because i'm having to deal with the fatal nightmare of circular module loading now
20:22 mspo http://codegolf.stackexchange.com/questions/28821/regex-that-only-matches-itself/31863#31863
20:22 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=31863
20:22 sftp joined #perl6
20:27 pyrimidine joined #perl6
20:27 Actualeyes joined #perl6
20:34 tomaw_ joined #perl6
20:35 pyrimidine joined #perl6
20:38 nowan joined #perl6
20:41 canopus joined #perl6
20:47 pyrimidine joined #perl6
20:48 timotimo seatek: btw, if you have $obj.^name ~~ /Class\:\:Name/, it might be about 1000x faster to just .contains("Class::Name")
20:49 seatek timotimo: I noticed that :)
20:50 shlomif joined #perl6
20:52 seatek I tried putting in "artificial" subclassing (that gave a common ancestor), so that i could use .isa .. but it was not faster.
20:54 seatek completely happy using the regex. it lacks purity... but it has a certain.. rustic charm ;)
20:55 seatek and i'm secretly rebelling against the fatality of circular module use's ;)
21:20 dalek doc: 857fab3 | coke++ | doc/Type/Int.pod6:
21:20 dalek doc: use actual spelling to pass spell test
21:20 synopsebot6 Link: http://doc.perl6.org/type/Int
21:20 dalek doc: review: https://github.com/perl6/doc/commit/857fab3673
21:23 timotimo whoops
21:23 river joined #perl6
21:23 timotimo thanks you
21:23 timotimo there's probably a make target in the repo that'll spellcheck for me?
21:23 river what's perl 6 written in?
21:24 timotimo perl6 is written in a bunch of NQP (not quite perl6) and a bunch of perl 6
21:24 timotimo we have our own custom VM to run the language on called MoarVM, which is written almost completely in C89
21:24 river that's interesting
21:24 timotimo and stuff for our support of the JVM is written in java, unsurprisingly
21:25 river oh well, can't have everything
21:25 timotimo the compiler of nqp and its runtime is also written completely in nqp
21:25 river that does all seem rather complicated
21:26 timotimo it's not terribly bad. it allows us to have a few cool things
21:27 Actualeyes joined #perl6
21:27 timotimo http://perl6.party/post/Perl-6-is-written-in...-Perl-6 -  i think this post shows a bit of that
21:29 timotimo i seem to recall another article about the coolness of that fact, but i don't remember who wrote it or what it was called
21:32 uncle_ joined #perl6
21:37 AlexDaniel joined #perl6
21:38 uncle_ hello, does anyone know if there's a rakudo 2016.10 installer for Windows? http://rakudo.org/downloads/star/ does not have it...
21:41 seatek uncle_: I looked for one very briefly the other day and couldn't find one. Also tried compiling it with Cygwin briefly which failed.
21:43 seatek I didn't need the video game distraction anyway. ;)
21:43 timotimo i think we have trouble on cygwin so can't support it
21:44 seatek Does it take a microsoft compiler of some sort? I have no idea really about the Windows world, except what I've had to learen
21:45 seatek (and video games)
21:46 seatek OSX is probably much easier since its unixy
21:46 uncle_ installers for older versions were provided on Windows before, so I wonder why 2016.10 doesn't have one
21:46 timotimo with MSVC and strawberry perl you can do it
21:48 seatek i heard something about windows 10 being able to run a Ubuntu command line now... ;)
21:48 timotimo yup
21:48 timotimo i think people have been able to compile rakudo with that
21:48 tadzik yep, it's quite nice
21:48 timotimo i don't remember if it requires any patches or tweaks
21:49 seatek i'm gonna have to play with that eventually
21:52 stmuk_ uncle_: because that version didn't "make install" correctly
21:52 yoleaux 18:25Z <viki> stmuk_: would you be able to retest RT#130031 with HEAD rakudo? I believe that bug has been fixed
21:52 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130031
21:52 Actualeyes joined #perl6
21:53 stmuk_ .tell viki thanks! I think you are right (and that 2016.10 problem fixed by a moar bump)
21:53 yoleaux stmuk_: I'll pass your message to viki.
21:54 stmuk_ I plan to try and build a working windows MSI either this or next weekend
21:55 pyrimidine joined #perl6
21:56 uncle_ stmuk_: that would be nice :)
21:56 Cole_ns stmuk_++
21:58 timotimo yay!
22:04 rurban joined #perl6
22:05 pyrimidine joined #perl6
22:10 grondilu "how many moves can players think ahead?"  omg he did ask this question
22:10 grondilu the most cliché chess question ever
22:12 grondilu oh sorry wrong chan
22:12 masak grondilu: I'm guessing, something like 2 moves? :P
22:14 grondilu it's a dumb question.  GrandMasters can play a whole game in their head, but they can inspect all branches.  How deep they inspect the move tree depends on the position.
22:15 pyrimidine joined #perl6
22:15 grondilu s/but they can/they can not/
22:15 bjz joined #perl6
22:16 masak yes, of course
22:16 seatek I play chess by using The Force, not thinking ahead.
22:16 geekosaur yeh. one of the things grand masters have over computers is they can tell which branches to prune immediately; the computers have to compute all of them
22:16 masak perhaps Monte Carlo Tree Search might give some insight here
22:16 grondilu Kasparov used to answer sarcastically:  "I don't know, just one?"
22:17 seatek hehe
22:17 geekosaur the AI folks keep playing with various forms of chunking (pattern matching on the high level) to try to reproduce what the players do
22:17 masak in the sense that trying out all of the branches in the game tree isn't the point; only the ones that are interesting/relevant
22:17 geekosaur well, the problem is nobody knows (or knows *consciously* which ones are relevant
22:23 pierre_ joined #perl6
22:29 pyrimidine joined #perl6
22:32 rurban1 joined #perl6
22:35 pyrimidine joined #perl6
22:44 pyrimidine joined #perl6
22:45 perlpilot joined #perl6
22:54 pyrimidine joined #perl6
22:54 Actualeyes joined #perl6
23:04 pyrimidine joined #perl6
23:12 seatek .keys doesn't seem to care what order keys were created. nor does it sort its return. yet it remains consistent...
23:12 seatek can i count on that forever and ever i wonder?
23:13 jnthn I wouldn't.
23:13 seatek hehe
23:13 seatek that means more work then :(
23:14 seatek or pie
23:14 seatek i think pie. yes.
23:15 perlpilot joined #perl6
23:17 perlpilot joined #perl6
23:23 pyrimidine joined #perl6
23:23 masak seatek: congratulations, you've discovered the unorderedness of hash keys.
23:23 masak seatek: here, have a level-up :)
23:25 timotimo we had a very short snippet that gave you an ordered hash
23:26 timotimo i seem to recall masak wrote it
23:26 seatek masak: hehe thanks :) but... they seem ordered in some way... that is, they are consistent across tests... but i can't figure out why they've taken the order they have
23:26 geekosaur well. technically "ordered" in the sense that the hash value determines the order. but the hash function may change, and there are hash impls in other languages that deliberately permute the hash function to prevent attacks based on ordering
23:26 ribasushi joined #perl6
23:27 seatek ah ok
23:27 jnthn We'll do that permuting in the future too
23:27 jnthn The only reason we didn't so far is "nobody had time"
23:27 seatek that explains the seeming "randomness" when they go in, but not when they come out
23:27 geekosaur basically you should not rely on the hash function always behaving in a particular way
23:27 masak seatek: hashes sacrifice consistent ordering in favor of fast lookup
23:28 kyclark_ joined #perl6
23:32 Tonik joined #perl6
23:33 pyrimidine joined #perl6
23:34 perlpilot joined #perl6
23:37 wamba joined #perl6
23:43 pyrimidine joined #perl6
23:52 pyrimidine joined #perl6
23:59 timotimo https://halite.io/index.php - potentially interesting?
23:59 pyrimidine joined #perl6
23:59 seatek yeah the hash order doesn't matter for me at all really, except that unit tests doing text generation... well, i gotta test those strings :)

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

Perl 6 | Reference Documentation | Rakudo