»ö« 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. |
|||
00:01
M-tadzik joined
00:04
M-Illandan joined
00:14
muraiki_ joined
|
|||
muraiki_ | m: map { say $_ }, "test".split("") | 00:14 | |
camelia | rakudo-moar bd4400: OUTPUT«test» | ||
muraiki_ | what causes the beginning and ending newlines? I suppose there's probably a better way to do htis though | 00:15 | |
teatime | m: map { say $_ }, "test".comb | 00:16 | |
camelia | rakudo-moar bd4400: OUTPUT«test» | ||
muraiki_ | thanks teatime++ :) | ||
timotimo | you get the beginning and end because there's empty strings there | ||
muraiki_ | I see | 00:17 | |
I just didn't know about comb. now it makes sense :) | |||
timotimo | ayup | ||
00:20
leont left,
muraiki_ left,
BenGoldberg joined
00:21
johndau joined
|
|||
tailgate | so would it be called with $the-additionoperator = &[+]; $the-additionoperator($a, $b); ? | 00:21 | |
timotimo | yeah, for example | 00:25 | |
Juerd | Out of the not-very-spectacular features of Perl 6, .comb is one of my favorites. | ||
timotimo | if you use a & instead of the $ for the variable name, you don't have to spell it another time | ||
00:35
tardisx left,
cdg joined
|
|||
MadcapJake | m: say &infix:<+>(10, 2) | 00:36 | |
camelia | rakudo-moar bd4400: OUTPUT«12» | ||
MadcapJake | m: say &infix:<R->(2, 10) | ||
camelia | rakudo-moar bd4400: OUTPUT«8» | ||
ZoffixWin | :o | 00:37 | |
00:37
khw left
|
|||
MadcapJake | are meta ops considered infixes? | 00:38 | |
probably not | |||
m: say &prefix:<[+]>([1, 2, 3]) | 00:39 | ||
camelia | rakudo-moar bd4400: OUTPUT«6» | ||
00:40
tardisx joined
|
|||
skink | This experiment worked first try... | 00:45 | |
I'm deeply suspicious | |||
00:46
cdg_ joined,
khw joined
00:50
cdg left
00:53
tardisx left
00:54
cdg_ left
01:00
Ben_Goldberg joined
01:01
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg
01:05
nightfrog joined
|
|||
skink | What in the | 01:07 | |
Someone verify my sanity for a moment here | 01:08 | ||
github.com/skinkade/p6-crypt-argon...Derive.pm6 | |||
The Argon2-meta being return by that function has $.keylen => 0 somehow | |||
Yet the other values within are as expected, and the returned $key does have 32 elems | 01:09 | ||
timotimo | the argon2d_hash_raw function may change the value of $keylen | 01:10 | |
oh | 01:11 | ||
you pass "hashlen", but you want "keylen" | |||
that should be what's wrong | |||
also, you do know you can write "t_cost => $t_cost" as ":$tcost"? | 01:12 | ||
skink | ... | 01:13 | |
timotimo | perhaps one of my fav shortcuts in the language | ||
skink | I changed that variable name :D | ||
but forgot it in the class | 01:14 | ||
timotimo | that'd be it; you may want to invest in "is required" for your attributes :) | ||
i wonder if we have (or should have) a trait that can go on the class that'd imply "is required" for all attributes | |||
skink | I'm surprised I didn't get an error trying to assign to an attribute that doesn't exist | 01:15 | |
or at least a warn | |||
timotimo | that's one place where "interface consistency" rules tend to bite people | 01:16 | |
methods take any named parameter you give to them | |||
and if you don't have "is required", the class will accept no value to be passed without complaining | |||
hoelzro | there's no builtin way to convert a 8-byte buffer into a Num via IEEE 754, is there? | 01:17 | |
timotimo | there's CArray + nativecast | ||
but that only works if your architecture uses IEEE 754 compatible floats/doubles internally | 01:18 | ||
hoelzro | that's what I figured, thanks timotimo! | ||
that's acceptable for my purposes =) | |||
timotimo | thought so :) | ||
did you know microsoft visual cpp interprets "long double" as "double"? | |||
and did you know there is *quadruple precision*? | |||
01:18
molaf left
|
|||
timotimo | (but usually no hardware implementation for arithmetic on quadruple precision floats) | 01:18 | |
01:19
Khisanth joined
|
|||
skink | timotimo, Maybe there could just be class Foo is (all-)required or something | 01:19 | |
timotimo | skink: yeah | ||
skink | and thanks for the named var trick | ||
timotimo | you're welcome :) | ||
"all-required" should be easy-ish to add, if you go look at how "is rw" is implemented on a class vs on an attribute | |||
hoelzro | I did not know either of those =) | ||
timotimo | i know of long double because tux has been keeping us posted about rakudo-moar + Inline::Perl5 not being compatible with a perl5 built to use long doubles | 01:20 | |
we'll be needing code to allow our registers to be extra-big for that to happen; currently we're capped at 64bits | 01:21 | ||
well, needing code isn't surprising. but we'll need a bit of design first | |||
skink: if you're interested in implementing that, you can also look at the ecosystem for AttrX:: modules | 01:22 | ||
timotimo goes to bed | 01:26 | ||
gnite, friends! | 01:27 | ||
hoelzro | night timotimo | 01:31 | |
01:31
molaf joined
01:37
M-tadzik is now known as tadzik,
tardisx joined
|
|||
MadcapJake | what does this error mean: Native call expected return type with CPointer representation, but got a P6opaque | 01:38 | |
hoelzro | MadcapJake: sounds like you're somehow returning an object from a class that doesn't have a CPointer repr | 01:40 | |
MadcapJake: could you paste some code? | |||
MadcapJake | hoelzro: here's the function that triggers it (I actually think it's an argument thing) github.com/MadcapJake/p6-MyHTML/bl...w.pm6#L426 | 01:43 | |
hoelzro: here's where it's called: github.com/MadcapJake/p6-MyHTML/bl...gh.pl6#L30 | |||
Maybe it's actually $*OUT | 01:44 | ||
I probably need to do $*OUT.file-descriptor | |||
hoelzro | probably | ||
MadcapJake | hmm, or not :P | 01:45 | |
I don't understand, what's the difference between CPointer and P6opaque | |||
hoelzro | a CPointer is just a pointer from C land | 01:48 | |
mst | CPointer is a pointer to something in C, P6opaque is 'whatever the implementation decides to do, which might incidentally be implemented via a C-level pointer but that's none of your business' | ||
01:48
dolmen joined
|
|||
hoelzro | a P6opaque is a chunk of memory managed by MoarVM | 01:48 | |
MadcapJake | oh ok, so it probably means that I'm not properly C-ifying something :P | 01:50 | |
01:51
ajoe joined
01:59
aries_liuxueyang joined
02:00
colomon joined,
ajoe left
02:04
Herby_ joined
|
|||
Herby_ | Evening, everyone! | 02:04 | |
o/ | |||
02:04
colomon left
02:06
snarkyboojum joined
02:12
kid51 left
02:19
snarkyboojum left
02:20
colomon joined
02:21
johndau left
02:24
johndau joined
02:25
johndau left
|
|||
sortiz | MadcapJake, are you still there? | 02:31 | |
skink | pfft, I think my travis build failed because I forgot done-checking | 02:32 | |
hey sortiz, Herby_ | |||
sortiz | \o | ||
Herby_ | o/ | 02:33 | |
02:36
noganex_ joined
02:42
colomon left
02:52
vendethiel joined
|
|||
Herby_ | ZoffixWin: I got your Twitter example to work :) | 02:52 | |
I forgot that on this fresh virtualbox I hadn't installed Curl | |||
02:56
vendethiel left
03:03
cpage_ left
03:09
sortiz left
03:13
Herby_ left
|
|||
MadcapJake | I am now | 03:16 | |
03:17
Ben_Goldberg joined,
BenGoldberg left
|
|||
MadcapJake | I love IRCCloud but sometimes I don't receive notifications... | 03:17 | |
03:17
Ben_Goldberg is now known as BenGoldberg
03:29
skink left
03:34
luis left
03:35
luis joined
03:39
lucs joined
|
|||
MadcapJake | I just dangerously commented about the ease of Perl 6 in a JavaScript reddit thread | 03:39 | |
MadcapJake crosses fingers | |||
It felt necessary, the article was about 3 ways to do Title Case and the comments included more. so I had to show how easy Title Case is with Perl 6! | 03:40 | ||
03:42
bitmap left
03:46
johndau joined
03:57
cpage_ joined
04:05
sortiz joined
04:08
bitmap joined
04:09
khagan joined
04:13
ugexe joined,
Cabanossi joined,
perlawhirl joined
|
|||
perlawhirl | MadcapJake: the only problem with doing .words».tc.Str is any arbitrary spacings get squished to one (though I will admit that's rarely an issue) | 04:15 | |
Alternatively... | 04:16 | ||
m: say "I'm a little tea pot".subst(/<:WB>(<:L>)/, -> $/ { " $0.tc()" }, :g) | |||
camelia | rakudo-moar bd4400: OUTPUT«I'm A Little Tea Pot» | ||
perlawhirl | or... given "I'm a little tea pot" { S:g/<:WB>(\w)/ {$0.uc}/; } | ||
04:17
ugexe left
04:18
ugexe joined
|
|||
perlawhirl | actually... i guess this might be slightly less mutating... "I'm a little tea pot".subst(/<?after <:WB>>(<:L>)/, -> $/ {$0.tc}, :g) | 04:19 | |
it also seems that P6's <:WB> behaves differently to p5's new \b{wb} ( added in 5.20-something, i think) | 04:23 | ||
04:27
bitmap left
04:28
khagan left,
ugexe left
04:29
molaf left
|
|||
perlawhirl | m: say "i'm a little tea pot".subst(/<?after <:WB> >(<:L>)/, -> $/ {$0.tc}, :g) # Initial wb is ignored | 04:30 | |
camelia | rakudo-moar bd4400: OUTPUT«i'm A Little Tea Pot» | ||
perlawhirl | whereas in p5, this works: $text =~ s/ (?<= \b{wb} ) ( \w ) / uc($1) /xge; | 04:32 | |
ie, "i'm" becomes "I'm" | |||
04:34
bitmap joined
04:36
ugexe joined
04:37
javan joined
04:44
khagan joined
04:48
tardisx left
04:51
tardisx joined
04:54
hubble joined
|
|||
hubble | hi all. | 04:54 | |
05:05
khw left
05:11
skids joined
|
|||
perlawhirl | hi hubble... it's a bit quiet in here | 05:14 | |
05:20
CIAvash joined,
BenGoldberg left
05:25
xiaomiao joined
05:27
mtj_ joined
|
|||
teatime waves. | 05:28 | ||
05:30
darutoko joined
|
|||
dalek | Iish: 609dd02 | (Salvador Ortiz)++ | lib/DBDish/SQLite.pm6: SQLite: Fix error report for missing library |
05:32 | |
Iish: 076111c | (Salvador Ortiz)++ | / (7 files): mysql: Fixes for Windows. The mysql library on Windows uses other name and has minor diferences Tested with the official oracle "community" release. |
|||
05:32
jjido joined
05:35
javan left
|
|||
ufobat | morning perl6 | 05:37 | |
perlawhirl | morning | 05:42 | |
however, it's afternoon here | 05:43 | ||
sortiz | and midnight here | ||
stmuk | its always morning on perl 6 | ||
dalek | osystem: 7c87bc3 | (Alex Maslakov)++ | META.list: Add TelegramBot to ecosystem; see github.com/GildedHonour/TelegramBot Add TelegramBot to ecosystem; see github.com/GildedHonour/TelegramBot |
06:01 | |
osystem: a813eb8 | (David Warring)++ | META.list: Merge pull request #197 from GildedHonour/patch-2 Add TelegramBot to ecosystem |
|||
06:22
dolmen left
06:25
_mg_ joined
06:26
PapaChub joined
06:31
firstdayonthejob joined
|
|||
PapaChub | p6: my %h = { a => 1, b => 2 }; given (%h) { my $x = { x => $_<a>, y => $_<b> }; say $x; } | 06:33 | |
camelia | rakudo-moar bd4400: OUTPUT«Potential difficulties: Useless use of hash composer on right side of hash assignment; did you mean := instead? at /tmp/tmpfile:1 ------> 3my %h = { a => 1, b => 2 }7⏏5; given (%h) { my $x = { x => $_<a>, y =-> ;; $_? is raw { #`…» | ||
PapaChub | p6: my %h = a => 1, b => 2; given (%h) { my $x = { x => $_<a>, y => $_<b> }; say $x; } | 06:34 | |
camelia | rakudo-moar bd4400: OUTPUT«-> ;; $_? is raw { #`(Block|65848024) ... }» | ||
06:34
hubble left
|
|||
PapaChub | p6: my %h = a => 1, b => 2; given (%h) { my $x = { x => "{$_<a>}", y => "{$_<b>}" }; say $x; } | 06:34 | |
camelia | rakudo-moar bd4400: OUTPUT«{x => 1, y => 2}» | ||
PapaChub | Anybody know why the first (ok, middle) evals as a Block, not a Hash? | 06:35 | |
ufobat | fuck yeah! a TelegramBot! :D cool | ||
oh excuse my language | |||
PapaChub | dabe.com/misc/hash-block.pl6 | ||
ufobat | i was thinking of writing one myself for quite a while | 06:36 | |
06:41
sortiz left
06:43
CIAvash left,
firstdayonthejob left
06:44
rindolf joined
06:45
jack_rabbit joined
|
|||
perlawhirl | PapaChub: more often than not, { ... } denotes a code block rather than a hash. why not just use %x instead of $x ? | 06:51 | |
m: my %h = a => 1, b => 2; given (%h) { my %x = x => $_<a>, y => $_<b>; say %x; } | |||
camelia | rakudo-moar bd4400: OUTPUT«{x => 1, y => 2}» | ||
06:52
RabidGravy joined
06:53
skids left
|
|||
perlawhirl | you could do 'my $x = ( x => $_<a>, y => $_<b> );` but then you have a list of Pairs, not a Hash | 06:53 | |
PapaChub | perlawhirl: I know %x is more idiomatic (see the link) but I was [naïvely] porting some old P5 code, and MOST places, the $x = { ... } worked fine — but inside a do/for, the $_ topic seemed to throw it off. | 06:55 | |
So it's more of a "help me /understand/ it" question, than a "help me fix it" one. :) | 06:56 | ||
perlawhirl | well, i'm not an expert... but it looks like the parser sees $_ inside the { ... } and infers that it's a block. | 06:57 | |
m: my $h = { a => 1 }; say $h.WHAT; my $b = { a => $_ }; say $b.WHAT; | 06:58 | ||
camelia | rakudo-moar bd4400: OUTPUT«(Hash)(Block)» | ||
PapaChub | «scratches chin» A bug or a feature? | 06:59 | |
07:00
domidumont joined
|
|||
perlawhirl | PapaChub: I'm... not sure | 07:00 | |
moritz | feature | ||
PapaChub | ;) | ||
RabidGravy | It's a feature, a consequence of the way it works - you'd struggle to return a pair from a block otherwise ;-) | ||
07:02
zakharyas joined
|
|||
perlawhirl | since you don't need references anymore, when porting your p5 code, just change all your hash refs to plain ol' hashes | 07:02 | |
07:04
domidumont left
07:05
domidumont joined
|
|||
PapaChub | If that's not already in a 5-to-6 gotcha list, it might be nice to document it for switchers. Is there a way I can submit a pull-request, or anything? | 07:05 | |
RabidGravy | yes | 07:06 | |
fork github.com/perl6/doc make changes, do PR | |||
PapaChub | ✔️ | 07:07 | |
Thanks, all! perlawhirl++ RabidGravy++ moritz++ | 07:08 | ||
07:09
jjido left
|
|||
moritz | PapaChub: or tell me your github username, and I'll give you commit acces right away | 07:10 | |
07:11
wamba joined,
abraxxa joined
|
|||
RabidGravy | moritz++ | 07:12 | |
So I successfully procrastinated adding the authentication to Sofa yesterday by making something cool instead, so let's see what I can do today | 07:13 | ||
perlawhirl | any unicode experts around? I know wb/wordbreak isn't documented, so maybe it's implementation isn't final, but is it supposed to break at the start of a string? | 07:17 | |
m: say "A B C" ~~ m:g/ <:WordBreak> . / | |||
camelia | rakudo-moar bd4400: OUTPUT«(「 B」 「 C」)» | ||
perlawhirl | if i understand unicode.org/reports/tr29/#WB1 correctly, it should break before the A as well | 07:18 | |
07:19
abraxxa left
07:20
abraxxa joined,
CIAvash joined
07:25
PapaChub left
07:34
perlawhirl left
07:43
lizmat joined
|
|||
lizmat clickbaits p6weekly.wordpress.com/2016/04/18/...om-dublin/ | 07:43 | ||
07:46
azawawi joined
|
|||
azawawi | hi | 07:48 | |
RabidGravy | Ooh, I've just found that JSON::Fast isn't a completely drop in replacement for JSON::Tiny | 07:49 | |
:-\ | |||
which is fun | |||
07:52
g4 joined,
g4 left,
g4 joined
|
|||
RabidGravy | m: use JSON::Fast; | 07:58 | |
camelia | rakudo-moar bd4400: OUTPUT«===SORRY!===Could not find JSON::Fast at line 1 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::Re…» | ||
moritz | star-m: use JSON::Fast; | 07:59 | |
camelia | ( no output ) | ||
08:00
domidumont left,
dakkar joined,
TimToady joined
|
|||
RabidGravy | ah okay | 08:01 | |
08:01
domidumont joined
|
|||
RabidGravy | star-m: use JSON::Fast; say to-json({foo => Str}) | 08:01 | |
camelia | star-m 2016.01: OUTPUT«Cannot unbox a type object in sub str-escape at /home/camelia/star-2016.01/share/perl6/site/sources/02AB8FEB8507E54529CA09DAB757E1747C5E96EE line 5 in sub to-json at /home/camelia/star-2016.01/share/perl6/site/sources/02AB8FEB8507E54529CA09DAB757E1747C…» | ||
RabidGravy | which is less than ideal (it works with JSON::Tiny) | 08:02 | |
I'll fix | 08:04 | ||
08:05
ocbtec joined,
tardisx left
08:26
mr-foobar joined
08:30
uruwi left
08:31
uruwi joined
|
|||
RabidGravy | timotimo, github.com/timo/json_fast/pull/12 if you're about | 08:41 | |
08:51
lizmat left
08:59
johndau left
|
|||
ufobat | m: sub get(Pair $x) {}; get "bla" => "blubb" | 09:12 | |
camelia | ( no output ) | ||
ufobat | m: class Foo {method get(Pair $x) { } }; my $foo = Foo.new; $foo.get "bla" => "blubb" | ||
camelia | rakudo-moar bd4400: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fWy4KfbR1nTwo terms in a rowat /tmp/fWy4KfbR1n:1------> 3$x) { } }; my $foo = Foo.new; $foo.get7⏏5 "bla" => "blubb" expecting any of: infix infix stopper sta…» | ||
ufobat | what is wrong? | ||
psch | m: class Foo {method get(Pair $x) { } }; my $foo = Foo.new; $foo.get( "bla" => "blubb" ) | 09:13 | |
camelia | ( no output ) | ||
psch | m: class Foo {method get(Pair $x) { } }; my $foo = Foo.new; $foo.get: "bla" => "blubb" | ||
camelia | ( no output ) | ||
psch | ufobat: methods need either parenthesis or a colon | ||
ufobat | subs not? | ||
psch | subs not | ||
ufobat | ok | ||
thanks :) | |||
09:13
abraxxa left
|
|||
RabidGravy | isn't it "subs usually not"? aren't there places where the parse needs to distinguish the sub from some term or infix operator for example? | 09:19 | |
psch | RabidGravy: right, ?? !! comes to mind | 09:20 | |
m: sub f() { "foo" }; say False ?? foo !! True | |||
camelia | rakudo-moar bd4400: OUTPUT«Non ast passed to WANTED: NQPMu5===SORRY!5=== Error while compiling /tmp/oesojtqu0mYour !! was gobbled by the expression in the middle; please parenthesizeat /tmp/oesojtqu0m:1------> 3sub f() { "foo" }; say False ?? foo !!7⏏5 True …» | ||
RabidGravy | well that's a strange error | 09:21 | |
m: sub foo() { "foo" }; say False ?? foo !! True | |||
camelia | rakudo-moar bd4400: OUTPUT«Non ast passed to WANTED: NQPMu5===SORRY!5=== Error while compiling /tmp/iUqwb4fQgQYour !! was gobbled by the expression in the middle; please parenthesizeat /tmp/iUqwb4fQgQ:1------> 3sub foo() { "foo" }; say False ?? foo !!7⏏5 True…» | ||
RabidGravy | infact quite awful | 09:22 | |
jnthn | m: sub foo() { "foo" }; say False ?? foo() !! True | ||
camelia | rakudo-moar bd4400: OUTPUT«True» | ||
psch | yeah, a bit at least | ||
psch doesn't know how WANTED works | |||
jnthn | That Non ast thingy looks like a leftover debug warning being leaked | ||
The rest of the error is fine, though. | |||
The !! got parsed as two prefix !s | 09:23 | ||
Because listops drop precedence | |||
RabidGravy | yeah, the debug stuff stops proper comprehension of the rest of the message | ||
09:23
jantore joined,
jervo joined
|
|||
jnthn | TimToady: Maybe something for you to check out... ^^ | 09:24 | |
09:28
andrewalker joined
|
|||
bartolin | psch: if you have some time: there is another PR to unbust rakudo-j: github.com/rakudo/rakudo/pull/748 | 09:31 | |
psch: with that NPE out of the way we are back to 19 test files with issues | |||
psch | bartolin: i have a hunch that would fall under the VMNull change jnthn proposed yesterday, which i think would be the more resilient change | 09:32 | |
bartolin: but i'll look at it later, gotta go in about half an hour | |||
bartolin | psch: even better | ||
thanks, ++psch :-) | |||
CIAvash | m: (if False {}).WHAT.say | 09:35 | |
camelia | rakudo-moar bd4400: OUTPUT«(Slip)» | ||
CIAvash | Is that how it's supposed to work? | ||
nine_ | Looks ok to me | 09:36 | |
psch | m: sub f { }; f().WHAT.say | ||
camelia | rakudo-moar bd4400: OUTPUT«Nil» | ||
RabidGravy | yeah, I can't imagine what else it could do | ||
so JSON::Marshal works fine with the fixed JSON::Fast | 09:37 | ||
09:37
ocbtec left,
TEttinger left,
ocbtec joined
|
|||
CIAvash | I thought when I used in subs before, It would just return Nil. | 09:38 | |
psch | m: say (eager (if False {})).WHAT | ||
camelia | rakudo-moar bd4400: OUTPUT«(Slip)» | ||
RabidGravy | If you want that, you need to be explicit | 09:39 | |
m: (if False {} else {}).WHAT.say | |||
camelia | rakudo-moar bd4400: OUTPUT«Nil» | ||
RabidGravy | right anyway off out for a bit | 09:43 | |
toodles | |||
CIAvash | I probably assumed it was Nil, now I noticed it with type check failure for return value | ||
09:49
abraxxa joined
|
|||
hahainternet | was reading this, it's so unfair: www.slideshare.net/osfameron/is-has...table-perl | 09:59 | |
really tempted to write a perl6 rebuttal | |||
they even mention perl 6 in there, but completely fail to provide comparisons or any downsides to haskell | 10:00 | ||
also "manipulexity" is assigned to the haskell column | |||
psch | slides 33 is just not understanding perl5 list context, isn't it? | 10:05 | |
33 to 35 i suppose | |||
hahainternet | psch: the assertion seems to be that it's all worthless in the face of the almighty god of Types | ||
psch | ah, mentioned on slide 36 | ||
hahainternet: ah, yeah, slide 49 | 10:06 | ||
10:06
pmurias joined
|
|||
hahainternet | psch: it's quiiiite biased lol | 10:06 | |
i mean i wouldn't mind if there was a little footnote "Perl 6 has basically none of these problems" | 10:07 | ||
psch | yeah, slide 53 is kinda eh | ||
and, well, 49 too | |||
hahainternet | psch: 53 is the one i found most offensive | ||
as it reads "Perl is just for jobbing programmers and magpies, Haskell is for us pure hard maths professor types" | |||
i also like on page 55 how it says "We" | 10:08 | ||
when it actually means "they" | |||
psch | yeah | ||
hahainternet | but the author realised that writing "they" would be quite offensive, and instead claimed himself in the same crew | ||
which makes no sense, as he's the one advocating for FP | |||
psch: i also like slide 86 | 10:10 | ||
which has a green background | |||
for 'good code' | |||
and is absolutely unreadable on its face | |||
teatime | so, there's something you can do in P6, and I'm curious if you can do this in any other language as easily. | 10:30 | |
with map, your function can return Empty, and you get a shorter list as output than as input. and presumably you could return a Slip w/ multiple values, and end up w/ a longer output list. | 10:31 | ||
hahainternet | perhaps not as easily but that's a fairly normal gather/take arrangement | 10:32 | |
jnthn | teatime: In other languages they break that out into two functions, often | ||
In C# they're Select and SelectMany for example | |||
But this makes you wrap single items up in a throwaway list | |||
teatime | thx | 10:33 | |
nine_ | In Perl 5 map can do the same by always flattening the list of values returned. | 10:37 | |
10:37
cpage__ joined,
cpage_ left,
cpage__ is now known as cpage_
|
|||
timotimo | o/ | 10:42 | |
hahainternet: i wouldn't call it "unreadable to its face" if you know what the syntax for "where" and guards and such is | 10:43 | ||
hahainternet | timotimo: compare it to the perl on the previous slide marked as bad | ||
which is bad perl to begin with | |||
timotimo | yeah. "wtf is ref, and why would it string-equals?" | ||
and ... dunno what else is bad about it; i don't perl5 at all | 10:44 | ||
jnthn finds Armenian unreadable | 10:45 | ||
It's probably a bad language. Doubt it's that I spent zero time studying it. :P | |||
hahainternet | i'm not saying Haskell is bad because that's hard to read | ||
i'm saying it's a rather dishonestly shoved in comparison right at the end | |||
timotimo | for my personal enlightenment, how would you change the perl5 code? | 10:46 | |
jnthn | My point is that any language is going to be hard to read if you haven't studied it at all. | ||
hahainternet | timotimo: i'd define a method on each prog that did the matching | ||
so it was much clearer what denoted equality | |||
jnthn | And the languages you find "readable" will be entirely coloured by their similarity to those you have learned. | ||
timotimo | oh, perl5 has classes! i forgot! :P | 10:47 | |
hahainternet | jnthn: i agree with that, my complaint is just about the comparisons used | ||
timotimo | it'd probably be easier to have an "isUndef" method, that'd probably make things easier | 10:49 | |
and then write the match from "the perspective" of one of the objects | 10:50 | ||
10:55
ajoe joined
10:57
smls joined
|
|||
smls | "Internal error: zeroed target thread ID in work pass", that's a new one... :P | 10:58 | |
timotimo | sounds memory-corruption-y | 11:00 | |
smls | unfortunately I can't reproduce it, it only happened on one run... | 11:01 | |
pmurias | isn't the point of the perl5/haskell talk to show how cool and familiar haskell is rather then bashing perl5? | 11:10 | |
ilmari | pmurias: the talk was given at a functional programming meetup, not a perl meetup | 11:11 | |
11:12
grondilu joined
|
|||
pmurias | ilmari: wasn't it given at YAPC::2015? | 11:13 | |
ilmari | no, LambdaLounge | ||
and will be at LPW 2016 | |||
11:13
kid51 joined
|
|||
ilmari | no, sorry, london pm tech meet in june | 11:14 | |
«From session at www.lambdalounge.org.uk/ on 18th April 2016.» - in the description on slideshare | |||
grondilu | m: sub f { pi but method gist { "pi" } }() | 11:16 | |
camelia | rakudo-moar bd4400: OUTPUT«Potential difficulties: Useless declaration of a has-scoped method in mainline (did you mean 'my method gist'?) at /tmp/e7sIonCzAV:1 ------> 3sub f { pi but method7⏏5 gist { "pi" } }()» | ||
grondilu | m: sub f { pi but role { method gist { "pi" } } }() | 11:17 | |
camelia | ( no output ) | ||
11:17
dogbert17 joined
|
|||
grondilu | m: sub f { pi but role { method gist { "pi" } } }().say | 11:17 | |
camelia | rakudo-moar bd4400: OUTPUT«pi» | ||
grondilu | m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).say | 11:18 | |
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
grondilu was expecting 3.1415... | |||
moritz | why? | ||
oh, I see | |||
grondilu | m: sub f($x) { $x.flip but role { method gist { "I'm pi!!" } } }(pi).say | 11:19 | |
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
timotimo | m: sub f($x) { $x.flip but role { method gist { "I'm pi!!" } } }(pi).gist.say | ||
camelia | rakudo-moar bd4400: OUTPUT«I'm pi!!» | ||
timotimo | kind of interesting | 11:20 | |
Juerd | m: tau.say | ||
camelia | rakudo-moar bd4400: OUTPUT«6.28318530717959» | ||
Juerd | :) | ||
11:20
zakharyas left
|
|||
dogbert17 | good afternoon #perl6 | 11:20 | |
grondilu | m: role Pi { method gist { "I'm pi!!" } }; sub f($x) { pi but Pi }().say | ||
camelia | rakudo-moar bd4400: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub f at /tmp/Swmt1HgYNK line 1 in block <unit> at /tmp/Swmt1HgYNK line 1» | ||
timotimo | woof woof, dogbert | 11:21 | |
grondilu | m: role Pi { method gist { "I'm pi!!" } }; sub f { pi but Pi }().say | ||
camelia | rakudo-moar bd4400: OUTPUT«I'm pi!!» | ||
dogbert17 | woof | ||
grondilu | m: role Pi { method gist { "I'm pi!!" } }; sub f($x) { $x but Pi }(355/113).say | ||
camelia | rakudo-moar bd4400: OUTPUT«I'm pi!!» | ||
Juerd | grondilu: What are you trying to do? | ||
Your code will happily claim that 5 is pi. | 11:22 | ||
grondilu | it's just an example | ||
Timbus_ | 'es figgerin out when gist is called | ||
Juerd | Ah | ||
grondilu | I want to make a sub that returns an int with a mixin role redefining gist | ||
timotimo | well, you can't return an "int" with a mixed in role, but an Int would do | 11:23 | |
grondilu | yes. | ||
11:24
jameslenz joined
|
|||
grondilu | m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).say | 11:24 | |
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
nine_ | m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
grondilu | that looks wrong | ||
wrong as in "bug" | |||
nine_ | m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.^name | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3Num» | ||
nine_ | m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.WHAT | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3(Num)» | ||
DrForr | Useful if you're programming in Indiana :) | ||
nine_ | m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.roles | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3Method 'roles' not found for invocant of class 'Num' in block <unit> at /tmp/SNOY3Ol4zc line 1» | ||
nine_ | m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.^roles | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3((Real) (Numeric))» | ||
grondilu | m: sub f($x) { $x.flip but role { method gist { "$x " } } }(pi).say | 11:25 | |
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
grondilu | m: sub f($x) { $x.flip but role { method gist { note "I'm calling gist!"; return "$x " } } }(pi).say | ||
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
grondilu | not even called | ||
timotimo | could very well be that Int defines .gist directly for performance reasons | 11:26 | |
er, i mean | |||
.say | |||
grondilu | but there are no Int here | ||
timotimo | oh, sorry | ||
that's a Rat, right | 11:27 | ||
Timbus_ | he means Real or whatever pi is | ||
grondilu | m: sub f($x) { "foo" but role { method gist { note "I'm calling gist!"; return "$x " } } }(pi).say | ||
camelia | rakudo-moar bd4400: OUTPUT«foo» | ||
timotimo | m: say pi.WHAT | ||
camelia | rakudo-moar bd4400: OUTPUT«(Num)» | ||
Timbus_ | ye that | 11:28 | |
grondilu | m: say pi but role { method gist { "Pi!" } } | ||
camelia | rakudo-moar bd4400: OUTPUT«Pi!» | ||
dogbert17 | Doesn't the type Pair have a 'key' method. According to the docs it does not, although it does have 'value'. | 11:29 | |
Timbus_ | huh.. its the flip? | ||
nine_ | m: sub f($x) { $x but role { method gist { ~$x } } }(pi).say; | ||
camelia | rakudo-moar bd4400: OUTPUT«3.14159265358979» | ||
nine_ | yep | ||
11:29
kaare_ joined
|
|||
Timbus_ | m: say pi.flip but role { method gist { "Pi!" } } | 11:29 | |
camelia | rakudo-moar bd4400: OUTPUT«97985356295141.3» | ||
Timbus_ | wowza | ||
nine_ | m: sub f($x) { $x.Str but role { method gist { ~$x } } }(pi).say; | 11:30 | |
camelia | rakudo-moar bd4400: OUTPUT«3.14159265358979» | ||
moritz | dogbert17: seems to be missing from the docs | 11:31 | |
nine_ | m: sub f($x) { $x.Str but role { method gist { note "I'm calling gist!"; ~$x } } }(pi).say; | ||
camelia | rakudo-moar bd4400: OUTPUT«3.14159265358979» | ||
timotimo | yeah, it's missing | ||
Timbus_ | i guess Strs arent gisted | ||
timotimo | only missing in the documentation | ||
i'm clearly not awake yet, wow. | 11:32 | ||
jnthn | iirc, there's a multi candidate for say on Str that doesn't bother calling .gist, 'cus a Str gists to itself | ||
nine_ | No, there's a multi sub say(Str:D: \x) candidate that doesn't call gist | ||
jnthn | ...except it doesn't if you do a mixin, which may be in DIHWIDT or "you broke Liskov" territory | ||
nine_ | m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).gist.say; | 11:33 | |
camelia | rakudo-moar bd4400: OUTPUT«3.14159265358979» | ||
nine_ | m: sub f($x) { $x.flip but role { method gist { note "gisted!"; ~$x } } }(pi).gist.say; | ||
camelia | rakudo-moar bd4400: OUTPUT«gisted!3.14159265358979» | ||
nine_ | The workaround seems simple enough. | ||
dogbert17 | moritz: and timotimo, ok then I'll fix that later today | 11:36 | |
unless someone beats me to it ... | 11:37 | ||
moritz | dogbert17: I guess I'm too pacifistic to beat you to it :-) | 11:38 | |
11:39
kid51 left
|
|||
dogbert17 | moritz: :-) was thinking about printf as well, in theory we should be able to take the sprintf docs and change a sentence or two if my reasoning is correct | 11:39 | |
11:58
jack_rabbit left
12:06
b2gills joined
12:19
azawawi left,
ajoe left
12:20
ajoe_ joined
12:28
ajoe_ left
12:30
ajoe joined
12:34
zakharyas joined
12:35
_mg__ joined
12:36
_mg_ left,
_mg__ is now known as _mg_
12:39
sufrostico joined
12:49
Actualeyes joined
12:50
skids joined
|
|||
masak | today's mini-challenge -- a re-run: write a Perl 6 program that finds all `1/p + 1/q + 1/r == 1` (p, q, r positive integers) | 12:58 | |
there are ten solutions. | 12:59 | ||
I have a working solution. it's 18 lines of code, including some blank lines. | |||
er, sorry - `1/p + 1/q + 1/r == 1/2` | 13:00 | ||
13:01
cdg joined,
sufrostico left
|
|||
jeek | p <= q <= r ? | 13:03 | |
masak | might as well, yes | ||
the 10 solutions are symmetry-broken in that way | |||
ufobat | :D | 13:05 | |
my @num = (1..*); my @cross = @num X @num X @num; for @cross -> $x { my ($p, $q, $r) = $x.flat; say "got it" if 1/$p + 1/$q + 1/$r == 1/2} | |||
i am not serious ;) | 13:06 | ||
13:07
sufrostico joined
|
|||
ufobat | if we randomize the order in @cross and exit after 10, this could terminate | 13:07 | |
wamba | m: {say "$^a $^b $^c" if 1/$^a+1/$^b+1/$^c == 1/2} for flat(^10 X, ^10 X, ^10) | ||
camelia | rakudo-moar bd4400: OUTPUT«4 8 86 6 68 4 88 8 4» | 13:08 | |
jeek | Going for speed or golf? | 13:09 | |
jnthn | m: for flat combinations(1..200, 3) -> $p, $q, $r { state $found = 0; if 1/$p + 1/$q + 1/$r == 1/2 { say (:$p, :$q, :$r); last if ++$found == 10; } } | 13:10 | |
pmurias | jeek: it's O(1) anyway ;) | ||
camelia | rakudo-moar bd4400: OUTPUT«(timeout)(p => 3 q => 7 r => 42)(p => 3 q => 8 r => 24)(p => 3 q => 9 r => 18)(p => 3 q => 10 r => 15)(p => 4 q => 5 r => 20)(p => 4 q => 6 r => 12)» | 13:11 | |
13:11
Actualeyes left
13:12
brabo joined
|
|||
jnthn | Damn, that one actually only finds 6 even if it doesn't time out | 13:14 | |
masak | jnthn: it's doing way too much work :) | 13:15 | |
my solution runs in the blink of an eye | |||
jnthn | masak: Yeah, but so am I :P | ||
masak | m: constant nums = 1, 2, 3 ... Inf; sub replace($divisor, $word) { -> $n { $n ~~ Int && $n %% $divisor ?? $word !! $n } }; constant fizzbuzz = nums.map(replace(3, "Fizz")).map(replace(5, "Buzz")).map(replace(15, "FizzBuzz")); say fizzbuzz[^100] | ||
camelia | rakudo-moar bd4400: OUTPUT«(1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 Fizz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 Fizz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 Fizz 61 62 Fizz 64 Buzz Fizz …» | ||
jeek | m: my $answers = 0; my $r = 1; while $answers < 10 { for 1..$r -> $q { if ($q*($r-2) != 2 * $r) && ((2 * $q * $r) % ($q*($r - 2) - 2 * $r) == 0) { my $p = 2 * $q * $r / ($q * ($r - 2) - 2 * $r); if ($p <= $q) && ($p > 0) { print "$p $q $r\n"; $answers++; } } }; $r++; } | 13:16 | |
camelia | rakudo-moar bd4400: OUTPUT«6 6 64 8 85 5 104 6 123 12 123 10 153 9 184 5 203 8 243 7 42» | ||
masak | that looks right | 13:17 | |
jeek | Could be sped up by using q as main loop, counting p from 1 to q, and calculating r | 13:18 | |
masak | here's my solution: gist.github.com/masak/a26d1b2b7417b0db7a28 | ||
13:18
sufrostico left
|
|||
masak | I especially like how it contains three nested loops running to Infinity, and yet it's quite fast :P | 13:19 | |
by the way, this is very related: math.ucr.edu/home/baez/42.html | 13:20 | ||
(you notice there's a 42 in one of the solutions) | |||
13:20
ajoe left
|
|||
ufobat | thats smart! | 13:20 | |
jeek | m: my $a = 0; my $q = 1; while $a < 10 { for 1..$q -> $p { if ($q*($p-2) != 2 * $p) && ((2 * $q * $p) % ($q*($p - 2) - 2 * $p) == 0) { my $r = 2 * $q * $p / ($q * ($p - 2) - 2 * $p); if $r >= $q { print "$p $q $r\n"; $a++; } } }; $q++; } | 13:22 | |
camelia | rakudo-moar bd4400: OUTPUT«4 5 205 5 104 6 126 6 63 7 423 8 244 8 83 9 183 10 153 12 12» | ||
jeek | It IS faster. :D | ||
arnsholt | masak: "Perl 6, the programming language that counts to infinity *thrice* in less than a second!" =D | ||
masak | :P | 13:23 | |
13:24
sena_kun joined
13:26
sufrostico joined,
Actualeyes joined
13:28
cur8or joined
13:32
Amnez777 left
13:35
cur8or left
13:36
cur8or joined,
CIAvash left
|
|||
dalek | osystem: 2fa2e98 | Altai-man++ | META.list: Add App::Whiff |
13:40 | |
osystem: e652610 | (Zoffix Znet)++ | META.list: Merge pull request #198 from Altai-man/master Add App::Whiff: github.com/Altai-man/perl6-app-whiff/ |
|||
13:40
cur8or left,
cur8or joined
|
|||
dalek | rl6-most-wanted: d003b32 | (Zoffix Znet)++ | most-wanted/modules.md: App::Whiff is now in the ecosystem |
13:42 | |
sena_kun | ZoffixWin++ | ||
13:43
cur8or_ joined
|
|||
wamba | m: my $c=6; say $c ~~ Int; | 13:43 | |
camelia | rakudo-moar bd4400: OUTPUT«True» | ||
wamba | m: my $c=1/(1/6); say $c;$c ~~ Int; | 13:44 | |
camelia | rakudo-moar bd4400: OUTPUT«6» | ||
wamba | m: my $c=1/(1/6); say $c;say $c ~~ Int; | ||
camelia | rakudo-moar bd4400: OUTPUT«6False» | ||
13:45
cur8or left
|
|||
moritz | m: my $c=1/(1/6); say $c;say $c.narrow ~~ Int | 13:46 | |
13:46
cur8or_ is now known as cur8or
|
|||
camelia | rakudo-moar bd4400: OUTPUT«6True» | 13:46 | |
13:47
sena_kun left
13:48
cur8or left
13:49
devtom30 joined
|
|||
wamba | m: {next if 1/$^a+1/$^b==1/2; my $c=-1/(1/$^a+1/$^b-1/2); say "$^a $^b $c" if $c.Int.abs == $c <= $^b | 13:55 | |
<= $^a} for flat(^100+1 X, ^100+1) | |||
camelia | rakudo-moar bd4400: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LZFB4Gja0QMissing blockat /tmp/LZFB4Gja0Q:1------> 3 "$^a $^b $c" if $c.Int.abs == $c <= $^b7⏏5<EOL>» | ||
wamba | m: {next if 1/$^a+1/$^b==1/2; my $c=-1/(1/$^a+1/$^b-1/2); say "$^a $^b $c" if $c.Int.abs == $c <= $^b <= $^a} for flat(^100+1 X, ^100+1) | 13:56 | |
camelia | rakudo-moar bd4400: OUTPUT«6 6 68 8 410 5 512 6 412 12 315 10 318 9 320 5 424 8 342 7 3» | ||
grondilu | do we have a p6doc-capable pager? | ||
13:57
chris2 joined,
CIAvash joined
|
|||
masak | grondilu: whatever do you mean? would it be enough for your needs to pipe something to `less` ? | 13:57 | |
13:58
g4 left
14:00
sufrostico left
14:06
sufrostico joined
14:10
colomon joined
14:11
sufrostico left
14:12
sufrostico joined
14:20
lizmat joined
14:23
sufrostico left
|
|||
stmuk | p6doc uses a pager | 14:23 | |
14:31
lizmat left
14:40
sufrostico joined
14:44
lizmat joined
14:48
zzz joined
|
|||
[Coke] wonders if there is anyone else on this channel who is theoretically eligible to vote today in the US. :) | 14:51 | ||
s/else// since technically I am not eligible :P | |||
moritz | [Coke]: I'd guess TimToady is? | 14:52 | |
and diakopte1 | |||
tadzik | there's a vote today? | ||
14:52
zzz left
|
|||
[Sno] | Is someone interested previewing a talk regarding cross-compile for perl hackers? www.netbsd.org/~sno/talks/nrpm/Cros...andout.pdf | 14:53 | |
awwaiid | tadzik: State presidential primary elections in some states (New York is the one I keep hearing about) | 14:54 | |
[Coke] | NYS party-only primaries, don't think there's any CA elections today | ||
[Sno] | jnthn, froggs, nine and timotimo are expected to be interested :) | ||
14:54
sufrostico left
|
|||
DrForr | I'm technically allowed, but statistically my vote gets ignored. | 14:55 | |
tadzik | awwaiid: ah, I see. I thought it's another of those mini-presidental elections | 14:56 | |
awwaiid | DrForr: I wrote a whole talkin-blues song about that, thelackthereof.org/Talking_DC_Vote_Blues (I should actually record it, this is only lyrics) | ||
tadzik: ah sorry I might have mis-explained. It is another of these mini-presidential elections | 14:57 | ||
14:57
Amnez777 joined
|
|||
perlpilot | [Sno]: s/Clearity/Clarify/ "Sensibilize" isn't a word either, but I don't know what you're really trying to say there. | 14:57 | |
[Sno]: er, s/Clearify/Clarify/ geez, I can't even get the correction right | 14:58 | ||
14:58
lizmat left
|
|||
tadzik | awwaiid: oh, I blame myself :) I don't really understand how US election system works, and at this point, I'm too afraid to ask | 14:58 | |
[Sno] | perlpilot: Sensibilize is probably much better - I re-read | ||
[Coke] | tadzik: then you're pretty much on par with US citizens. | 14:59 | |
tadzik | it seems extremely complex, and I don't think scalability is the issue with the "normal" way | ||
DrForr | And at least one Presidential candidate. | ||
awwaiid | tadzik: this is one of the worst ones for understanding, so you're ok. Each party has to select a final presidential candidate by july or so, and each party in each state has different rules for how this is done. madness. | ||
tadzik | :) | ||
[Coke] apologizes for derailing #perl6 today. :) | |||
I imagine it's going to make the EU process when they decide to form a single state look sane. :) | 15:00 | ||
[Sno] | perlpilot: dict.leo.org/ende/index_de.html#/se...ensibilize | ||
tadzik | I read quite a bit of reddit, and it's all about Bernie Sanders all the time, to the point when I start exercising those subreddit filters | ||
but when I see how people apparently donate money and their time to do phone calls, I slowly back away :o | |||
awwaiid: well, the fact that there's only two parties makes at least that part easier, I guess | 15:01 | ||
awwaiid | tadzik: everyone is just going through the motions despite, as far as I can tell, it being pretty obvious that without something very severe happening Clinton will be our next president. I guess everyone is hoping for something to happen. | ||
m: say "la la la" | 15:02 | ||
camelia | rakudo-moar baf8ac: OUTPUT«la la la» | ||
moritz | awwaiid: to me as an outside observer, it looks as though Trump is going to be president, and he's going to be worse than Bush Jr. | 15:03 | |
tadzik | awwaiid: so that part is just desperation/people really wanting to contribute to someone's success, not a regular part of the campaign? | ||
perlpilot | [Sno]: I'm having trouble imagining what you're going to talk about for slides 9/10, but the rest looks excellent. | ||
moritz: There's more drama to be had before that happens. | 15:04 | ||
15:04
lizmat joined
|
|||
moritz | perlpilot: the mere fact that it seems to be quite possible repells me from the US | 15:08 | |
15:08
Relsak joined
|
|||
perlpilot | moritz: yeah, imagine what it's like for those of us who are living in the US :( | 15:08 | |
moritz | perlpilot: come to the EU. We have cookies! | 15:09 | |
tadzik | hmm | ||
stmuk | cookie warnings you mean :/ | ||
moritz | perlpilot: and no software patents | ||
awwaiid | moritz: Yeah. madness. | ||
moritz | stmuk: yes, that too :( | ||
DrForr | works for me.. :/ | ||
pmurias OTOH finds the Trump campaign highly entertaining (compared to the politics in his own country) | |||
awwaiid | If only we were electing chief entertainer! | 15:10 | |
tadzik | having a shift in government in poland recently, I can say that a constant feeling that you should run the fuck away from your own country because of who leads is something you can get used to | ||
15:10
lizmat left,
Relsak left
|
|||
perlpilot | moritz: I've already moved my family across Texas in the last 6 months; I don't think they'll be up for another move and even if they were, "out of state" would be a hard sell and "out of country" near impossible I think | 15:10 | |
moritz | pmurias: I found it entertaining only as long as it didn't seem to be a real possibility that he'd win | ||
awwaiid | tadzik: yeah ... on the good side our gov is pretty specifically designed to deadlock on error | ||
moritz | awwaiid: ... not only on error | 15:11 | |
perlpilot: yes, understandable | |||
awwaiid | moritz++ # truth | ||
DrForr | s/ on error//; # ... | ||
awwaiid | By design though, that's the key :) | ||
tadzik | awwaiid: ah, how do you specify an error though | 15:12 | |
perlpilot | moritz: It's worse than you state though (about the election). Because Ted Cruz could get the Republican nomination. And because Clinton will get the Democratic nomination. | ||
If ever there was a time for the phrase "least of all evils", it's this election. | |||
DrForr | Nyarlathotep for President. | ||
15:13
domidumont left
|
|||
stmuk | john mcafee :) | 15:13 | |
RabidGravy | goats | ||
huf_ | i'd like to see orban as the US president | 15:14 | |
it would be even more hilariously awesome than trump. | |||
15:14
Relsak joined
|
|||
moritz | or be like Beligum, try it without a government for a few years | 15:16 | |
huf_ | :) | ||
tadzik | oh, mongodb sponsors qah | 15:18 | |
I can't wait to see mst grind his teeth | |||
nine_ can't think of any country that displays sane politics. Even Iceland seems to have fallen :/ | 15:20 | ||
huf_ | but in an insane context, insanity is the only sane choice | 15:21 | |
15:22
sufrostico joined
|
|||
nine_ | [Sno]: oh I wish I hadn't read your slides. This makes things...more complicated. Makes it harder now to continue living in the "if it works on your system it must be good" bubble :) | 15:26 | |
[Sno] | :) | 15:27 | |
15:27
lostinfog joined
|
|||
psch | and *that* is why i mostly stick with the jvm backend :P | 15:28 | |
RabidGravy | something weird going on with module loading, I changed JSON::Marshal to use JSON::Fast - all good and it works fine | ||
however JSON::Class uses JSON::Marshal and JSON::Unmarshal and it was giving me "global merge errors for Fast" | 15:29 | ||
which is odd | |||
so I twatted everything reinstalled the modules and it's fine and happy | 15:30 | ||
tadzik | :| | ||
[Coke] | moritz: (cookies) you should lead with stroopwafel | 15:32 | |
[Coke] bought some wafel on the jersey turnpike on the way home from awwaiid's con this weekend. it was disappointing after the real thing. | |||
(the wafel, not the con!) | |||
RabidGravy | there must be something like it thinks there are two JSON::Fasts, one gets loaded from one place and then it has the difficulty when it tries to load the "different" one | 15:33 | |
15:33
colomon left
|
|||
pmurias | is it possible to access the debugname from the nqp level? | 15:34 | |
jnthn | pmurias: No | 15:39 | |
pmurias: You can always do .^name if you're at that level | 15:40 | ||
15:49
khw joined
15:50
zakharyas left
15:54
Timbus joined
15:55
zakharyas joined
15:56
zakharyas left
15:58
abraxxa left
16:02
smls left
|
|||
stmuk | if anyone is in San Francisco (and hasn't seen their mailing list) sue and myself will be at a SF Mongers meeting at the Mikkeller Bar from 5.30 onwards | 16:04 | |
16:05
zakharyas joined
16:06
devtom30 left
16:12
ajoe joined
16:13
colomon joined
|
|||
grondilu | m: role :: does Numeric { has $.x handles <Numeric> }.new(1) + 1 | 16:15 | |
camelia | rakudo-moar baf8ac: OUTPUT«WARNINGS for /tmp/xsDQVEpTqV:Useless use of "+" in expression ".new(1) + 1" in sink context (line 1)Package '<anon|76829520>' already has a method 'Numeric' (did you mean to declare a multi-method?) in any add_method at gen/moar/m-Metamodel.nqp l…» | ||
grondilu | m: say role :: does Numeric { has $.x handles <Numeric> }.new(1) + 1 | 16:16 | |
camelia | rakudo-moar baf8ac: OUTPUT«Package '<anon|51200816>' already has a method 'Numeric' (did you mean to declare a multi-method?) in any add_method at gen/moar/m-Metamodel.nqp line 474 in any compose_attributes at gen/moar/m-Metamodel.nqp line 382 in any compose at gen/moar/…» | ||
grondilu | m: say class :: does Numeric { has $.x handles <Numeric> }.new(:x(1)) + 1 | 16:18 | |
camelia | rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CEQLEICR1TPackage '<anon|80245408>' already has a method 'Numeric' (did you mean to declare a multi-method?)at /tmp/CEQLEICR1T:1» | ||
16:22
wamba left,
wamba joined
16:25
tbrowder joined
|
|||
tbrowder | my $a := "t"; | 16:26 | |
say $a.VAR.WHAT; | 16:27 | ||
teatime | www.idontplaydarts.com/2016/04/det...rver-side/ <-- I love this, and it also provides further reason (as if needed) to never `curl | bash` | 16:28 | |
tbrowder | $a:="t";say $a.VAR.WHAT; | 16:29 | |
teatime | m: my $a := "t"; say $a.VAR.WHAT; | 16:30 | |
camelia | rakudo-moar baf8ac: OUTPUT«(Str)» | ||
tbrowder | my $a=42;my $b := $a; $b=100;say$a; | 16:34 | |
16:34
xiaomiao left
16:35
zakharyas left
|
|||
RabidGravy | "this REPL is really good it looks just like IRC" | 16:35 | |
tbrowder | 16:36 | ||
grondilu | ever considered making Pair a role and not a class? | ||
16:37
_mg_ left
|
|||
timotimo | so that it gets parameterized on its key and value type? | 16:38 | |
16:39
Actualeyes left
|
|||
nine_ | The idea smells a bit like bootstrap hell ;) | 16:39 | |
16:39
dogbert2 joined
16:40
tbrowder left
16:41
dakkar left,
xiaomiao joined
16:44
zakharyas joined
|
|||
grondilu | it's just that I have a class I'd like to behave as Pair and it'd be so much easier if Pair was a role and not a class. Maybe class inheritance would do but it seems merkier to me. | 16:46 | |
but maybe that's just me who got too much used to do mixins and not inheritance. | |||
timotimo | hehe | 16:49 | |
you've been in #perl6 too long ;) | |||
16:49
sufrostico left
|
|||
timotimo | thing is, when you buy into inheritance, you ought to liskov it; is your class acceptable everywhere a Pair would be? | 16:49 | |
grondilu | I don't know what liskov means. | ||
timotimo | liskov substitution principle | 16:51 | |
16:53
CIAvash left
|
|||
dogbert2 | timotimo: hello, have time for a question? | 16:53 | |
timotimo | we can try :) | 16:54 | |
16:54
sufrostico joined
|
|||
timotimo | i mean, i have time | 16:55 | |
dogbert2 | i'm going to dcoument the key method for Pair but I'm not sure how it's defined, should i be 'multi method key(Pair:D:)' | ||
s/i/it/ | |||
grondilu | the key is actually an attribute of the class, isn't it? | 16:56 | |
timotimo | github.com/rakudo/rakudo/blob/nom/...air.pm#L37 - check it! :D | ||
oh, oops :) | |||
there's "keys" and such in there, but not actually "key" or "value" | |||
but you're right. at the top of the file you find the key and value definitions | |||
dogbert2 | value is 'multi method value(Pair:D:) is rw' | 16:57 | |
timotimo | the signature itself doesn't actually specify :D i don't think. but the fact that it's an accessor to an attribute pretty much means it'll immediately explode if the Pair you supply isn't defined | ||
m: Pair.key.say | |||
camelia | rakudo-moar baf8ac: OUTPUT«Cannot look up attributes in a type object in method key at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1 in block <unit> at /tmp/c6Qug7es5n line 1» | ||
dogbert2 | so, should I go with multi method key(Pair:D:) or is that utter nonsense :-) | 16:59 | |
timotimo | nope, that's good | 17:00 | |
dogbert2 | ok, give me a couple of minutes, thx for the help | ||
timotimo | thx for your contribution :) | 17:01 | |
dogbert2 | with help like this there will be more :-) | ||
17:02
Amnez777 left
|
|||
dalek | c: 79be2f6 | (Jan-Olof Hendig)++ | doc/Type/Pair.pod: Added documentation for the key method |
17:03 | |
17:08
Amnez777 joined
|
|||
wamba | luku můžeš mi tam dát toho líkaře? | 17:08 | |
huf_ | is this the joke about the bread? | 17:11 | |
wamba | bad chat guys sorry | 17:12 | |
[Coke] | it's not entirely off topic here. :) | 17:13 | |
(mainly because it's not english) | 17:14 | ||
arnsholt | Pretty sure it's Czech | 17:15 | |
Might be Slovak, but IIRC Slovak doesn't have the r with hacek (or was it vowels with hackek?) | 17:17 | ||
wamba | It is Czech | ||
masak | was gonna say | 17:18 | |
17:18
colomon left
|
|||
huf_ | okay okay, but is it the joke about the bread? | 17:19 | |
arnsholt | I haven't the faintest idea. I don't know any Czech =D | ||
(I've only seen enough of it to recognize it =) | |||
huf_ | "- doctor, i cant pee. - let me look at it... you have a knot on your dick! - oh my god, the bread!" | 17:20 | |
is the skeleton of the joke | |||
tadzik | wat :o | 17:21 | |
huf_ | you know that thing where if you're prone to forget something, tie a knot in your handkerchief or something to remember it by? | ||
grondilu | kind of weird: I was watching a TV series episode and in that episode suddenly a character starts to speak Czech as well. Kind of a weird coincidence. | 17:23 | |
masak | tadzik: apparently in some parts of Europe, people tie knots on things to remember other things. | ||
tadzik: I've known Dutch people to do this, too. | |||
huf_ | i've never actually seen this happen | 17:24 | |
timotimo | i have heard about this, but i've never seen anybody actually do it, or did it myself | ||
masak | tadzik: if you tie two knots, you're supposed to remember two things. | ||
no, I've seen people do it. | |||
huf_ | but i understood somehow that this is the thing underlying the joke | ||
[Coke] | my grandmother used to, for example, move her wedding ring to remind her to turn off the lights in the car when she got out. | 17:25 | |
17:25
molaf joined
|
|||
[Coke] | sameish thing. | 17:25 | |
huf_ | hmm... so this is why people often look at me strange when i tell this joke. | 17:26 | |
_especially_ as i tend to tell jokes backwards | 17:27 | ||
timotimo | backwards, eh? | ||
huf_ | yes, just like i did here | ||
timotimo | like .flip, or like .words.reverse.join? | ||
huf_ | punchline, skeleton, underlying cultural thing | ||
[Coke] | m: say "Why did the chicken cross the road?".words.reverse; | 17:28 | |
camelia | rakudo-moar baf8ac: OUTPUT«(road? the cross chicken the did Why)» | ||
17:29
kaare_ left,
kaare_ joined
|
|||
masak | m: say .uc.map: * ~ "!" for "Why did the chicken cross the road?".words.reverse | 17:30 | |
camelia | rakudo-moar baf8ac: OUTPUT«(ROAD?!)(THE!)(CROSS!)(CHICKEN!)(THE!)(DID!)(WHY!)» | ||
17:30
vendethiel joined
|
|||
masak | :) | 17:30 | |
arnsholt | masak: I don't tie knots, but I have been known when shopping to make a mental note of the number of things I Was supposed to get. That way I can at least checksum the number of things in my basket before paying | ||
masak | arnsholt: I've started doing that too, lately | 17:31 | |
arnsholt: I find it soothing | |||
huf_ | :) | ||
i picked that one up a few years ago | |||
arnsholt | Although these days I generally make a list on my phone | ||
masak | I often just snap a photo of the recipe | ||
17:31
domidumont joined
|
|||
arnsholt | Yeah, or that | 17:32 | |
timotimo | i'm using "OurGroceries" on my phone, which has the nice feature that i can give out access to the grocery list to others who only have to use a browser to push stuff my way | 17:35 | |
arnsholt | Oh, neat! | 17:37 | |
I've actually been wanting something like that, for sharing that kind of thing with the missus | 17:38 | ||
timotimo | our groceries is free to use, but it'll pop up a "wanna go premium?" dialog every now and then | 17:39 | |
arnsholt | Sounds like something I can live with | 17:40 | |
17:40
confundus joined
|
|||
timotimo | me, too | 17:41 | |
17:42
unbound_delegate joined
|
|||
unbound_delegate | howdy | 17:45 | |
17:45
ajoe left
|
|||
dalek | line-Perl5: 6a5f4ae | (Zoffix Znet)++ | README.md: Update perlbrew instructions to build latest stable perl |
17:46 | |
17:47
_mg_ joined
|
|||
grondilu | m: use MONKEY-TYPING; augment class Int { multi method gist(UInt $:) { self ~ " (>0)" } }; say 7 | 17:48 | |
camelia | rakudo-moar baf8ac: OUTPUT«7 (>0)» | ||
grondilu | ^wondering how to a methods to subsets. | ||
17:49
colomon joined
|
|||
unbound_delegate | perl6: my uint8 $x = 255; say $x; $x++; say $x; | 17:52 | |
camelia | rakudo-jvm 40a953: OUTPUT«cannot connect to eval server: Connection refused» | ||
..rakudo-moar baf8ac: OUTPUT«255256» | |||
timotimo | oh, that's awkward | 17:53 | |
we must be missing the codegen for truncation for inc and dec opcodes | 17:54 | ||
they are the only opcodes that have a parameter that they both read from and write to, afaik | |||
so there's special cases for those two all over our code :| | |||
unbound_delegate | Any idea when this will be fixed? I found this similar bug on rt: rt.perl.org/Public/Bug/Display.html?id=127144 | ||
17:58
firstdayonthejob joined
|
|||
timotimo | sadly, not many of us are familiar with that part of the compiler's internals | 17:58 | |
diakopte1 | which part is that | 17:59 | |
diakopter | timotimo: could you try to reproduce in a mostly-nqp:: edition? | 18:00 | |
masak | the codegen-for-truncation-for-inc-and-dec-opcodes part, duh | ||
timotimo | it's probably a change needed inside QASTCompilerMAST inside nqp | ||
m: my uint8 $v = 255; nqp::inc_i($v); say $v | 18:01 | ||
camelia | rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PDJXzjMH97Could not find nqp::inc_i, did you forget 'use nqp;' ?at /tmp/PDJXzjMH97:1------> 3my uint8 $v = 255; nqp::inc_i($v)7⏏5; say $v» | ||
diakopter | my favorite | ||
timotimo | m: use nqp; my uint8 $v = 255; nqp::inc_i($v); say $v | ||
camelia | rakudo-moar baf8ac: OUTPUT«===SORRY!===No registered operation handler for 'inc_i'» | ||
timotimo | i think we actually codegen the op when we see ++ | ||
and there's some more code about ++ and -- in the optimizer, iirc | |||
huh, it actually codegens an add_i with 1 as the second operator | 18:02 | ||
18:03
sufrostico left
|
|||
masak | m: my uint8 $x = 255; say $x; $x = $x + 1; say $x; | 18:03 | |
camelia | rakudo-moar baf8ac: OUTPUT«2550» | ||
masak | ...and yet, that works | ||
timotimo | yeah | 18:04 | |
masak | probably because that one is storing something back into $x | ||
explicitly, I mean | |||
diakopter | m: my uint8 $x = 255; say $x; $x = nqp::add_i($x, 1); say $x | ||
camelia | rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/a7rz1ZgLfZCould not find nqp::add_i, did you forget 'use nqp;' ?at /tmp/a7rz1ZgLfZ:1------> 3$x = 255; say $x; $x = nqp::add_i($x, 1)7⏏5; say $x» | ||
diakopter | m: use nqp; my uint8 $x = 255; say $x; $x = nqp::add_i($x, 1); say $x | ||
camelia | rakudo-moar baf8ac: OUTPUT«2550» | ||
timotimo | it might be about sink vs no sink | ||
18:05
sufrostico joined
|
|||
diakopter | m: use nqp; my uint8 $x = 255; say $x; say nqp::add_i($x, 1); | 18:05 | |
camelia | rakudo-moar baf8ac: OUTPUT«255256» | ||
pmurias | grondilu: is your Pair class really just a Pair or an object consisting of two things? | ||
timotimo | well, just adding 1 to $x shouldn't truncate it. assigning it back to $x or another uint8 variable should | 18:06 | |
timotimo AFK for a bit | |||
grondilu | pmurias: I'd like it to behave as a pair because it'd be very usefull to feed it to a MixHash. | ||
diakopter | timotimo: you're right, the codegen there needs the truncation | ||
masak | m: my uint8 $x = 255; say $x; ++$x; say $x | 18:07 | |
camelia | rakudo-moar baf8ac: OUTPUT«255256» | ||
grondilu | so yeah, it's really a pair I guess. | ||
I mean I want it to be. | |||
nine_ | /win 40 | ||
18:08
cdg left,
zakharyas left
18:11
dalek joined,
ChanServ sets mode: +v dalek
18:12
pmurias left
18:13
jjido_ joined
|
|||
confundus | Hi, is there any built-in takeWhile routine? Old logs suggested something like this: sub take-while(@list, &cond) { @list.grep: { &cond($_) ?? True !! last } }; | 18:13 | |
This works fine here: my @list = (^Inf).&take-while(* < 5); .say for @list; | |||
But I can't use it do do further chaining. This doesn't work: .say for (^Inf).&take-while(* < 5); | |||
grondilu | maybe with ... | 18:16 | |
@list ... &cond | |||
or rather @list ...^ { !cond($_) } | 18:17 | ||
moritz | m: sub take-while(&cond, @list) { gather for @list { take $_ while cond($_) } } | ||
camelia | ( no output ) | ||
18:19
Relsak left,
jjido_ left
18:20
colomon left
|
|||
masak | m: my @a = 1, 2, 3, 4, 5, 3, 2, 4; .say for @a ...^ * > 4 | 18:22 | |
camelia | rakudo-moar 2d6f5c: OUTPUT«1234» | ||
masak | confundus: ^^ | ||
18:26
spider-mario joined
|
|||
confundus | masak, pretty cool, except I don't have the first clue about how to read that... | 18:26 | |
grondilu | ... is the sequence operator | ||
18:26
rindolf left
|
|||
grondilu | as in 1, 2 ... * | 18:26 | |
confundus | and what is ...^ if you don't mind me asking. | 18:27 | |
grondilu | ^ indicates exclusion at the border | ||
18:27
Ven joined
|
|||
confundus | oh yes | 18:27 | |
isn't writing * > 4 a bit anti-intuitive? after all it's accumulating values below 4. | 18:28 | ||
TimToady | m: say 1, 2, 4 ... 1024 | 18:29 | |
camelia | rakudo-moar 2d6f5c: OUTPUT«(1 2 4 8 16 32 64 128 256 512 1024)» | ||
TimToady | the thing on the right is a goal, not a filter | ||
diakopter | m: say 1, 2, 4 ...^ 1024 | 18:30 | |
camelia | rakudo-moar 2d6f5c: OUTPUT«(1 2 4 8 16 32 64 128 256 512)» | ||
18:31
unbound_delegate left
|
|||
masak | confundus: it's more intuitive if you think about that construction as takeUntil | 18:31 | |
18:32
_28_ria joined
18:33
rindolf joined
|
|||
confundus | m: say 2, 4 ... * > 10; | 18:35 | |
camelia | rakudo-moar 2d6f5c: OUTPUT«(2 4 6 8 10 12)» | ||
confundus | why is 12 included here? | ||
TimToady | because you didn't use ^, and 12 was your "goal" | ||
also, because you used > rather than >= :) | 18:36 | ||
confundus | ah right, thank you all for being so helpful :) | ||
TimToady | we're not really helpful, we just pretend to be most of the time :) | ||
18:37
kaare__ joined
|
|||
confundus | apparently that's quite enough ;) | 18:37 | |
18:38
kaare_ left
|
|||
TimToady | "The whole world runs on hypocrisy." —my daughter | 18:38 | |
confundus | This is probably the coolest possible solution of project euler #2 (fibonacci) in any language: say [+] (0, 1, * + * ...^ * > 4_000_000).grep: * %% 2; | 18:43 | |
nine_ | Is --target=mast supposed to show the optimized version? | 18:44 | |
moritz | mast comes after optimize, so yes | ||
timotimo | since it's later in the chain, yeah | ||
does --target=mast actually output anything usable? | 18:45 | ||
i thought it'd just say "don't know how to dump this" | |||
moritz | but before dynamic optimization :-) | ||
18:47
ab6tract joined
|
|||
ab6tract | o/ #perl6 | 18:47 | |
working on Git::Version with BooK in a bar in Amsterdam ;) | |||
BooK | :-) | 18:48 | |
ab6tract | how do I go about overriding comparison for a class? | ||
is that by adding coercions to Less/Same/More ? | |||
timotimo | i'm afraid not | 18:49 | |
override the cmp operator? :\ | 18:50 | ||
ab6tract | ouchhh | ||
timotimo | yeah | ||
18:51
aindilis joined
18:57
patrickz joined,
ZoffixW joined
|
|||
nine_ | I just wonder because perl6 --target=optimize -e 'm: my uint8 $x = 255; ++$x;' clearly shows usage of the add_i op while --target=mast looks very much like a call to &prefix:<++> | 18:57 | |
ZoffixW | Is there a way to import optionally-exported subroutines from Perl 5 modules when using Inline::Perl5? I'm using Perl 5's Text::Markdown but its markdown sub is exported only by request (I know I can use the full name, but I rather not) | 18:58 | |
timotimo | may have to do with whether or not the void or regular variant of the Want node gets taken | 18:59 | |
nine_ | I find it very cool that after my debugging EVAL endeavour, the --target=mast output makes complete sense to me :) | 19:00 | |
ZoffixW: same as you'd do in Perl 5 | |||
use Foo:from<Perl5> <fooicate> | |||
ZoffixW | That's too easy! :P | 19:01 | |
Thanks, nine_++ | |||
19:02
takadonet joined
19:03
colomon joined
|
|||
takadonet | hey everyone | 19:03 | |
[Coke] ends up writing a "git for dummies" equivalent for his dayjob. whee. | |||
timotimo | hello, adventurer | 19:04 | |
masak | hello [ad], venturer | 19:07 | |
timotimo | have ad you, venturer | 19:08 | |
19:11
Timbus left,
Timbus joined
19:15
ZoffixW left
19:17
jjido_ joined
19:19
colomon left
19:20
sortiz joined
19:25
zakharyas joined
|
|||
sjn looks at the perl6 command-line options, and sees there are a bunch of them that aren't mentioned in the usage text | 19:25 | ||
19:27
mane joined,
khw left
19:28
Ven left
|
|||
ab6tract | re: the Version type | 19:30 | |
was there discussion about adding 'rc' logic? | 19:31 | ||
19:32
_mg_ left
19:39
_mg_ joined
19:40
domidumont left
|
|||
teatime | ok, so, someone was telling me about how people complain about Perl6's datetime being evil... I have to share this someone just snapshotted from some (non-perl) production code they're working on: i.imgur.com/XFYUhL5.png | 19:43 | |
psch | uhh, that doesn't actually turn $date into a unix timestamp, does it..? | 19:44 | |
teatime | no. not at alllllll | 19:45 | |
timotimo | i didn't know perl6's datetime is supposedly evil | ||
what's wrong about it? | |||
err, what the flying fuck? | |||
teatime | timotimo: nothing afaict, but someone was mentioning that it's frequently whinged about. | ||
timotimo | wat? i thought "nobody uses perl6"? :P | 19:46 | |
teatime | and time is hard enough to get right that I don't claim to be sure there's nothing wrong with it, although I don't see anything. | ||
haha | |||
timotimo | but that unix timestamp implementation is ... amazing | ||
teatime | the guy says the best part is, mktime() returns a unix timestamp | ||
moritz | I'd go so far as to call it "creative" :-) | 19:48 | |
teatime | best thing I've seen in a while. | ||
19:55
mane left
19:56
kaare__ left
|
|||
takadonet | masak: adventurer.... more returning from the dead | 20:04 | |
20:04
darutoko left
|
|||
huf_ | ofcourseit'sphp :D | 20:09 | |
takadonet | Was looking over jnthn jnthn.net/papers/2015-yapcasia-concurrency.pdf and was curious to know if there is thread safe variable? Saw the ability to have monitor and actor for thread safe method. No indication for variables. | 20:13 | |
20:20
TEttinger joined
|
|||
nine_ | takadonet: what would a thread safe variable look like? The concept seems strange to me since only actions have the time component that can make them thread unsafe. | 20:22 | |
perlpilot | perhaps he means shared and non-volatile? | ||
takadonet | perlpilot: yes | 20:23 | |
grondilu | m: role A {...}; dd class :: does A {}.new; role A {} # failed to pre-declare a role | 20:24 | |
camelia | rakudo-moar d6ed4c: OUTPUT«Use of uninitialized value of type Any in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in any try_select at gen/moar/m-Metamodel.nqp line 26015===SORRY!5=== Error while compiling /tmp/y3r1q3Qofm…» | ||
wamba | m: say [+] (0, 1 ...^ * > 4_000).grep: * %% 3 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«2667333» | ||
wamba | m: say [+] (0, 1 ...^ * > 4_000).race.grep: * %% 3 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«0» | ||
20:24
TungMay joined
|
|||
perlpilot | takadonet: I think the short answer is "yes, you can do that". I don't really have the long answer though. | 20:24 | |
takadonet | I am looping over an array of files and each iteration does some calculation and deposit its single result into an array. | ||
wamba | m: say [+] (0, 1 ...^ * > 4_000).race.map: {$_ if $_ %% 3 } | ||
camelia | rakudo-moar d6ed4c: OUTPUT«2667333» | ||
grondilu | m: role A {...}; class :: does A {}.new; role A {} # failed to pre-declare a role | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Use of uninitialized value of type Any in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in any try_select at gen/moar/m-Metamodel.nqp line 26015===SORRY!5=== Error while compiling /tmp/nKkDX1ZX__…» | ||
20:25
TungMay left
|
|||
grondilu | it's weird that there is a string context anywhere here | 20:25 | |
20:25
domidumont joined
20:26
cdg joined
|
|||
grondilu | I just wanted to put the definition of the role at the end of the file to keep things tidy. | 20:26 | |
I thought that was allowed. | |||
jnthn | The warning hides the real error | ||
===SORRY!=== Error while compiling -e | |||
No appropriate parametric role variant available for 'A' | |||
(when I do it locally) | |||
Feel free to RT the warning. But it's correct that you can't do that. | 20:27 | ||
grondilu | we can't predeclare roles? | ||
jnthn | You can but you must define them before you try to consume them. | ||
grondilu | ok | 20:28 | |
arnsholt | I assume the issue is that the composition of the role into the class requires the full role definition to work properly (detect method conflicts, for example) | ||
jnthn | `does` is compile-time composition, and class composition time is at the closing curly | ||
arnsholt | And since does is a compile-time directive, it's broken | ||
[Coke] | m: m: role A {...}; role A {}; class :: does A {}.new; | ||
camelia | ( no output ) | ||
arnsholt | Since the role body isn't available at that point, compile-time | ||
jnthn | And composing a role involves copying its stuff into the class at composition time, and conflicts etc. | ||
As arnsholt++ points out :) | |||
So yeah, that one's in the realm of "can't really work" rather than "doesn't work" | 20:29 | ||
patrickz | jnthn / TimToady: I try to solve #123934 and I think I need some guidance on what the expected behavior of Perl6 should be. | 20:31 | |
RabidGravy | but doing the same at run time works fine | ||
patrickz | m: say "asdfEnd" ~~ / :ratchet ^ [ .+? || z ] {say $/} End $ /; | 20:32 | |
camelia | rakudo-moar d6ed4c: OUTPUT«「a」「a」「a」「a」「asdfEnd」» | ||
patrickz | m: say "asdfEnd" ~~ / :ratchet ^ [ .+? | z ] {say $/} End $ /; | ||
camelia | rakudo-moar d6ed4c: OUTPUT«「a」Nil» | ||
jnthn | RabidGravy: As a mixin? Sure, 'cus you defined the role before runtime :) | ||
patrickz | [ || ] allows to be backtracked into in ratchet mode, while [ | ] does not. My gut feeling tells me the two should behave the same. | ||
RabidGravy | yeah, it was more about encouraging grondilu :) | 20:33 | |
jnthn | patrickz: Interesting...I think I'd have to defer to TimToady on that one, though :) | ||
patrickz | Ok. | 20:34 | |
.seen TimToady | |||
yoleaux | I saw TimToady 18:38Z in #perl6: <TimToady> "The whole world runs on hypocrisy." —my daughter | ||
20:38
leont joined
20:39
_mg_ left
20:40
khw joined,
_mg_ joined
|
|||
perlpilot | patrickz: why would [||] be backtracked into when ratchet mode is on? That doesn't make any sense to me. | 20:41 | |
20:41
domidumont left
20:42
zakharyas left
|
|||
perlpilot | patrickz: why would say "asdfEnd" ~~ /:ratchet [ xyz | .+! ] End /; match? | 20:42 | |
ab6tract | timotimo: so we were a bit surprised that overriding cmp and exporting it from our module did not cascade to lt/gt/etc | 20:44 | |
it's not such a big deal at all, just too used to 'use overload', maybe | 20:45 | ||
patrickz | perlpilot: From what I heard up to now, the opinions differ on what ratchet mode means. I'm still unclear if ratcheting means preventing giving up consumed input or going leftwards in the regex. | ||
m: say "asdfEnd" ~~ /:ratchet [ xyz | .+! ] End /; | 20:46 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Nil» | ||
timotimo | ab6tract: you do realize that lt and gt are strictly for string comparison? | 20:49 | |
20:49
confundus left
|
|||
perlpilot | my mental model has ":ratchet means : after every atom", so that makes sense | 20:49 | |
ab6tract | timotimo: i do realize that, but then... i didn't connect it to a different set of ops :) | 20:50 | |
what are the generic forms of lt/gt then? | |||
perlpilot | m: say "asdfEnd" ~~ / [ xyz: | .+: ]: End /; # should be the same | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Nil» | ||
20:50
unbound_delegate joined
|
|||
patrickz | say "asdfEnd" ~~ /:ratchet [ .+! ] End /; | 20:51 | |
m: say "asdfEnd" ~~ /:ratchet [ .+! ] End /; | |||
camelia | rakudo-moar d6ed4c: OUTPUT«「asdfEnd」» | ||
ab6tract | or is it that if we override leg we get our expected cascade? | ||
the use case is a class which has a $!literal-version and a $!normalized | 20:52 | ||
perlpilot | patrickz: that last one looks like a bug to me. | ||
ab6tract | the comparisons need to use the $!normalized, but we want Str to return $!literal-version | ||
patrickz | m: say "asdfEnd" ~~ / :ratchet ^ [ .+? || z ] {say $/} End $ /; # Do you also think this one is a bug? | 20:53 | |
camelia | rakudo-moar d6ed4c: OUTPUT«「a」「a」「a」「a」「asdfEnd」» | ||
timotimo | ab6tract: also, the operators can only work where they have been exported to ;( | ||
20:53
unbound_delegate left
|
|||
perlpilot | patrickz: I would | 20:54 | |
ab6tract | timotimo: yeah, that's not an issue in this case. but yeah, this is a bit of a super-sad face | ||
[Coke] | can we get yoleaux to switch back to "saw ... time ago" instead of <time>Z ? | 20:55 | |
teatime | hehe | 20:57 | |
patrickz | perlpilot: I'd be ok with making the [ || ] cases also fail. It's just that I'm not sure what the intended behavior is. I have heard opinions on both sides and have been sent to the authorities for a definite decision. :-) | ||
teatime | It is said, “Go not to the Elves for counsel, for they will say both no and yes.” | 20:58 | |
j/k | 20:59 | ||
perlpilot | patrickz: we'd all have to defer to TimToady :) But also, I think the language in S05 would need to be clearer too since my understanding comes from reading S05. | 21:00 | |
[Coke] | S05 ain't nothing but some notes. | 21:03 | |
perlpilot | then whatever the "official documentation" ends up being :) | ||
S05 is a a good first approximation for many concepts, unfortunately, it's the _only_ approximation for some of them. | 21:04 | ||
ZoffixWin | I think those who'll start programming with Perl 6 will have trouble grasping other languages: twitter.com/zoffix/status/722531566413594626 | 21:08 | |
21:08
leont left
|
|||
ZoffixWin | (from a JS tutorial: "// Some basic arithmetic works as you'd expect: .1 + 0.2; // = 0.30000000000000004" ) | 21:08 | |
TEttinger | ZoffixWin: how does perl 6 do floating point? | 21:10 | |
ZoffixWin | m: say 0.1 + 0.2 == 0.3 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«True» | ||
TEttinger | yes | ||
ZoffixWin | m: say 0.1.nude | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(1 10)» | ||
TEttinger | ah ok | ||
ZoffixWin | It's stored as a rat | ||
TEttinger | m: say pi.nude | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Method 'nude' not found for invocant of class 'Num' in block <unit> at /tmp/WprzVk11CW line 1» | ||
TEttinger | m: say pi | 21:11 | |
camelia | rakudo-moar d6ed4c: OUTPUT«3.14159265358979» | ||
ZoffixWin | It's not magical :) You still get the same problems in places, just not with 0.1 + 0.2 :) | ||
timotimo | m: say pi.Rat.nude; say pi.Rat(0.0000001e0).nude | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(355 113)(103993 33102)» | ||
teatime | TEttinger: by default, anyway; you have lots of options. | ||
TEttinger | well you could represent it as 314159265358979/100000000000000 | 21:12 | |
m: say 314159265358979/100000000000000 | |||
camelia | rakudo-moar d6ed4c: OUTPUT«3.14159265358979» | ||
ZoffixWin | That's not pi, though | ||
TEttinger | it's as much as pi knows here right? | ||
teatime | Rat is supposed to have 64-bit denominator... but it seems (usually) arbitrary-precision, currently. | ||
ZoffixWin | m: say pi.Rat.nude; say pi.Rat(1/100000000000000).nude | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(355 113)(80143857 25510582)» | ||
TEttinger | ? | 21:13 | |
ZoffixWin | hm | ||
m: say pi*100000000000000_00 | |||
camelia | rakudo-moar d6ed4c: OUTPUT«3.14159265358979e+16» | ||
ZoffixWin | Seems so | ||
m: say 80143857/25510582 == 314159265358979/100000000000000 | 21:14 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«False» | ||
21:14
ab6tract left
21:15
rindolf left
|
|||
ZoffixWin | teatime, oh and I've no idea about date stuff and I've no idea what that code you linked is about :) | 21:16 | |
timotimo | m: say 80143857/25510582 - 314159265358979/100000000000000 | ||
camelia | rakudo-moar d6ed4c: OUTPUT«2.65937562694571e-15» | ||
21:18
geekosaur left
|
|||
timotimo | my constant pi = 3.14159_26535_89793_238e0; | 21:18 | |
that's how it's defined in rakudo, btw | |||
when we get long double support, we may want to up the precision on that | 21:19 | ||
teatime | ZoffixWin: if you know what "unix timestamp" typically means, it's really really funny. take another look. | ||
ZoffixWin | I already closed that PM window. | 21:20 | |
teatime | well, really funny, anyway. | ||
21:20
geekosaur joined
|
|||
diakopter | TimToady: how would one make a constant pi with arbitary precision (the more digits you request, the more it refines it using the series expansion) | 21:20 | |
timotimo | diakopter: i suppose you'd mix a role into the pi Num that gives you better rationals in its .Rat | 21:21 | |
diakopter | *arbitrary | ||
21:21
hankache joined
|
|||
ZoffixWin | teatime, I give it 7/10 :) | 21:22 | |
timotimo | ZoffixWin: you know what the number a unix timestamp is means? then, how correct does it seem that the function "toUnixTimestamp" returns "YYYYMMDD000000" given a date? | 21:23 | |
21:23
unbound_delegate joined
|
|||
timotimo | i wonder if any unix timestamps coincide with their representation in that format when you chop off any initial digits and normalize the last six digits to zeroes | 21:25 | |
ZoffixWin | Right. I didn't even look at the function name. I thought the joke was all that messing about with mktime instead of tossing the dashes and appending the zeros :P | 21:26 | |
skids | it could be a holiday :-) | ||
ZoffixWin | Oh well... I don't judge. I have worse :) | 21:27 | |
ufobat | does anyone like, dislike or have a certain opinion on gist.github.com/ufobat/72aceef40b6...336d6be3e0 | ||
ZoffixWin | Like this: metacpan.org/source/ZOFFIX/Syntax-...SS.pm#L105 | ||
patrickz | Do RT accounts have to be activated in some way to allow to view bugs or reply to them? I'm basically locked out of all tickets as soon as I log in to bitcard. | ||
ZoffixWin | patrickz, not that I know of. | 21:28 | |
skids | patrickz: do you own any tickets? For several people including myself, you can only view your own tickets when logged in. | 21:29 | |
Unless you explicitly provide the number. | |||
patrickz | Seems to be the same for me. | ||
[Coke] | Yes, you need to be a bugadmin to interact with perl 6 tickets once logged in. | ||
patrickz | Is there a way to reply to bugs by email? | 21:30 | |
[Coke] | Anyone who wants to be a bugadmin, you're welcome to if you follow some simple guidelines. | ||
patrickz: yes. reply to them. | |||
if you don't have the existing ticket, someone can hook you up with the subject/to combination you'll need. | |||
ZoffixWin | Huh? So I'm a bugadmin somehow? I can reply to any ticket and view both p6 and p5 queues | 21:32 | |
patrickz | Coke: Can you close 127935? I accidentally created that ticket while trying to reply to another one.. | ||
21:33
skink joined
|
|||
[Coke] | Sure. | 21:34 | |
RT #127935 # closed | 21:35 | ||
patrickz | Thank you! | ||
21:35
hankache left
|
|||
[Coke] | ZoffixWin is not a p6 bugadmin. | 21:37 | |
you can see the queues. you just can't interact with the tickets, probably. | |||
ZoffixWin | [Coke], I was able to view and reply to this ticket this morning: rt.perl.org/Ticket/Display.html?id=127925 | ||
[Coke] | ZoffixWin: via the UI? | ||
ZoffixWin | Yeah, by going to rt.perl.org/ | ||
And clicking things | 21:38 | ||
[Coke] | weird. | ||
could you perhaps be a p5 bug admin? | |||
and their permissions are leaking? | |||
you're not on my list, though. | |||
patrickz | How long do email replies to tickets usually take to manifest in the webinterface? | ||
[Coke] | depends. if they're flagged as spam, someone has to release 'em | 21:39 | |
21:40
lizmat joined
|
|||
TimToady | diakopter: The problem with your question is the phrase "the more digits you request". It's easy enough to write a pi spigot, but how would you want to implement a lazy digits API in relation to existing types? | 21:40 | |
21:40
_mg_ left
|
|||
TimToady | In fact, RC has a pi spigit in P6 already, but at what point does a calculation know it wants "more precision"? | 21:44 | |
(rosettacode.org/wiki/Pi#Perl_6 if you want the link) | 21:45 | ||
21:45
leont joined
|
|||
ZoffixWin | no, I'm not a p5 bug admin. Thought my bitcard account is probably more than a decade old. Who knows what perms it got :P | 21:46 | |
s/Thought/Though/; | 21:47 | ||
21:47
vendethiel left
|
|||
diakopter | TimToady: I dunno, maybe using sprintf | 21:48 | |
(lololololz) | |||
21:49
unbound_delegate left
|
|||
[Coke] | ZoffixWin: yah, no clue. use your power responsibly, thank you! ;) | 21:52 | |
ZoffixWin | Will do! :D | ||
timotimo | diakopter: imagine every mathematical operation had to be expressed as a format string | 21:53 | |
or every reference to a variable had to have a precision specifier in its mention | |||
patrickz | TimToady: Can you have a look at my #123934 question above? | ||
[Coke] tries to find his roll of turing tape. | |||
timotimo | damn it, synopsebot. | ||
[Coke] | RT #123934 | ||
... more damns. | |||
is it smart enough to catch a bare #123 when it's here? | 21:54 | ||
timotimo | it is, yes | ||
you can try it out right now! | 21:55 | ||
21:55
synopsebot6 joined
|
|||
MadcapJake | How can I get a FILE pointer for stdout in native call? $*OUT and $*OUT.native-descriptor aren't solving it for me | 21:55 | |
I tried open($*OUT, :w) which works in Perl 6 but isn't working in NativeCall routines | 21:56 | ||
timotimo | well, you have to use a function that turns the fd into a FILE* | ||
MadcapJake | timotimo: what function? | ||
RabidGravy | fdopen | 21:57 | |
in C | |||
timotimo | No manual entry for fdopen in section 2 | ||
isn't that where c functions live? | |||
oh, it's section 3 | |||
that explains why i didn't find it! | |||
MadcapJake | section 2/3? what's that? | ||
RabidGravy | unix manpage | 21:58 | |
geekosaur | fdopen is the stdio library, not a syscall | ||
so section 3 | |||
MadcapJake | how do i access section 3? | ||
RabidGravy | linux.die.net/man/3/fdopen | ||
geekosaur | man 3 fdopen | ||
unless your'e on solaris then it's man -s3 fdopen | |||
MadcapJake | so you think if I pass it $*OUT.native-descriptor, that will create a FILE handle? | 21:59 | |
RabidGravy | no, I know it will ;-p | ||
MadcapJake | ok good! thanks timotimo RabidGravy! | 22:00 | |
timotimo | you need the red and blue security access keys to get to section 3 of the MAN complex | ||
be careful, a bugbear with a rocket launcher guards the blue one | |||
skink | timotimo, re: last night, there is ClassX::StrictConstructor which throws an exception if you attempt to assign a non-specific attribute | 22:01 | |
MadcapJake | O_O good thing I've got my Book of Camelian Spells & Native Calls | ||
skink | non-specified* | ||
RabidGravy | MadcapJake, gist.github.com/jonathanstowe/6561...cf6f9f47fa - is one I prepared earlier | 22:03 | |
timotimo | yup | 22:04 | |
i forgot about that one | |||
RabidGravy | anyhow that's me done for the day, toodles | ||
MadcapJake | RabidGravy: what's the termios? | ||
RabidGravy | don't worry about that | ||
MadcapJake | ok! worrying done | 22:05 | |
22:05
jjido_ left
|
|||
MadcapJake | very elegant File repr class! thanks RabidGravy++ | 22:05 | |
BooK | the final discussion with ab5tract was how maybe .Str and .gist could return different things | 22:08 | |
ZoffixWin | They do: | 22:09 | |
m: class Foo { method gist { 'gist' }; method Str { 'Str' } }; put Foo.new; say Foo.new | |||
camelia | rakudo-moar d6ed4c: OUTPUT«Strgist» | ||
22:10
RabidGravy left
|
|||
BooK | ZoffixWin: yes, exactly | 22:12 | |
so stuff like eq, cmp, etc would run throught Str, while "$obj" would go through gist, right? | |||
ZoffixWin | No, "$obj" would be .Str | 22:13 | |
BooK | arg | ||
ZoffixWin | AFAIK, only say calls .gist | ||
timotimo | oh hey master book | 22:14 | |
BooK | we figures that the difference with perl5 overload was that in p5 you define the behaviour of + when the object is on either side, while in p6, + just expects numbers and will call .Int | ||
hey timotimo | |||
timotimo | hm, not totally | ||
lizmat | BooK: prefix:<+> defined +foo | 22:15 | |
timotimo | you are free to supply variants of + that work on your custom class | ||
lizmat | infix:<+> defines foo + bar | ||
timotimo | but + is meant to add numbers and numeric things | ||
TimToady | patrickz: you do realize that if I get my brane back into regexland I'm likely to rewrite the whole parser? :) | ||
BooK | but then it needs to be loaded in the scope that will use those objects | ||
ZoffixWin | Right | ||
timotimo | so when you start overloading + to do string concatenation, we might get mad at you | ||
BooK | it does not simply follow the objects | ||
22:15
colomon joined
|
|||
timotimo | that is correct | 22:15 | |
BooK | whereas in perl5 it does follow the objects | 22:16 | |
ZoffixWin | m: class Foo { method Numeric { 40 }; }; say 2 + Foo.new; | ||
camelia | rakudo-moar d6ed4c: OUTPUT«42» | ||
BooK | tiny differences, I guess I'm frustrated because I still try to apply my p5 knowledge and expectations to this new p6 thing | 22:17 | |
timotimo | mhm | ||
BooK | new magic, old magic | ||
ZoffixWin gave up doing that long time ago :P | |||
lizmat | m: class A { has $.a = "foo" }; sub infix:<+>(A:D $a, A:D $b) { $a.a ~ $b.a }; say A.new + A.new | ||
camelia | rakudo-moar d6ed4c: OUTPUT«foofoo» | ||
timotimo | that's actually a gigantic difference | ||
22:17
colomon left
|
|||
BooK | I was still really happy, when I realized afterwards that I had been writing perl 6 (porting a p5 module) without really thinking about it | 22:18 | |
after ab5tract showed a few things to me, I just filled the gaps and wrote nice valid perl6 on the first try | |||
timotimo | oh | ||
patrickz | TimToady: Can I borrow you brane for a bit? I promise to return it unharmed (whatever that means for borrowed brains). | 22:19 | |
timotimo | that sounds nice | ||
TimToady | errands & # unfortunately, brane needs to transport itself elsewhere for a bit | ||
BooK | he forced me to rewrite some of my perl5 one-liners in like an actual block and everything | 22:20 | |
but to be honest, I had trouble remembering what my stuff did | |||
this is why we have libraries! to hide the ugly away from innocnent eyes | |||
22:20
ugexe left
22:21
bitmap left
|
|||
BooK | ($c) = ( 1, splice @v, -1 ) if $v[-1] eq 'GIT'; # before 1.4 | 22:21 | |
($c) = splice @v, -2 if substr( $v[-1], 0, 1 ) eq 'g'; # after 1.4 | |||
22:21
khagan left
|
|||
BooK | the lines that ab5tract didn't like :-) | 22:21 | |
he seemed to take issue with my 1-letter vars too | |||
cramming stuff in 80 columns with comment takes some sacrifice, right? ;-) | 22:22 | ||
my takeaway from the evening is: xx is pretty cool | 22:25 | ||
22:25
bitmap joined
|
|||
BooK | I think ab5tract was kinda frustrated by this manual page: docs.perl6.org/language/typesystem :-) | 22:26 | |
skink | What's that travis-like ci that's just for Windows? | 22:27 | |
22:28
khagan joined
|
|||
timotimo | appveyor | 22:29 | |
ZoffixWin | NOW I get why people say the P6 community is hugtastic 😂😂😂 i.imgur.com/4GwUggA.png | ||
skink | That's it, thanks timotimo | 22:30 | |
22:34
wamba left
22:36
Herby_ joined
|
|||
Herby_ | Afternoon, everyone! | 22:36 | |
o/ | |||
timotimo | hey Herby_ | 22:37 | |
i saw your tweet; was that with a perl6 module for tweeting? | |||
Herby_ | Yep! Using the zoffix's Twitter module | ||
22:38
kurahaupo joined
|
|||
Herby_ | Haven't played with it too much just, just copied the github example to send out a test tweet | 22:40 | |
just yet... I can't type today. | |||
ZoffixWin | Now I feel bad for it being a bare-bone tweet-only thing and not a solid and tested API implementation :P | ||
timotimo | oh, now i remember what i wanted to do with my particle system test code | ||
ZoffixWin | Should give it more attention on the weekend. | ||
Herby_ | I was contemplating creating something similar but I didn't even know where to start. Then I saw your module :) | 22:41 | |
grondilu | m: say ("foo", "bar" but role {}).MixHash<foo bar> | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(1 0)» | ||
grondilu was expecting (1 1) | 22:42 | ||
m: say ("foo" => 1, ("bar" but role {}) => 1).Hash<foo bar> | |||
camelia | rakudo-moar d6ed4c: OUTPUT«(1 1)» | ||
22:43
firstdayonthejob left
|
|||
patrickz is off to bed | 22:43 | ||
22:45
patrickz left,
lostinfog left
22:46
spider-mario left
22:47
mtj_ left
22:48
ugexe joined,
Xliff joined
|
|||
skink | ZoffixWin, Could add an optional param of a path to a media file and have it be uploaded with the tweet. I could see someone automating certain types of postings with that | 22:50 | |
Just a random idea, though. | 22:51 | ||
ZoffixWin | Yeah | ||
I kinda got distracted after the "look, I can Tweet with Perl 6" moment :P | |||
Xliff | MadcapJake, you there? | 22:54 | |
timotimo | holy wow | 22:56 | |
the framerate just went up 3x | |||
lizmat | timotimo: what did you do ? | 22:58 | |
23:01
ocbtec left
|
|||
MadcapJake | Xliff: yeah | 23:01 | |
Made some progress on MyHTML wrapper but I am in the midst of a large refactor now. | 23:02 | ||
23:05
mtj_ joined
|
|||
MadcapJake | all the NativeCall stuff will now be in HTML::MyHTML::Raw so you can choose to just use this part | 23:05 | |
then HTML::MyHTML and sub-modules will be high-level 6y interface | 23:07 | ||
I'll be back on later tonight Xliff | |||
MadcapJake is off to pizza buffet & | |||
23:08
au joined
|
|||
MadcapJake | (the complete-raw-transform branch is where the action is at) | 23:08 | |
Herby_ | mmm pizza | ||
23:08
agentzh joined,
petercommand joined
|
|||
MadcapJake | pizza is the best thing ever | 23:08 | |
23:08
sunnavy_ joined
|
|||
MadcapJake is really off now :) | 23:08 | ||
Herby_ | i concur | ||
\o | |||
timotimo | lizmat: use nqp::atpos and nqp::bindpos instead of .AT-POS | ||
23:08
BenGoldberg joined
|
|||
grondilu | m: say ("foo", "bar" but role {}).MixHash<foo bar> | 23:09 | |
camelia | rakudo-moar d6ed4c: OUTPUT«(1 0)» | ||
lizmat | timotimo: ah, yes, if you can do that, :-) | ||
grondilu | ^every time I write things in Perl 6 I encounter bugs like that. It's very LTA | ||
lizmat | timotimo: but that would not be very portable Perl 6 code now would it ? | ||
Herby_ | LTA? | ||
grondilu | "Less Than Awesome". See S99 | 23:10 | |
Herby_ | ahh | ||
23:11
_notbenh joined
|
|||
diakopter | timotimo: if the framerate went up [to] 3x, that means more than 66% of time was spent in those two routines?? | 23:11 | |
grondilu | I love perl6 but frankly it's very discouraging to spend so much time trying to figure out what I did wrong only to find out it's actually a bug. :( | 23:13 | |
TimToady | I don't think that's a bug | ||
grondilu | really? | 23:14 | |
TimToady | "bar" but role {} is a different object from "bar" | ||
grondilu | m: say ("foo" => 1, ("bar" but role {}) => 1).Hash<foo bar> | ||
lizmat | m: say +{} | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(1 1)» | ||
rakudo-moar d6ed4c: OUTPUT«0» | |||
grondilu | m: say ("foo", "bar" but role {}).MixHash<foo bar> | ||
camelia | rakudo-moar d6ed4c: OUTPUT«(1 0)» | ||
grondilu | Hash and MixHash should at least be consistent in that regard. | ||
TimToady | no, Hash is not an object hash, but MixHash is | ||
Xliff | MadcapJake, yeah. I pulled a couple of hours ago. Noticed new branches. | ||
TimToady | Hash coerces keys to strings | ||
Xliff | MadcapJake, anything I can help with? | 23:15 | |
TimToady | MixHash doesn't | ||
Xliff | MadcapJake, Right now I think origin/master has that dependency loop you were talking about, earlier. | ||
D'oh! Pizza. Missed that in the backlog. Now I'm jealous!! | 23:16 | ||
lizmat | m: say +("bar" but role {}) # perhaps we lose an error somewhere? | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5bar' (indicated by ⏏) in block <unit> at /tmp/_OD42AOviT line 1Actually thrown at: in block <unit> at /tmp/_OD42AOviT line 1» | ||
TimToady | why would it be coercing to numeric anywhere in the OP? | 23:17 | |
is it trying to do even/odd stuff? | 23:18 | ||
yes, the OP didn't have => 1 | 23:19 | ||
m: say <a a b>.BagHash.perl | |||
camelia | rakudo-moar d6ed4c: OUTPUT«("a"=>2,"b"=>1).BagHash» | ||
TimToady | m: say <a a b>.Hash.perl | 23:20 | |
camelia | rakudo-moar d6ed4c: OUTPUT«Odd number of elements found where hash initializer expected in block <unit> at /tmp/UHZUr4MppG line 1» | ||
TimToady | m: say <a a b>.Bag.perl | ||
camelia | rakudo-moar d6ed4c: OUTPUT«("a"=>2,"b"=>1).Bag» | ||
timotimo | diakopter: fwiw, i'm using a very big amount of AT-POS and BIND-POS. but replacing postcircumfix:<[ ]> with AT-POS and ASSIGN-POS manually already gave a tiny speed boost | ||
TimToady | except it's not doing even/odd for mixes or bags | ||
timotimo | diakopter: and there's a problem where moar won't optimize spesh-time-inlined things strongly that causes the result of bind pos to be boxed and returned even when we have a native array, so it also had a bunch of GC overhead | 23:21 | |
TimToady | so I think my original diagnosis is correct, it's just never gonna be able to lookup "bar" but role {} using a bare "bar" key | ||
because sets/bags/mixes use object identity, not value identity | |||
diakopter | m: say ("foo", 3, "bar" but role {}, 5).Hash<foo bar> | 23:22 | |
camelia | rakudo-moar d6ed4c: OUTPUT«(3 5)» | ||
ZoffixWin | m: my $h = ("foo", "bar" but role {}).MixHash; say $h{ 'bar' but role {} } | ||
camelia | rakudo-moar d6ed4c: OUTPUT«0» | ||
TimToady | it's a different object, still | 23:23 | |
apparently | |||
ZoffixWin | m: my $bar = 'bar' but role {}; my $h = ("foo", $bar).MixHash; say $h{ $bar } | ||
camelia | rakudo-moar d6ed4c: OUTPUT«1» | ||
ZoffixWin | TimToady++ # good diagnosis | ||
diakopter | m: 1 but role {} but role {} | ||
camelia | rakudo-moar d6ed4c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xo2kxA7cd0Only identical operators may be list associative; since 'but' and 'but' differ, they are non-associative and you need to clarify with parenthesesat /tmp/xo2kxA7cd0:1------> 031 but role {}7…» | ||
TimToady | but, but, but... :) | 23:24 | |
diakopter | wut wut | ||
tadzik: ^^ | |||
lizmat | m: dd ("foo","bar" but role {}).MixHash | ||
camelia | rakudo-moar d6ed4c: OUTPUT«("bar"=>1,"foo"=>1).MixHash» | ||
diakopter | TimToady: in my example above the lookup succeeded | ||
lizmat | m: dd ("foo","bar" but role {}).MixHash.keys | ||
camelia | rakudo-moar d6ed4c: OUTPUT«("bar", "foo").Seq» | ||
diakopter | oh, but MixHash | 23:25 | |
grondilu | m: say ("foo", "bar" but role { method WHICH { ~self } }).MixHash<foo bar> | 23:26 | |
camelia | rakudo-moar d6ed4c: OUTPUT«(1 0)» | ||
ZoffixWin | m: say 'bar' === ("foo","bar" but role {}).MixHash.keys.sort[0] | ||
camelia | rakudo-moar d6ed4c: OUTPUT«True» | ||
ZoffixWin | Does feel a bit buggish in this respect | 23:27 | |
TimToady | yes, === should require the same type | ||
so that should say False | |||
timotimo | diakopter: even with nqp::atpos_n and nqp::bindpos_n everywhere, i'm still getting 12.5% time spent inside the GC :\ | 23:28 | |
diakopter | timotimo: actually 12.5% isn't bad, unless you think it should be static state | 23:29 | |
timotimo | it'd be dreamy if it'd be static state | 23:30 | |
but all the arithmetic i'm doing ... not all of it is inlined properly, i'd bet. and superfluous boxing *everywhere* | |||
diakopter | static statist statistical state stasis | ||
timotimo | (is my guess) | ||
do you think you can get SDL2::Raw to work on your machine? because then i can just give you my code :) | |||
diakopter runs away screaming fire | 23:31 | ||
timotimo | i don't *really* understand why i'm getting calls to .Bridge in my arithmetic, for example. i'm trying to make everything i can use Num, and shouldn't we have candidates for + - * / on Num and Num? | ||
lizmat | m: use nqp; say nqp::unbox_s("bar" but role {}) # why "bar" === "bar" but role {} is True | 23:34 | |
camelia | rakudo-moar d6ed4c: OUTPUT«bar» | ||
lizmat | m: use nqp; say nqp::istype("bar" but role {},Str) # related | 23:35 | |
camelia | rakudo-moar d6ed4c: OUTPUT«1» | ||
skink | timotimo, Appveyor takes like half an hour per test o_o | 23:36 | |
Travis Linux 7min, OS X 14min, Appveyor Windows 32min | |||
timotimo | skink: windows boots slow :P | 23:37 | |
skink | No this is just for building | ||
VM creation/boot time isn't included | |||
23:37
cdg left
23:38
cdg joined
|
|||
lizmat | TimToady: are you suggesting all infix:<===> should have a nqp::istype(a.WHAT,b.WHAT) ? | 23:38 | |
TimToady | it should fall out of correct WHICH-ness | 23:39 | |
m: say "foo".WHICH | |||
camelia | rakudo-moar d6ed4c: OUTPUT«Str|foo» | ||
TimToady | m: say ("foo" but role {}).WHICH | ||
camelia | rakudo-moar d6ed4c: OUTPUT«Str+{<anon|77223360>}|foo» | ||
timotimo | *sigh*, replaced three / with nqp::div_n and got another sixth of performance extra | 23:40 | |
23:41
sue joined
|
|||
TimToady | m: say "foo" === ("foo" but role {}) | 23:41 | |
camelia | rakudo-moar d6ed4c: OUTPUT«True» | ||
TimToady | obviously === is not correctly comparing WHICH there, somehow | 23:42 | |
23:43
cdg left
|
|||
lizmat | TimToady: I just noticed that most infix:<===> *do* have a a.WHAT =:= b.WHAT test in there | 23:43 | |
23:43
tardisx joined,
rjbs left
|
|||
lizmat | just the Any / Str candidates didn't | 23:43 | |
spectesting that change now | |||
TimToady | it has always been the intent that === and eqv fail if types are not identical | ||
23:43
rjbs joined
|
|||
timotimo | diakopter: the thing ran for 1018 frames, which took 13669 ms, of which 160ms were spent doing the 304 garbage collections; a collection on every third frame ain't even that terrible | 23:44 | |
basically all of the collections took around 5.3 ms | |||
m: say 13669 / 1018, " ms per frame" | |||
camelia | rakudo-moar d6ed4c: OUTPUT«13.427308 ms per frame» | ||
lizmat | TimToady: will check all of the infix:<eqv> candidates as well | ||
timotimo | m: say 13.669 R/ 1018, " FPS on average" | 23:45 | |
camelia | rakudo-moar d6ed4c: OUTPUT«74.475090 FPS on average» | ||
timotimo | that's with 2000 particles on screen on every frame | ||
*and* running the profiler in the background | |||
lizmat | TimToady: if a mixed in role doesn't provide an altered .WHICH, the comparison would succeed | 23:46 | |
23:48
rjbs left
23:49
rjbs joined
|
|||
grondilu | I can't tell exactly why, but I feel there's something deeply wrong in the whole thing. For one, I find it silly that mixing an empty, anonymous role could change a variable in any way. I know it was still a dummy example, but still. | 23:49 | |
b2gills | say ("a" but role {}).^name | 23:50 | |
m: say ("a" but role {}).^name | |||
camelia | rakudo-moar d6ed4c: OUTPUT«Str+{<anon|75617728>}» | ||
lizmat | m: say 42 === 42 but role {} | ||
camelia | rakudo-moar d6ed4c: OUTPUT«False» | ||
lizmat | grondilu: that was the inconsistent part ^^^ | 23:51 | |
grondilu | ^ that is just dumb if you ask me | ||
lizmat | m: say "foo" === "foo" but role {} | ||
camelia | rakudo-moar d6ed4c: OUTPUT«True» | ||
lizmat | grondilu: well, that may be so, but that was TimToady's intent (at one point, anyway :-) | ||
grondilu | oh ok I had followed all the analysis | ||
*hadn't | 23:52 | ||
23:52
infina_ joined,
infina_ left,
infina_ joined
|
|||
grondilu | it so happens that in my original code it was an integer I was mixing, so maybe things will change tomorrow. I should get some sleep now anyway. | 23:53 | |
lizmat | grondilu: same for me | ||
the change breaks quite a few spectests, and makes one TODO pass :-) | 23:54 | ||
will look at it more in depth tomorrow | |||
23:55
kid51 joined
23:56
cpage_ left
|
|||
lizmat | good night, #perl6! | 23:58 | |
23:58
lizmat left
|