Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-04-26

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 samcv ok i think i got it. ignore me
00:26 Cabanossi joined #perl6
00:30 Actualeyes left #perl6
00:35 Actualeyes joined #perl6
00:35 samcv PR's away
00:38 Geth ¦ yaml-pm6: samcv++ created pull request #4: Use SPDX identifier in license field of META6.json
00:38 Geth ¦ yaml-pm6: review: https://github.com/perl6-community-modules/yaml-pm6/pull/4
00:45 tyil joined #perl6
00:45 samcv working on sending out 179 PR right now... that's a lot. will take a while
00:45 samcv if anybody is curious these will be getting PR and the license they're under is on the right column https://gist.github.com/samcv/a19f7e6f5a707329643032bbdf006425
00:45 Geth ¦ gtk-simple: samcv++ created pull request #78: Use SPDX identifier in license field of META6.json
00:45 Geth ¦ gtk-simple: review: https://github.com/perl6/gtk-simple/pull/78
00:47 [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
00:47 samcv get updated
00:48 samcv i mean i just used json to do it
00:48 samcv also what does IWBNI
00:48 samcv mean
00:48 [Coke] "it would be nice if"
00:48 samcv yeah i agree
00:49 samcv will see if i can do that and pause it for now
00:49 samcv idk what's the best way though... i mean
00:49 samcv i don't wanna screw up the json
00:50 samcv maybe just stick it under name? since like 100% have a name field
00:50 samcv and detect the indent on that?
00:52 japhdc joined #perl6
00:54 [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:54 samcv yeah
00:54 samcv can always improve you know
00:56 [Coke] What json module did you use?
00:56 [Coke] (because I might have a patch for that.)
00:56 Cabanossi joined #perl6
00:57 [Coke] (don't like the big spacing on empty arrays)
00:59 dustinm` joined #perl6
01:00 samcv JSON::Fast
01:17 aborazmeh joined #perl6
01:17 aborazmeh joined #perl6
01:21 samcv hmm [Coke] why doesn't this insert spaces https://gist.github.com/258a705b46e5085c2ce76808552b209a
01:21 samcv if you run it, it shows it captures spaces in $<mid> and $<midafter> but they don't show up in the final thing
01:22 Geth Swapped META.info → META6.json in 2 dists in https://github.com/perl6/ecosystem/commit/fdceaa59b2
01:23 GalenC joined #perl6
01:31 Actualeyes joined #perl6
01:35 samcv well i'm scrapping that... doing something else line by line
01:39 xiaomiao joined #perl6
01:39 sjn_web joined #perl6
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:51 skids joined #perl6
01:57 Cabanossi joined #perl6
02:03 GalenC joined #perl6
02:07 japh-com joined #perl6
02:15 imcsk8_ joined #perl6
02:20 japhdotcom joined #perl6
02:27 Cabanossi joined #perl6
02:42 mcmillhj joined #perl6
02:50 noganex joined #perl6
02:53 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/ddea4bcffe
02:58 wamba joined #perl6
03:09 poohman joined #perl6
03:09 poohman m: say " test"
03:09 camelia rakudo-moar ff4a03: OUTPUT: « test␤»
03:10 poohman hello, is there a way to update rakudo in windows from reply??
03:10 poohman repl??
03:11 mst I'm unsure why you'd try and update it from the repl
03:11 mst surely you'd want to install the latest release however you installed what you're currently using
03:12 poohman2 joined #perl6
03:13 poohman2 I guess I'm asking whether we have something like "dnf update" in fedora or emerge world
03:14 Sgeo_ joined #perl6
03:15 japh-com joined #perl6
03:18 skids Well, there's rakudobrew for building from git.
03:19 japhdotcom joined #perl6
03:22 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:23 poohman2 oh sorry
03:23 skids just download a new one from http://rakudo.org/how-to-get-rakudo/ ?
03:23 Geth Swapped META.info → META6.json in 4 dists in https://github.com/perl6/ecosystem/commit/c99f9e0dc1
03:24 poohman2 that's just what I did
03:25 poohman2 was ok - just noticed that rakudobrew is available for windows as well
03:28 japh-com joined #perl6
03:40 Cabanossi joined #perl6
03:40 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:43 TreyHarris (I know I can just use (Bool :$enabled?) and check for definedness in the routine body, but I'm asking theoretically.)
03:44 Actualeyes left #perl6
03:45 u-ou what's the given/when equivalent to C switch's break?
03:45 u-ou s/C/C's/
03:46 TreyHarris u-ou: see https://docs.perl6.org/language/control#proceed
03:46 ugexe use a multi for :$enable where True and :$enabled where False
03:48 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
03:48 ugexe yeah i believe so. you just cant multi private methods
04:02 samcv we are up to 25.5% license tags now :)
04:02 samcv up up up
04:02 samcv was 20% 2 days ago i think. then 4 days before that 13%
04:05 stmuk_ joined #perl6
04:08 mst TreyHarris: even if you can, I'm not entirely sure I *would*
04:10 Cabanossi joined #perl6
04:11 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:12 TreyHarris 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:13 TreyHarris s/unless another is set/unless another is unset/
04:16 dj_goku joined #perl6
04:17 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:18 mst 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 mst like
04:19 mst 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:20 * 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:24 Geth Swapped META.info → META6.json in 2 dists in https://github.com/perl6/ecosystem/commit/2fa951181e
04:25 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:30 TreyHarris 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:36 TreyHarris ... 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:39 Voldenet TreyHarris: :no-logging and :log-verbosely seem redundant, you could design this interface to not accept mutually exclusive arguments instead
04:40 Voldenet m: enum LogLevel<none info verbose>; sub try-me(LogLevel :$log = info){ say $log }; try-me(:log(verbose));
04:40 camelia rakudo-moar ff4a03: OUTPUT: «verbose␤»
04:40 Voldenet or something similar
04:40 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.
04:41 TreyHarris Voldenet: if I had the freedom to redesign the interface that way, I would, absolutely.
04:41 TreyHarris er, s/= True/= False/
04:44 TreyHarris 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
04:44 mst and that you'd be better making the perl6 interface actually good
04:45 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
04:45 mst it was never a decision whose wisdom had stood the test of time
04:46 TreyHarris good point.
04:47 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 mst if I want ugly-in-the-name-of-backcompat, I know where to find perl5 and/or Inline::Perl5 after all :D
04:48 Voldenet did you mean ugly_in_the_name_of_backcompat
04:48 Voldenet because - is so perl6
04:49 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 TreyHarris s/It's/Its/
04:50 TreyHarris urk. s/when/where/
04:51 TreyHarris that is a mistake I keep making, even after years of seeing 'where'
04:52 TreyHarris the default going after the where clause makes me think it's intended to be evaluated prior to the default being set
04:53 curan joined #perl6
04:56 mst I always got the feeling the where thing was an annotation on the type of the variable or so
04:56 mst at least morally
04:56 mst please don't confuse me with somebody who's good at perl6 yet though
04:56 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)
04:57 TreyHarris m: sub foo(Int $num where { $num < 10 } = 10) { $num.say }; foo(3); foo()
04:57 camelia rakudo-moar ff4a03: OUTPUT: «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␤␤»
04:57 mst right, the 'where' constrains the Int type
04:57 mst for a passed $num
04:57 mst the default is only used if you don't pass one
04:58 mst look at it as sugar for (Int where { ... }) $num = 10
04:58 mst sort of
04:58 mst metaphorically
04:59 TreyHarris m: sub foo(Int $num where { $num.defined and $num < 5 } = 10) { $num.say }; foo(3); foo()
04:59 camelia rakudo-moar ff4a03: OUTPUT: «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␤␤»
05:01 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!
05:01 mst TreyHarris: so, this is a lie, but maybe you can convince your brain that 'postfix where has tighter precedence than infix ='
05:02 mst (at least I think it's a lie, see "not actually very good" comment above)
05:08 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 rakudo-moar ff4a03: OUTPUT: «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:08 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 rakudo-moar ff4a03: OUTPUT: «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…»
05:09 TreyHarris ^^ is confusing to me.
05:10 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 rakudo-moar ff4a03: OUTPUT: «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:11 John[Lisbeth] joined #perl6
05:11 John[Lisbeth] he he he
05:11 John[Lisbeth] so I heard about dem perl6 macros
05:11 John[Lisbeth] dem good macros
05:12 John[Lisbeth] 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.
05:12 John[Lisbeth] gotta get me dat sugar
05:14 wamba joined #perl6
05:14 TreyHarris hence:
05:15 TreyHarris 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 rakudo-moar ff4a03: OUTPUT: «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␤␤»
05:15 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 https://github.com/masak/007
05:17 Actualeyes joined #perl6
05:17 gdonald joined #perl6
05:17 John[Lisbeth] gotta get the sugar
05:18 John[Lisbeth] https://www.youtube.com/watch?v=eSbxJMkI-tI
05:19 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 rakudo-moar ff4a03: OUTPUT: «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␤␤»
05:19 TreyHarris huh?
05:25 Geth Swapped META.info → META6.json in 2 dists in https://github.com/perl6/ecosystem/commit/22bcb1619f
05:26 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:27 japhdotcom joined #perl6
05:30 astj_ joined #perl6
05:30 lowbro joined #perl6
05:30 lowbro joined #perl6
05:31 japh-com joined #perl6
05:31 lowbro joined #perl6
05:31 mst TreyHarris: maybe cos the $z value is being checked before the defaults happeN? I dunno
05:31 moritz I don't think you can do list assignemnt of defaults in sigantures
05:32 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 rakudo-moar ff4a03: OUTPUT: «1 is bigger than 0, but smaller than 10␤»
05:32 TreyHarris moritz: you can
05:34 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),4)
05:34 camelia rakudo-moar ff4a03: OUTPUT: «2 is bigger than 1, but smaller than 4␤»
05:34 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))
05:34 camelia rakudo-moar ff4a03: OUTPUT: «2 is bigger than 1, but smaller than 10␤»
05:34 xtreak joined #perl6
05:38 TreyHarris m: sub bar($z? where { $z.defined ?? $z > 5 !! True }) { say "bang!" }; bar(); bar(6); bar(3)
05:38 camelia rakudo-moar ff4a03: OUTPUT: «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␤␤»
05:38 Voldenet Does moar optimize tail calls?
05:39 Voldenet I'm not sure if I want to abuse this mechanism without that
05:40 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:43 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:46 TreyHarris 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:48 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 samcv but i made a script. because i was bored
05:49 samcv Nuclear::Blackmail_aka_9PM_BST.p6 # should delete it as we need to deproliferate nuclear weapons
05:49 * TreyHarris passes out &
05:50 samcv night TreyHarris
05:53 lowbro joined #perl6
05:53 lowbro joined #perl6
06:02 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:07 Xliff joined #perl6
06:17 japh-com joined #perl6
06:24 CIAvash joined #perl6
06:25 Cabanossi joined #perl6
06:30 salva joined #perl6
06:32 japh-com could i read the symbol table (variable names, object names, methods, etc) via the context returned by nqp:: ?
06:33 samcv i don't know of a way to do that
06:33 samcv can you get access through
06:34 samcv m: SETTING::.keys.say
06:34 camelia rakudo-moar ff4a03: OUTPUT: «($=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…»
06:34 samcv idk there's a bunch of random things there
06:35 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 wamba joined #perl6
06:35 samcv the QAST tree?
06:35 japh-com yes
06:35 samcv i would look at Optimizer.nqp to see. it does that
06:35 samcv optmizes it from the QAST
06:36 samcv in rakudo
06:36 japh-com ok. i'll take a look :-)
06:36 samcv np :)
06:36 samcv let me know if you figure it out
06:37 samcv 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:42 japhdotcom joined #perl6
06:46 abraxxa joined #perl6
06:47 mr-foobar joined #perl6
06:48 timotimo qast nodes don't keep pointers to their parents at all
06:50 winnie_ joined #perl6
06:52 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 #perl6
06:53 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:54 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?
06:55 timotimo perl6 user code, Perl6::Grammar, Perl6::Optimizer?
06:55 domidumont joined #perl6
06:55 japhdotcom user code... trying to extend the atom perl 6 package with very intelligent autocompletion
06:55 Cabanossi joined #perl6
06:56 timotimo have you looked at how readline and linenoise get autocompletion?
06:56 Geth Swapped META.info → META6.json in 3 dists in https://github.com/perl6/ecosystem/commit/ce8b59107d
06:57 ufobat___ joined #perl6
06:58 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:59 domidumont joined #perl6
07:01 samcv heh
07:01 samcv japhdotcom, you could always steal methods from atom-language-perl6
07:01 samcv if you wanna cheat
07:01 samcv lol.
07:02 samcv tho curious how linenoise does it
07:02 samcv wonder if there's a way to dump all methods and paste them into atom-language-perl6
07:02 samcv hm
07:05 timotimo well, methods are a bit difficult, as they are completely run-time constructs
07:05 timotimo (unless you can prove that nothing fishy is going on)
07:08 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
07:08 samcv should have done that before i sent 198 PR
07:09 samcv seems to be working now though
07:09 timotimo someone just suggested adding newline before EOF in the meta6 file
07:09 samcv japhdotcom, do you have JS experience?
07:10 samcv 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 samcv language is a bit weird
07:10 samcv timotimo, who? where
07:10 samcv oh i see
07:10 timotimo https://github.com/perl6/gtk-simple/pull/78#issuecomment-297256902
07:10 samcv ok fixing
07:11 abraxxa joined #perl6
07:11 timotimo will you also close all pull-requests that haven't been merged yet? :)
07:12 samcv why would i do that
07:12 timotimo right, i forgot you can just force-push over your fork
07:12 samcv yeah
07:12 samcv i commented out the PR part
07:12 wamba joined #perl6
07:14 samcv maybe i'll force push over all the repos with json changer 2.0
07:17 darutoko joined #perl6
07:17 timotimo does the script verify that what it's suggesting is valid json?
07:18 astj joined #perl6
07:19 samcv yep
07:19 timotimo neat
07:19 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...
07:19 samcv and it aligns them too
07:19 samcv cool
07:20 samcv script has gotten pretty nice timotimo https://gist.github.com/3448cce3b0229561f1a76ddbace67a8b
07:21 samcv this is my 3rd script i think? at least
07:21 samcv much cleaner than the 1st script i made.
07:21 samcv and have aseperate one for checking what license things are
07:21 samcv may make the license checker on github or something
07:21 samcv as a module
07:22 samcv 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:29 timotimo looks good
07:31 * hobbs fools samcv's checker by taking common licenses and adding the word "not" in strategic places
07:32 samcv heh
07:32 samcv 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
07:32 samcv which is pretty high
07:32 samcv will also check order as well, and check the number of words better
07:33 samcv 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 :)
07:33 samcv once i have that top match i can do more work to verify it further
07:33 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
07:39 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
07:39 timotimo i threw internet explorer 6 ON THE GROUND
07:40 tyil IE6 has always been on the ground
07:40 tyil it was the crippled kid in the back of the class
07:43 timotimo IE6 is a pretty mean thing to call a disabled person
07:46 inokenty joined #perl6
07:48 timotimo current mood is: "threw it on the ground" on endless repeat
07:51 g4 joined #perl6
07:51 g4 joined #perl6
07:53 timotimo such an absurdly good song
07:55 samcv timotimo, all pending PR now have the super nice and aligned json thingy :)
07:55 timotimo \o/
07:55 samcv *look at how perfectly aligned* https://github.com/MadcapJake/Test-Lab/pull/5/files
07:55 tyil its pretty good, ye
07:55 samcv perfect
07:55 timotimo perfect!
07:55 Cabanossi joined #perl6
07:55 samcv it finds the "name" : " line, and then gets the index of the ':'
07:56 samcv if that index is longer than $indent-of-name-line"license"
07:56 samcv than it padds it. otherwise it adds one space
07:56 samcv works more perfectly than i could have hoped
07:57 timotimo it doesn't detect when the json right-justified
07:57 samcv is there a json module to ocd align my json?
07:57 samcv right justified...
07:57 timotimo :D
07:57 * samcv dies
07:58 samcv but is there a module to get perfectly aligned json?
07:58 timotimo i don't think so
07:58 timotimo not only because there's no such thing as "perfectly aligned" :)
07:58 samcv uhm aligning the ':' and aligning the start of the keys
07:58 samcv or something
07:58 samcv sounds annoying to make
07:58 timotimo nah, it'd be fine
07:59 samcv i mean i don't want to make it :P
07:59 timotimo how do you align nested objects?
07:59 samcv that's not much work
07:59 timotimo anyway, i should be hittin' the road, yo
07:59 samcv that's easy
07:59 timotimo no, i mean, what is your decision what it should look like
07:59 moritz you could take a look if you like for example jq's pretty-printed json output
07:59 samcv jq?
07:59 moritz or try other command-line json tools that can pretty-print
07:59 moritz samcv: a command line tool for working with json data
07:59 samcv i don't really care if they are aligned as long as it's indented
08:00 moritz jq and json_pp and json_xs can certainly do that
08:01 AlexDaniel joined #perl6
08:03 japh-com joined #perl6
08:04 hobbs jq is a nice tool and worth learning. And also interesting as a little functional language.
08:05 darutoko- joined #perl6
08:11 zakharyas joined #perl6
08:15 winnie_ joined #perl6
08:17 dakkar joined #perl6
08:21 parv joined #perl6
08:25 Geth ¦ Inline-Python: 5eee2a8bab | (Samantha McVey)++ | META6.json
08:25 Geth ¦ Inline-Python: Use SPDX identifier in license field of META6.json
08:25 Geth ¦ Inline-Python:
08:25 Geth ¦ Inline-Python: Use the standardized identifier for the license field.
08:25 Geth ¦ Inline-Python: For more details see https://design.perl6.org/S22.html#license
08:25 Geth ¦ Inline-Python: review: https://github.com/niner/Inline-Python/commit/5eee2a8bab
08:25 Geth ¦ Inline-Python: dd03cc767c | niner++ (committed using GitHub Web editor) | META6.json
08:25 Geth ¦ Inline-Python: Merge pull request #23 from samcv/SPDX-license
08:25 Geth ¦ Inline-Python:
08:25 Geth ¦ Inline-Python: Use SPDX identifier in license field of META6.json
08:25 Geth ¦ Inline-Python: review: https://github.com/niner/Inline-Python/commit/dd03cc767c
08:28 xtreak joined #perl6
08:29 lowbro joined #perl6
08:29 lowbro joined #perl6
08:29 SMS joined #perl6
08:31 domidumont joined #perl6
08:33 astj_ joined #perl6
08:35 cpage_ joined #perl6
08:41 eliasr joined #perl6
08:45 andrzejku joined #perl6
08:45 andrzejku hi people
08:45 andrzejku :)
08:45 rindolf joined #perl6
08:48 parv yo/
08:48 gdonald joined #perl6
08:53 wamba joined #perl6
08:55 u-ou hiyo
08:55 u-ou off to bed soon ;)
08:55 zakharyas joined #perl6
08:55 u-ou then up early the next day
08:56 bjz joined #perl6
09:02 jonas1 joined #perl6
09:13 xtreak joined #perl6
09:17 daxim .tell MadcapJake https://chocolatey.org/packages?q=rakudo is outdated
09:17 yoleaux daxim: I'll pass your message to MadcapJake.
09:17 daxim .tell Zoffix please do not forget about nuget/chocolatey specs for vip release
09:17 yoleaux daxim: I'll pass your message to Zoffix.
09:22 xtreak joined #perl6
09:23 xtreak joined #perl6
09:25 Cabanossi joined #perl6
09:27 Geth ¦ gtk-simple: 4efebf7a3a | (Samantha McVey)++ | META6.json
09:27 Geth ¦ gtk-simple: Use SPDX identifier in license field of META6.json
09:27 Geth ¦ gtk-simple:
09:27 Geth ¦ gtk-simple: Use the standardized identifier for the license field.
09:27 Geth ¦ gtk-simple: For more details see https://design.perl6.org/S22.html#license
09:27 Geth ¦ gtk-simple: review: https://github.com/perl6/gtk-simple/commit/4efebf7a3a
09:27 Geth ¦ gtk-simple: f8ac1b93c8 | (Kamil Kułaga)++ (committed using GitHub Web editor) | META6.json
09:27 Geth ¦ gtk-simple: Merge pull request #78 from samcv/SPDX-license
09:27 Geth ¦ gtk-simple:
09:27 Geth ¦ gtk-simple: Use SPDX identifier in license field of META6.json
09:27 Geth ¦ gtk-simple: review: https://github.com/perl6/gtk-simple/commit/f8ac1b93c8
09:38 Actualeyes left #perl6
09:39 * grondilu made a TrigPi module, inspired from Julia:  https://github.com/grondilu/trigpi
09:41 grondilu it's really a short module (just https://github.com/grondilu/trigpi/blob/master/lib/TrigPi.pm6), I'd like to propose its implementation in core
09:43 grondilu that would allow a particularly elegant formulation of FFT:  http://paste.debian.net/929407/
09:45 rindolf joined #perl6
09:49 Geth ¦ ecosystem: 8dede53cd7 | grondilu++ (committed using GitHub Web editor) | META.list
09:49 Geth ¦ ecosystem: Add TrigPi
09:49 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/8dede53cd7
09:55 Cabanossi joined #perl6
10:01 GalenC joined #perl6
10:04 nebuchadnezzar joined #perl6
10:07 mls joined #perl6
10:10 Geth ¦ yaml-pm6: 8e40e1032e | (Samantha McVey)++ | META6.json
10:10 Geth ¦ yaml-pm6: Use SPDX identifier in license field of META6.json
10:10 Geth ¦ yaml-pm6:
10:10 Geth ¦ yaml-pm6: Use the standardized identifier for the license field.
10:10 Geth ¦ yaml-pm6: For more details see https://design.perl6.org/S22.html#license
10:10 Geth ¦ yaml-pm6: review: https://github.com/perl6-community-modules/yaml-pm6/commit/8e40e1032e
10:10 Geth ¦ yaml-pm6: f012d8aaef | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json
10:11 Geth ¦ yaml-pm6: Merge pull request #4 from samcv/SPDX-license
10:11 Geth ¦ yaml-pm6:
10:11 Geth ¦ yaml-pm6: Use SPDX identifier in license field of META6.json
10:11 Geth ¦ yaml-pm6: review: https://github.com/perl6-community-modules/yaml-pm6/commit/f012d8aaef
10:24 nowan joined #perl6
10:38 xtreak joined #perl6
10:40 xtreak joined #perl6
11:10 samcv night all
11:10 Cabanossi joined #perl6
11:15 tyil gn samcv
11:25 awwaiid joined #perl6
11:50 domidumont joined #perl6
11:55 domidumont1 joined #perl6
12:00 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/6167d52be6
12:07 AlexDaniel joined #perl6
12:08 wamba joined #perl6
12:13 gdonald joined #perl6
12:24 Geth Swapped META.info → META6.json in 9 dists in https://github.com/perl6/ecosystem/commit/2da42e6626
12:28 sena_kun joined #perl6
12:32 mr-foobar joined #perl6
12:35 xtreak joined #perl6
12:36 [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 rakudo-moar d92a21: OUTPUT: «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 joined #perl6
12:36 [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 rakudo-moar d92a21: OUTPUT: «"March"␤»
12:37 [Coke] m: dd now.Date;
12:37 camelia rakudo-moar d92a21: OUTPUT: «Date.new(2017,4,26)␤»
12:37 * [Coke] wonders how he got the -1 in there. ah well. :)
12:42 poohman joined #perl6
12:43 skids joined #perl6
12:48 perlpilot joined #perl6
12:55 lowbro joined #perl6
12:55 lowbro joined #perl6
12:55 astj joined #perl6
12:58 moritz [Coke]: one -1 is fine :-)
13:00 [Coke] I ended up with Months.enums.invert.hash{$month} , but that still seems too verbose.
13:00 Voldenet joined #perl6
13:00 Voldenet joined #perl6
13:02 wamba joined #perl6
13:02 moritz m: enum Months <January February March April May>; say Months(1)
13:02 camelia rakudo-moar 9f0b12: OUTPUT: «February␤»
13:02 moritz [Coke]: better? :-)
13:03 mcmillhj joined #perl6
13:12 poohman do we have operator overloading here??
13:13 moritz poohman: yes!
13:13 perlpilot poohman: yes
13:14 moritz m: multi infix:<+>('pooh', 'man') { 'awesome' }; say 'pooh' + 'man'
13:14 camelia rakudo-moar 9f0b12: OUTPUT: «awesome␤»
13:15 poohman cool thanks let me look it up now
13:16 poohman ????
13:17 dogbert17 moritz: I tried to comment on RT #130760 but failed, anyway it should be fixed now
13:17 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130760
13:18 moritz dogbert17: thanks!
13:19 pat_js joined #perl6
13:23 cdg joined #perl6
13:24 zakharyas joined #perl6
13:25 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/ccb50e63eb
13:27 [Coke] moritz: MUCH better, thank you
13:27 * [Coke] wonders why we used () and not [] there.
13:27 [Coke] (or <> or {})
13:31 isBEKaml joined #perl6
13:33 poohman2 joined #perl6
13:33 moritz [Coke]: () is a coercion, and an enum is really a subtype of an Int, so coercion seems to work well there
13:37 mls joined #perl6
13:38 pmurias joined #perl6
13:39 pmurias hi
13:42 [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:42 camelia rakudo-moar 9f0b12: OUTPUT: «(Months)␤»
13:43 [Coke] (want to do MAIN(enumname $var) , but it's case sensitive. :|)
13:43 moritz m: enum Months <January February March April May>; say ::Months::('April')
13:43 camelia rakudo-moar 9f0b12: OUTPUT: «April␤»
13:43 moritz [Coke]: ^^
13:43 moritz m: enum Months <January February March April May>; say ::Months::{'April'}
13:43 camelia rakudo-moar 9f0b12: OUTPUT: «April␤»
13:43 moritz there the {} is a bit more intuitive
13:44 cdg_ joined #perl6
13:45 berov joined #perl6
13:46 [Coke] yay, now I have a p6-cal which works for current month, given month/year, and highlights today's date.
13:46 [Coke] I ran cal earlier today and was frustrated I then had to run 'date'
13:47 moritz my cal does exactly that :-)
13:47 [Coke] moritz++ # enum help
13:47 moritz I just find it frustrating that I can't select a month of the current year without also selecting the year
13:47 moritz cal 2 # year 2 BC. Thanks!
13:48 [Coke] moritz: done.
13:48 moritz ah, cal -m 3
13:48 [Coke] (one line MAIN addition)
13:48 moritz I guess I should have read the man page
13:48 moritz [Coke]: nice
13:49 cdg joined #perl6
13:49 * [Coke] will polish this up later and post it. Dumb little thing.
13:50 cdg_ joined #perl6
13:55 isBEKaml [Coke]: All things start dumb, just look at all babies!
13:55 * isBEKaml hides
13:55 Cabanossi joined #perl6
14:03 mcmillhj joined #perl6
14:08 aborazmeh joined #perl6
14:08 aborazmeh joined #perl6
14:09 Ulti how are updates triggered to the ecosystem? is it on change to the META.list?
14:12 moritz it's a cron job, iirc
14:20 [Coke] moritz, isBEKaml, yay, now bin/cal 2017 also works.
14:22 zakharyas joined #perl6
14:27 kurahaupo joined #perl6
14:28 Ulti looks like
15:07 perlpilot joined #perl6
15:08 alimon joined #perl6
15:17 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
15:19 grondilu so, sinPi and cosPi are in IEEE 954 :  https://www.csee.umbc.edu/~tsimo1/CMSC455/IEEE-754-2008.pdf   How would you feel about adding them in the core?  I wrote a version here:  https://github.com/grondilu/trigpi
15:22 perlpilot grondilu: what about asinPi, acosPi, atanPi, and atan2Pi?
15:22 perlpilot (personally, I wouldn't miss them from core and wouldn't mind if they were in a module)
15:23 grondilu perlpilot: I don't know how easy those are to write.
15:25 Cabanossi joined #perl6
15:26 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:27 Skarsnik joined #perl6
15:29 El_Che !deb
15:29 El_Che !debs
15:29 Skarsnik Hello
15:30 Skarsnik does use-ok (in Test) get changed and does not load the 'module'?
15:30 shlomif joined #perl6
15:31 perlpilot grondilu: also ... "sinPi(+n) is +0 and sinPi(−n) is −0 for positive integers n."  I don't think yours does that.
15:33 khw joined #perl6
15:38 grondilu I don't know.  What does (2*n) % 2 returns as opposed to (-2*n) % 2 ?
15:39 grondilu m: say 8 % 2 === -8 % 2
15:39 camelia rakudo-moar ee4593: OUTPUT: «True␤»
15:40 grondilu m: say $_ % 2 === -$_ % 2 given my uint $ = 8
15:40 camelia rakudo-moar ee4593: OUTPUT: «True␤»
15:40 grondilu m: say $_ % 2 === -$_ % 2 given my num $ = 8e0
15:40 camelia rakudo-moar ee4593: OUTPUT: «True␤»
15:41 grondilu meh
15:46 abraxxa joined #perl6
15:48 wamba joined #perl6
15:50 Actualeyes joined #perl6
15:52 skink joined #perl6
15:53 Zoffix joined #perl6
15:54 Zoffix Skarsnik: it's not use-ok itself that changed, but the module loading that did: http://rakudo.org/2016/12/17/lexical-module-loading/
15:55 Zoffix 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
15:55 Skarsnik it was in a BEGIN block
15:56 Skarsnik so it was lexical for the BEGIN block I guess
15:56 Possum joined #perl6
15:56 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 ^^
15:57 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: https://github.com/rakudo/rakudo/pulse/monthly
15:57 Zoffix skink: nope
15:58 Zoffix buggable: eco if
15:58 buggable Zoffix, if 'conditionally use packages': https://github.com/FROGGS/p6-if 34 other matching results: https://modules.perl6.org/#q=if
15:58 skink Seems like he was on yesterday to merge all the meta PRs, so hopefully he's seen it
15:58 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).
15:59 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.
16:00 grondilu colomon: that's exactly what I'm doing :)
16:00 colomon +1
16:00 Zoffix grondilu: even the easy parts need time and motivation.
16:00 tyil colomon: does it get a decent performance boost if its merged into core, compared to being a module?
16:00 Zoffix Of course not
16:01 Zoffix There's nothing special about core code.
16:01 Zoffix It's just Perl 6
16:01 colomon tyil: obviously the tiny one of not needing to load the module, but other than that I wouldn’t expect a difference.
16:01 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
16:02 tyil developernamespace::modulename
16:02 tyil (not that I use that, but that should work fine for most things, no?)
16:02 tyil a catchy name is just a bonus, if its a good module people will use it
16:02 Zoffix timotimo: did you recently fix "Cannot find method 'symtable' on object of type GLOBAL" error somewhere? What was the fix?
16:02 colomon Math::TrigPI or somesuch
16:02 tyil though it can help being found when people look for it
16:03 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.
16:03 Zoffix bugs and all
16:03 tyil does the single module have to do both? otherwise Math::CosPi and Math::SinPi
16:03 Zoffix m: say 2e0/0e0
16:03 camelia rakudo-moar ee4593: OUTPUT: «Attempt to divide 2 by zero using /␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:03 colomon single module makes much more sense
16:03 Zoffix m: $ = 2e0/0e0
16:03 camelia rakudo-moar ee4593: ( no output )
16:03 timotimo Zoffix: i don't recall a fix like that
16:03 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
16:04 grondilu tyil: well for one I very much dislike modules starting with Math::
16:04 Zoffix the exception I mean
16:04 tyil Grondilu::Pi
16:04 tyil :D
16:05 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 jnthn It's worth noting that for everything we add, though, to some degree everyone pays
16:05 jnthn Everything that goes in increases the base memory use of Rakudo
16:05 jnthn Which a small number of folks are trying to bring down :-)
16:06 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
16:06 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
16:07 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: https://github.com/FROGGS/p6-if/issues/2#issuecomment-290522547
16:07 jnthn *harder
16:07 rindolf joined #perl6
16:08 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:09 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:11 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:12 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:13 Zoffix TreyHarris: $z.defined || $z > 5
16:13 Zoffix TreyHarris: oh, never mind :)
16:14 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
16:14 Zoffix TreyHarris: $z andthen * > 5 orelse True
16:14 Zoffix :)
16:15 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)
16:15 Zoffix m: my $z; say ($z andthen * > 5 orelse True)
16:15 Zoffix m: 42
16:15 Zoffix huh
16:15 camelia rakudo-moar ee4593: OUTPUT: «(timeout)»
16:15 camelia rakudo-moar ee4593: OUTPUT: «True␤»
16:15 camelia rakudo-moar ee4593: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
16:16 TreyHarris perlpilot: I didn't say "shorter". This is for a clause though, so multiline would be undesirable.
16:16 Zoffix Oh
16:16 Zoffix TreyHarris: what sort of clause? `where`?
16:16 Zoffix .defined.not or $_ > 5
16:16 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)
16:17 TreyHarris Zoffix: in this case it was. ahh, nice.
16:17 Zoffix TreyHarris: see also:
16:17 Zoffix buggable: eco Subset::Helper
16:17 camelia rakudo-moar ee4593: OUTPUT: «(timeout)»
16:17 buggable Zoffix, Subset::Helper 'create awesome subsets': https://github.com/zoffixznet/perl6-Subset-Helper
16:17 Zoffix `where subset-is * > 5` I think that should work
16:18 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
16:18 Zoffix TreyHarris: yeah, that's kinda annoying
16:18 TreyHarris because there are various perl5 dwimmeries that could be done entirely in the signatures if you could do that.
16:19 grondilu how do I unmix a role?
16:20 grondilu m: role Foo {}; my $x does Foo = 1; my $y = +$x; say $y ~~ Foo;
16:20 camelia rakudo-moar ee4593: OUTPUT: «Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
16:20 grondilu m: role Foo {}; my $x = 1 but Foo; my $y = +$x; say $y ~~ Foo;
16:20 camelia rakudo-moar ee4593: OUTPUT: «True␤»
16:20 grondilu m: role Foo {}; my $x = 1 but Foo; my $y = 0+$x; say $y ~~ Foo;
16:20 camelia rakudo-moar ee4593: OUTPUT: «False␤»
16:21 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 TreyHarris s/set/said/ # why am I making so many homophonic typos on IRC lately?
16:23 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 #perl6
16:24 mscha joined #perl6
16:24 Zoffix tyil: get
16:24 tyil thanks
16:24 tyil that explains why get was highlighting already
16:24 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;
16:24 camelia rakudo-moar ee4593: OUTPUT: «[1 2 3]␤[1 2 3]␤1 2␤»
16:24 Zoffix tyil: there's also prompt if you want to show a message
16:24 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)
16:24 camelia rakudo-moar ee4593: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "cos(3/5*pi)" in expression "cos(3/5*pi)" in sink context (line 1)␤»
16:24 tyil :o
16:25 tyil perl has everything these days
16:25 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)
16:25 camelia rakudo-moar ee4593: OUTPUT: «-0.309016994374947␤»
16:25 cdg joined #perl6
16:26 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
16:26 mscha That @c[2] //= 3 doesn't work is a bug, right?
16:26 Geth Swapped META.info → META6.json in 5 dists in https://github.com/perl6/ecosystem/commit/7c163e7592
16:26 mscha And why is the output of "say @c" different than the other two?  (No brackets)
16:26 itaipu joined #perl6
16:27 TreyHarris tyil: well, it answers this, if you know how to do it in Perl 5 :-)
16:28 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`. https://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 rindolf joined #perl6
16:30 Skarsnik_ joined #perl6
16:31 * Zoffix looks at .define_slang
16:31 Zoffix Maybe World isn't available for messing with anymore?
16:32 jnthn mscha: A native int array cannot represent undefined
16:33 jnthn mscha: So indexes out of range produce zero, which is boxed because // is an operation on objects, and so is defined
16:33 jnthn So no bug, just forgetting that native means :)
16:33 mscha Ah, that explains it.
16:33 jnthn *what
16:34 jnthn Well, not so much forgetting as it not being immediately obvious that'd be a consequence :-)
16:34 Skarsnik__ joined #perl6
16:36 perlpilot joined #perl6
16:36 Zoffix bah
16:36 Zoffix I think I see the bug.
16:37 Skarsnik joined #perl6
16:38 Zoffix .tell TimToady disregard. Found where the bug was at.
16:38 yoleaux Zoffix: I'll pass your message to TimToady.
16:41 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:44 Zoffix skink: I PRed a fix for if.pm6: https://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:46 Zoffix TreyHarris: no idea. I wrote that when I barely knew Perl 6.
16:47 TreyHarris heh
16:47 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
16:47 Zoffix s/before/because/;
16:48 Zoffix And that's so that the subset matches in `sub (Foo $x?) {}`
16:49 Zoffix 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. :-)
16:50 Zoffix heh
16:50 TreyHarris Zoffix: got it, that makes sense
16:50 skink Zoffix, Seems to work on 2016.10
16:50 Zoffix Sweet.
16:51 Zoffix TreyHarris: well, I got no kids and spend a lot of type *per day* on Perl 6. It's all relative :)
16:51 Zoffix s/type/time/;
16:52 * Zoffix &
16:52 Zoffix left #perl6
16:53 gdonald joined #perl6
17:05 cognominal joined #perl6
17:06 cdg_ joined #perl6
17:13 cdg joined #perl6
17:14 wamba joined #perl6
17:18 MilkmanDan joined #perl6
17:38 cognominal joined #perl6
17:42 b2gills TreyHarris: how about ($z // 6) > 5
17:44 b2gills 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:46 setty1 joined #perl6
17:46 TimToady joined #perl6
17:47 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 #perl6
17:56 ggoebel joined #perl6
18:01 espadrine joined #perl6
18:08 cdg joined #perl6
18:10 b2gills m: sub foo ( |c ( $z? ) ) { c.elems == 0 ?? '$z is default' !! '$z has a value' }; say foo; say foo 1
18:10 camelia rakudo-moar ee4593: OUTPUT: «$z is default␤$z has a value␤»
18:10 b2gills TreyHarris: you mean like that ^
18:12 TreyHarris b2gills: I don't see a default in that signature. I mean a signature with '= value'
18:15 perlpilot joined #perl6
18:18 erdic joined #perl6
18:27 Geth Swapped META.info → META6.json in 3 dists in https://github.com/perl6/ecosystem/commit/a9c8ed4599
18:38 cdg_ joined #perl6
18:40 matiaslina joined #perl6
18:48 raschipi joined #perl6
18:55 jnthn m: sub foo(|c, :$a where { say c<a>:exists } = 42) { }; foo(); foo(a => 40)
18:55 camelia rakudo-moar ee4593: OUTPUT: «False␤True␤»
18:55 Cabanossi joined #perl6
18:55 jnthn TreyHarris: There's a way to do what you asked about :)
18:56 jnthn (And can use c[0]:exists for positionals too I guess)
18:56 Geth ¦ Inline-Perl5: 50803bff13 | (Stefan Seifert)++ | p5helper.c
18:56 Geth ¦ Inline-Perl5: Fix memory corruption when running multiple Perl 5 interpreters
18:56 Geth ¦ Inline-Perl5:
18:56 Geth ¦ Inline-Perl5: Add PERL_SET_CONTEXT(my_perl) calls to all remaining functions which were
18:56 Geth ¦ Inline-Perl5: lacking it. We really have to do it before making any calls into Perl 5,
18:56 Geth ¦ Inline-Perl5: except for the few cases where macros really just access their arguments and
18:56 Geth ¦ Inline-Perl5: not make any further calls.
18:56 Geth ¦ Inline-Perl5:
18:56 Geth ¦ Inline-Perl5: This fixes the "Scalars leaked", "Attempt to free unreferenced scalar" and
18:56 Geth ¦ Inline-Perl5: other messages printed by t/use.t
18:56 Geth ¦ Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/50803bff13
18:56 Geth ¦ Inline-Perl5: 32d0cdfb70 | (Stefan Seifert)++ | META6.json
18:57 Geth ¦ Inline-Perl5: Version 0.26
18:57 Geth ¦ Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/32d0cdfb70
19:00 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:06 jnthn TreyHarris: Yeah, it lets you snapshot the argument capture at that point in the binding, essentially
19:08 TreyHarris but you can't follow it with any positionals
19:10 TreyHarris 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 TreyHarris s/pleo/ple/
19:11 skids You can put them in the capture subsig
19:11 skids m: sub c (|c($f, $g)) { "$f {c} $g".say }; c(3,4)
19:11 camelia rakudo-moar ee4593: OUTPUT: «3 3 4 4␤»
19:13 astj joined #perl6
19:13 skids Or use a less grabby destructurer
19:13 skids m: sub c ($a ($f, $g), $h) { "$a $f $g $h".say }; c([3,4], 5)
19:13 camelia rakudo-moar ee4593: OUTPUT: «3 4 3 4 5␤»
19:14 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 TreyHarris (the link is broken, obviously).
19:15 MasterDuke_ https://docs.perl6.org/type/Signature#index-entry-destructuring_arguments_%28Signature%29
19:15 ggoebel joined #perl6
19:15 MasterDuke_ is ^^^ what you're looking for?
19:16 dwarring joined #perl6
19:16 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 TreyHarris thanks
19:17 TreyHarris (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:18 skids Coincidentally I was on that very page in my browser.  There must be some sort of global Perl6 gestalt.
19:25 Cabanossi joined #perl6
19:27 Geth ¦ doc: feb9d6bc54 | (Trey Harris)++ | doc/Language/typesystem.pod6
19:27 Geth ¦ doc: Fix mispelling of sub-signatures & broken link
19:27 Geth ¦ doc:
19:27 Geth ¦ doc: In typessytem.pod6.
19:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/feb9d6bc54
19:27 Geth Swapped META.info → META6.json in 7 dists in https://github.com/perl6/ecosystem/commit/66b9079498
19:29 dwarring m: class C { method greet {say "hi" }}; subset S of C; S.greet; S.new
19:29 camelia rakudo-moar ee4593: OUTPUT: «hi␤You cannot create an instance of this type (S)␤  in block <unit> at <tmp> line 1␤␤»
19:29 dwarring m: class C { method greet {say "hi" }}; subset S of C; S.greet
19:29 camelia rakudo-moar ee4593: OUTPUT: «hi␤»
19:29 dwarring m: class C { method greet {say "hi" }}; subset S of C; S.new
19:29 camelia rakudo-moar ee4593: OUTPUT: «You cannot create an instance of this type (S)␤  in block <unit> at <tmp> line 1␤␤»
19:32 dwarring m: class C { method sneaky-new {say "hi" }}; subset S of C; S.sneaky-new
19:32 camelia rakudo-moar ee4593: OUTPUT: «hi␤»
19:32 dwarring m: class C { method sneaky-new {self.new }}; subset S of C; dd S.sneaky-new
19:32 camelia rakudo-moar ee4593: OUTPUT: «You cannot create an instance of this type (S)␤  in method sneaky-new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:32 dwarring ahh
19:33 dwarring Was just seeing if I can create an object from a subset
19:34 dwarring seems I can't
19:35 dwarring but I can call other class level methods from the subset
19:36 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:37 raschipi m: class C { method greet {say "hi" }}; subset S of C; S.^methods.say
19:37 camelia rakudo-moar ee4593: OUTPUT: «No such method 'methods' for invocant of type 'Perl6::Metamodel::SubsetHOW'␤  in block <unit> at <tmp> line 1␤␤»
19:38 dwarring yeah there's some pratical difficulties
19:38 dwarring you'd need to make sure the newly created object belongs to the subset
19:39 dwarring m: class C { method sneaky-new {self.new }}; subset S of C; dd S.sneaky-new
19:39 camelia rakudo-moar ee4593: OUTPUT: «You cannot create an instance of this type (S)␤  in method sneaky-new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:39 dwarring ^ and its too easy to bypass
19:39 samcv good morning :-)
19:39 dwarring makes sense
19:40 raschipi heya samcv
19:40 samcv gonna check on ecosystem stats
19:41 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.
19:41 samcv which awesomeness?
19:41 samcv which one lol
19:41 raschipi your usual
19:41 samcv more pull requests? then yes
19:42 samcv raschipi, you saw my post on my eco effort yes? https://cry.nu/perl6/ecosystem-license-module-tagging/
19:44 labster joined #perl6
19:46 raschipi samcv: yes I did.
19:46 samcv cool :)
19:46 samcv so yeah gonna do more of that
19:46 samcv did 190 yesterday. got another 110 to go that have license files in them
19:46 samcv that don't have PR yet
19:47 rindolf joined #perl6
19:48 samcv not sure how many PR are still pending, but 190 PR more accepted will put us to 56% of ecosystem
19:48 samcv trying to get to 50% before the end of the week
19:48 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
19:49 samcv 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 samcv here we go: https://gist.github.com/samcv/6a7e74e4b071e1d514904f7b02bb001e
19:49 rindolf joined #perl6
19:50 samcv so we have a plan b in case he actually does remove all his modules
19:50 samcv removig some of those would break lots of eco modules
19:51 samcv 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.
19:52 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 cdg joined #perl6
19:52 samcv before i wrote as script to automate the fork + change the auth + source-url fields etc i was kind of stressed out
19:53 samcv 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 samcv "perl" -> "Artistic-2.0" is not a bad change, even if he for whatever reason thinks we shouldn't use SPDX identifiers
19:54 raschipi It's just how metadata works after all. It's useless if it can't be parsed.
19:55 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 samcv yeah exactly
19:55 samcv 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
19:56 samcv some more i can't remember
19:57 samcv plus they look nice to humans. and nicer than the perl 5 metadata ones https://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.
19:57 samcv yeah it is used there
19:58 samcv and you can view all licenses at https://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 samcv and plus they have a json file with ALL license names and full license text and the other urls for it as well
19:58 samcv so that's super nice
19:59 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 https://raw.githubusercontent.com/sindresorhus/spdx-license-list/master/spdx-full.json
20:00 samcv my license detection module uses it (not yet in eco until perfected)
20:00 raschipi Release early, release often.
20:01 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 samcv would prefer not to put it in my git repo, since it could be updated
20:01 samcv or if the user wants to pull in and check for an update
20:02 * skids wonders what libtommath's license's SPDX code is.
20:02 samcv it's public domain it says
20:02 samcv but good point
20:02 skids Have you read it? :-)
20:03 samcv read what?
20:03 skids that license
20:03 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)
20:03 samcv https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files
20:03 samcv i'd like it to not have to download it each time it runs though
20:04 samcv 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 samcv maybe add a subrepo? never done that before
20:04 raschipi hum, download it and check to see if it's there already before doing it.
20:04 samcv already where?
20:04 samcv and where to put it
20:05 skids WTFPL
20:05 skids (seems to be)
20:06 raschipi -- /var/licensedetection/spdx-full.json
20:06 samcv imo anybody trying to public domain should use CC-0
20:06 samcv because it has fallback for if the law won't let you put it in public domain
20:07 samcv it's pretty nice, i read the full license text https://creativecommons.org/share-your-work/public-domain/cc0/
20:08 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 samcv and does your country even support that? it may have 0 effect
20:09 samcv Public Domain is a horrible license because it has no fallback. so anybody wanting to public domain should use CC0
20:10 Cabanossi joined #perl6
20:11 raschipi if it can't write to /var/modulename, it should use the current directory
20:13 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:14 samcv 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 samcv in case they had two licenses or something
20:15 samcv 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
20:16 samcv we can distribute the metadata. there's a legal clause for ecosystem
20:16 samcv saying you allow meta to be altered and distributed
20:16 samcv permissively
20:16 samcv but. i do agree all modules should have licenses. becuase otherwise you don't know if you can use them or not
20:16 raschipi Yes, but what's the point about distributing the metadata of a module we can't distribute?
20:16 samcv yep
20:16 TreyHarris making sqlite an impossible dependency sucks.
20:17 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
20:18 TreyHarris from depending on sqlite
20:18 freesoftwarejoe joined #perl6
20:18 freesoftwarejoe Has alot changed since perl 5?
20:19 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 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
20:20 raschipi TreyHarris: Public Domain can be used, it's just complicated.
20:20 freesoftwarejoe i know perl 5, but was thinking i could try perl 6...
20:21 itaipu joined #perl6
20:22 raschipi freesoftwarejoe: This is the document for you:  https://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.)
20:23 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 ( https://en.wikipedia.org/wiki/Distributed_hash_table ) on Perl 6?
20:23 raschipi I would personally just use DNS for that.
20:24 freesoftwarejoe I dont think that would work, its a rather large table
20:24 jast joined #perl6
20:26 raschipi Zoffix said he has long-lived daemons written in Perl6 and haven't found any problems recently.
20:27 rindolf joined #perl6
20:28 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/1424966406
20:31 raschipi Later people, gotta go.
20:31 Zoffix joined #perl6
20:33 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 Zoffix Geth, uptime
20:33 Geth Zoffix, 1 day, 2 hours, 30 minutes, and 13 seconds
20:33 Zoffix Well, I added a new feature yesterday and restarted it
20:34 Zoffix Oh, huggabpe has been on since March 22nd according to whous
20:35 Zoffix So there. 1 month listening to ~4 IRC channels using async code and no issues
20:35 Zoffix left #perl6
20:45 AlexDaniel joined #perl6
20:55 Actualeyes joined #perl6
21:00 AlexDaniel not sure about sinPi or cosPi, but thinking about fft in core makes me excited :)
21:10 Cabanossi joined #perl6
21:14 samcv freesoftwarejoe, how big is the table
21:15 hobbs depends how many leaves you put in it
21:15 samcv well. that goes without saying
21:19 pierrot joined #perl6
21:33 [Coke] joined #perl6
21:51 dct joined #perl6
21:55 Cabanossi joined #perl6
21:59 samcv found a project under GPL-1.0/Artistic-1.0-Perl oo. gonna make my first dual licensed PR
22:07 AlexDaniel GPL-1.0 what????
22:08 AlexDaniel ah right, artistic 1.0 also
22:11 bjz joined #perl6
22:13 samcv yeah
22:16 samcv ok cool. now it has 99.5% similarity or <= 4 words different as the benchmark. now detecting these MIT and shorter licenses
22:21 samcv gonna see if i can paralelize this and speed it up
22:23 samcv omgzzz segmentation fault :|
22:23 AlexDaniel welcome to my world
22:24 hobbs was it a *fast* segfault?
22:26 Cabanossi joined #perl6
22:26 samcv yeah
22:26 samcv gonna build debug moar and use gdb
22:28 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/b39fda3b19
22:28 samcv not a ton of info https://gist.github.com/samcv/2696f9cd1ce9652760b88121768309fd
22:29 skids joined #perl6
22:29 samcv well picked up some mvm things
22:29 samcv looks like a gc bug
22:29 AlexDaniel hobbs: interestingly, you can get fast segfaults if it's your fault
22:30 AlexDaniel m: my @a; start loop { @a.push: rand }; start loop { @a.push: rand }; sleep 1
22:30 AlexDaniel
22:30 camelia rakudo-moar 139243: OUTPUT: «(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…»
22:30 samcv hehe
22:30 AlexDaniel like here
22:30 AlexDaniel (RT #128870)
22:30 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=128870
22:30 samcv shouldn't trust variables won't break when you don't use locks and doing in tons of threads
22:31 AlexDaniel yup
22:31 samcv i ran it with use 6.d.Preview
22:31 samcv maybe should try without
22:32 alphah joined #perl6
22:32 samcv yep same thing
22:34 samcv does OO::Monitors still work when you set @.var is rw
22:34 samcv in the class
22:35 AlexDaniel :|
22:35 AlexDaniel I just executed some code…
22:35 AlexDaniel which crunches some numbers… pure math
22:35 AlexDaniel and I got one number wrong out of it
22:36 AlexDaniel surprised, I executed it again, and this time it's right
22:36 samcv threads?
22:36 AlexDaniel no
22:36 kurahaupo_ joined #perl6
22:37 AlexDaniel this is horrible, I can't reproduce it
22:38 samcv ok now i'm using OO::Monitors for the one variable which is outside the start { } block that's modified
22:38 samcv now i get Tried to get the result of a broken Promise
22:39 * 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.
22:39 samcv k
22:39 skids That will get you the error.
22:41 AlexDaniel ah, ok. I've probably pasted two random chars into my terminal, that's why
22:41 AlexDaniel phew
22:42 samcv gonna not write to variables and keep the return values of them instead
22:45 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 samcv and it seesm to be working
22:46 samcv \o/
22:46 samcv using the return value of a promise is the easiest way to get results i think
22:46 AlexDaniel (sure, just let it run for a little bit…)
22:46 samcv well without exploding
22:47 samcv ahhhhh
22:47 samcv segfault
22:47 mcmillhj joined #perl6
22:47 AlexDaniel samcv: ;)
22:47 samcv you jynxed it
22:47 AlexDaniel I've been through this way too many times
22:47 samcv :(
22:48 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 AlexDaniel samcv: can I take a look at the code?
22:50 samcv yeah
22:52 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:53 samcv sec
22:53 samcv AlexDaniel, https://github.com/samcv/eco-license-automation-stuff/blob/master/checkall.p6
22:54 samcv this is the license checker module https://github.com/samcv/eco-license-automation-stuff/blob/master/lib/license_check.pm6
22:54 samcv oh oops. it doesn't work hold on
22:54 samcv gonna revert some things
22:55 AlexDaniel how many times does it 「start」 at the same time?
22:55 samcv lots
22:55 AlexDaniel well… I don't think that's a proper way to do it :)
22:55 samcv :(
22:55 AlexDaniel better create some worker threads with channels
22:55 samcv i want speeddddd
22:55 AlexDaniel and instead of start-ing just push into the channels
22:55 samcv and i'm lazy
22:56 samcv push what to the channels
22:56 samcv oh worker threads etc
22:56 samcv ugh
22:56 samcv easier just to not thread it and let it run over an extended period
22:57 AlexDaniel yea… yea
22:57 AlexDaniel that's what whateverable does now
22:58 AlexDaniel at times we needed more speed, so we ran several scripts in parallel
22:58 AlexDaniel instead of trying to parallelize inside the script
22:58 samcv :\
22:58 AlexDaniel ten times more reliable
22:58 samcv modules seem to make it harder for it to work imo
22:59 samcv when you have lots of different scopes
22:59 samcv can i just put locks everywhere
22:59 samcv hm
22:59 samcv make 5 locks.
23:00 samcv because i'm super lazy.
23:01 AlexDaniel m: use 6.d.Preview; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a
23:01 camelia rakudo-moar 139243: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    use used at line 1␤␤»
23:01 samcv my @locks = Lock.new xx 5; @locks.pick.protect( { } )
23:01 AlexDaniel use used :|
23:01 samcv before entering the start block
23:01 samcv X:
23:01 samcv genius
23:01 AlexDaniel m: use v6.d.Preview; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a
23:01 camelia rakudo-moar 139243: OUTPUT: «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␤»
23:02 AlexDaniel what was it?
23:02 AlexDaniel m: use v6.d.PREVIEW; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }); say @a
23:02 camelia rakudo-moar 139243: OUTPUT: «[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…»
23:02 AlexDaniel m: use v6.d.PREVIEW; my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).say
23:02 camelia rakudo-moar 139243: OUTPUT: «HyperSeq.new␤»
23:02 AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).say
23:02 camelia rakudo-moar 139243: OUTPUT: «HyperSeq.new␤»
23:02 samcv m: @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 } ); }
23:02 camelia rakudo-moar 139243: OUTPUT: «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␤»
23:03 samcv m: my @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 } ); }
23:03 camelia rakudo-moar 139243: OUTPUT: «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␤»
23:03 samcv m: my @locks = Lock.new xx 5; await do for ^10 { @locks.pick.protect({ start { 1 }; }); }
23:03 camelia rakudo-moar 139243: ( no output )
23:03 samcv m: my @locks = Lock.new xx 5; my @results = await do for ^10 { @locks.pick.protect({ start { 1 }; }); }; say @results
23:03 camelia rakudo-moar 139243: OUTPUT: «[1 1 1 1 1 1 1 1 1 1]␤»
23:03 samcv geniusssss
23:03 samcv i still got a segfault tho :|
23:03 AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).list.say
23:03 camelia rakudo-moar 139243: OUTPUT: «(-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…»
23:03 AlexDaniel look! Hyper is working!
23:04 bjz joined #perl6
23:04 AlexDaniel m: my @a = rand xx 20; @a.hyper.map({sleep rand / 100; -$_ }).grep({ $_ < -0.5 }).list.say
23:04 camelia rakudo-moar 139243: OUTPUT: «(-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)␤»
23:04 AlexDaniel \o/
23:04 samcv did it not work before
23:04 samcv i've never tried the method
23:04 AlexDaniel are you kidding me :|
23:04 Kaffe joined #perl6
23:04 samcv i remember something about it
23:05 samcv 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
23:05 samcv even when i have only 2 locks
23:05 committable6 AlexDaniel, ¦releases (18 commits): «(-6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19)»
23:06 AlexDaniel :o yea, wrong example then
23:06 samcv oh cause i don't await the start block inside the lock i guess
23:06 samcv m: my @locks = Lock.new xx 5; my @results = await do for ^10 { @locks.pick.protect({ await start { 1; }; }); }; say @results
23:06 camelia rakudo-moar 139243: OUTPUT: «Must specify a Promise, Channel, or Supply to await on (got a Int)␤  in block <unit> at <tmp> line 1␤␤»
23:06 samcv oh yay it's working!!!
23:07 samcv only two threads
23:07 samcv ===SORRY!===
23:07 samcv next without loop construct
23:07 samcv argh
23:07 raschipi joined #perl6
23:07 AlexDaniel committable6 just died with “too many open files”
23:08 samcv can you return from a start block?
23:08 * AlexDaniel *shrug*
23:08 samcv m: start { return 10; 100 }
23:08 camelia rakudo-moar 139243: ( no output )
23:08 samcv m: my $prom = start { return 10; 100 }; say $prom.result
23:08 camelia rakudo-moar 139243: OUTPUT: «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:08 samcv m: my $prom = start { return 10; 100 }; await $prom; say $prom.result
23:08 camelia rakudo-moar 139243: OUTPUT: «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 }
23:09 camelia rakudo-moar 139243: ( no output )
23:09 committable6 joined #perl6
23:09 Voldenet no, you can't
23:09 samcv how to end a start loop early?
23:09 Voldenet m: my $prom = start { CATCH { .say }; return 10; 100 }; await $prom; say $prom.result
23:09 camelia rakudo-moar 139243: OUTPUT: «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>…»
23:10 Voldenet goto?
23:10 Voldenet ;>
23:10 samcv that doesn't exist
23:10 AlexDaniel c: releases my @a = ^30; @a.hyper.grep({ $_ %% 2 }).list.say
23:10 samcv *work* that is
23:10 committable6 AlexDaniel, ¦releases (18 commits): «()»
23:10 AlexDaniel samcv: there ↑
23:10 AlexDaniel but .map seems to be working
23:13 pochi joined #perl6
23:13 samcv it's still going strong at least AlexDaniel
23:14 samcv https://github.com/samcv/eco-license-automation-stuff/blob/master/checkall.p6#L81-L106
23:15 samcv 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
23:16 samcv :)
23:16 samcv now with 9 locks
23:16 samcv gonna see if it dies on me
23:16 AlexDaniel except that it does it serially in this case…
23:16 AlexDaniel or am I wrong?
23:17 baest joined #perl6
23:17 AlexDaniel yea, shouldn't be parallel
23:17 samcv hmm
23:20 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 AlexDaniel ugly as hell but will do as a quick hack
23:20 samcv how to check if a lock is currently protected?
23:20 samcv .condition doesn't seem to work
23:21 samcv ok not what i want in this case
23:21 AlexDaniel ok, so let's say you checked the lock status, now what?
23:21 samcv i don't `.pick` that lock
23:22 AlexDaniel the moment you do something it could be anything else
23:22 samcv go to the next open one
23:22 samcv that's what the protect is for
23:22 AlexDaniel still won't work
23:22 samcv ah
23:22 AlexDaniel because in your case .protect({}) will wait for it to finish
23:22 samcv it still has a protect
23:22 samcv fine
23:22 AlexDaniel use the channel trick mentioned above
23:22 AlexDaniel or try .hyper
23:23 samcv how does the channel trick help me?
23:23 samcv it pushes locks to the channel?
23:23 cdg joined #perl6
23:24 samcv ok i think i get it
23:25 samcv brb
23:30 samcv trying now
23:31 cognominal joined #perl6
23:32 samcv AlexDaniel, do i still want `await start { }` in the  block?
23:32 samcv that wasn't spawning any extra processes
23:32 AlexDaniel samcv: just start
23:32 Voldenet start {} returns a promise, start with that
23:33 samcv yeah it wasn't happy like that AlexDaniel
23:33 samcv sec
23:33 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)
23:34 timotimo https://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 }
23:34 camelia rakudo-moar 139243: OUTPUT: «0␤4␤3␤1␤2␤5␤6␤7␤9␤8␤13␤10␤14␤11␤12␤18␤16␤17␤15␤19␤»
23:34 Voldenet something like this?
23:35 timotimo you don't need to "await Promies.allof(...)", it's the same semantics as "await ..."
23:35 timotimo (except i don't think allof gives you the actual result values
23:35 Voldenet allof discards broken promises
23:35 timotimo but if you weren't going to take them, it doesn't matter that await on a list will give 'em)
23:35 timotimo oh, i didn't realize
23:35 samcv yep
23:35 samcv what vol said
23:35 timotimo right, allof is for "kept or broken"
23:35 timotimo good to know
23:36 AlexDaniel yea that's better
23:38 TEttinger joined #perl6
23:38 timotimo i think i'm going to bed now before i dispense any more wrong advice about concurrency stuff :)
23:39 samcv oh hey. is this. working
23:39 samcv pls no crashhhh
23:39 u-ou joined #perl6
23:39 samcv maybe it..deadlocked?
23:40 samcv oo forgot to send the lock back to the channel
23:40 Voldenet but why lock if you are using channels anyway
23:40 AlexDaniel send the lock? no need for locks
23:41 samcv ok
23:41 Voldenet just push arguments, receive processed data
23:41 samcv k
23:41 timotimo locks? where we're going we don't need locks.
23:41 samcv :D
23:41 Voldenet Locks are for people that don't believe in concurrency god
23:42 samcv ok it's working
23:47 samcv yay segfault
23:47 * samcv puts back the lock
23:49 samcv there is no concurrency god :(
23:50 BenGoldberg joined #perl6
23:51 samcv now i get segfault yay
23:51 samcv took a while though
23:54 * samcv moves the lock one closure higher
23:54 samcv or lower. not sure
23:54 samcv less deep
23:55 Cabanossi joined #perl6
23:58 timotimo .o( you get me closure to god )
23:58 timotimo .o( my whole concurrency is flawed )

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

Perl 6 | Reference Documentation | Rakudo