»ö« 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.
Voldenet u-ou: you could also do async code, more sane 00:07
and actually I think sync code in networking should die, really 00:08
telling the kernel 'where to go with the data' instead of 'write data here and continue the program' is more descriptive
because then the program can wait for multiple pieces of data
u-ou ok. where can I read about that? 00:12
Voldenet docs.perl6.org/type/IO::Socket::Async 00:13
if I understood correctly, you wanted socket programming, so basically it has examples of how it should work
u-ou thanks 00:14
Voldenet There are some things I don't know for sure yet though, like if using the pattern 'start react whenever $socket.Supply { .say }' is a good practice 00:15
(I use it to start multiple listeners and it mostly works) 00:16
(but there are pitfalls of error handling within start... so maybe there's better way to do this)
u-ou gtg 00:30
thanks
BenGoldberg m: enum Foo { bar }; sub baz( --> Foo ) { ... }; 00:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Type 'Foo' is not declared
at <tmp>:1
------> 3enum Foo { bar }; sub baz( --> Foo7⏏5 ) { ... };
BenGoldberg Derp, nevermind. 00:49
m: enum Foo ( bar => 0 ); sub baz( --> Foo ) { ... };
camelia ( no output )
BenGoldberg has C in his brain, and thus keeps expecting enum Name { ... } to work.
timotimo Voldenet: i'd really $socket.Supply.act({ .say }) instead of that 00:53
Voldenet timotimo: but then it works differently, right? 00:54
i mean the receiving thread will perform the operation
timotimo a little bit
that's the event thread, yeah
Voldenet and in my case a new thread will
timotimo you can also $socket.Supply.start({ .say })
Voldenet It's more expensive, but is able to scale multiple listeners
timotimo that's also a bit different
Voldenet since they'd be invoked concurrently 00:55
oh, what does .Supply.start(...) do, spawn a thread?
timotimo same as other "start"
it goes to the $*SCHEDULER and tells it to add a new work item
Voldenet hm, might be a better solution than start react
timotimo also, if you're doing stuff with async and such, you'll want "use 6.d.PREVIEW" on the top of your program 00:56
so you get non-blocking await
Voldenet oh, it'll start working like in js/C# now?
(generate the continuation and state machine per async/await method?) 00:57
timotimo not sure how it works in js
it uses continuations, but i don't know what you mean by state machine there
Voldenet well, C# and JS use the object to store the actual execution state along with the method invoked 00:59
timotimo well, that's just what a continuation is, isn't it?
Voldenet the object also stores all variables related to the execution scope
Yeah, pretty much.
timotimo yeah
it takes a continuation and passes control back to the scheduler
before 6.d it won't do that, so you'll be blocking a thread from the thread pool when you await something 01:00
Voldenet but the async function is converted into { switch(state){ case 1: ..., case 2: ..., etc. } } 01:00
timotimo yeah we have the benefit of actually being able to take proper continuations 01:01
timotimo except of course on the javascript backend 01:02
Voldenet hm, underneath it's probably still some kind of state machine though :) 01:03
timotimo um, yeah, duh :)
we have a long array of opcodes and we store the instruction pointer
except we don't have an up-front list of positions that are valid
so not quite like putting a switch/case around it
Voldenet ah, it makes sense, so IP is the /state/ in this case 01:04
but it's not very explicit state machine
timotimo unless of course you put in a switch/case for every byte offset and make more than 3/4 of them just behave absolutely chaotically
Voldenet yeah, switch/case looks a lot like a workaround against runtime 01:06
timotimo *shrug*, if the runtime can optimize it well, it's probably just fine 01:07
Voldenet also, can I somehow create a continuable method? 01:09
timotimo what, like with "take"? 01:10
committable6 timotimo, ¦like: «Cannot find this revision (did you mean “all”?)»
timotimo oh, thank you, committable6, but that's not helping
gfldex Voldenet: if you are fine that the method always returns a list, you can use gather/take
AlexDaniel wtf
I thought I fixed this
there's even a test for this
Voldenet hm, gather/take would work, but thught a bit of something like
gfldex did the bots get an AI upgrade?
AlexDaniel gfldex: not yet, but are you referring to “did you mean …” part? 01:11
Voldenet sub reentrable { do-something(); yield; do-something-second(); }; reentrable(); reentrable();
AlexDaniel c: ca924df2 say 42 01:12
committable6 AlexDaniel, ¦ca924df: «Cannot find this revision (did you mean “5ca924d”?)»
gfldex you can drop the returned item
timotimo you can make a trait that wraps a sub or method so that it handles return values, but you'll still need some way to kick it off so it continues work where it stopped
gfldex m: my method foo(){ gather { say "foo"; take Nil; say "bar" } }; my $a = 42; my $b = $a.&foo; $b = $a.&foo; dd $b 01:15
camelia foo
bar
Seq $b = (Nil,).Seq
gfldex m: my method foo(){ gather { say "foo"; take Nil; say "bar" } }; my $a = 42; my $b = $a.&foo; $b = $a.&foo;
camelia ( no output )
gfldex clever Rakduo is to clever for this task
Voldenet Hm, gather and take surely would work like a solution, but I dislike "take without parameters doesn't make sense"
:P
gfldex gather returns a Seq 01:16
so the fault is not really with take
timotimo just build a "sub yield { take Nil }" and you're done
Voldenet Now that's clever! :)
timotimo the trait i speculated above could take the Seq it gets from gather { } and wrap it in a class that pretends it's not about lists, but about coroutines 01:17
Voldenet Uhm, and it'd make sense in the context 01:18
timotimo anyway, it's bedtime for me 01:20
have a good one!
Voldenet well, time for me to go too, then, see ya 01:21
i'm tempted to fiddle around further and sacrifice sleep though ;)
AlexDaniel m: sub foo($a where /$<aa>=<[abc]>/, $b where /$<bb>=<[xyz]>/) { say $<aa>; say $<bb> }; foo ‘b’, ‘z’ 01:37
camelia Nil
「z」
AlexDaniel how can I make something like this work?
MasterDuke why does the second capture work but not the first? 01:59
AlexDaniel MasterDuke: because the first one is overwritten 02:00
geekosaur ^ 02:01
geekosaur you get one $/ that gets implicitly referenced by $<foo> 02:02
MasterDuke ah, right, of course
llfourn AlexDaniel: I wasn't aware that worked at all even for one.
AlexDaniel well, I know one way to do it 02:04
but I don't really like it
m: sub foo($a where /(<[abc]>) {} :my $aa = ~$0;/, $b where /(<[xyz]>) {} :my $bb = ~$0;/) { say $aa; say $bb }; foo ‘b’, ‘z’
camelia b
z
AlexDaniel llfourn: I can imagine your “wtf???” face right now xD 02:05
MasterDuke m: sub foo($a where my $aa = $a ~~ /$<aa>=<[abc]>/, $b where my $bb = $b ~~ /$<bb>=<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘z’ 02:06
camelia 「b」
aa => 「b」
「z」
bb => 「z」
AlexDaniel oh!
now that's much better!
AlexDaniel hm… or maybe not 02:06
AlexDaniel then $aa gets the whole match, not something I actually want 02:07
MasterDuke m: sub foo($a where my $aa = $a ~~ /<[abc]>/, $b where my $bb = $b ~~ /<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘z’
camelia 「b」
「z」
AlexDaniel oh, but then I can do $aa<foo>. Okay. That works
MasterDuke m: sub foo($a where my $aa = $a ~~ /<[abc]>/, $b where my $bb = $b ~~ /<[xyz]>/) { say $aa; say $bb }; foo ‘z’, ‘b’ 02:08
camelia (Any)
(Any)
AlexDaniel oops…
MasterDuke m: sub foo($a where so my $aa = $a ~~ /<[abc]>/, $b where so my $bb = $b ~~ /<[xyz]>/) { say $aa; say $bb }; foo ‘z’, ‘b’ 02:09
camelia Constraint type check failed for parameter '$a'
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
MasterDuke m: sub foo($a where so my $aa = $a ~~ /<[abc]>/, $b where so my $bb = $b ~~ /<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘z’
camelia 「b」
「z」
02:09
MasterDuke m: sub foo($a where so my $aa = m/<[abc]>/, $b where so my $bb = m/<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘z’ 02:10
camelia 「b」
「z」
MasterDuke nope
m: sub foo($a where so my $aa = m/<[abc]>/, $b where so my $bb = m/<[xyz]>/) { say $aa; say $bb }; foo ‘z’, ‘b’
camelia Constraint type check failed for parameter '$a'
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
MasterDuke m: sub foo($a where so my $aa = m/<[abc]>/, $b where so my $bb = m/<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘a’ 02:11
camelia Constraint type check failed for parameter '$b'
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
MasterDuke oh, typo locally, it does work fine 02:12
MasterDuke m: sub foo($ where so my $aa = m/<[abc]>/, $ where so my $bb = m/<[xyz]>/) { say $aa; say $bb }; foo ‘b’, ‘z’ 02:13
camelia 「b」
「z」
MasterDuke m: sub foo($a where so $a = m/<[abc]>/, $b where so $b = m/<[xyz]>/) { say $a; say $b }; foo ‘b’, ‘z’ 02:14
camelia b
z
MasterDuke nope
m: sub foo($a where so $a = m/<[abc]>/, $b where so $b = m/<[xyz]>/) { say $a; say $b }; foo ‘b’, ‘a’
camelia b
a
llfourn it would be cool if we could have some general way to extract the match from regexes in signatures. 02:16
llfourn it would be nice even for signatures in when statements 02:18
m: given ("foo","bar") { when :($ where /(.)o+/, $ where /(.)r/) { say $/ } } 02:20
camelia Nil
grondilu tries rosettacode.org/wiki/Evolutionary_a...thm#Perl_6 and is glad to see it got much faster than it used to. 02:29
AlexDaniel grondilu: how long does it take? 02:30
AlexDaniel just thinking that maybe we can feed it into benchable to see how much it improved 02:31
grondilu it takes a few seconds. I had never ran it all the way to the end. It used to take too long. 02:32
AlexDaniel e: gist.githubusercontent.com/AlexDan...0a/test.p6 02:34
evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
(signal SIGHUP) 0: 'SNHKTNAVFMCLECABDVPZFICTVRMV'
1: 'SNHKTNAVFRCLECABIVPZF CTVR…
AlexDaniel, Full output: gist.github.com/f2493ca09af0582f86...042259c3a9
AlexDaniel bench: releases gist.githubusercontent.com/AlexDan...0a/test.p6 02:35
benchable6 AlexDaniel, Successfully fetched the code from the provided URL.
AlexDaniel, starting to benchmark the 17 given commits
AlexDaniel well, probably won't work
yea, will time out
nevermind then
SmokeMachine does multi dispatch have performance problem? 03:00
mst this sounds like a question that is based on you observing something and guessing at what caused the something 03:02
mst have you considered asking the original question instead? 03:02
SmokeMachine mst: no...
I am trying to fix the hash multidimensional slice, and im abusing of it... 03:03
mst I mean, "does X have a performance problem" is basically a meaningless question anyway
SmokeMachine and i'd like to know if I should be using that so much...
mst lots of the internals seem to be based on multimethods
and I *think* it tries to resolve stuff at compile time where possible 03:04
but really the question is "is this sufficiently performant for this case"
which would require you benchmarking it against an uglier version
and also of course it might be the answer is "it's a bit slow right now, but the multimethod implementation is still better because it'll be fast enough shortly"
sorry. I don't really have any answers here, I just wanted to debug the question 03:05
samcv yay that is good to know 03:09
samcv m: "1F3F4 E0067 E0062 E0065 E006E E0067 E007F".split(' ')».parse-base(16).chrs.chars.say 03:09
camelia 1
samcv new emoji 5.0 Emoji_Tag_Sequence's for englad at least register correct number of characters 03:10
samcv will need to re-asses next month once the documentation itself is finalized 03:10
Geth whateverable: 2f44142079 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 5 files
Github no longer has .org domain

At least, it is no longer usable.
03:28
whateverable: e85320c533 | (Aleks-Daniel Jakimenko-Aleksejev)++ | t/committable.t
Slightly longer timeout for the test

Otherwise it flaps a bit
whateverable: f1f8840807 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
Make sure committable does not answer on “what,”

I've fixed this in the past, but no test was added. The result is predictable.
mst AlexDaniel++ # that commit message made me laugh 03:29
AlexDaniel :) 03:32
samcv you know what would be fun. having a poll on p6weekly and see what OS people use 04:25
TEttinger what: 05:01
committable6 TEttinger, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Committable
evalable6
bisectable6 TEttinger, On both starting points (old=2015.12 new=41ac4b4) the exit code is 0 and the output is identical as well
TEttinger, Output on both points: «»
TEttinger oh.
what what: 05:03
committable6 what, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Committable
evalable6
bisectable6 what, On both starting points (old=2015.12 new=41ac4b4) the exit code is 0 and the output is identical as well
what, Output on both points: «»
what m: say 'hi'
camelia hi
samcv what what what 05:06
what: what:
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/5pC0n1Ep4w
Confused
at /tmp/5pC0n1Ep4w:1
------> 03what:08⏏04<EOL>
expecting any of:
colon pair
bisectable6 samcv, On both starting points (old=2015.12 new=41ac4b4) the exit code is 1 and the output is identical as well
samcv, Output on both points: «04===SORRY!04=== Error while compiling /tmp/ny9OpEr_G1␤Confused␤at /tmp/ny9OpEr_G1:1␤------> 03what:08⏏04<EOL>␤ expecting any of:␤ colon pair»
committable6 samcv, ¦6c (17 commits): «04===SORRY!04=== Error while compiling /tmp/gnEDX6VXgG␤Confused␤at /tmp/gnEDX6VXgG:1␤------> 03what:08⏏04<EOL>␤ expecting any of:␤ colon pair «exit code = 1»»
samcv haha
what: sleep 10000000
evalable6 (signal SIGHUP) «timed out after 10 seconds» 05:07
bisectable6 samcv, On both starting points (old=2015.12 new=41ac4b4) the exit code is 0, exit signal is 1 (SIGHUP) and the output is identical as well
samcv, Output on both points: ««timed out after 10 seconds»»
committable6 samcv, «hit the total time limit of 180 seconds» 05:10
samcv thanks guys. you tried you best
ufobat aloah 07:13
pytuger my $greeting = "Hello ufobat"; $greeting.say 07:15
a lot of people are afk. please do not feel ignored
ufobat :D 07:17
samcv aloha ufobat 07:22
moritz \o 12:01
raschipi hey
moritz back in Germany, but not back at home yet
DrForr \n 12:02
lowbro what is this, a 1998 revival community? 12:18
DrForr \m/_
jast \r\n 12:19
lowbro i see :) 12:21
[Coke] now sees rn as cdn.collider.com/wp-content/uploads...tthead.jpg (but reversed) 12:58
Geth doc: cd136e7584 | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Language/faq.pod6
Small tweaks to FAQ about “good documentation”

Resolves #771.
Somebody beat me to it, but there were still some minor tweaks to make.
14:21
timotimo .seen leont 14:24
yoleaux I saw leont 14 Dec 2016 10:19Z in #perl6: <leont> Also, I'm clearly not awake since I should have converted the while in a for
pmurias what does the + in -> +lol {} do? 14:37
pmurias ahh it seems to be is raw for ones without sigils 14:38
geekosaur docs.perl6.org/type/Signature#Slur...Parameters 14:44
or more specifically docs.perl6.org/type/Signature#Type...Parameters 14:45
ugexe curt.tilmes.org/2017-GraphQL-PHLPM # was this ever posted to P6W? someone @work posted it in slack and I've never seen it 16:15
Voldenet "Perl 6 implementation still restricted access" 16:30
such tease
oh look, a nice framework, but not for you obviously :-) 16:31
daxim rakudo: use v6; grammar demo { rule TOP { <B> }; rule B { <A> 'x' 'y' | <C> }; rule A { '' | 'x' 'z' }; rule C { <C> 'w' | 'v' }; }; demo.parse('x z x y').say; demo.parse('v w w w w w w').say; 16:45
camelia (timeout)「x z x y」
B => 「x z x y」
A => 「x z 」
16:46
daxim second string hangs the program
please explain why
geekosaur daxim, because C is left recursive 16:52
the first thing it tries to do is parse a C
[Coke] hurls github.com/perl6/doc/issues/1084 for samcv if she wants it. 17:05
DrForr Say, does the semicolon in [1;2] have any formal name? 17:39
[Coke] m: say "\c[GREEK QUESTION MARK]" 17:40
camelia ;
DrForr Doesn't look it, I'll stick with 'Dimension Separator'.
Heh. Don't give me ideas :)
[ptc] was going to propose: "Dr Semicolon"
DrForr No relation to Dr. Feelgood. I *deeply* hope. 17:41
[ptc] No. However, in less formal situations she prefers to be called "Ms Semicolon" 17:44
DrForr Duly noted. 17:45
gfldex DrForr: the semicolon is the constructor of a semilist. The semicolon itself doesn't have a special name in this case, the list does.
DrForr Mmhmm, I found the description, nothing isnpiring there. 17:46
gfldex DrForr: see design.perl6.org/S09.html#The_semicolon_operator
DrForr *inspiring
I was just working on indentation and remembered that ';' can occur in multidimensional lists and loop(...) constructs. 17:47
DrForr rocks to /My {Sharona,Bologna}/. 17:48
Geth doc: 0ac09ee68e | (Zoffix Znet)++ | doc/Type/Method.pod6
Remove confused sentence

No idea what it even meant to say. lastcall *is* a sub; it does things when called. appears to? control statement? :shrug:
18:18
samcv [Coke], i think the color of the comments has already been changed since then? or maybe it hasn't. will have to check the git logs. may have been a while since it's been altered. 18:35
i forget
yeah looks like the contrast could be bumped up 18:37
DrForr Okay, design question. I"ve got Perl6::Tidy as a class, which currently has both an indent-style *and* current indent-depth. So along comes the .tidy() method that uses indent-style, and messes with indent-depth. When someone calls .tidy() again, I want a bulletproof way of cleaning out indent-depth, without having to remember to clear the other state variables. 18:57
DrForr *I've 18:57
El_Che zef install Terminal::ANSIColor -> Failed to find dependencies: nqp 18:58
mmm?
DrForr I could put the state in a dependent class, but then unless I copy in the stuff that comes in from the creator (and potentially forget) the dependent class has to reference stuff outside it. Thoughts? 18:59
Oh, make the child state stuff a dependent and rebless somehow. 19:00
El_Che (it's trivial to print in color, but it's handy when there)
Hi DrForr
DrForr %greeting<TZ>; 19:02
DrForr Feh, I'll just make it a separate class and make sure that the preinitialized stuff is required and has no defaults. Feels like useless copying though. 19:05
[Coke] El_Che: github.com/tadzik/Terminal-ANSICol.../META.info doesn't contain the string 'nqp', so it shouldn't depend on it
can you gist the whole output?
(/me fixes my network so I can try the install locally) 19:06
worked fine here, no errors.
El_Che [Coke]: gist.github.com/anonymous/5c0df6d2...acf5f50e57 19:17
[Coke]: I'll install the latest rakudo in the machine in question for in case it's a resolved bug 19:18
[Coke] I would update zef and your modules list.
El_Che yeah, I haven't run perl6 on this machine for a while 19:20
updating zef
[Coke] oh.
github.com/tadzik/perl6-Term-ANSIC...TA.info#L8 19:21
Missed that.
that's a bug, and should be removed (there's no reference to 'nqp' in the t/ folder...)
(and even if, nqp is a builtin)
El_Che yes, that what I thought 19:22
DrForr www.youtube.com/watch?v=8xKn9bk9JAk # Egads.
El_Che [Coke]: I'll change that in a fork to see how it goes 19:23
[Coke] .seen tadzik
yoleaux I saw tadzik 17 Mar 2017 17:58Z in #perl6: <tadzik> this channel wouldn't be the same without terrible puns
El_Che [Coke]: you linked to the old module (TERM) 19:25
El_Che [Coke]: no nqp in the new one github.com/tadzik/Terminal-ANSICol.../META.info 19:26
let's try with the zef update
failing tests there 19:27
that's better :)
I'll just print "\e" myself :) 19:28
[Coke] whoops, good catch 19:39
timotimo so ... do people on windows usually get a 64bit rakudo? 20:52
timotimo i guess they do 20:55
wine: Bad EXE format for Z:\home\timo\Downloads\gtk3-runtime-3.22.9-2017-03-09-ts-win64.exe. 20:56
>:(
El_Che m: grammar Word { token TOP { <word> }; token word { <<\w+>> } }; my $w = Word.new; $w.parse("one two")
camelia ( no output )
El_Che what the silly part of what I am doing? 20:57
I would have expected to match
timotimo you need subparse for you rcode to work
grammar matches are anchored to beginning and end 20:58
El_Che first time I hear of subparse
thx
DrForr .tell lizmat before I forget, Perl6::Tidy does primitive indentation. 21:15
yoleaux DrForr: I'll pass your message to lizmat.
lizmat . 21:20
yoleaux 21:15Z <DrForr> lizmat: before I forget, Perl6::Tidy does primitive indentation.
lizmat Cool! :-) 21:20
DrForr I'm not all that happy with the outer loop, but it lets me do stuff like 'when Perl6::Balanced::Exit and .content eq "}"{}' 21:22
tadzik I'm here now 21:50
lizmat tadzik o/ 21:56
tadzik o/
I see that ANSIColor has metabugs
Blimeo p6: say 4; 22:33
camelia 4
AlexDaniel m: say ‘hello!’ 22:33
camelia hello!
TimToady wonders what mode 4 is for the botnet... 22:35
AlexDaniel argh… this gumbo issue is really annoying 22:44
samcv AlexDaniel, how2customkeyboardmap 23:55
AlexDaniel samcv: I simply create my own file in /usr/share/X11/xkb/symbols/ 23:56
samcv can i see yours? 23:57
AlexDaniel samcv: gist.github.com/AlexDaniel/6e33353...859c25d539 23:59