»ö« 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.
[Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(->$a {}); $a.stderr.tap(->$a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"}\ 00:03
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3.exitcode { say "oops"} else { say "ok"}7⏏5\
[Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(-> $a {}); $a.stderr.tap(-> $a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"}\ 00:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3.exitcode { say "oops"} else { say "ok"}7⏏5\
[Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(-> $a {}); $a.stderr.tap(-> $a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"} 00:04
camelia Proc::Async is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
[Coke] if I run that locally, I get Unhandled exception in code scheduled on thread 6 00:05
Unhandled exception in code scheduled on thread 6 (and again on 7), and then two "no such file or directory".
[Coke] (I need the tap to avoid output when it *does* work, but having the tap when the command is bad dies) 00:12
Geth doc: 11609476f4 | (Will "Coke" Coleda)++ | xt/aspell.t
convert aspell.t to use Proc::Async

  …except in the initial aspell check because Proc::Async fails if you
try to tap a non-existant program's output
00:42
doc: ba421f17c5 | (Will "Coke" Coleda)++ | xt/aspell.t
make aspell.t respect TEST_THREADS
samcv my Final Grand Report is now up! cry.nu/grant-report/ 00:50
TEttinger wowza, just clicked your contrib graph samcv github.com/samcv 00:52
3450 is wow
samcv :)
Zoffix
.oO( lightweight :P )
00:53
[Coke] samcv++
TEttinger however, I did hit a 1200-day commit streak today 00:54
my contrib count is far less, 1230 this year 00:55
ugexe can default values be assigned to a hash parameter inside a signature somehow? 03:02
m: sub foo(%all [:$a = 1, *%_]) { %all }; say foo({ b => 2 }) 03:03
camelia {b => 2}
AlexDaniel m: sub foo(%all (:$bar=42, *%_)) { $bar }; say foo(%(foo => 90)) 03:10
camelia 42
AlexDaniel m: sub foo(%all (:$bar=42, *%_)) { $bar }; say foo(%(foo => 90, bar => 95))
camelia 95
AlexDaniel ugexe: like this?
m: sub foo(%all (:$bar=42, *%_)) { %all }; say foo(%(foo => 90)) 03:11
camelia {foo => 90}
AlexDaniel ah, I see
AlexDaniel that's a weird error message 03:15
m: sub foo(%all [:$a = 1, *%_]) { %all }; say foo({ b => 2 })
camelia {b => 2}
AlexDaniel not this one
m: sub foo(@all is copy ($a, $b, $c=3)) { @all }; say foo(<a b>)
camelia replace this Array is copy logic
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
thou m: say ' ' ~~ / ^ ' ' ** { 1 ^.. 3 } $ /; 05:03
camelia 「 」
thou m: say ' ' ~~ / ^ ' ' ** { 2 .. 3 } $ /;
camelia Nil
thou Shouldn't those two behave the same?
pmurias should I ask language designy question I have in regards to roast in here or in #perl6-dev? 06:56
pmurias the first one is that in the test we check that something like 3.base(10, 2**100) throws and OutOfRange exception 06:58
(rather than running out of memory or such a gigantic string working)
this seems implementation dependent 06:59
lizmat pmurias: #perl6-dev is probably a better place 07:10
teatime m: say ' ' ~~ / ^ ' ' ** { 1 ^.. 3 } $ /; say ' ' ~~ / ^ ' ' ** { 2 .. 3 } $ /;
camelia 「 」
Nil
teatime m: say ' ' ~~ / ^ ' ' ** 1^..3 $ /; say ' ' ~~ / ^ ' ' ** 2..3 $ /; 07:11
camelia Nil
Nil
teatime m: say ' ' ~~ / ^ ' ' ** 1^..3 $ /; say ' ' ~~ / ^ ' ' ** 2..3 $ /;
camelia Nil
Nil
teatime m: say ' ' ~~ / ^ ' ' ** 1^..3 $ /; say ' ' ~~ / ^ ' ' ** 2..3 $ /;
camelia 「 」
「 」
teatime m: say ~{1^..3} 07:12
camelia Block object coerced to string (please use .gist or .perl to do that)

in block <unit> at <tmp> line 1
teatime m: say ~(1^..3)
camelia 2 3
teatime hmm 07:13
lizmat clickbaits p6weekly.wordpress.com/2017/09/25/...-the-pool/ 07:18
tyil wow!
teatime is tyil a bot? 07:20
tyil no :(
w-why 07:21
teatime tyil: thought you were responding to a "clickbaits" command :)
teatime is obv. confused. what is wow-ing you at the moment?
tyil I wow-ed at the new p6weekly
it doesnt feel like a week passed
I didnt do anything last week that got in the weekly :( 07:22
sacomo hi all 07:27
tyil hi 07:28
sacomo is there a way to disable module exports without using export tags?
sacomo hi tyil, heard you were a bot 07:28
jk
tyil sacomo: ;~; 07:29
teatime heh, sorry tyil :) 07:31
tyil dont worry, I can handle it :p
sacomo I am looking to export a bunch of subs by default, but have an easy toggle to disable exports on demand 07:33
also, not sure if this means anything, but something like this: "use Foo :!DEFAULT" behaves like "use Foo :DEFAULT" 07:36
Zoffix thou, yeah, looks like a bug to me. Filed as rt.perl.org/Ticket/Display.html?id=132166 10:15
teatime lol, Zoffix I have been tracking it down for fun
but noticed just now it is already reported at rt.perl.org/Public/Bug/Display.html?id=130127 10:16
rakudo/src/core/Match.pm : method DYNQUANT_LIMITS 10:17
Zoffix Ok, thanks 10:18
teatime: so, you'll submit a patch to fix it? :) 10:20
teatime well, I kindof hit a knowledge-wall now, because I don't know what is OK to do there 10:21
Zoffix teatime: looks like anything, basically 10:22
teatime can you call Range.minmax or .int-bounds there
Zoffix Should be, yeah
Just keep this in mind:
m: say (2.2^..^6.5).int-bounds
camelia Cannot determine integer bounds
in block <unit> at <tmp> line 1
teatime yeah. but do non-int ranges need to work in regex quantifier? 10:24
Zoffix m: say "foo.txt".IO.extension: 1.1..2.2 10:24
camelia Cannot resolve caller extension(IO::Path: Range); none of these signatures match:
(IO::Path:D $: *%_)
(IO::Path:D $: Int :$parts!, *%_)
(IO::Path:D $: Range :$parts!, *%_)
(IO::Path:D $: Str $subst, Int :$parts = 1, Str :$joiner =…
Zoffix m: say "foo.txt".IO.extension: :parts(1.1..2.2) 10:25
camelia txt
Zoffix They work in other places, so why not
m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..^6.5
camelia Too few positionals passed; expected 3 arguments but got 2
in block <unit> at <tmp> line 1
teatime 'aa' ~~ / 'a' ** 1.1..3.3 /
m: say 'aa' ~~ / 'a' ** 1.1..3.3 /
camelia Nil
Zoffix m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..^6.5, 'Cannot use non-Numeric Ranges' 10:26
camelia (3, 5)
Zoffix Don't know how sane that method is due to its behaviour with Inf
m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..Inf, 'Cannot use non-Numeric Ranges'
camelia (3, 9223372036854775807)
teatime hmm. welp, I will give it a try after sleep. thanks for the tips. 10:30
Zoffix teatime: I see another bug with it:
m: say "xxxxx" ~~ /"x" ** { -5..-1 }/ 10:31
camelia 「xxxxx」
Zoffix It doesn't check whether -1 was its own doing or something that came from the Range
teatime there were several tickets about dynamic ranges
it feels pretty sketchy that DYNQUANT is doing so much work, logic I'd expect to be largely inside Range and/or wherever non-dynamic regex ** ranges are handled. 10:33
Zoffix Range itself is iffy. The whole stringy ranges thing should probably be burnt with fire and then Range split into int ranges and non-int 10:35
teatime heh, I had the same thought.
wictory[m] Is there a way to read lines from $*IN (or some other standard in method) using a supply. I want to use a react and setup an eventloop and do some other stuff concurrently while I read input from the user interactively
Zoffix wictory[m]: handles have .Supply method 10:36
wictory[m] I tried $*IN.Supply(:size<1>).lines, but it does not work satisfactory
Zoffix Ah, ok then, nevermind :)
wictory[m] When I look the process with strace, I see that it reads every line separately from stdin, but it does not seems to trigger the whenever 10:37
Zoffix wictory[m]: this appears to work fine for me: perl6 -e 'react { whenever $*IN.Supply(:size<1>).lines { .say } }' 10:38
samcv is there a way to turn a parsetree into a hash easily? 10:39
Zoffix & 10:39
wictory[m] Zoffix: that line does not read the input interactively for me. hmm 10:40
Zoffix: can it be that you have some newer version of rakudo ? :) 10:41
(my perl6 --version gives "This is Rakudo version 2017.08-108-g760530a52 built on MoarVM version 2017.08.1-150-g0b81969db 10:47
implementing Perl 6.c.")
sacomo hi all, is there a way to disable module exports without using export tags? 10:49
something like: use Foo :!DEFAULT 10:50
Zoffix sacomo: write `need Foo` instead of `use Foo` 10:55
Zoffix wictory[m]: don't recall anything specifically fixing that, though were have been some commits with IO. What do you mean "interactively" precicely? I type a line of text, press ENTER, the program displays it 10:56
sacomo ah, ok thanks. 10:57
Zoffix wictory[m]: if you mean receiving keystrokes as user types them, then I don't know why `.lines` is involved and you'd need to make the terminal non-buffering. There's Term::termios and Terminal::Print modules that can assist with that 10:57
sacomo Zoffix, thanks that is perfect.
wictory[m] Zoffix: I mean that when the user types a line and presses enter, the program should write it out. When I run the program you suggested, I type multiple lines and nothing happens, the program outputs when I end it with ^D. 11:00
Zoffix That's not the behaviour I'm observing: gist.github.com/zoffixznet/3154c55...fe1ae4468b 11:02
Try perl6 -e 'react { whenever $*IN.lines.Supply { .say } }'
Zoffix &&
DrForr Aah, every new hacker's *true* first bug hunt - learning exactly what's broken since the *last* time someone updated the installation manual for the core software. 11:06
wictory[m] Zoffix: this is my corresponding output gist.github.com/wictory/15309bfb3e...723c6bb609 when I exit with ^C, nothing comes out. I will update rakudo and check if anything changes... 11:35
wictory[m] Zoffix: with the new rakudo version, it works. Thanks for the help! 11:51
wander4096 gist.github.com/W4anD0eR96/4dafd14...4fe5c39228 12:02
i think they are almost run in the same way 12:03
but the p6 ver. spent a few minutes
while the py ver. spent under 1 second
did i write p6 code in a inefficient way? 12:04
or the efficiency of `set` is lack
jnthn set() is immutable in Perl 6, so it'll be doing the union operation and making a full copy each time. Maybe try replacing the lot with something like: my $set = set($text.lines.map(*.split(' ==> ')).flat) 12:08
wander4096 oh
that' it
that's it
dont know it is immutable 12:09
jnthn Though I'd probably write it $text.lines.map(*.split(' ==> '')).flat.unique if I didn't have other needs for the set
Wwithout the duplicated ', oops :) 12:10
lizmat jnthn: why did you put the .flat in there ? 12:17
timotimo because the keys and values, as it were, ought to get put into the set individually
jnthn .split returns a List, so without it we'd end up unique'ing the list of lists 12:18
timotimo i.e. a => b, c => d should turn into a, b, c, d 12:18
lizmat jnthn timotimo: ah, duh, /me would have probably slipped the result of the split 12:29
tbrowder ref travis: will specifying a specific perl6 version like 2017.NN speed up a travis run? 12:45
HoboWithAShotgun good day you lovely humans and bots 13:00
moritz m: say 0x2013.uniname 13:02
camelia EN DASH
moritz m: say 0x2014.uniname
camelia EM DASH
wander4096 gist.github.com/W4anD0eR96/e8356c8...62b42aa718 13:19
Too many positionals passed; expected 1 argument but got 2 13:20
wander4096 puzzled 13:20
it can be corrected in a hard way, but why
Zoffix m: class {}.item 13:21
camelia ( no output )
timotimo token doesn't require you to leave out psaces 13:21
Zoffix wander4096: the default Actions object is a Mu, and it has all the Mu methods, so your <item> token results in an attempt to call .item on that object and number of args doesn't match 13:22
m: class :: is Mu {}.item: 'meows'
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
Zoffix There's a ticket for it, but I couldn't find an easy way around it. As soon as you make it something less than a Mu, it refuses to fit anywhere 13:23
wander4096 i think i can rename `item'
Zoffix This one rt.perl.org/Ticket/Display.html?id...et-history
wander4096: and the other fix would be providing an Actions object that implements `item`, though, I think renaming it is more robust :) 13:24
wander4096 sure >_< 13:25
thank you
Zoffix
.oO( make default Actions object a speshul class and don't check its methods at all... )
13:26
mspo where is MP_GEN_RANDOM_MAX supposed to come from? 14:11
timotimo from inside libtommath 14:13
mspo thanks 14:14
timotimo all MP_ and mp_ stuff lives there
mspo ugh WTFPL 14:15
mspo looks like I just needed to upgrade that to 1.0.1 14:28
skids gist.github.com/skids/08245ef93cf4...a78afe2a10 <== What magic ingredient am I missing here? 15:04
timotimo now i'm interested how good the better version of wander4096's set code got by writing it with split, flat, unique? 15:58
robertle in the MAIN() type of cmdline arg parsing, how can I handle a named argument that may appear multiple times? 16:02
ilmari $ perl6 -e 'multi sub MAIN(:$foo) { $foo.say }' --foo=42 --foo=37 16:09
[42 37]
robertle: like that?
robertle yes, but I thought I had tried that... 16:12
$ perl6 -e 'multi sub MAIN(Str :$foo) { $foo.say }' --foo=42 --foo=37 16:13
ilmari add a multi that takes a List
$ perl6 -e 'multi sub MAIN(Str :$foo) { say "gone one ", $foo }; multi sub MAIN(List :$foo) { say "got many ", $foo }' --foo=42 --foo=37
got many [42 37] 16:14
robertle right! makes sense now
thanks!
Zoffix Or don't add a `Str` type constraint 16:20
robertle Zoffix: yeah, that's what I am doing now. and that also makes it understandable... 16:21
ugexe is it possible to enter a non-Str type via MAIN / commandline anyway? 16:36
ilmari Int works 16:38
ugexe its an IntStr
Bool maybe
ilmari $ perl6 -e 'multi sub MAIN(Int :$foo) { say "gone one ", $foo }' --foo=wibble 16:38
Usage:
-e '...' [--foo=<Int>]
ugexe what i mean is declaring Str :$foo is pointless 16:40
mst except possibly as a hint that it's a plain string 16:41
ugexe because everything passed is a FooString
Zoffix We have the enum processor
mst though in that case maybe you'd want a named subtype for clarity
ilmari ugexe: no, String :$foo means you can only specify it once 16:42
ugexe ah good point
Zoffix m: @*ARGS = "Purr"; enum Meows (Purr => 42); sub MAIN(Meows $x) { dd +$x } 16:43
camelia 42
foo3 I think I hit a bug: typing "Rat.^roles" into the REPL eats all memory until OOM. tested on windows and linux with rakudo / moarvm 2017.07 17:04
Zoffix Looks to hang in non-repl too 17:05
bisect: Rat.^roles 17:06
bisectable6 Zoffix, Bisecting by exit signal (old=2015.12 new=c9f1e05). Old exit signal: 0 (None)
foo3 it doesn't just hang, the OOM rendered my ubuntu unresponsive, so take care :) 17:07
Zoffix :)
bisectable6 Zoffix, bisect log: gist.github.com/c103a4d077d3999e71...3e6cfdd293
Zoffix, (2017-06-29) github.com/rakudo/rakudo/commit/41...a245336715
ilmari did a 'ulimit -v $((128*1024))' first
ilmari presumes bisectable6 has sensible resource limits in place too 17:07
foo3 yeah presumably. just saying tho :D 17:08
Zoffix Can someone restart hack? I don't have access to a box that both has a GUI to run virt-manager and key added to root users
timotimo hold on 17:11
wander4096 how can i get a element in Math::Matrix 17:11
Zoffix foo3: I think I see a fix. Gonna try it out after I push the current commit I'm working on 17:12
wander4096 given `$A = Math::Matrix.new([[0,1,1,0], [1,0,0,1], [1,0,0,1], [1,1,0,0]])', is there something like $A[0][1]? 17:13
foo3 Zoffix: sure, just wanted to let you know. is there an official place to report bugs btw? or is irc cool?
timotimo hack is booting back up now
Zoffix huggable: rakudobug
huggable Zoffix, Report bugs by emailing to [email@hidden.address] See also: github.com/rakudo/rakudo/wiki/rt-introduction
foo3 ty 17:13
timotimo wander4096: hey, how did the script with the ==> turn out when you used the .flat.unique thing? 17:13
Zoffix foo3: ^ that is it. IRC is OK if some dev sees it and says they'll take care of it right now; otherwise, there's a good chance it'll get missed or forgotten :)
timotimo i mean how much slower was it than the python code? 17:14
wander4096 3s
while py 0.8s
Zoffix wander4096: what's the code?
foo3 Zoffix: that's what I was thinking, hence the question. ty :)
Zoffix I tried going to your gist, but it was already deleted
wander4096 wait a minute
Zoffix Also a perf fix just went in that affects all chainable ops. Dunno how much impact it has tho 17:15
Zoffix OMIGAWD! Run for your lives! That hobo's got a shotgun! 17:17
foo3 hides
timotimo runs
timotimo Zoffix: the code was more or less "path".IO.lines.map(*.split(" ==> ")).flat.unique.elems or something 17:18
well, teh old code was a for loop doing $set (|)= $x; $set (|)= $y with my ($x, $y) = .split(' ==> ');
that with in there was not syntax
Zoffix And what's the input? Do all lines just have one ==> ?
timotimo i assume so 17:19
the python code also only has x, y in there for holding the results of split
wander4096 timotimo: gist.github.com/W4anD0eR96/9833049...de81ee96e9 17:19
timotimo the other version spent a few minutes, yeah? 17:20
wander4096 the raw file `acl.txt' is more than 120000+ lines
right
in form `P12-1040 ==> W99-0201' each line 17:21
Zoffix wander4096: what's sample input I can try out this with?
timotimo i wonder if the file is basically columns, and two substr calls would be even faster 17:22
wander4096 how can i share a file?
Zoffix wander4096: just copy-paste it into a gist 17:23
timotimo you can also put it into the gist, worst case you use the git clone for that
wander4096 gist.github.com/W4anD0eR96/49c4063...cccb74a4df 17:25
wander4096 over 120000 lines, maybe open a bit slowly 17:25
Zoffix wget gist.githubusercontent.com/W4anD0e...1d/acl.txt
wander4096 timotimo: nearly
wander4096 timotimo: but few special case don't fit 17:26
timotimo right
i wonder how .split(["\n", " ==> "]) would do
instead of .lines.map(*.split(...))
wander4096 oh 17:27
timotimo that would also get rid of the need for .flat 17:28
Zoffix wander4096: this version makes it 2.3x faster: say "/tmp/opt/acl.txt".IO.slurp.split(["\n", ' ==> ']).unique.elems; 17:29
wander4096 it does 17:30
timotimo nice. 17:31
so rather close to the python code 17:32
MasterDuke and if/when this github.com/MoarVM/MoarVM/pull/705 gets merged the slurp itself might get a bunch faster
timotimo while being a bit shorter, too
timotimo AFKBBL
wander4096 clever and, hopeful :) 17:33
Zoffix oh wait 17:34
wander4096: this version makes it 5.2x faster than original: say "/tmp/opt/acl.txt".IO.open(:nl-in["\n", ' ==> ']).lines.unique.elems; 17:35
just tells the VM to use your splitter chars as line dilimiters 17:36
s/chars/strings/;
kyan Huh, that gist page is kinda slow to load in my Firefox... I guess that kind of thing is why I shouldn't have like 40 addons installed, heh 17:37
good old less handles it just fine though
Zoffix kyan: slow for me too. You could use the `wget` line I pasted to just download that file raw
kyan Yeah, i'm just a sucker and wanted to see how it performed :3 17:37
wander4096 0.971s total 17:38
Zoffix m: say .971/.8 17:38
camelia 1.21375
Zoffix So 20% slower than python
kyan The mostly text-based Links browser opens the page pretty much instantly 17:38
wander4096 i use linux command `time', so it may be faster 17:39
Zoffix timotimo++ # I can now login to hack 17:43
tyil kyan: links is amazing 17:45
AlexDaniel ilmari: “presumes bisectable6 has sensible resource limits in place too” – actually… not really 18:09
ilmari: but so far it had more resources than rakudo can possibly eat in 10 seconds 18:10
at least typically
Zoffix c: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" xx 9999999999 18:11
committable6 Zoffix, ¦"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx": «Cannot find this revision (did you mean “HEAD”?)»
Zoffix c: HEAD "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" xx 9999999999 18:12
committable6 Zoffix, ¦HEAD(6ec21cb): «»
Zoffix heh ok then :)
c: HEAD use NativeCall; sub fork is native {}; fork while 1
AlexDaniel is interested to see what's going to happen
Zoffix oops :} 18:12
AlexDaniel did it OOM kill the whole bot instead of killing just the eval process? 18:13
masak .oO( needs more nice(1) )
Zoffix I think it forkbombed the whole box. I can't ssh into it
AlexDaniel bisectable6: help 18:14
bisectable6 AlexDaniel, Like this: bisectable6: old=2015.12 new=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # See wiki for more examples: github.com/perl6/whateverable/wiki/Bisectable
Zoffix Nice going, Zoffix!
huh, ok, nevermind :)
AlexDaniel but bisectable6 is still working?
but I can't ssh also… :)
Zoffix lol
moritz pro tip: run it as a separate UNIX user, set up resource limits
AlexDaniel I'm suspecting it'll take a few seconds to swapoff the required things, maybe
moritz even easier with systemd 18:15
AlexDaniel moritz: volunteers welcome :) 18:15
raschipi With systemd there's no need to set up a user for limits, it does it wih cgroups
mst ulimit works pretty well if you're still running a unix-like system
AlexDaniel or if somebody can point me to whatever is needed to do it with systemd, I can maybe do it myself right now 18:16
moritz AlexDaniel: this is the systemd file for camelia: github.com/perl6/evalbot/blob/mast...a@.service 18:17
moritz it's templated (so @ in the name and %i inside the config file) because you can have multiple instances (on for each IRC server) 18:18
you might not need that
AlexDaniel maybe I need that so that I can have 1 file for all bots
AlexDaniel bisectable6: I don't get it, you're on the same server, right? 18:19
AlexDaniel bisectable6: help 18:19
ok
moritz www.freedesktop.org/software/syste....exec.html has some stuff about how to set various limits 18:20
Zoffix ZofBot: I guess that means I got myself on the kill list when the robot uprising occurs, eh?
AlexDaniel also looks at systemd-nspawn 18:21
Zoffix \o/ 18:22
Zoffix How to tell parametarization params in a role? I just wanna take a look at 'em 18:24
m: dd class :: does Rational[UInt, UInt] {} 18:25
camelia <anon|63793344>
Zoffix how to see?
Zoffix Ah, ok, .^roles does show. Got it 18:26
Zoffix um 18:29
m: role Foo[::A, ::B = Int] {}; Foo[Int].new.^roles.say
camelia ((Foo[Int]))
Zoffix It doesn't show the ::B's value.
Zoffix m: role Foo[::A, ::B = ::A] {}; 18:35
camelia ( no output )
Zoffix This doesn't compile in core :/ says no such symbol A
Xliff Zoffix: Parametized roles? 18:38
haxmeister pastebin.com/9ewun504 18:38
Xliff (Perl6's templates, I presume?)
haxmeister installing modules continues to be a confusing issue for me :/ 18:40
Zoffix haxmeister: the error message say "501 Protocol scheme 'https' is only supported if IO::Socket::SSL is installed"
zef install IO::Socket::SSL
timotimo haxmeister: GTK::Simple downloads gtk DLL files from our server when you're on windows 18:41
Zoffix Xliff: yeah, I wanna know what the parameters were
haxmeister Zoffix: thank you, your always so helpful
Zoffix \o/
haxmeister timotimo: I seen that after going through the mess of installing GTK the other way..lol 18:42
Xliff Zoffix: Yes, I got that, but I was trying to think how to do that, and you have just shown me.
Zoffix Ohhh...
m: my role Irrational[::NuT = Int, ::DeT = ::Nut] does Real {}
camelia 5===SORRY!5=== Error while compiling <tmp>
No such symbol 'Nut'
at <tmp>:1
------> 3le Irrational[::NuT = Int, ::DeT = ::Nut7⏏5] does Real {}
timotimo oh, you mean the gtk installer that exists somewhere?
Zoffix m: my role Irrational[::N = Int, ::DeT = ::N] does Real {}
camelia ( no output )
Xliff Although most of the reasons I would use templates in C++/Java aren't really necessary in perl6
Zoffix Looks like it's matching just for single letters
timotimo m: my role Irrational[::NuT = Int, ::DeT = ::NuT] does Real {} 18:43
camelia ( no output )
timotimo Zoffix: you just typo'd
Zoffix Oh god. I need to start wearing glasses
timotimo++
timotimo yeah, i wear glasses, so i was able to spot that %)
haxmeister timotimo: they have instructions on their website which include installing a terminal emulator and using pacman
Zoffix :D
Xliff So what was the typo? :p 18:44
(And I am wearing my glasses)
Zoffix Xliff: Nut vs. NuT
timotimo Nut instead of NuT
Xliff *snork* 18:44
haxmeister Zoffix: pastebin.com/7VQLs83h 18:47
Zoffix Hm, it still doesn't like me:
$ ./perl6 -e 'Rational.new.^roles.say' 18:48
Internal error: inconsistent bind result
m: my role Irrational[::NuT = Int, ::DeT = ::NuT] does Real {}; Irrational[Int].new.^roles.say
camelia ((Irrational[Int]) (Real) (Numeric))
Zoffix Yet works fine here :/
timotimo haxmeister: that's a problem with the PowerShell code in there, but it should work? :\
kyan moritz: Sorry to bother you, but I wanted to check — did my emails get through? Thanks. :) 18:49
haxmeister I dunno... probably works fine at home on my linux machines
moritz kyan: yes; sorry, I wasn't very responsive yet :/ 18:54
kyan no worries! Just wanted to make sure it didn't get eaten by a hungry computer somewhere
Thanks :)
Zoffix m: role Irrational[::NuT = Int, ::DeT = NuT] does Real { method new(NuT \nu = 0, DeT \de = 1) {self.bless} }; Irrational.new.^roles.say 19:02
camelia Internal error: inconsistent bind result
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix Any idea how to fix that? 19:03
m: role Irrational[::NuT = Int, ::DeT = ::("NuT")] does Real { method new(NuT \nu = 0, DeT \de = 1) {self.bless} }; Irrational.new.^roles.say 19:04
camelia ((Irrational) (Real) (Numeric))
Zoffix Thanks!
^_^
Dunno if the first version is a bug; filed as rt.perl.org/Ticket/Display.html?id=132169 19:07
AlexDaniel heh, local online supermarket has 0€ shipping promotion today. Ordered a banana for 0.14€. Then also an apple and an onion. All scheduled on separate days. 19:21
Zoffix Marketing department: "OK, we clearly should never run a 0€ promotion again" 19:22
moritz reminds me of when Microsoft announce OneDrive without capacity limits 19:24
and some asshole put multiple Tera or even Peta bytes in his account in the first few weeks, permanently ruining it for everybody 19:25
(and yes, they couldn't have kept this up for free, I know...)
Zoffix :) 19:26
moritz but what everybody[tm] knows is that you only give out free stuff if it's either dirt cheap, or linked to a min required amount, or in any other way effectively limited 19:28
or limited total amount of free stuff, or "at our discretion"
AlexDaniel I'm estimating that it costs them 4€ or so per delivery, so my fun is only 12€ worth
moritz AlexDaniel: I'm not hold that little fun against you, just reminiscing the bad auld days :-) 19:29
I also wonder how many others do the same :-) 19:30
(get free shipping for cent totals)
AlexDaniel all it takes is 1 person posting about it on facebook and there will be hundreds… 19:31
moritz AlexDaniel: what you really need to do is write something like "Send me a screenshot of ordering free delivery with a total of less than USD 1, and I'll send you a free sticker" 19:34
or make it a contest: what's the cheapest item you can find? send a screenshot of your order confirmation! 19:35
skids
.oO(this is why we can't have nice things.)
19:36
AlexDaniel skids: normaly they have free delivery for orders over 40€. That's nice enough. 19:37
audiatorix If I .tap several supplies (which are grepped from a "parent" supply), what thread or threads will each one be run on? 21:32
the handler, that is 21:33
jnthn In absence of something introducing concurrency, then the thread that emits the value 21:36
audiatorix Hmm okay, that was sorta my worst case scenario. What's a good way to parallelize that? 21:37
I suppose the handler could return a promise 21:38
Wait, nevermind--the handler doesn't need to return anything 21:40
what am I thinking
jnthn Supplies are primarily a tool for taming, not introducing, concurrency
HoboWithAShotgun what do you guys think of this ( hastebin.com/zipepodape.rb ) interface? can you immedeatly tell me what the code does? 21:41
gfldex m: constant b = -> $s { say "$s‽" }; sub s(&c){ c 'oi' }; s(b);
camelia oi‽
jnthn Though there are ways to introduce it too. For example, .schedule-on($*SCHEDULER) will shuffle execution of the rest of the stuff chained after it onto the thread pool 21:42
A Channel may also help; the sender just pays the (very low) cost of sticking a value into the queue, and then another receiving thread (or multiple threads) can obtain the values 21:43
And then do the processing there
audiatorix Hmmm
Yeah, that does seem a bit more like the behaviour I want 21:44
And I could call .Supply on the channel and then tap it just like I'm doing now, but the emitting (sending) thread won't block? 21:47
jnthn There's a few options
That's one of them
jnthn If you want to dedicate a thread to processing the values then you can also do something like start for $channel.list -> $value { } 21:48
audiatorix That still doesn't really introduce concurrency, though
My solution, I mean
jnthn Do you want concurrent processing of the emitted values?
audiatorix Yeah, that's the goal 21:49
jnthn Or just want to process them off the sender?
Oh
audiatorix Well, both really
So obviously a Channel will need to be involved
HoboWithAShotgun take a step back, a deep breath and describe the actual problem :)
jnthn Well, there is another way now I understand you want parallel processing of values too, which is to use the .start method on Supply
Which basically schedules the processing on the thread pool 21:50
audiatorix Sorry for being vague about it
jnthn You then end up with a Supply of Supply
You might find it more comfortable to write it like
start react {
whenever $the-supply { 21:51
whenever start do-work($_) { ... process result if needed here ... }
}
and write sub do-work that does the work
That way you'll get errors handled correctly and stuff
(In general, prefer the react/supply + whenever block syntax over calling .tap) 21:52
HoboWithAShotgun in sight of the Internet of Shit, errm, Things, i am sure we will see a wherever keyword soon 21:53
audiatorix Okay, I see what you mean 21:55
By the way, are you Jonathan Worthington? 21:56
jnthn Yes
audiatorix Wow
Your talks are great
jnthn Glad you enjoy them :)
HoboWithAShotgun I envy you for having been in asia so often 21:57
did you ever sleep in one of those coffin hotels? 21:58
jnthn No, didn't (yet :)) do that 21:59
HoboWithAShotgun i am writing a little terminal based widget system, jnthn, to build uis with 22:03
timotimo HoboWithAShotgun: that looks neat
oh, i was scrolled one page up 22:04
jnthn It works for the latest too :) 22:04
HoboWithAShotgun i'm still here :)
the latest?
audiatorix What would it look like if I were to use .start?
jnthn HoboWithAShotgun: Is it in the ecosystem yet, or not ready for that yet? 22:06
timotimo m: Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT });
camelia ( no output )
jnthn audiatorix: $the-supply.start(&the-thing-to-do-per-value).flat.tap or so
timotimo m: await Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).head(5);
camelia ( no output )
timotimo m: react whenever Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).head(5) { }; 22:07
camelia ( no output )
jnthn timotimo: .start returns a Supply of Supply
HoboWithAShotgun it's not even written :) that's just a mockup of the interface
timotimo oh, i should whenever the result inside then
jnthn timotimo: Try .flat
timotimo m: react whenever Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).flat.head(5) { };
jnthn That'll make sure the errors get propagated out
camelia 0.0817190
0.1949666
0.2880887
0.39119071
0.48389776
0.58691915
0.68995390
0.78270783
0.8858456
0.98890416
0
1.0857346
1.08650834
1.18233746
1
1.19585490
1.2824913
2
1.2891061
1.3827881
3
1.39211376
1.4827730
jnthn As well as results :)
There we go
HoboWithAShotgun i have two problems, more colors than ansi and detecting keypress like alt_key_down 22:09
audiatorix .flat would not be necessary if the results did not matter, right 22:09
Reactions to the values being passed down will be passed back up in a different way 22:10
jnthn audiatorix: Potentially not, but be careful; not doing it will result in errors being dropped on the floor 22:11
So if you're handling the erorrs yourself also then you're OK I guess :)
audiatorix Ah! I just thought of an excellent way to restructure system and make the issue of concurrency more straightforward 22:20
the system*
jnthn Simplifications are nice :) 22:24
Sleep time for me, 'night all o/ 22:25
timotimo gnite jnthn :)
tbrowder hi, #perl6 23:11
anyone around that can help debug a p6 cgi script?
tbrowder ok, if anyone is interested, leave me a msg via .tell, bye 23:13
tbrowder ref: unit class 23:30
timotimo tbrowder: it's difficult to get excited about cgi scripts :) 23:31
can you give a bit more detail?
tbrowder we can package a class
well, i think the problem may be something else. i have a module, CGI, which is in file CGI.pm6, and the top of the file has the line...having trouble with my keyboard. 23:34
timotimo: let me put all this in a gist and tell you about it tomorrow. story too long...better in a gist. will you be here tomorrow? 23:35
timotimo i think i will, but this time of day is when i go to bed 23:38
tbrowder when i get it ready i’ll leave a .tell msg
yeah, i’m fading too...
thanks 23:39
timotimo gnite :) 23:42
thou teatime, Zoffix, thanks for looking at that 'x' ** { 1^..* } question for me! 23:53
Zoffix Any time :)_ 23:59