»ö« 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.
samcv ok i think i got it. ignore me 00:00
00:24 Cabanossi left 00:26 Cabanossi joined 00:28 mr-foobar left 00:30 Actualeyes left 00:35 Actualeyes joined
samcv PR's away 00:35
Geth yaml-pm6: samcv++ created pull request #4:
Use SPDX identifier in license field of META6.json
00:38
00:39 Actualeyes left 00:43 tyil left, tyil joined
samcv working on sending out 179 PR right now... that's a lot. will take a while 00:43
if anybody is curious these will be getting PR and the license they're under is on the right column gist.github.com/samcv/a19f7e6f5a70...bbdf006425 00:44
Geth gtk-simple: samcv++ created pull request #78:
Use SPDX identifier in license field of META6.json
00:45
[Coke] samcv: when giving PRs to update the META6.json, IWBNI the entire file didn't get reformatted as well. 00:47
samcv no it did
get updated
i mean i just used json to do it 00:48
also what does IWBNI
mean
[Coke] "it would be nice if"
samcv yeah i agree
will see if i can do that and pause it for now 00:49
idk what's the best way though... i mean
i don't wanna screw up the json
maybe just stick it under name? since like 100% have a name field 00:50
and detect the indent on that?
00:52 japhdc left, japhdc joined
[Coke] that seems fine. I wouldn't worry about it too much, but in case anyone rejects it because of that, something to think about. 00:55
samcv yeah
can always improve you know
00:55 Cabanossi left
[Coke] What json module did you use? 00:56
(because I might have a patch for that.)
00:57 Cabanossi joined
[Coke] (don't like the big spacing on empty arrays) 01:01
01:01 dustinm` joined
samcv JSON::Fast 01:01
01:17 mcmillhj left, aborazmeh joined, aborazmeh left, aborazmeh joined
samcv hmm [Coke] why doesn't this insert spaces gist.github.com/258a705b46e5085c2c...08552b209a 01:21
if you run it, it shows it captures spaces in $<mid> and $<midafter> but they don't show up in the final thing
Geth Swapped META.info → META6.json in 2 dists in github.com/perl6/ecosystem/commit/fdceaa59b2 01:22
01:23 GalenC joined 01:31 Actualeyes joined
samcv well i'm scrapping that... doing something else line by line 01:35
01:39 xiaomiao joined, sjn_web joined 01:40 sjn_web left 01:46 ilbot3 left
samcv ok i got it working starting the PR up again 01:46
01:47 japhdotcom joined
samcv seems nice github.com/teodozjan/mortage6/pull/7/files 01:47
yay 01:48
brb
01:48 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:49 japhdc left 01:51 skids joined 01:55 Cabanossi left 01:57 Cabanossi joined 02:00 GalenC left 02:03 GalenC joined 02:07 GalenC left, japh-com joined 02:11 japhdotcom left 02:15 imcsk8_ joined, imcsk8 left 02:20 japhdotcom joined 02:23 japh-com left 02:24 Cabanossi left 02:27 Cabanossi joined 02:42 mcmillhj joined 02:47 mcmillhj left 02:50 noganex joined 02:51 eliasr left
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/ddea4bcffe 02:53
02:53 noganex_ left 02:57 dj_goku left 02:58 wamba joined 03:09 poohman joined
poohman m: say " test" 03:09
camelia test
poohman hello, is there a way to update rakudo in windows from reply?? 03:10
repl??
mst I'm unsure why you'd try and update it from the repl 03:11
surely you'd want to install the latest release however you installed what you're currently using
03:12 poohman2 joined
poohman2 I guess I'm asking whether we have something like "dnf update" in fedora or emerge world 03:13
03:14 Sgeo_ joined 03:15 poohman left, japh-com joined
skids Well, there's rakudobrew for building from git. 03:18
03:19 japhdotcom left, japhdotcom joined 03:22 japh-com left
poohman2 I just noticed that the version in my Windows computer is extreme old and there I don't want to start building with cygwin or whatever 03:22
oh sorry 03:23
skids just download a new one from rakudo.org/how-to-get-rakudo/ ?
Geth Swapped META.info → META6.json in 4 dists in github.com/perl6/ecosystem/commit/c99f9e0dc1
poohman2 that's just what I did 03:24
was ok - just noticed that rakudobrew is available for windows as well 03:25
03:28 japh-com joined 03:31 japhdotcom left 03:39 Cabanossi left 03:40 Cabanossi joined
TreyHarris can a routine tell if a defaulted named parameter was explicitly used in the call to set the default value? i.e., given sub foo(Bool :$enabled = True) { my Bool $explicitly_enabled = mumble; say "Was I called as foo()? {$explicitly_enabled.not}" }, is there a "mumble"? 03:40
(I know I can just use (Bool :$enabled?) and check for definedness in the routine body, but I'm asking theoretically.) 03:43
03:44 Actualeyes left
u-ou what's the given/when equivalent to C switch's break? 03:45
s/C/C's/
TreyHarris u-ou: see docs.perl6.org/language/control#proceed 03:46
ugexe use a multi for :$enable where True and :$enabled where False
TreyHarris ugexe: *nod*. Can I multi submethod BUILD, or will the MOP be unhappy with me if I try that? (I can just test it, but if you happen to know...) 03:48
u-ou thanks
ugexe yeah i believe so. you just cant multi private methods
03:55 poohman2 left 03:57 zapwai left
samcv we are up to 25.5% license tags now :) 04:02
up up up
was 20% 2 days ago i think. then 4 days before that 13%
04:04 AlexDaniel left 04:05 stmuk_ joined 04:08 wamba left
mst TreyHarris: even if you can, I'm not entirely sure I *would* 04:08
04:09 Cabanossi left 04:10 Cabanossi joined
TreyHarris mst: I have dependent options--one doesn't make sense unless another is set, but it defaults to being set--and trying to figure out the best way to catch the case when it's used nonsensically--ideally I could catch it and die when it's explicitly nonsensical, but DWIM when it's implicitly nonsensical (just assume the caller meant to turn the other flag off if they're turning this flag on) 04:11
Easy enough to do it as a boolean logic chain in the first line of the routine without setting any defaults in the signature, but setting defaults in the signature is nicely self-documenting for the 90% case 04:12
s/unless another is set/unless another is unset/ 04:13
04:16 dj_goku joined
mst TreyHarris: ok, but given IIRC named parameters don't participate in ordering for multi-dispatch, you're going to have to be -really- careful about writing that, and probably add a comment so you don't accidentally break it any time you modify the code, and at that point it doesn't seem nearly so self-documenting to me 04:17
also dependent options are often horrible in other ways and wherever possible I tend to the idea that doing something with a polymorphic has-a makes a lot more sense 04:18
like
this may not be applicable, but I've had good results from stuff like "if option Y only makes sense given option X, have option X make delegate Z be a class that understand Y, and !X make delegate Z be some other class that doesn't" 04:19
mst handwaves furiously and notes that none of this should stop you from trying, but if it breaks, you get to happyu there's only two halves to keep ;) 04:20
Geth Swapped META.info → META6.json in 2 dists in github.com/perl6/ecosystem/commit/2fa951181e 04:24
TreyHarris Hmm. right now I have submethod BUILD (Bool :$no-logging = True, ..., Bool :$log-verbosely = False); I think DWIM is that .new(:log-verbosely) should flick :no-logging off, while .new(:no-logging, :log-verbosely) should die. Easiest way to get said behavior is remove the default from :$no-logging, but that's the most important option the method has, so removing its self-documenting default feels really wrong. 04:25
flipping to (Bool :$!logging?, ...) fixes the situation (because not setting is also falsey, so I can check its definedness) and would be nice, but unfortunately the P5 code this is based on already uses (no_logging => 0) extensively, so translation would have a major gotcha if I made that change. If I could ignore the P5 users and start anew, I'd just do it that way. 04:30
... and in fact, the P5 analogue does die when the explicit arguments clash but DWIMs when just one is given. But it can do that because there's no such thing as default parameters so you can always tell a named parameter that was explicitly set from one unnamed in the args) 04:36
Voldenet TreyHarris: :no-logging and :log-verbosely seem redundant, you could design this interface to not accept mutually exclusive arguments instead 04:39
m: enum LogLevel<none info verbose>; sub try-me(LogLevel :$log = info){ say $log }; try-me(:log(verbose)); 04:40
camelia verbose
Voldenet or something similar
TreyHarris Grr, if the original author had just gone the other way and had a 'logging' parameter which defaulted to 0... *sigh* I could always just make it 'has Bool $.logging = True; submethod BUILD (Bool $!logging, ..., Bool :$no-logging?) and have $no-logging be an optional param that exists just so that dumbly translated P5 code will continue to work right.
Voldenet: if I had the freedom to redesign the interface that way, I would, absolutely. 04:41
er, s/= True/= False/
Voldenet: I suppose I could anyway... make no-logging and log-verbosely both :$params? and not attributes that can jointly affect the actual $!log-level enum 04:44
mst TreyHarris: I would propose that you consider that most people *won't* be mechanically porting existing already-working perl5 code because, well, porting code between programming languages that different doesn't tend to work out very well
and that you'd be better making the perl6 interface actually good
Voldenet Yeah, focus on the quality. Ignore compatibility. People will thank you later for this ;-) 04:45
mst has, occasionally, encountered things that had kept compatibility with the way it worked in perl4
it was never a decision whose wisdom had stood the test of time
TreyHarris good point. 04:46
mst if we were having this conversation a decade ago while perl6 was still attempting to be 'the next version of perl5' it might be different, but at this stage it mostly isn't, it certainly isn't seen that way by most perl5 hackers, and speaking as a backcompat-obsessed perl5 hacker I would *really* prefer people writing things in perl6 fixed stuff like this so perl6 can actually be shiny rather than inheriting any existing mistakes :) 04:47
if I want ugly-in-the-name-of-backcompat, I know where to find perl5 and/or Inline::Perl5 after all :D
Voldenet did you mean ugly_in_the_name_of_backcompat 04:48
because - is so perl6
04:49 Possum left
TreyHarris Random curiosity: is the definedness and value of $foo well-defined in a signature (:$foo when { $foo.defined and is-valid($foo) } = mumble }, ...)? It's actual behavior in rakudo is a bit surprising to me 04:49
s/It's/Its/
urk. s/when/where/ 04:50
that is a mistake I keep making, even after years of seeing 'where' 04:51
the default going after the where clause makes me think it's intended to be evaluated prior to the default being set 04:52
04:53 curan joined
mst I always got the feeling the where thing was an annotation on the type of the variable or so 04:56
at least morally
please don't confuse me with somebody who's good at perl6 yet though
Voldenet Well, the constraint is absolute, it's fine that way - you don't want to ignore invalid values (human errors include mistyped integers and stuff like that, I'd rather get an error than default value)
TreyHarris m: sub foo(Int $num where { $num < 10 } = 10) { $num.say }; foo(3); foo() 04:57
camelia 3
Constraint type check failed in binding to parameter '$num'; expected anonymous constraint to be met but got Int (10)
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
mst right, the 'where' constrains the Int type
for a passed $num
the default is only used if you don't pass one
look at it as sugar for (Int where { ... }) $num = 10 04:58
sort of
metaphorically
TreyHarris m: sub foo(Int $num where { $num.defined and $num < 5 } = 10) { $num.say }; foo(3); foo() 04:59
camelia 3
Constraint type check failed in binding to parameter '$num'; expected anonymous constraint to be met but got Int (10)
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
TreyHarris got it. it just feels like it should be after the default since the default is set by the time we get into the where block. 05:01
mst oh!
TreyHarris: so, this is a lie, but maybe you can convince your brain that 'postfix where has tighter precedence than infix ='
(at least I think it's a lie, see "not actually very good" comment above) 05:02
TreyHarris m: sub bar(($x, $y where {$x > $y}), Bool :$yell = False) { say "$x is bigger than $y", ($yell ?? "!" !! "") }; bar((2,1)); bar((2,1), :yell); bar((1,2)) 05:08
camelia 2 is bigger than 1
2 is bigger than 1!
Constraint type check failed in binding to parameter '$y'; expected anonymous constraint to be met but got Int (2)
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
TreyHarris m: sub bar(($x, $y) where {$x > $y}, Bool :$yell = False) { say "$x is bigger than $y", ($yell ?? "!" !! "") }; bar((2,1)); bar((2,1), :yell); bar((1,2))
camelia Cannot resolve caller infix:«>»(Mu, Mu); none of these signatures match:
($?)
(\a, \b)
(Real \a, Real \b)
(Int:D \a, Int:D \b)
(int $a, int $b)
(Num:D \a, Num:D \b --> Bool)
(num $a, num $b --> Bool)
(Rat…
TreyHarris ^^ is confusing to me. 05:09
Voldenet m: sub bar($x, $y where {$x > $y}, Bool :$yell = False) { say "$x is bigger than $y", ($yell ?? "!" !! "") }; bar(2, 1); bar(2, 1, :yell); bar(1,2) 05:10
camelia 2 is bigger than 1
2 is bigger than 1!
Constraint type check failed in binding to parameter '$y'; expected anonymous constraint to be met but got Int (2)
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
05:10 aborazmeh left 05:11 John[Lisbeth] joined
John[Lisbeth] he he he 05:11
so I heard about dem perl6 macros
dem good macros
how about I get me some of them perl6 macros 05:12
TreyHarris it's because as sugar for a type annotation, the first is expressible, the second is not, because the internal relationship of the elements of a tuple ($x,$y) is not a type annotation, but the expression of "this num is bigger than that num" is an expressible annotation on a numeric type, which $y is.
John[Lisbeth] gotta get me dat sugar
05:14 wamba joined
TreyHarris hence: 05:14
m: sub bar(($x, $y where {$x > $y}), $z where {$z > $x } ) { say "$x is bigger than $y, but smaller than $z" }; bar((2,1),3); bar((2,1),0) 05:15
camelia 2 is bigger than 1, but smaller than 3
Constraint type check failed in binding to parameter '$z'; expected anonymous constraint to be met but got Int (0)
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
mst John[Lisbeth]: there is no fully specified publically facing macro API; if you're interested in the ideas being worked upon, you want to watch github.com/masak/007
05:16 gdonald left 05:17 Actualeyes joined, gdonald joined
John[Lisbeth] gotta get the sugar 05:17
www.youtube.com/watch?v=eSbxJMkI-tI 05:18
TreyHarris m: sub bar((Int $x, Int $y where {$x > $y}) = (1,0), Int $z? where {$z > $x } ) { say "$x is bigger than $y, but smaller than $z" }; bar(z => 3) 05:19
camelia Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
TreyHarris huh?
Geth Swapped META.info → META6.json in 2 dists in github.com/perl6/ecosystem/commit/22bcb1619f 05:25
TreyHarris that's a "non-exhaustive pattern" to use the lambdacamel lingo, but I don't see why I should get _that_ exception--it should work when I pass in a z 05:26
05:26 wamba left 05:27 japhdotcom joined 05:30 astj_ joined, lowbro joined, astj left, japh-com left, lowbro left, lowbro joined 05:31 japh-com joined, lowbro left, lowbro joined
mst TreyHarris: maybe cos the $z value is being checked before the defaults happeN? I dunno 05:31
05:31 lowbro left
moritz I don't think you can do list assignemnt of defaults in sigantures 05:31
TreyHarris m: sub bar((Int $x, Int $y where {$x > $y}) = (1,0), Int $z? where {$z > $x } = 10) { say "$x is bigger than $y, but smaller than $z" }; bar() 05:32
camelia 1 is bigger than 0, but smaller than 10
TreyHarris moritz: you can
m: sub bar((Int $x, Int $y where {$x > $y}) = (1,0), Int $z? where {$z > $x } = 10) { say "$x is bigger than $y, but smaller than $z" }; bar((2,1),4) 05:34
camelia 2 is bigger than 1, but smaller than 4
TreyHarris m: sub bar((Int $x, Int $y where {$x > $y}) = (1,0), Int $z? where {$z > $x } = 10) { say "$x is bigger than $y, but smaller than $z" }; bar((2,1))
camelia 2 is bigger than 1, but smaller than 10
05:34 xtreak joined 05:35 japhdotcom left
TreyHarris m: sub bar($z? where { $z.defined ?? $z > 5 !! True }) { say "bang!" }; bar(); bar(6); bar(3) 05:38
camelia bang!
bang!
Constraint type check failed in binding to parameter '$z'; expected anonymous constraint to be met but got Int (3)
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
Voldenet Does moar optimize tail calls?
I'm not sure if I want to abuse this mechanism without that 05:39
TreyHarris (I know there's a much better way to write '$z.defined ?? $z > 5 !! True', but it's very late here and I should have gone to bed hours ago so my brain is fuzzy and I can't recall it.) 05:40
05:40 skids left
TreyHarris Voldenet: yes, I'm abusing it, but as a Haskeller I'm used to trying to stuff as much logic into signatures as humanly possible, so I'm just testing its limits :-) 05:43
ideally, all your right-hand-sides of your functions are just "= []" and "= foo:[]", where foo is the function you're defining; all else gets worked into the types of the arguments ;-) 05:46
samcv don't think it'd be a good idea to add a module that removes all your ecossytem modules at 9PM bst XD 05:48
but i made a script. because i was bored
Nuclear::Blackmail_aka_9PM_BST.p6 # should delete it as we need to deproliferate nuclear weapons 05:49
TreyHarris passes out &
samcv night TreyHarris 05:50
05:53 lowbro joined, lowbro left, lowbro joined
samcv i'm happy though :) keep getting merges to my inbox of all those license metadata PR. can't wait till we top 50% 06:02
06:06 Xliff left 06:07 Xliff joined 06:08 salva left 06:16 japh-com left 06:17 japh-com joined 06:23 Cabanossi left 06:24 CIAvash joined 06:25 Cabanossi joined 06:30 salva joined
japh-com could i read the symbol table (variable names, object names, methods, etc) via the context returned by nqp:: ? 06:32
samcv i don't know of a way to do that 06:33
can you get access through
m: SETTING::.keys.say 06:34
camelia ($=pod &symlink $_ $/ RESTRICTED-CLASS &restricted !UNIT_MARKER &UNLINK-PATH &SYMLINK-PATH &MAKE-DIR &CHANGE-DIRECTORY &rmdir $=finish EXPORT PIO &CHMOD-PATH &chmod $! Proc NativeCall &COPY-FILE &rename &open ::?PACKAGE GLOBALish &shell &pipe &link &RENA…
samcv idk there's a bunch of random things there
japh-com say if you have an OP inside nqp::, how do you walk around on the node tree from children to parents and vice versa? 06:35
06:35 wamba joined
samcv the QAST tree? 06:35
japh-com yes
samcv i would look at Optimizer.nqp to see. it does that
optmizes it from the QAST 06:36
in rakudo
japh-com ok. i'll take a look :-)
samcv np :)
let me know if you figure it out
i have read optimizer.nqp, but didn't focus on the parts that processed the tree really, looked around at the other stuf optimizing code and such. but curious what you discover 06:37
06:42 japhdotcom joined 06:44 japh-com left 06:46 abraxxa joined 06:47 mr-foobar joined
timotimo qast nodes don't keep pointers to their parents at all 06:48
06:50 wamba left, winnie_ joined 06:51 abraxxa left
japhdotcom thanks timotimo. i found Optimizer.nqp method visit_children... i now see why i couldn't find any reference to parents... 06:52
timotimo :)
06:53 domidumont joined
timotimo we tend to just replace children inside their parents all willy-nilly, we'd have to have a bunch more code to handle proper removal of parent links, too, if we had those 06:53
06:54 Cabanossi left, domidumont left
japhdotcom any thoughts on how to access *everything* in the current environment? (variable names, package names, etc) 06:54
timotimo what code are you coming from here?
perl6 user code, Perl6::Grammar, Perl6::Optimizer? 06:55
06:55 domidumont joined
japhdotcom user code... trying to extend the atom perl 6 package with very intelligent autocompletion 06:55
06:55 Cabanossi joined
timotimo have you looked at how readline and linenoise get autocompletion? 06:56
Geth Swapped META.info → META6.json in 3 dists in github.com/perl6/ecosystem/commit/ce8b59107d
06:57 ufobat___ joined
japhdotcom i'll check into that. i looked at how atom-perl6-editor-tools is doing it, but that package is just downloading some json summaries from docs.perl6.org... 06:58
06:58 domidumont left 06:59 domidumont joined
samcv heh 07:01
japhdotcom, you could always steal methods from atom-language-perl6
if you wanna cheat
lol.
tho curious how linenoise does it 07:02
wonder if there's a way to dump all methods and paste them into atom-language-perl6
hm
timotimo well, methods are a bit difficult, as they are completely run-time constructs 07:05
(unless you can prove that nothing fishy is going on)
japhdotcom timotimo, yes... i was thinking that something at runtime (actually on top of the debugger so you have current code context) would be ideal rather than trying to reconstruct suggestions externally 07:08
samcv ok finally added a sieve filter for my email. was getting endless flood of github emails as europe wakes up
should have done that before i sent 198 PR
seems to be working now though 07:09
timotimo someone just suggested adding newline before EOF in the meta6 file
samcv japhdotcom, do you have JS experience?
i have uh. minimal. i mean i implemented the highlights support for docs.perl6.org, and am the dev working on the highlighter grammar, but i only know a bit. well only learned enough to do what i had to do 07:10
language is a bit weird
timotimo, who? where
oh i see
timotimo github.com/perl6/gtk-simple/pull/7...-297256902
samcv ok fixing
07:11 abraxxa joined
timotimo will you also close all pull-requests that haven't been merged yet? :) 07:11
samcv why would i do that 07:12
timotimo right, i forgot you can just force-push over your fork
samcv yeah
i commented out the PR part
07:12 wamba joined
samcv maybe i'll force push over all the repos with json changer 2.0 07:14
07:17 darutoko joined
timotimo does the script verify that what it's suggesting is valid json? 07:17
07:18 astj_ left, astj joined
samcv yep 07:19
timotimo neat
japhdotcom msg /samcv not so great at JS... coffeescript seems to make it bearable so that's what i've been using... i've worked some of my key concerns on the debugger side since we talked last and got my head around the autocomplete+ api...
samcv and it aligns them too
cool
script has gotten pretty nice timotimo gist.github.com/3448cce3b0229561f1...dbace67a8b 07:20
this is my 3rd script i think? at least 07:21
much cleaner than the 1st script i made.
and have aseperate one for checking what license things are
may make the license checker on github or something
as a module
before that though i need to fix a few things. like with it not detecting MIT licenses, because if 5 words are different it has 95% the same, which is under the 99.5% standard i have it set as. which works fine for long licenes. but others no so much. so need to go based on words. 07:22
timotimo looks good 07:29
hobbs fools samcv's checker by taking common licenses and adding the word "not" in strategic places 07:31
07:32 inokenty left
samcv heh 07:32
yeah i'm not putting it on the ecosystem until i also check word order. but. for now i have 99.5% before making a PR
which is pretty high
will also check order as well, and check the number of words better
and identify the license line. but i've at least found the best way to identify the closest out of 50 licenses or however many spdx license identifiers there are 07:33
hobbs yeah, makes good sense :)
samcv once i have that top match i can do more work to verify it further
timotimo use markov chains! 07:34
samcv and for MIT licenses even if 2 words work changed it would be under 99.5% because it's so short :P
timotimo i just re-discovered The Lonely Island, recently i re-discovered Epic Rap Battles of History, i wonder what else i should dig back out 07:39
tyil Internet Explorer 6
timotimo i threw internet explorer 6 ON THE GROUND
tyil IE6 has always been on the ground 07:40
it was the crippled kid in the back of the class
timotimo IE6 is a pretty mean thing to call a disabled person 07:43
07:45 wamba left 07:46 inokenty joined
timotimo current mood is: "threw it on the ground" on endless repeat 07:48
07:51 g4 joined, g4 left, g4 joined 07:52 Cabanossi left
timotimo such an absurdly good song 07:53
samcv timotimo, all pending PR now have the super nice and aligned json thingy :) 07:55
timotimo \o/
samcv *look at how perfectly aligned* github.com/MadcapJake/Test-Lab/pull/5/files
tyil its pretty good, ye
samcv perfect
timotimo perfect!
07:55 Cabanossi joined
samcv it finds the "name" : " line, and then gets the index of the ':' 07:55
if that index is longer than $indent-of-name-line"license" 07:56
than it padds it. otherwise it adds one space
works more perfectly than i could have hoped
timotimo it doesn't detect when the json right-justified 07:57
samcv is there a json module to ocd align my json?
right justified...
timotimo :D
samcv dies
but is there a module to get perfectly aligned json? 07:58
timotimo i don't think so
not only because there's no such thing as "perfectly aligned" :)
samcv uhm aligning the ':' and aligning the start of the keys
or something
sounds annoying to make
timotimo nah, it'd be fine
samcv i mean i don't want to make it :P 07:59
timotimo how do you align nested objects?
samcv that's not much work
timotimo anyway, i should be hittin' the road, yo
samcv that's easy
timotimo no, i mean, what is your decision what it should look like
moritz you could take a look if you like for example jq's pretty-printed json output
samcv jq?
moritz or try other command-line json tools that can pretty-print
samcv: a command line tool for working with json data
samcv i don't really care if they are aligned as long as it's indented
moritz jq and json_pp and json_xs can certainly do that 08:00
08:01 AlexDaniel joined 08:04 japh-com joined
hobbs jq is a nice tool and worth learning. And also interesting as a little functional language. 08:04
08:05 darutoko- joined 08:06 japhdotcom left 08:08 darutoko left 08:10 darutoko- left 08:11 zakharyas joined 08:15 winnie_ left, winnie_ joined 08:17 dakkar joined, winnie_ left 08:21 parv joined 08:24 AlexDaniel left
Geth Inline-Python: 5eee2a8bab | (Samantha McVey)++ | META6.json
Use SPDX identifier in license field of META6.json

Use the standardized identifier for the license field. For more details see design.perl6.org/S22.html#license
08:25
Inline-Python: dd03cc767c | niner++ (committed using GitHub Web editor) | META6.json
Merge pull request #23 from samcv/SPDX-license

Use SPDX identifier in license field of META6.json
08:25 xtreak left 08:27 lowbro left 08:28 xtreak joined 08:29 lowbro joined, lowbro left, lowbro joined, SMS joined 08:30 domidumont left 08:31 domidumont joined 08:33 astj_ joined, astj left, cpage_ left 08:34 japh-com left 08:35 cpage_ joined 08:41 eliasr joined 08:45 andrzejku joined
andrzejku hi people 08:45
:)
08:45 rindolf joined
parv yo/ 08:48
08:48 gdonald left, gdonald joined 08:52 zakharyas left 08:53 wamba joined
u-ou hiyo 08:55
off to bed soon ;)
08:55 zakharyas joined
u-ou then up early the next day 08:55
08:56 bjz joined 09:02 jonas1 joined 09:07 parv left 09:12 xtreak left 09:13 xtreak joined 09:16 rindolf left
daxim .tell MadcapJake chocolatey.org/packages?q=rakudo is outdated 09:17
yoleaux daxim: I'll pass your message to MadcapJake.
daxim .tell Zoffix please do not forget about nuget/chocolatey specs for vip release
yoleaux daxim: I'll pass your message to Zoffix.
09:21 xtreak left 09:22 xtreak joined 09:23 Cabanossi left, xtreak left, xtreak joined 09:25 Cabanossi joined
Geth gtk-simple: 4efebf7a3a | (Samantha McVey)++ | META6.json
Use SPDX identifier in license field of META6.json

Use the standardized identifier for the license field. For more details see design.perl6.org/S22.html#license
09:27
gtk-simple: f8ac1b93c8 | (Kamil Kułaga)++ (committed using GitHub Web editor) | META6.json
Merge pull request #78 from samcv/SPDX-license

Use SPDX identifier in license field of META6.json
09:32 TEttinger left 09:38 Actualeyes left
grondilu made a TrigPi module, inspired from Julia: github.com/grondilu/trigpi 09:39
it's really a short module (just github.com/grondilu/trigpi/blob/ma...igPi.pm6), I'd like to propose its implementation in core 09:41
that would allow a particularly elegant formulation of FFT: paste.debian.net/929407/ 09:43
09:45 rindolf joined
Geth ecosystem: 8dede53cd7 | grondilu++ (committed using GitHub Web editor) | META.list
Add TrigPi
09:49
09:53 Cabanossi left 09:55 Cabanossi joined 10:01 GalenC joined 10:04 CIAvash left, nebuchadnezzar joined 10:07 mls joined
Geth yaml-pm6: 8e40e1032e | (Samantha McVey)++ | META6.json
Use SPDX identifier in license field of META6.json

Use the standardized identifier for the license field. For more details see design.perl6.org/S22.html#license
10:10
yaml-pm6: f012d8aaef | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json
Merge pull request #4 from samcv/SPDX-license

Use SPDX identifier in license field of META6.json
10:18 domidumont left 10:21 nowan left 10:22 labster left 10:24 nowan joined 10:37 xtreak left 10:38 xtreak joined 10:39 xtreak left 10:40 xtreak joined 10:56 wamba left 11:08 Cabanossi left
samcv night all 11:10
11:10 Cabanossi joined
tyil gn samcv 11:15
11:16 zakharyas left 11:25 awwaiid joined 11:50 domidumont joined 11:55 domidumont1 joined 11:58 domidumont left
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/6167d52be6 12:00
12:02 mr-foobar left 12:07 AlexDaniel joined 12:08 wamba joined 12:11 astj_ left 12:12 gdonald left 12:13 gdonald joined
Geth Swapped META.info → META6.json in 9 dists in github.com/perl6/ecosystem/commit/2da42e6626 12:24
12:28 sena_kun joined 12:33 mr-foobar joined 12:34 xtreak left 12:35 xtreak joined
[Coke] m: enum Months <January February March April May>; my $mo = now.Date.month -1; dd Months.enums.invert.sort.list[$month-1].value; # please remind me of the more idiomatic way to do that? 12:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$month' is not declared
at <tmp>:1
------> 3th -1; dd Months.enums.invert.sort.list[7⏏5$month-1].value; # please remind me of t
12:36 xtreak left, xtreak joined
[Coke] m: enum Months <January February March April May>; my $mo = now.Date.month -1; dd Months.enums.invert.sort.list[$mo-1].value; 12:36
camelia "March"
[Coke] m: dd now.Date; 12:37
camelia Date.new(2017,4,26)
[Coke] wonders how he got the -1 in there. ah well. :)
12:42 xtreak left, poohman joined 12:43 skids joined 12:48 perlpilot joined 12:54 lowbro left 12:55 lowbro joined, lowbro left, lowbro joined, astj joined 12:57 wamba left
moritz [Coke]: one -1 is fine :-) 12:58
13:00 astj left
[Coke] I ended up with Months.enums.invert.hash{$month} , but that still seems too verbose. 13:00
13:00 Voldenet joined, Voldenet left, Voldenet joined 13:02 wamba joined
moritz m: enum Months <January February March April May>; say Months(1) 13:02
camelia February
moritz [Coke]: better? :-)
13:03 mcmillhj joined
poohman do we have operator overloading here?? 13:12
moritz poohman: yes! 13:13
perlpilot poohman: yes
moritz m: multi infix:<+>('pooh', 'man') { 'awesome' }; say 'pooh' + 'man' 13:14
camelia awesome
poohman cool thanks let me look it up now 13:15
😀 13:16
dogbert17 moritz: I tried to comment on RT #130760 but failed, anyway it should be fixed now 13:17
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=130760
moritz dogbert17: thanks! 13:18
13:19 pat_js joined 13:23 cdg joined 13:24 zakharyas joined
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/ccb50e63eb 13:25
[Coke] moritz: MUCH better, thank you 13:27
[Coke] wonders why we used () and not [] there.
(or <> or {})
13:31 isBEKaml joined, mls left 13:33 poohman2 joined
moritz [Coke]: () is a coercion, and an enum is really a subtype of an Int, so coercion seems to work well there 13:33
13:34 poohman left 13:37 mls joined 13:38 pmurias joined
pmurias hi 13:39
13:40 curan left 13:42 poohman2 left
[Coke] moritz: any idea how to go the other way? Given a string, pick the enum value? 13:42
moritz m: enum Months <January February March April May>; say Months('January') 13:43
camelia (Months)
[Coke] (want to do MAIN(enumname $var) , but it's case sensitive. :|)
moritz m: enum Months <January February March April May>; say ::Months::('April')
camelia April
moritz [Coke]: ^^
m: enum Months <January February March April May>; say ::Months::{'April'}
camelia April
moritz there the {} is a bit more intuitive
13:44 cdg_ joined 13:45 berov joined
[Coke] yay, now I have a p6-cal which works for current month, given month/year, and highlights today's date. 13:46
I ran cal earlier today and was frustrated I then had to run 'date'
moritz my cal does exactly that :-) 13:47
[Coke] moritz++ # enum help
13:47 cdg left
moritz I just find it frustrating that I can't select a month of the current year without also selecting the year 13:47
cal 2 # year 2 BC. Thanks!
[Coke] moritz: done. 13:48
13:48 cdg_ left
moritz ah, cal -m 3 13:48
[Coke] (one line MAIN addition)
moritz I guess I should have read the man page
[Coke]: nice
13:49 cdg joined
[Coke] will polish this up later and post it. Dumb little thing. 13:49
13:50 cdg_ joined 13:54 cdg left, Cabanossi left, shdb left
isBEKaml [Coke]: All things start dumb, just look at all babies! 13:55
isBEKaml hides
13:55 Cabanossi joined 14:02 mcmillhj left 14:03 mcmillhj joined 14:08 aborazmeh joined, aborazmeh left, aborazmeh joined
Ulti how are updates triggered to the ecosystem? is it on change to the META.list? 14:09
14:10 lowbro left
moritz it's a cron job, iirc 14:12
14:12 aborazmeh left 14:15 zakharyas left
[Coke] moritz, isBEKaml, yay, now bin/cal 2017 also works. 14:20
14:22 zakharyas joined 14:27 kurahaupo joined
Ulti looks like 14:28
14:37 bjz left 14:41 g4 left 14:57 perlpilot left 15:07 perlpilot joined 15:08 alimon joined
grondilu .seen TimToady 15:17
yoleaux I saw TimToady 24 Apr 2017 16:52Z in #perl6: <TimToady> it pays attention to :U vs :D there
grondilu so, sinPi and cosPi are in IEEE 954 : www.csee.umbc.edu/~tsimo1/CMSC455/...4-2008.pdf How would you feel about adding them in the core? I wrote a version here: github.com/grondilu/trigpi 15:19
perlpilot grondilu: what about asinPi, acosPi, atanPi, and atan2Pi? 15:22
(personally, I wouldn't miss them from core and wouldn't mind if they were in a module)
grondilu perlpilot: I don't know how easy those are to write. 15:23
15:24 Cabanossi left 15:25 Cabanossi joined
grondilu frankly I understand they are not essential but as I mentioned earlier I encountered accuracy issues lately while writing a FFT function and it bugged me quite a bit. Of course it could be module space but I think it'd be cool to have them in core. 15:26
15:27 Skarsnik joined 15:29 abraxxa left
El_Che !deb 15:29
!debs
Skarsnik Hello
does use-ok (in Test) get changed and does not load the 'module'? 15:30
15:30 shlomif joined
perlpilot grondilu: also ... "sinPi(+n) is +0 and sinPi(−n) is −0 for positive integers n." I don't think yours does that. 15:31
15:33 khw joined, rindolf left
grondilu I don't know. What does (2*n) % 2 returns as opposed to (-2*n) % 2 ? 15:38
m: say 8 % 2 === -8 % 2 15:39
camelia True
grondilu m: say $_ % 2 === -$_ % 2 given my uint $ = 8 15:40
camelia True
grondilu m: say $_ % 2 === -$_ % 2 given my num $ = 8e0
camelia True
grondilu meh 15:41
15:45 wamba left 15:46 abraxxa joined 15:48 wamba joined 15:50 Actualeyes joined 15:52 shlomif left, skink joined 15:53 Zoffix joined
Zoffix Skarsnik: it's not use-ok itself that changed, but the module loading that did: rakudo.org/2016/12/17/lexical-module-loading/ 15:54
Skarsnik: and yes, that affected the `use-ok` that you can't also make it load the module for tests. Frankly, just normal-use the module. If it's not used ok, the test suite will still fail. The `use-ok` test is fairy useless 15:55
Skarsnik Oh ok
it was in a BEGIN block
so it was lexical for the BEGIN block I guess 15:56
15:56 Possum joined
Zoffix grondilu: adding everything under the sun to core is very UN-cool, when you consider how few devs work on rakudo. 15:56
Skarsnik and thanks Zoffix for the work on pullrequest for meta ^^
skink Zoffix, Have you heard anything from froggs, the 'if' package dev? 15:57
Zoffix I frequently see talk in here of adding stuff to core as a means to get maintenance burden off your plate, but you're just piling stuff onto Rakudo's devs. It'd help you to look at the Pulse charts before just shoving everything onto us: github.com/rakudo/rakudo/pulse/monthly
skink: nope
buggable: eco if 15:58
buggable Zoffix, if 'conditionally use packages': github.com/FROGGS/p6-if 34 other matching results: modules.perl6.org/#q=if
skink Seems like he was on yesterday to merge all the meta PRs, so hopefully he's seen it
grondilu I have the impression that the core is not exactly the most difficult part of development. Especially the numeric part. Even I could once contribute (for List.pm).
tyil you can submit a PR with the working code then :> 15:59
colomon grondilu: make them a module, get them working there, then try to convince people to add them to core.
grondilu colomon: that's exactly what I'm doing :) 16:00
colomon +1
Zoffix grondilu: even the easy parts need time and motivation.
tyil colomon: does it get a decent performance boost if its merged into core, compared to being a module?
Zoffix Of course not
There's nothing special about core code. 16:01
It's just Perl 6
colomon tyil: obviously the tiny one of not needing to load the module, but other than that I wouldn’t expect a difference.
grondilu tyil: the problem with making a module IMHO is that you have to find a smart name for the module, and then you have to type 'use smartModuleName;' it's very LTA IMHO
tyil developernamespace::modulename 16:02
(not that I use that, but that should work fine for most things, no?)
a catchy name is just a bonus, if its a good module people will use it
Zoffix timotimo: did you recently fix "Cannot find method 'symtable' on object of type GLOBAL" error somewhere? What was the fix?
colomon Math::TrigPI or somesuch
tyil though it can help being found when people look for it
grondilu tyil: how would you name a module implementing sinPi and cosPi? I picked 'TrigPi' but I'm not exactly proud of that choice :/ 16:03
Zoffix grondilu: and the problem with adding to core is we'd have to support and maintain it basically forever.
bugs and all
tyil does the single module have to do both? otherwise Math::CosPi and Math::SinPi
Zoffix m: say 2e0/0e0
camelia Attempt to divide 2 by zero using /
in block <unit> at <tmp> line 1

Actually thrown at:
in block <unit> at <tmp> line 1
colomon single module makes much more sense
Zoffix m: $ = 2e0/0e0
camelia ( no output )
timotimo Zoffix: i don't recall a fix like that
colomon because there are a lot of other functions besides sin and cos 16:04
Zoffix Like ^ that isn't the way it's meant to be, but we have to suppoort it
grondilu tyil: well for one I very much dislike modules starting with Math::
Zoffix the exception I mean
tyil Grondilu::Pi
:D
jnthn If it's in the IEEE standard then at least it *should* be a well thought out thing to need to maintain. :-) 16:05
It's worth noting that for everything we add, though, to some degree everyone pays
Everything that goes in increases the base memory use of Rakudo
Which a small number of folks are trying to bring down :-)
grondilu yeah memory usage is a good point, as well as compile time and tests I suppose 16:06
jnthn There's already so much there that we implemented a bunch of lazy handling of object deserialization in MoarVM
Zoffix timotimo: oh, it's the slang thing. Now I remember. I fixed it on my own, but there's another bug in if.pm6 that's getting had afterwards
jnthn That made something very few people understood into something that is hard to reason about. I've already had to fix a number of bugs that result from it mis-interacting with concurrency. 16:07
Zoffix bah, even got the diff for it: github.com/FROGGS/p6-if/issues/2#i...-290522547
jnthn *harder
16:07 rindolf joined
jnthn Of course you could use this to argue against adding anything. But it's another side of the coin that's worth keeping in mind. 16:08
TreyHarris perlpilot: asinPi, acosPi, and atanPi are not in IEE 954-2008, as they were considered less necessary. atan2Pi is part of IEEE 954-2008 though. 16:09
16:09 wamba left 16:11 cdg_ left
TreyHarris in the wee hours last night, I wrote "I know there's a much better way to write '$z.defined ?? $z > 5 !! True', but it's very late here and I should have gone to bed hours ago so my brain is fuzzy and I can't recall it." A good night's sleep has not restored this recall. 16:11
grondilu one thing that would be cool, though I may be asking too much, would be to mix a role on pi and its ratios, and define candidates to &cos and &sin that would do what cosPi and sinPi do. 16:12
Zoffix TreyHarris: $z.defined || $z > 5 16:13
TreyHarris: oh, never mind :)
16:13 isBEKaml left
perlpilot TreyHarris: "a much better way" would be clearer and more verbose :) 16:14
colomon btw, there’s plenty of room for work on the existing trig functions in core. do the complex versions handle branch cuts “correctly”? do they come up with reasonable answers when passed really big numbers? etc
Zoffix TreyHarris: $z andthen * > 5 orelse True
:)
colomon (though really big numbers seems like a spot where sinPi would shine.) 16:15
grondilu m: role PiRatio { has $.ratio }; multi infix:<*>(Rat $r, pi) { $r*pi but PiRatio($r) }; multi cos(PiRatio $x) { note "computing cos($x.ratio*pi)"; cos($x) }; cos(3/5*pi)
Zoffix m: my $z; say ($z andthen * > 5 orelse True)
m: 42
huh
camelia (timeout)
True
WARNINGS for <tmp>:
Useless use of constant integer 42 in sink context (line 1)
TreyHarris perlpilot: I didn't say "shorter". This is for a clause though, so multiline would be undesirable. 16:16
Zoffix Oh
TreyHarris: what sort of clause? `where`?
.defined.not or $_ > 5
grondilu m: role PiRatio { has $.ratio }; multi infix:<*>(Rat $r, pi) { $r*pi but PiRatio($r) }; multi cos(PiRatio $x) { note "computing cos($x.ratio*pi)"; cos($x) }; cos(my num $ = 3/5*pi)
TreyHarris Zoffix: in this case it was. ahh, nice. 16:17
Zoffix TreyHarris: see also:
buggable: eco Subset::Helper
camelia (timeout)
buggable Zoffix, Subset::Helper 'create awesome subsets': github.com/zoffixznet/perl6-Subset-Helper
Zoffix `where subset-is * > 5` I think that should work
16:18 gdonald left
TreyHarris Zoffix: the question that led me to that was surprise that you couldn't, in a where clause, determine if the value was coming from the default or from the captured argument 16:18
colomon wrote a beautiful little five line p6 script to help track down $work errors this morning
Zoffix TreyHarris: yeah, that's kinda annoying
TreyHarris because there are various perl5 dwimmeries that could be done entirely in the signatures if you could do that.
grondilu how do I unmix a role? 16:19
m: role Foo {}; my $x does Foo = 1; my $y = +$x; say $y ~~ Foo; 16:20
camelia Cannot assign to an immutable value
in block <unit> at <tmp> line 1
grondilu m: role Foo {}; my $x = 1 but Foo; my $y = +$x; say $y ~~ Foo;
camelia True
grondilu m: role Foo {}; my $x = 1 but Foo; my $y = 0+$x; say $y ~~ Foo;
camelia False
TreyHarris (Voldenet set that was "abuse" of signatures, but as a Haskeller, I'm wired to put as much logic into function typing as humanly possible--there's a reason that the default Haskell docs for functions just tell you the types and you have to expand to get an English description of what the function does--you usually don't need the description once you know the types.) 16:21
s/set/said/ # why am I making so many homophonic typos on IRC lately?
16:21 rindolf left 16:23 domidumont1 left
TreyHarris # and that's a particularly interesting one, as it's only homophonic in my dialect because the next consonant was an eth followed by an back unrounded vowel... 16:23
tyil how to read stdin in perl 6 untill a newline (enter)
16:24 Skarsnik_ joined, mscha joined
Zoffix tyil: get 16:24
tyil thanks
that explains why get was highlighting already
mscha m: my @a = (1,2); my Int @b = (1,2); my int @c = (1,2); @a[2] //= 3; @b[2] //= 3; @c[2] //= 3; say @a; say @b; say @c;
camelia [1 2 3]
[1 2 3]
1 2
Zoffix tyil: there's also prompt if you want to show a message
grondilu m: role PiRatio { has $.ratio }; multi infix:<*>(Rat $r, pi) { ($r/2)*tau but PiRatio($r) }; multi cos(PiRatio $x) { note "computing cos($x.ratio*pi)"; cos($x) }; cos(3/5*pi)
camelia WARNINGS for <tmp>:
Useless use of "cos(3/5*pi)" in expression "cos(3/5*pi)" in sink context (line 1)
tyil :o 16:25
perl has everything these days
grondilu m: role PiRatio { has $.ratio }; multi infix:<*>(Rat $r, pi) { ($r/2)*tau but PiRatio($r) }; multi cos(PiRatio $x) { note "computing cos($x.ratio*pi)"; cos($x) }; say cos(3/5*pi)
camelia -0.309016994374947
16:25 cdg joined
TreyHarris tyil: if you know Perl 5 well, you could really have a read through all the 5-to-6* docs. They're quite good at answering these kind of questions. 16:26
tyil I wouldnt say well, but I do know some perl 5
mscha That @c[2] //= 3 doesn't work is a bug, right?
Geth Swapped META.info → META6.json in 5 dists in github.com/perl6/ecosystem/commit/7c163e7592
mscha And why is the output of "say @c" different than the other two? (No brackets)
16:26 itaipu joined
TreyHarris tyil: well, it answers this, if you know how to do it in Perl 5 :-) 16:27
16:27 Skarsnik left
Zoffix .ask TimToady what's the new way to write $*W.HOW.mixin($*W, BetterWorld); ? I'm getting `Cannot find method 'symtable' on object of type GLOBAL`. github.com/FROGGS/p6-if is busted up due to this and a bunch of modules depend on it 16:28
yoleaux Zoffix: I'll pass your message to TimToady.
16:29 Skarsnik_ left, rindolf joined 16:30 Skarsnik_ joined
Zoffix looks at .define_slang 16:31
Maybe World isn't available for messing with anymore?
jnthn mscha: A native int array cannot represent undefined 16:32
mscha: So indexes out of range produce zero, which is boxed because // is an operation on objects, and so is defined 16:33
So no bug, just forgetting that native means :)
mscha Ah, that explains it.
jnthn *what
Well, not so much forgetting as it not being immediately obvious that'd be a consequence :-) 16:34
16:34 Skarsnik__ joined, perlpilot left, berov left 16:36 perlpilot joined
Zoffix bah 16:36
I think I see the bug.
16:37 Skarsnik joined, Skarsnik_ left
Zoffix .tell TimToady disregard. Found where the bug was at. 16:38
yoleaux Zoffix: I'll pass your message to TimToady.
16:38 jercos_ is now known as jercos 16:39 Skarsnik__ left
TreyHarris Zoffix: I think I follow what you're saying in Subset::Helper about Any values and optional parameters, but can you give an example? I was trying to see it in action at the REPL but I'm having trouble 16:41
Zoffix skink: I PRed a fix for if.pm6: github.com/FROGGS/p6-if/pull/3 Works on HEAD rakudo, I assume it also works on pre-slang-change Rakudos (I think 2017.01 would be it) I added a thing for those, but don't have a build available to test on 16:44
TreyHarris: no idea. I wrote that when I barely knew Perl 6. 16:47
TreyHarris heh
Zoffix TreyHarris: I think that `subset Foo where subset-is 42; my Foo $x = Any` will succeed, before .defined check in the subset will clear it or something
s/before/because/;
And that's so that the subset matches in `sub (Foo $x?) {}` 16:48
I guess that should read "Note: undefined values are accepted by the subset to allow for optional parameters to match without issues` 16:49
TreyHarris Zoffix: if that's true and the commits on that repo are correct, then I've had 16x the time you have to think about Perl 6. I'm feeling very stupid now. And old. :-)
Zoffix heh 16:50
TreyHarris Zoffix: got it, that makes sense
16:50 dakkar left
skink Zoffix, Seems to work on 2016.10 16:50
Zoffix Sweet.
TreyHarris: well, I got no kids and spend a lot of type *per day* on Perl 6. It's all relative :) 16:51
s/type/time/;
Zoffix & 16:52
16:52 Zoffix left 16:53 gdonald joined 16:54 skink left 17:05 cognominal joined, perlpilot left 17:06 cdg_ joined 17:09 cdg left 17:10 cdg_ left 17:12 Actualeyes left 17:13 cdg joined 17:14 wamba joined 17:15 cognominal left 17:16 MilkmanD1n left 17:18 MilkmanDan joined, AlexDaniel left 17:32 cdg left 17:38 cognominal joined 17:41 mscha left 17:42 zakharyas left
b2gills TreyHarris: how about ($z // 6) > 5 17:42
Maybe I'm too used to writing code golfs, as that should probably not be used in production 17:44
TreyHarris b2gills: uh, yeah. that's pretty gross. 17:45
17:45 TimToady left 17:46 setty1 joined, TimToady joined
TreyHarris .ask TimToady Should there be a way in a where-clause to tell if a defaulted variable was implicitly set to default (i.e., wasn't passed as an argument)? It would make several kinds of DWIMmery much easier and self-documenting. 17:47
yoleaux TreyHarris: I'll pass your message to TimToady.
17:55 John[Lis` joined 17:56 ggoebel joined 18:00 John[Lisbeth] left 18:01 espadrine joined 18:08 abraxxa left, cdg joined
b2gills m: sub foo ( |c ( $z? ) ) { c.elems == 0 ?? '$z is default' !! '$z has a value' }; say foo; say foo 1 18:10
camelia $z is default
$z has a value
b2gills TreyHarris: you mean like that ^
TreyHarris b2gills: I don't see a default in that signature. I mean a signature with '= value' 18:12
18:15 perlpilot joined 18:18 erdic joined
Geth Swapped META.info → META6.json in 3 dists in github.com/perl6/ecosystem/commit/a9c8ed4599 18:27
18:38 cdg_ joined 18:40 matiaslina joined 18:41 cdg left 18:43 cdg_ left 18:48 raschipi joined 18:53 Cabanossi left
jnthn m: sub foo(|c, :$a where { say c<a>:exists } = 42) { }; foo(); foo(a => 40) 18:55
camelia False
True
18:55 Cabanossi joined
jnthn TreyHarris: There's a way to do what you asked about :) 18:55
(And can use c[0]:exists for positionals too I guess) 18:56
Geth Inline-Perl5: 50803bff13 | (Stefan Seifert)++ | p5helper.c
Fix memory corruption when running multiple Perl 5 interpreters

Add PERL_SET_CONTEXT(my_perl) calls to all remaining functions which were lacking it. We really have to do it before making any calls into Perl 5, except for the few cases where macros really just access their arguments and not make any further calls.
This fixes the "Scalars leaked", "Attempt to free unreferenced scalar" and other messages printed by t/use.t
Inline-Perl5: 32d0cdfb70 | (Stefan Seifert)++ | META6.json
Version 0.26
18:57
TreyHarris jnthn: ah, a capture as the first item in a signature doesn't define an argument but a capture variable the rest of the arguments will go into in addition to where the signature puts them? 19:00
19:02 ggoebel left 19:03 khw left
jnthn TreyHarris: Yeah, it lets you snapshot the argument capture at that point in the binding, essentially 19:06
TreyHarris but you can't follow it with any positionals 19:08
so you can't do like in haskell where you can name the elements of a 2-pleo x and y and also name the whole tuple t 19:10
s/pleo/ple/
skids You can put them in the capture subsig 19:11
m: sub c (|c($f, $g)) { "$f {c} $g".say }; c(3,4)
camelia 3 3 4 4
19:13 astj joined
skids Or use a less grabby destructurer 19:13
m: sub c ($a ($f, $g), $h) { "$a $f $g $h".say }; c([3,4], 5)
camelia 3 4 3 4 5
TreyHarris skids: I would like to know more. I've seen this and been intrigued but the only appearance of the word 'subsignature' is the docs is in Language/typesystem and consists of a single line: 257:L«subsignatures|/type/Signature#Subsignatures» are supported. 19:14
(the link is broken, obviously).
MasterDuke_ docs.perl6.org/type/Signature#inde...gnature%29 19:15
19:15 ggoebel joined
MasterDuke_ is ^^^ what you're looking for? 19:15
19:16 dwarring joined
TreyHarris MasterDuke_: oh! yes; I didn't think to try spelling it 'sub-signature' because the reference didn't spell it that way 19:16
thanks
(I will correct this in the docs if someone's not already doing so.) 19:17
skids I'd stay with "sub-signature" in natural language docs, but idf there is a way to goose the search results that would be good.
19:17 astj left
skids Coincidentally I was on that very page in my browser. There must be some sort of global Perl6 gestalt. 19:18
19:23 Cabanossi left 19:25 Cabanossi joined
Geth doc: feb9d6bc54 | (Trey Harris)++ | doc/Language/typesystem.pod6
Fix mispelling of sub-signatures & broken link

In typessytem.pod6.
19:27
Swapped META.info → META6.json in 7 dists in github.com/perl6/ecosystem/commit/66b9079498
dwarring m: class C { method greet {say "hi" }}; subset S of C; S.greet; S.new 19:29
camelia hi
You cannot create an instance of this type (S)
in block <unit> at <tmp> line 1
dwarring m: class C { method greet {say "hi" }}; subset S of C; S.greet
camelia hi
dwarring m: class C { method greet {say "hi" }}; subset S of C; S.new
camelia You cannot create an instance of this type (S)
in block <unit> at <tmp> line 1
dwarring m: class C { method sneaky-new {say "hi" }}; subset S of C; S.sneaky-new 19:32
camelia hi
dwarring m: class C { method sneaky-new {self.new }}; subset S of C; dd S.sneaky-new
camelia You cannot create an instance of this type (S)
in method sneaky-new at <tmp> line 1
in block <unit> at <tmp> line 1
dwarring ahh
Was just seeing if I can create an object from a subset 19:33
seems I can't 19:34
but I can call other class level methods from the subset 19:35
TreyHarris dwarring: think of it this way: you can't make a regex generate the string it matches. you can, with effort, generate _a_ string it matches in some cases. but that's not generalizable. 19:36
raschipi m: class C { method greet {say "hi" }}; subset S of C; S.^methods.say 19:37
camelia No such method 'methods' for invocant of type 'Perl6::Metamodel::SubsetHOW'
in block <unit> at <tmp> line 1
dwarring yeah there's some pratical difficulties 19:38
you'd need to make sure the newly created object belongs to the subset
m: class C { method sneaky-new {self.new }}; subset S of C; dd S.sneaky-new 19:39
camelia You cannot create an instance of this type (S)
in method sneaky-new at <tmp> line 1
in block <unit> at <tmp> line 1
dwarring ^ and its too easy to bypass
samcv good morning :-)
dwarring makes sense
19:40 sena_kun left
raschipi heya samcv 19:40
samcv gonna check on ecosystem stats
raschipi samcv: how are we getting more of your awesomeness today? What do you have in mind? 19:41
samcv 33.4% license field now. cool.
which awesomeness?
which one lol
raschipi your usual
samcv more pull requests? then yes
raschipi, you saw my post on my eco effort yes? cry.nu/perl6/ecosystem-license-module-tagging/ 19:42
19:44 labster joined 19:45 rindolf left
raschipi samcv: yes I did. 19:46
samcv cool :)
so yeah gonna do more of that
did 190 yesterday. got another 110 to go that have license files in them
that don't have PR yet
19:47 rindolf joined
samcv not sure how many PR are still pending, but 190 PR more accepted will put us to 56% of ecosystem 19:48
trying to get to 50% before the end of the week
19:48 rindolf left
raschipi So, is RabidGravy just going to take all of his stuff out of the ecosystem because he doesn't want to fix the metadata? 19:48
samcv idk. he threatened to, then did not. we will see what happens
but i've backed up all his modules with changed auth info with a list ready to go to paste into META.list for the ecosystem 19:49
here we go: gist.github.com/samcv/6a7e74e4b071...7b02bb001e
19:49 rindolf joined
samcv so we have a plan b in case he actually does remove all his modules 19:50
removig some of those would break lots of eco modules
META5 and Test-META at least are fairly highly used. plus maybe LibraryCheck is? forget 19:51
raschipi Yaeh, it's a shme having to fork them.
samcv well. i don't plan to replace his modules, i mean that's plan b, and at least makes me less stressed about about thneats of removing them. having them ready to go 19:52
19:52 cdg joined
samcv before i wrote as script to automate the fork + change the auth + source-url fields etc i was kind of stressed out 19:52
now i can relax a bit more. I still hope he comes around and corrects his metadata. I think the whole thing is silly 19:53
"perl" -> "Artistic-2.0" is not a bad change, even if he for whatever reason thinks we shouldn't use SPDX identifiers
raschipi It's just how metadata works after all. It's useless if it can't be parsed. 19:54
samcv i haven't seen him in this channel for many days, hopefully when he comes back he has cooled off a bit. I want the eco and community to be a good place, don't want any community member being adverse to things 19:55
yeah exactly
and spdx is the most widely used. even github's license api uses it apparently though i haven't tried that. freedesktop.org xml files use it, node package manager uses and requires it for packages
some more i can't remember 19:56
19:56 perlpilot left
samcv plus they look nice to humans. and nicer than the perl 5 metadata ones metacpan.org/pod/CPAN::Meta::Spec#license 19:57
raschipi If it's the one used in AppStream and DEP 11, it's certainly the way to go.
samcv yeah it is used there
and you can view all licenses at spdx.org/licenses/Artistic-2.0 and the license name at the end. and it also links to all sites it's listed to 19:58
and plus they have a json file with ALL license names and full license text and the other urls for it as well
so that's super nice
raschipi It's the one used by the multi-distro agreement, it can be tranplanted as-is to packages automatically. 19:59
samcv here's the json, a bit big. but pretty cool raw.githubusercontent.com/sindreso...-full.json
my license detection module uses it (not yet in eco until perfected) 20:00
raschipi Release early, release often.
samcv not sure how to handle, maybe should have it download the json file when the module is installed at ecosystem? not sure how to do that 20:01
would prefer not to put it in my git repo, since it could be updated
or if the user wants to pull in and check for an update
skids wonders what libtommath's license's SPDX code is. 20:02
samcv it's public domain it says
but good point
skids Have you read it? :-)
samcv read what? 20:03
skids that license
raschipi give it an option to everride the URL and have it fetch that one by default using a common download utility to avoid a dependency (curl or wget)
samcv wiki.spdx.org/view/Legal_Team/Deci...SPDX_Files
i'd like it to not have to download it each time it runs though
will have to ask if i can do that some easy way or i should just add it to my repo or something 20:04
maybe add a subrepo? never done that before
raschipi hum, download it and check to see if it's there already before doing it.
samcv already where?
and where to put it
skids WTFPL 20:05
(seems to be)
raschipi -- /var/licensedetection/spdx-full.json 20:06
samcv imo anybody trying to public domain should use CC-0
because it has fallback for if the law won't let you put it in public domain
it's pretty nice, i read the full license text creativecommons.org/share-your-wor...omain/cc0/ 20:07
20:08 Cabanossi left
samcv because "Public Domain" is not a license. and has the person who made it died 70 years ago (changes depending on juristdiction) did they say it's in the public domain? 20:08
and does your country even support that? it may have 0 effect
Public Domain is a horrible license because it has no fallback. so anybody wanting to public domain should use CC0 20:09
20:10 Cabanossi joined
raschipi if it can't write to /var/modulename, it should use the current directory 20:11
samcv it could i guess. or just load it once for an individual script which is what it does now. but that works because it goes through all modules in the ecosystem 20:13
using github api to get directory listings, anything matching licence/license/copying containing those words in the root directory, it skips ones without any file. and it skips ones with more than one matching them (case insensitive) 20:14
in case they had two licenses or something
then uses the meta to compare the licenses for similarness. atm i had it set to 99.5% of a match required for PR. i need to set it better so it goes more strongly based on # of words changed. so short licenes don't get 95% or whatever, and thus no MIT licensed modules were PR'd yesterday 20:15
raschipi If it doesn't have a license, we can't distribute it anyway, so there's no point worrying about metadata
samcv we can distribute the metadata. there's a legal clause for ecosystem 20:16
saying you allow meta to be altered and distributed
permissively
but. i do agree all modules should have licenses. becuase otherwise you don't know if you can use them or not
raschipi Yes, but what's the point about distributing the metadata of a module we can't distribute?
samcv yep
TreyHarris making sqlite an impossible dependency sucks.
raschipi If it doesn't have a license, it's clear we can't use them. 20:17
TreyHarris raschipi: that clarity doesn't stop people
from depending on sqlite 20:18
20:18 freesoftwarejoe joined
freesoftwarejoe Has alot changed since perl 5? 20:18
20:19 jonas1 left
raschipi freesoftwarejoe: Yes. 20:19
TreyHarris freesoftwarejoe: do you have a more specific question? Perl 6 is an entirely different language inspired by prior versions of Perl, so, yes?
20:20 itaipu left
freesoftwarejoe I'm looking to develop a DHT application 20:20
TreyHarris some very simple Perl 5 programs are valid Perl 6, but not many
raschipi TreyHarris: Public Domain can be used, it's just complicated.
freesoftwarejoe i know perl 5, but was thinking i could try perl 6...
20:20 rindolf left 20:21 itaipu joined
raschipi freesoftwarejoe: This is the document for you: docs.perl6.org/language/5to6-nutshell 20:22
TreyHarris raschipi: but public domain by definition "doesn't have a license". (In sqlite's case, Hwaci will charge you $6K if you really need a license, but the license they'll sell you doesn't give you sufficient open-source rights.)
raschipi When things don't have any indication of what could be done to them, they're all rights reserved by default. 20:23
freesoftwarejoe What do you think DHT ( en.wikipedia.org/wiki/Distributed_hash_table ) on Perl 6?
raschipi I would personally just use DNS for that.
freesoftwarejoe I dont think that would work, its a rather large table 20:24
20:24 jast joined
raschipi Zoffix said he has long-lived daemons written in Perl6 and haven't found any problems recently. 20:26
20:27 rindolf joined
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/1424966406 20:28
raschipi Later people, gotta go. 20:31
20:31 raschipi left, Zoffix joined
Zoffix Yeah, Geth is probably the most used one. It gets all events sent for a crapton of repos (comments, new issues, closed PRs etc) and I think it ran for like a month almost without any issues. I think two or three times it just crashed, but I didn't have any logs for it to know why 20:33
Geth, uptime
Geth Zoffix, 1 day, 2 hours, 30 minutes, and 13 seconds
Zoffix Well, I added a new feature yesterday and restarted it
Oh, huggabpe has been on since March 22nd according to whous 20:34
So there. 1 month listening to ~4 IRC channels using async code and no issues 20:35
20:35 Zoffix left 20:45 AlexDaniel joined 20:50 itaipu left 20:55 Actualeyes joined 20:56 pierrot left
AlexDaniel not sure about sinPi or cosPi, but thinking about fft in core makes me excited :) 21:00
21:09 Cabanossi left 21:10 Cabanossi joined 21:12 skids left
samcv freesoftwarejoe, how big is the table 21:14
hobbs depends how many leaves you put in it 21:15
samcv well. that goes without saying
21:15 mcmillhj left 21:16 mr-foobar left, cdg left 21:19 pierrot joined 21:27 rindolf left 21:28 wamba left 21:33 [Coke] left, [Coke] joined 21:40 grondilu left 21:51 dct joined 21:54 Cabanossi left 21:55 Cabanossi joined
samcv found a project under GPL-1.0/Artistic-1.0-Perl oo. gonna make my first dual licensed PR 21:59
22:02 matiaslina left
AlexDaniel GPL-1.0 what???? 22:07
ah right, artistic 1.0 also 22:08
22:11 bjz joined, John[Lis` is now known as John[Lisbeth] 22:12 pat_js left
samcv yeah 22:13
ok cool. now it has 99.5% similarity or <= 4 words different as the benchmark. now detecting these MIT and shorter licenses 22:16
gonna see if i can paralelize this and speed it up 22:21
omgzzz segmentation fault :| 22:23
AlexDaniel welcome to my world
22:24 Cabanossi left
hobbs was it a *fast* segfault? 22:24
22:26 Cabanossi joined
samcv yeah 22:26
gonna build debug moar and use gdb
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/b39fda3b19 22:28
samcv not a ton of info gist.github.com/samcv/2696f9cd1ce9...21768309fd
22:29 skids joined
samcv well picked up some mvm things 22:29
looks like a gc bug
AlexDaniel hobbs: interestingly, you can get fast segfaults if it's your fault
m: my @a; start loop { @a.push: rand }; start loop { @a.push: rand }; sleep 1 22:30
camelia (signal ABRT)*** Error in `/home/camelia/rakudo-m-inst-1/bin/moar': double free or corruption (!prev): 0x00007ffb6405c210 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x721af)[0x7ffb6ec111af]
/lib64/libc.so.6(+0x779d6)[0x7ffb6ec169d6]
/lib6…
samcv hehe
AlexDaniel like here
(RT #128870)
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=128870
samcv shouldn't trust variables won't break when you don't use locks and doing in tons of threads
AlexDaniel yup 22:31
samcv i ran it with use 6.d.Preview
maybe should try without
22:32 alphah joined
samcv yep same thing 22:32
does OO::Monitors still work when you set @.var is rw 22:34
in the class
AlexDaniel :| 22:35
I just executed some code…
which crunches some numbers… pure math
and I got one number wrong out of it
surprised, I executed it again, and this time it's right 22:36
samcv threads?
AlexDaniel no
22:36 kurahaupo_ joined
AlexDaniel this is horrible, I can't reproduce it 22:37
samcv ok now i'm using OO::Monitors for the one variable which is outside the start { } block that's modified 22:38
now i get Tried to get the result of a broken Promise
samcv goes back to cry.nu to read what i said about this 22:39
skids samcv: Add a CATCH { $_.note } in the code block that runs in the promise.
samcv k
skids That will get you the error.
22:40 kurahaupo left
AlexDaniel ah, ok. I've probably pasted two random chars into my terminal, that's why 22:41
phew
samcv gonna not write to variables and keep the return values of them instead 22:42
22:43 kurahaupo_ left 22:44 espadrine left, ufobat___ left
samcv ok moved the state variables of one sub into the package scope. so they get filled before it launches tons of threads 22:45
and it seesm to be working
\o/ 22:46
using the return value of a promise is the easiest way to get results i think
AlexDaniel (sure, just let it run for a little bit…)
samcv well without exploding
ahhhhh 22:47
segfault
22:47 mcmillhj joined
AlexDaniel samcv: ;) 22:47
samcv you jynxed it
AlexDaniel I've been through this way too many times
samcv :(
AlexDaniel good news is that half of the times it was my fault, and a significant fraction of the other half was rakudobugged 22:48
samcv: can I take a look at the code?
22:49 bjz left
samcv yeah 22:50
skids Being careful not to let exterior binds to variables in the scope surrounding a start into the start block is half the battle. 22:52
samcv sec 22:53
AlexDaniel, github.com/samcv/eco-license-autom...heckall.p6
this is the license checker module github.com/samcv/eco-license-autom..._check.pm6 22:54
oh oops. it doesn't work hold on
gonna revert some things
AlexDaniel how many times does it 「start」 at the same time? 22:55
samcv lots
22:55 mcmillhj left
AlexDaniel well… I don't think that's a proper way to do it :) 22:55
samcv :(
AlexDaniel better create some worker threads with channels
samcv i want speeddddd
AlexDaniel and instead of start-ing just push into the channels
samcv and i'm lazy
push what to the channels 22:56
oh worker threads etc
ugh
easier just to not thread it and let it run over an extended period
AlexDaniel yea… yea 22:57
that's what whateverable does now
at times we needed more speed, so we ran several scripts in parallel 22:58
instead of trying to parallelize inside the script
samcv :\
AlexDaniel ten times more reliable
samcv modules seem to make it harder for it to work imo
when you have lots of different scopes 22:59
can i just put locks everywhere
hm
make 5 locks. 23:00
because i'm super lazy.
23:00 cognominal left
AlexDaniel m: use 6.d.Preview; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a 23:01
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
use used at line 1
samcv my @locks = Lock.new xx 5; @locks.pick.protect( { } )
AlexDaniel use used :|
samcv before entering the start block
X:
genius
AlexDaniel m: use v6.d.Preview; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a
camelia 5===SORRY!5=== Error while compiling <tmp>
No compiler available for Perl v6.d.Preview
at <tmp>:1
------> 3use v6.d.Preview7⏏5; my @a = rand xx 20; @a.hyper.map({slee
AlexDaniel what was it? 23:02
m: use v6.d.PREVIEW; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a
camelia [0.278421863894387 0.342979965179161 0.454384005191767 0.651171974246981 0.774678418557517 0.627261566803671 0.459206621137376 0.38600241351122 0.80414398253954 0.273561518372253 0.735990828097008 0.852712490951442 0.78017606914615 0.476527375351257 0.79…
AlexDaniel m: use v6.d.PREVIEW; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).say
camelia HyperSeq.new
AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).say
camelia HyperSeq.new
samcv m: @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 } ); }
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@locks' is not declared. Did you mean 'Block'?
at <tmp>:1
------> 3<BOL>7⏏5@locks = Lock.new xx 5; await do for ^10
samcv m: my @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 } ); } 23:03
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3^10 { @locks.pick.protect({ start { 1 } 7⏏5); }
expecting any of:
statement end
statement modifier
statement modifier loop
samcv m: my @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 }; }); }
camelia ( no output )
samcv m: my @locks = Lock.new xx 5; my @results = await do for ^10 { @locks.pick.protect({ start { 1 }; }); }; say @results
camelia [1 1 1 1 1 1 1 1 1 1]
samcv geniusssss
i still got a segfault tho :|
AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).list.say
camelia (-0.55383415004766 -0.667366065542101 -0.455569605054086 -0.562147024278054 -0.335064394462432 -0.870280955153864 -0.963870307754299 -0.980533697314887 -0.728860184551215 -0.261784249452723 -0.00293983627881868 -0.709534479511831 -0.675072650950007 -0.83…
AlexDaniel look! Hyper is working!
23:04 bjz joined
AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).grep({ $_ < -0.5 }).list.say 23:04
camelia (-0.716246559120834 -0.821095607928687 -0.558735792647939 -0.864114305253259 -0.791166390333352 -0.696601379634548 -0.971754850987822 -0.70023168174096 -0.807429331928772 -0.964369758608349 -0.969720010639297 -0.959068093678871 -0.784706185701735)
AlexDaniel \o/
samcv did it not work before
23:04 Kaffe left
samcv i've never tried the method 23:04
AlexDaniel are you kidding me :|
23:04 Kaffe joined
samcv i remember something about it 23:04
aww this doesn't work. it still starts like 12 threads 23:05
AlexDaniel c: releases my @a = ^20; @a.hyper.map({sleep rand / 100; -$_ }).grep({ $_ < -5 }).list.say
samcv even when i have only 2 locks
committable6 AlexDaniel, ¦releases (18 commits): «(-6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19)»
AlexDaniel :o yea, wrong example then 23:06
samcv oh cause i don't await the start block inside the lock i guess
m: my @locks = Lock.new xx 5; my @results = await do for ^10 { @locks.pick.protect({ await start { 1; }; }); }; say @results
camelia Must specify a Promise, Channel, or Supply to await on (got a Int)
in block <unit> at <tmp> line 1
samcv oh yay it's working!!!
only two threads 23:07
23:07 pochi left
samcv ===SORRY!=== 23:07
next without loop construct
argh
23:07 raschipi joined
AlexDaniel committable6 just died with “too many open files” 23:07
samcv can you return from a start block? 23:08
AlexDaniel *shrug*
samcv m: start { return 10; 100 }
camelia ( no output )
samcv m: my $prom = start { return 10; 100 }; say $prom.result
camelia Tried to get the result of a broken Promise
in block <unit> at <tmp> line 1

Original exception:
Attempt to return outside of any Routine
in block at <tmp> line 1
samcv m: my $prom = start { return 10; 100 }; await $prom; say $prom.result
camelia Tried to get the result of a broken Promise
in block <unit> at <tmp> line 1

Original exception:
Attempt to return outside of any Routine
in block at <tmp> line 1
23:09
samcv m: start { return; 100 }
camelia ( no output )
23:09 committable6 joined, ChanServ sets mode: +v committable6
Voldenet no, you can't 23:09
samcv how to end a start loop early?
Voldenet m: my $prom = start { CATCH { .say }; return 10; 100 }; await $prom; say $prom.result
camelia Attempt to return outside of any Routine
in block at <tmp> line 1

Tried to get the result of a broken Promise
in block <unit> at <tmp> line 1

Original exception:
Attempt to return outside of any Routine
in block at <tmp>…
Voldenet goto? 23:10
;>
samcv that doesn't exist
AlexDaniel c: releases my @a = ^30; @a.hyper.grep({ $_ %% 2 }).list.say
samcv *work* that is
committable6 AlexDaniel, ¦releases (18 commits): «()»
AlexDaniel samcv: there ↑
but .map seems to be working
23:12 bjz left 23:13 baest left, pochi joined
samcv it's still going strong at least AlexDaniel 23:13
github.com/samcv/eco-license-autom...6#L81-L106 23:14
pretty nice can choose how many threads to start. not true multi tasking. but good enough for this 23:15
AlexDaniel heh, that's an interesting hack
samcv :) 23:16
now with 9 locks
gonna see if it dies on me
23:16 Skarsnik left
AlexDaniel except that it does it serially in this case… 23:16
or am I wrong?
23:17 baest joined
AlexDaniel yea, shouldn't be parallel 23:17
samcv hmm
AlexDaniel samcv: if you want to throttle it this way, create a channel my $unlocks = Channel.new; $unlocks.send(1) for ^5; then use $unlocks.receive() before start {} and in the end of your start block do $unlocks.send(1) 23:20
ugly as hell but will do as a quick hack
samcv how to check if a lock is currently protected?
.condition doesn't seem to work
ok not what i want in this case 23:21
AlexDaniel ok, so let's say you checked the lock status, now what?
samcv i don't `.pick` that lock
AlexDaniel the moment you do something it could be anything else 23:22
samcv go to the next open one
that's what the protect is for
AlexDaniel still won't work
samcv ah
AlexDaniel because in your case .protect({}) will wait for it to finish
samcv it still has a protect
fine
AlexDaniel use the channel trick mentioned above
or try .hyper
samcv how does the channel trick help me? 23:23
it pushes locks to the channel?
23:23 cdg joined
samcv ok i think i get it 23:24
brb 23:25
trying now 23:30
23:31 cognominal joined
samcv AlexDaniel, do i still want `await start { }` in the block? 23:32
that wasn't spawning any extra processes
AlexDaniel samcv: just start
Voldenet start {} returns a promise, start with that
samcv yeah it wasn't happy like that AlexDaniel 23:33
sec
timotimo if you want something throttled, you can perhaps have a shared supplier that you emit on and the next stage of the pipeline has a .throttle on that (or what it's called)
docs.perl6.org/routine/throttle - this one 23:34
Voldenet m: sub parallel-for (@a, &b, :$threads = 4) { my $c = Channel.new; $c.send($_) for @a; $c.close; await Promise.allof((^$threads).map: { start loop { b($c.receive) }})}; parallel-for ^20, { sleep(rand); .say }
camelia 0
4
3
1
2
5
6
7
9
8
13
10
14
11
12
18
16
17
15
19
Voldenet something like this?
timotimo you don't need to "await Promies.allof(...)", it's the same semantics as "await ..." 23:35
(except i don't think allof gives you the actual result values
Voldenet allof discards broken promises
timotimo but if you weren't going to take them, it doesn't matter that await on a list will give 'em)
oh, i didn't realize
samcv yep
what vol said
timotimo right, allof is for "kept or broken"
good to know
AlexDaniel yea that's better 23:36
23:37 cdg left 23:38 TEttinger joined
timotimo i think i'm going to bed now before i dispense any more wrong advice about concurrency stuff :) 23:38
samcv oh hey. is this. working 23:39
pls no crashhhh
23:39 u-ou joined
samcv maybe it..deadlocked? 23:39
oo forgot to send the lock back to the channel 23:40
Voldenet but why lock if you are using channels anyway
AlexDaniel send the lock? no need for locks
samcv ok 23:41
Voldenet just push arguments, receive processed data
samcv k
timotimo locks? where we're going we don't need locks.
samcv :D
Voldenet Locks are for people that don't believe in concurrency god
samcv ok it's working 23:42
yay segfault 23:47
samcv puts back the lock
there is no concurrency god :( 23:49
23:50 BenGoldberg joined 23:51 pmurias left
samcv now i get segfault yay 23:51
took a while though
23:53 Cabanossi left
samcv moves the lock one closure higher 23:54
or lower. not sure
less deep
23:55 Cabanossi joined
timotimo .o( you get me closure to god ) 23:58
.o( my whole concurrency is flawed )