Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-08

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 Actualeyes joined #perl6
00:01 timotimo but it's quite clear that you rproblem isn't that one, it's the core setting build
00:01 timotimo or perhasp install-core-distributions or what it's called
00:01 timotimo but less likely to be a problem
00:05 ajr_ Timotimo - any suggestions for the next step in debugging?
00:07 timotimo if you had "stage parse" close to before the crash, it's pretty much 99% sure you're running out of memory
00:07 ajr_ Agreed.
00:13 ugjka joined #perl6
00:16 abruanese joined #perl6
00:16 dalek doc: d1fe150 | gfldex++ | doc/Type/IO.pod6:
00:16 dalek doc: tell the trap that is Cool.IO. We need that because searching for
00:16 dalek doc: IO is a little misleading.
00:16 dalek doc: review: https://github.com/perl6/doc/commit/d1fe150239
00:16 synopsebot6 Link: http://doc.perl6.org/type/IO
00:16 pierre_ joined #perl6
00:18 imcsk8 joined #perl6
00:24 huf joined #perl6
00:33 samcv hmm anybody know a way to get this working?
00:33 samcv m: my $a = ' '; 'a b c' ~~ s:sigspace/<$a>/space/
00:33 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex {  7⏏5}␤»
00:34 skids joined #perl6
00:34 samcv or a suggestion on what i need to read into to be able to do regex with variable interpolation that lets me use spaces in the variable
00:35 gfldex m: my $a = 'a'; my $b = 'a b c'; $b ~~ s:sigspace/<$a>/space/
00:35 camelia rakudo-moar c00061: ( no output )
00:35 AlexDaniel m: my $a = ' '; say 'a b c' ~~ s/<{$a}>/space/
00:35 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex {  7⏏5}␤»
00:35 gfldex samcv: you may have found a bug
00:35 samcv i was reading the design docs, but didn't see anything about this not being allowed
00:36 AlexDaniel m: my $a = ‘b’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:36 camelia rakudo-moar c00061: OUTPUT«a space c␤»
00:37 AlexDaniel m: my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:37 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex {  7⏏5}␤»
00:37 AlexDaniel pffffffft
00:37 AlexDaniel committable6: 6c my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:37 committable6 AlexDaniel, https://gist.github.com/c951b19cef1635b35aff93a8453fae36
00:37 samcv m: my $a = 'a '; 'a b c' ~~ s:sigspace/<$a>/space/
00:37 camelia rakudo-moar c00061: OUTPUT«Cannot modify an immutable Str␤  in block <unit> at <tmp> line 1␤␤»
00:37 AlexDaniel committable6: all my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:37 samcv oops
00:37 samcv m: my $a = 'a '; my $b = 'a b c'; $b ~~ s:sigspace/<$a>/space/; say $b
00:37 camelia rakudo-moar c00061: OUTPUT«space b c␤»
00:37 committable6 AlexDaniel, https://gist.github.com/283790325417cb4e76850554d298c3f8
00:38 AlexDaniel wtf is EVAL_0 ???
00:38 gfldex m: my $a = ' '; my $b = 'a b c'; my regex R { <$a> }; say $b ~~ &R
00:38 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex {  7⏏5}␤»
00:38 samcv but yeah if you try substituting ' a', it only substitutes the 'a' part. and ignores the space
00:39 samcv so ignores spaces for that too
00:39 gfldex m: my $a = ' '; my $b = 'a b c'; my token R { <$a> }; say $b ~~ &R
00:39 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex {  7⏏5}␤»
00:39 AlexDaniel samcv: please rakudobug
00:39 samcv ok :) thanks
00:39 gfldex wait
00:39 gfldex m: my $a = ' '; my $b = 'a b c'; my token R { '<$a>' }; say $b ~~ &R
00:39 camelia rakudo-moar c00061: OUTPUT«Nil␤»
00:40 gfldex m: my $a = ' '; my $b = 'a b c'; my Regex R { '<$a>' }; say $b ~~ &R
00:40 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed my␤at <tmp>:1␤------> 3my $a = ' '; my $b = 'a b c'; my Regex7⏏5 R { '<$a>' }; say $b ~~ &R␤»
00:40 gfldex m: my $a = ' '; my $b = 'a b c'; my regex R { '<$a>' }; say $b ~~ &R
00:40 camelia rakudo-moar c00061: OUTPUT«Nil␤»
00:40 gfldex well, rakudobug away but please note the lack of documentation
00:40 AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:40 camelia rakudo-moar c00061: OUTPUT«aspaceb c␤»
00:40 AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/g; say $b
00:40 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of /g; in Perl 6 please use :g␤at <tmp>:1␤------> 3 my $b = ‘a b c’; $b ~~ s/<{$a}>/space/g7⏏5; say $b␤»
00:41 AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b
00:41 camelia rakudo-moar c00061: OUTPUT«aspacebspacec␤»
00:41 gfldex samcv: do you understand the difference?
00:41 AlexDaniel m: my $a = ‘‘a’ ~ ‘ ’’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b
00:41 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter ~ (must be quoted to match literally)␤at /home/camelia/EVAL_0:1␤------> 3anon regex { ‘a’ ~ ‘ ’7⏏5}␤Malformed regex␤at /home/camelia/EVAL_0:1␤------> 3anon regex { ‘a’ ~ ‘…»
00:42 samcv what AlexDaniel is evaluating right now?
00:42 gfldex yes
00:42 samcv <AlexDaniel> m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
00:42 AlexDaniel m: my $a = ‘{‘a’ ~ ‘ ’}’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b
00:42 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Prohibited regex interpolation (use the MONKEY-SEE-NO-EVAL pragma to override this error,␤but only if you're VERY sure your data contains no injection attacks)␤at /home/camelia/EVAL_0:1␤…»
00:42 samcv yeah
00:42 samcv i get the {} you are using
00:42 samcv the quoting construct no
00:43 AlexDaniel personally I don't get anything
00:43 AlexDaniel how come it is attempting to EVAL it
00:43 gfldex still this is a ENODOC
00:43 gfldex that's the filename
00:43 AlexDaniel filename of what?
00:43 gfldex at /home/camelia/EVAL_0:1
00:43 AlexDaniel so why does it use a temp file for that?
00:43 gfldex line 1 in the file
00:44 AlexDaniel and why does it EVAL it at all
00:44 gfldex camelia always did it that way
00:44 AlexDaniel no, camelia does not use EVAL file
00:44 gfldex it doesn't eval it
00:44 AlexDaniel it does
00:44 AlexDaniel that's why I got MONKEY-SEE-NO-EVAL error
00:46 samcv gfldex, i'm not sure why ‘‘ ’’ works but ' ' or ‘ ’ doesn't work. is there a difference between them, or is this a part of the bug
00:46 aborazmeh joined #perl6
00:46 aborazmeh joined #perl6
00:46 AlexDaniel samcv: "' '" is what works, basically
00:46 samcv ah so "' '" is like ‘‘ ’’ ?
00:46 AlexDaniel m: say ‘hello ‘world’’
00:46 camelia rakudo-moar c00061: OUTPUT«hello ‘world’␤»
00:48 gfldex m: say «hello «world»»
00:48 camelia rakudo-moar c00061: OUTPUT«(hello « world »)␤»
00:48 AlexDaniel that's not a string though
00:48 gfldex indeed
00:48 edehont joined #perl6
00:50 AlexDaniel so let's say I have a string right
00:50 AlexDaniel and I want it to match it
00:50 AlexDaniel what do I do?
00:50 AlexDaniel <{}> EVALs the string as a regex
00:50 gfldex ‘‘ is another ENODOC
00:51 AlexDaniel m: my $a = ‘.’; say ‘hello world.’ ~~ /<{$a}>/
00:51 camelia rakudo-moar c00061: OUTPUT«「h」␤»
00:51 AlexDaniel no, I want it to match a dot!
00:51 gfldex m: my $a = ‘\.’; say ‘hello world.’ ~~ /<$a>/
00:51 camelia rakudo-moar c00061: OUTPUT«「.」␤»
00:51 samcv that won't match a dot though
00:52 gfldex m: my $a = ‘\.’; say ‘hello world.’ ~~ /<{$a}>/
00:52 camelia rakudo-moar c00061: OUTPUT«「.」␤»
00:52 gfldex m: my $a = ‘\ ’; say ‘hello world.’ ~~ /<{$a}>/
00:52 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex { \ 7⏏5}␤»
00:52 AlexDaniel well no, I have no idea what's inside $a
00:52 gfldex m: my $a = ‘\ ’; say ‘hello world.’ ~~ /<$a>/
00:52 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Null regex not allowed␤at /home/camelia/EVAL_0:1␤------> 3anon regex { \ 7⏏5}␤»
00:53 samcv m: my $a = "' '"; my $b = ‘a b c’; $b ~~ s/<$a>/space/; say $b #this is slightly different than <{$a}> right
00:53 camelia rakudo-moar c00061: OUTPUT«aspaceb c␤»
00:54 samcv as i'm seeing in the design docs
00:58 AlexDaniel m: use MONKEY-SEE-NO-EVAL; my $a = ‘a }; say 42; my regex foo { ‘b’ }#’; say ‘a b c’ ~~ /<{$a}>/
00:58 camelia rakudo-moar c00061: OUTPUT«42␤「b」␤»
00:59 AlexDaniel yes, EVAL protection saves it here, but still ????
01:09 huf joined #perl6
01:12 AlexDaniel alright, so to abuse this I have to search for places in Grammar.nqp without <!RESTRICTED>
01:14 samcv what does ‘‘ ’’ do if i may ask?
01:15 samcv though that doesn't get around the problem i'm having where the space is in the variable due to user input and not actually written in the file
01:15 AlexDaniel samcv: if your variable comes from user input, don't do that
01:16 AlexDaniel samcv: because it will be EVAL-ed
01:16 AlexDaniel samcv: even though there is partial protection, you don't want that
01:16 samcv yeah
01:17 AlexDaniel now ‘‘ ’’ is just a string "‘ ’"
01:17 AlexDaniel just quote, space, unquote
01:17 AlexDaniel once it is EVAL-ed, your regex will turn into /‘ ’/
01:17 samcv ahhh
01:17 AlexDaniel and that's what matches the space
01:17 samcv ok :)
01:17 samcv that makes sense
01:17 AlexDaniel but… please don't do that :/
01:18 samcv so it's not a bug it's just an undocumented thing right.
01:18 AlexDaniel um, well… actually…
01:18 samcv it ignores any spaces when you use s:ss with <$var>
01:18 samcv even if it's not blank
01:20 AlexDaniel well the question here is “how do I match some Str variable from a regex?”
01:20 AlexDaniel because <{}> is clearly not that
01:20 AlexDaniel ah wait, isn't it just $a?
01:21 samcv well. that makes it literal
01:21 samcv so like
01:21 AlexDaniel m: my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s:g/$a/space/; say $b
01:21 camelia rakudo-moar c00061: OUTPUT«aspacebspacec␤»
01:21 AlexDaniel there we go! Alright…
01:21 * AlexDaniel bangs his head against the wall
01:21 samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/$a/space/;
01:21 camelia rakudo-moar c00061: ( no output )
01:22 samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/<$a>/space/;
01:22 camelia rakudo-moar c00061: ( no output )
01:22 AlexDaniel why would you need :ss ? :)
01:22 samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/<$a>/space/; say $b;
01:22 camelia rakudo-moar c00061: OUTPUT«space b c␤»
01:22 samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/$a/space/; say $b;
01:22 camelia rakudo-moar c00061: OUTPUT«a b c␤»
01:22 samcv hah AlexDaniel
01:23 AlexDaniel for some reason I forgot that you can just write $a and was expecting it to be <~{}> or whatever…
01:23 AlexDaniel dammit
01:23 samcv but the perl 6 design docs seem to suggest <$a> just does interpolation of the variable
01:23 samcv so a space should work i think...
01:23 AlexDaniel NO, it EVALs it!!
01:24 samcv doesn't it eval text you put in there regardless
01:24 AlexDaniel https://github.com/rakudo/rakudo/blob/91a7140aa24f327e5e2cfe13ebb8d36ce3a43ff4/src/core/Cursor.pm#L466
01:24 AlexDaniel ↑ here is what happens
01:24 AlexDaniel no, just matching a variable is not equal to EVAL-ing the damn thing :)
01:25 samcv no that's not what i'm saying
01:25 samcv s/stuff here/thing/ the 'stuff here' is evaled right
01:25 samcv you have typed into the file
01:25 AlexDaniel samcv: what part of the “design docs” are you referring to, by the way?
01:26 samcv https://design.perl6.org/S05.html#Variable_(non-)interpolation
01:26 kurahaupo__ joined #perl6
01:26 AlexDaniel samcv: well not really, because stuff in / / is just parsed as a regex language
01:26 AlexDaniel for example
01:26 samcv ah okay
01:26 samcv i understand.
01:27 AlexDaniel m: say “hello {“world” ~ “{ 25 + 50}”}”
01:27 camelia rakudo-moar c00061: OUTPUT«hello world75␤»
01:27 AlexDaniel nothing is EVAL-ed, that's just the way it parses it
01:27 Actualeyes joined #perl6
01:29 AlexDaniel “To interpolate a Regex object, use <$var> instead.”
01:29 AlexDaniel so it does what it says
01:30 samcv ok so by interpolate it does more than just plop the value in there seems to be what you're saying
01:30 samcv making it less safe than if the code were typed into the regex in the program file
01:31 samcv so i guess the interpolation it mentions does more than i thought it?
01:32 AlexDaniel gfldex: here ↑, our documentation should clarify all that
01:33 dalek doc: 810ec37 | coke++ | doc/Type/IO.pod6:
01:33 synopsebot6 Link: http://doc.perl6.org/type/IO
01:33 dalek doc: fix spelling
01:33 dalek doc: review: https://github.com/perl6/doc/commit/810ec37f61
01:36 kurahaupo_ joined #perl6
01:46 samcv m: my $a = ' '; $a ~~ m:ss/ /;
01:46 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5===␤Null regex not allowed␤at <tmp>:1␤------> 3my $a = ' '; $a ~~ m:ss/ 7⏏5/;␤Adverb ss not allowed on m␤at <tmp>:1␤------> 3my $a = ' '; $a ~~ m:ss/ /7⏏5;␤␤»
01:46 samcv ss is not allowed on match but the language section of perl 6 docs do not mention that is the case
01:49 AlexDaniel well, first of all it is just :s
01:49 AlexDaniel secondly, it is allowed
01:49 AlexDaniel m: say ‘a b c’ ~~ m:s/a b/
01:49 camelia rakudo-moar c00061: OUTPUT«「a b」␤»
01:50 samcv ah ok
01:50 AlexDaniel but / / is still treated as a Null regex, for whatever reason
01:50 AlexDaniel so just use quotes
01:50 AlexDaniel m: say ‘a b c’ ~~ m/‘ ’/
01:50 camelia rakudo-moar c00061: OUTPUT«「 」␤»
01:50 AlexDaniel (or whatever other quotes you prefer)
01:50 samcv ah ok. i was getting same space and sigspace mixed up
01:51 samcv though ss implies s, but thank you
01:52 dalek doc: 19ddd2e | coke++ | util/xt-recent-aspell.p6:
01:52 dalek doc: provide a much faster spelling test for recent checks
01:52 dalek doc: review: https://github.com/perl6/doc/commit/19ddd2e5a1
01:52 Actualeyes joined #perl6
01:53 samcv m: my $a = ' a'; say $a ~~ m:s/ a/;
01:53 camelia rakudo-moar c00061: OUTPUT«「a」␤»
01:53 samcv m: my $a = ' '; say $a ~~ m:s/ /;
01:53 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Null regex not allowed␤at <tmp>:1␤------> 3my $a = ' '; say $a ~~ m:s/ 7⏏5/;␤»
01:53 samcv yeah it does not like only a space even with sigspace on
01:54 AlexDaniel maybe it is a bug, I don't know
02:04 pierre_ joined #perl6
02:23 tars joined #perl6
02:30 jdv79 is it right to use ${} to pass a hashref to a I::P5 func?
02:31 jdv79 seems wrong but i forget
02:33 BenGoldberg joined #perl6
02:46 imcsk8 joined #perl6
02:49 dalek doc: f0364aa | gfldex++ | doc/Language/typesystem.pod6:
02:49 synopsebot6 Link: http://doc.perl6.org/language/typesystem
02:49 dalek doc: not all types have a type object (the paragraph is still not good)
02:49 dalek doc: review: https://github.com/perl6/doc/commit/f0364aa5b2
03:15 samcv m: my $a = 'a a'; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
03:15 camelia rakudo-moar c00061: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at /home/camelia/EVAL_0:1␤    ------> 3anon regex { a7⏏5 …»
03:15 samcv interesting...
03:15 gfldex m: my $a = /' '/; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
03:15 camelia rakudo-moar c00061: OUTPUT«alefta␤»
03:17 samcv yeah quoting works fine but it seems sigspace never applies this way
03:17 gfldex m: my $a = rx:s/ /; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
03:17 camelia rakudo-moar c00061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Null regex not allowed␤at <tmp>:1␤------> 3my $a = rx:s/ 7⏏5/; my $b = 'a a', $b ~~ s:s/<$a>/left/; ␤»
03:17 gfldex m: my $a = rx:s/\s/; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
03:17 camelia rakudo-moar c00061: OUTPUT«alefta␤»
03:18 samcv but it's interesting the error message on for one was telling you to 'use the :s modifier to make space significant' so it might be a bug that it's not using sigspace?
03:18 gfldex the problem is the typecast from Str to Regex
03:20 gfldex samcv: did you check roast for sigspace?
03:21 samcv i will do that now
03:25 mayathecat joined #perl6
03:26 john51 joined #perl6
03:31 john51 joined #perl6
03:32 samcv gfldex, it doesn't test for leading/trailing spaces, or just only whitespace
13:05 ilbot3 joined #perl6
13:05 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!
13:06 * moritz restarts da logga
13:06 yoleaux 13:03Z <MasterDuke_> moritz: looks like the bot that logs to irclog.perlgeek.de is down on the various Perl 6 related channels
13:06 moritz MasterDuke_: thanks for letting me know!
13:06 MasterDuke_ np
13:07 moritz looks like 10 hours ago, it lost its connection to mysql, retried a few times, and then systemd gave up
13:09 MasterDuke_ all that scintillating conversation lost, like tears in the rain...
13:09 * moritz adds RestartSec=60 to the ilbot systemd service file
13:10 moritz whta I'd really like to add is a quadratic backoff, but I don't think systemd implements that
13:14 MasterDuke_ maybe hack something in with ExecStartPre?
13:15 cpin` hi all - have been looking at RT#129363 and think I have something, but would appreciate some advice/discussion...
13:15 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129363
13:15 cpin` initial hacking at: https://github.com/cpin/rakudo/commit/43cb55f3f8c2d44ccf8ec7143687e968a039257a
13:16 cpin` spectest passes, as does manually testing - however, new here so might be some naive assumptions in there
13:17 moritz cpin`: the type constraint in the new multi is Associative, but you call hash() as a coercer
13:17 cpin` (tests: https://github.com/cpin/roast/commit/dda2515565a3ce86c19e0bf99d310f612a2cdcbd)
13:17 moritz cpin`: maybe try h.WHAT.new(...) instead of hash() ?
13:18 cpin` moritz: ok - that may take some explaining - i took the majority of the existing code from `deepmap`...
13:22 moritz cpin`: maybe your version is a good enough first short
13:22 cpin` moritz: assume that would be the same for duckmap, deepmap (and coremap) - worthy or a separate change?
13:22 moritz yes
13:23 moritz cpin`: background is, we have multiple types that do Associative, including EnumMap and Hash
13:23 cpin` moritz: that's what I wondered; worth PRs on roast and rakudo?
13:23 MasterDuke_ cpin`: just a style thing, but you have a couple 'deep => $deep'. i think most of the core uses the ':$deep' syntax
13:23 moritz cpin`: and Bag, iirc
13:23 cpin` moritz: ah, yes
13:23 moritz cpin`: yes, worth a PR
13:23 cpin` MasterDuke_: ok, will check that out - thanks
13:24 moritz op.WHAT gives the type object of `op`, so op.WHAT.new(...) should reproduce an object with the same type as `op`
13:24 MasterDuke_ also, do you need the nqp::stmts() that wraps this line? https://github.com/cpin/rakudo/commit/43cb55f3f8c2d44ccf8ec7143687e968a039257a#diff-c1b40d138bbe6e0c822036ad326487ddR563
13:24 cpin` moritz: great - as I assumed. thanks!
13:26 cpin` MasterDuke_: nope - don't think so. artifact of debugging...
13:26 aborazmeh joined #perl6
13:26 aborazmeh joined #perl6
13:26 skids joined #perl6
13:28 zakharyas joined #perl6
13:28 MasterDuke_ cpin`: you could also ask for comments in #perl6-dev
13:38 rindolf joined #perl6
13:42 Rawriful joined #perl6
13:42 domidumont joined #perl6
13:48 andrzejku joined #perl6
13:55 FROGGS joined #perl6
13:55 FROGGS o/
13:56 grondilu joined #perl6
13:57 itaipu joined #perl6
14:10 nadim Hi P6, just dropped in to say "Keep up the good work" and thank you.
14:11 pmurias joined #perl6
14:12 lizmat nadim: thanks for the kind words
14:13 nicq20 joined #perl6
14:13 ajr_ joined #perl6
14:14 cdg joined #perl6
14:15 nicq20 Hello o/
14:16 MasterDuke_ cpin`: can't the nqp::if here ( https://github.com/cpin/rakudo/blob/1ee524771e4911720d3eaa8629ea0bfe54a43962/src/core/metaops.pm#L558-L566 ) be refactored to: nqp::if($deep && nqp::istype($value, Iterable), ($result := coremap(&!block, $value, :$deep).item), ($result := &!block($value)))
14:20 rgrinberg joined #perl6
14:24 cpin` MasterDuke_: i suspect so...
14:27 CIAvash joined #perl6
14:28 nadim lizmat: greatly deserved
14:33 domidumont joined #perl6
14:39 eater joined #perl6
14:50 * viki eyes Xliff
14:59 dalek joined #perl6
15:04 dalek doc: 1dfcb50 | (Zoffix Znet)++ | doc/Language/typesystem.pod6:
15:04 synopsebot6 Link: http://doc.perl6.org/language/typesystem
15:04 dalek doc: Fix incorrect URL
15:04 dalek doc: review: https://github.com/perl6/doc/commit/1dfcb50e84
15:04 Rawriful joined #perl6
15:14 dalek doc: aa0945b | (Zoffix Znet)++ | doc/Type/DateTime.pod6:
15:14 synopsebot6 Link: http://doc.perl6.org/type/DateTime
15:14 dalek doc: Document DateTime.hh-mm-ss
15:14 dalek doc: review: https://github.com/perl6/doc/commit/aa0945bb42
15:25 pierre_ joined #perl6
15:25 Tonik joined #perl6
15:34 AlexDaniel joined #perl6
15:49 Upasaka joined #perl6
16:00 maybekoo2 joined #perl6
16:24 viki It's so quiet in here, I can hear myself breathing...
16:25 profan *heavy breathing*
16:25 nicq20 Echo! echo, echo....
16:25 viki I guess the world's on edge as we watch Murica deciding whether to give nuke codes to a rich imbicile or a corrupt pschopathic warmonger. Tough choice!
16:28 nicq20 Huh, I kind of though most countries would mistake this for some weird "American reality show".
16:28 viki Sure, today's season's finale :P
16:28 dylanwh there are people in trucks driving around screaming at people here... #florida.
16:29 viki heh
16:29 [Coke] well, viki's half right, anyway.
16:30 viki At least I'm already in Canada, so I don't have to move ;)
16:43 Rawriful joined #perl6
16:49 Actualeyes joined #perl6
16:56 cpin` left #perl6
17:06 zakharyas joined #perl6
17:13 nicq20 When using `start`, where does it store it's promises? I've been using the REPL and it completes them without assigning to a var.
17:15 viki It returns it.
17:15 viki m: dd start sleep 1;
17:15 camelia rakudo-moar a581bf: OUTPUT«Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Planned)␤»
17:16 nicq20 Huh. So the promise is still kept if it does not get saved to a var?
17:16 viki The promise still runs whether or not it's saved anywhere. Whether or not it's kept depends on the code running it.
17:16 viki *running in it
17:18 viki .oO( if there's nobody there to catch it, is a sunk Promise ever broken? )
17:18 viki :}
17:18 viki m: start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
17:18 camelia rakudo-moar a581bf: OUTPUT«all'swell␤»
17:19 viki eheh
17:19 zakharyas joined #perl6
17:19 viki m: use MONKEY; augment class Promise { method sink { say self.status } }; start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
17:19 camelia rakudo-moar a581bf: OUTPUT«Planned␤all'swell␤»
17:19 viki :o
17:19 moritz a very solipsistic view :-)
17:20 viki Oh, right, it gets sunk before it completes.
17:20 moritz m: use MONKEY; augment class Promise { method sink { await self } }; start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
17:20 camelia rakudo-moar a581bf: OUTPUT«===SORRY!===␤egahds␤»
17:21 viki m: use MONKEY; augment class Promise { method sink { my $s = self; start { await $s; say $s.status } } }; start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
17:21 camelia rakudo-moar a581bf: OUTPUT«all'swell␤»
17:21 viki :(
17:21 viki Oh, it dies in await
17:22 viki m: use MONKEY; augment class Promise { method sink { my $s = self; start { try await $s; say $s.status } } }; start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
17:22 camelia rakudo-moar a581bf: OUTPUT«Broken␤Kept␤all'swell␤»
17:22 viki :D
17:30 nicq20 left #perl6
17:39 FROGGS joined #perl6
17:39 lichtkind joined #perl6
17:40 kyclark joined #perl6
17:40 AlexDaniel joined #perl6
17:43 wamba joined #perl6
17:47 hankache joined #perl6
17:48 hankache hello #perl6
17:50 viki \o\
17:56 domidumont joined #perl6
17:58 girafe joined #perl6
18:16 tbrowder left #perl6
18:16 viki m: 42
18:16 camelia rakudo-moar a581bf: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
18:16 tbrowder joined #perl6
18:16 viki m: 42e1000000000000
18:16 camelia rakudo-moar a581bf: ( no output )
18:17 viki m: Inf
18:17 camelia rakudo-moar a581bf: ( no output )
18:20 troys joined #perl6
18:27 cdg joined #perl6
18:31 pierre_ joined #perl6
18:46 * grondilu had never seen use MONKEY; before
18:47 grondilu m: use MONKEY-TYPING;
18:47 camelia rakudo-moar a581bf: ( no output )
18:47 grondilu m: use MONKEY;
18:47 camelia rakudo-moar a581bf: ( no output )
18:48 perlpilot there are many MONKEYs
18:50 AlexDaniel … and most of them do nothing
18:55 canopus joined #perl6
19:03 buggable joined #perl6
19:03 rindolf Hi all! So I benchmarked my sprintf optimisation and the "before" was much faster than the "after" but there may have been a variance in compile flags.
19:06 perlpilot doesn't much sound like an optimization  :)
19:08 timotimo the core setting is compiled with a higher --optimize than your own code
19:08 tyil maybe he was trying to make it slower so he has more time to do other stuff
19:08 timotimo you can see the --optimize that gets passed in your "make" output
19:09 hankache joined #perl6
19:10 viki .oO( just copy the internal sprintf impl. into your bench file and compare next to your own... )
19:10 nicq20 joined #perl6
19:11 viki It's all nqp code anyway
19:11 timotimo good point
19:24 wamba joined #perl6
19:24 viki m: say ("1." ~ "1" x 308).EVAL
19:24 camelia rakudo-moar a581bf: OUTPUT«1.11111111111111109384097517249756492674350738525390625␤»
19:24 viki m: say ("1." ~ "1" x 309).EVAL
19:24 viki :}
19:24 camelia rakudo-moar a581bf: OUTPUT«(timeout)»
19:25 TimToady yer mean!
19:25 mst TimToady: well you're ... ... ... median!"
19:26 TimToady that's my usual mode...
19:26 maybekoo2 joined #perl6
19:26 nicq20 Trying to think of a "range" joke...
19:26 mst I prefer to be a non-standard deviant
19:27 hankache hmm outliers :)
19:30 pmurias joined #perl6
19:42 xinming joined #perl6
19:48 pdcawley joined #perl6
19:54 bjz joined #perl6
19:54 vendethiel joined #perl6
20:10 Rawriful joined #perl6
20:12 ufobat joined #perl6
20:18 Rawriful joined #perl6
20:20 kyclark_ joined #perl6
20:21 kyclark_ I’m back with more bouncy balls.  I got some good feedback on reddit, and I’ve made some changes.  http://pastie.org/10958479
20:22 kyclark_ Everything that was said about the enums in the previous version is right.  I think the “move” in this version is simpler and cleaner.  Also, this version has the balls fight to the death!  Collisions cause balls to be removed.
20:22 kyclark_ Before I post a new version, I’d like feedback on this, specifically around lines 58-62
20:24 RabidGravy nice :)
20:27 [Coke] why PosInt?
20:27 [Coke] oh. nevermind, missed the subset. :)
20:27 * [Coke] thinks he was thinking IntStr, maybe.
20:28 [Coke] could be faster with --balls=100_000 :)
20:30 viki kyclark_: just what I've said last night. That do for ^$balls { Ball.new(:$rows, :$cols) }; is just a strange way to write ^$balls .map: Ball.new: :$rows, :$cols;  You're mapping values in $balls to a list of new values, so reading that operation as "do for X" just reads weird
20:30 RabidGravy I ought to finish Term::Cap at some point
20:30 viki kyclark_: also, my understanding is this won't be thread safe: for $positions.list».kv -> ($pos, $count) {
20:31 masak kyclark_: nice!
20:31 viki IIRC jnthn said » would initially be just doing what .hyper does... and that gives a HyperSeq
20:31 masak kyclark_: agree with viki, but the nicest way to write it IMO would be `Ball.new(:$rows, :$cols) xx $balls`
20:31 viki masak++ that is indeed much better
20:31 masak kyclark_: something bothers me about that passing-in of $rows and $cols, by the way.
20:31 kyclark_ Wow, interesting.  I would not have come up with that.
20:32 masak kyclark_: somehow they don't really "belong" on the object as attrs (though I see what you're trying to achieve)
20:32 viki Also, masak++ your Inf bug is actually much severe than originally reported.
20:32 [Coke] huh. added a --profile when invoking the bouncy balls, but when you hit ^C to exit out, no profile.
20:33 viki m: say say 1.1e307
20:33 camelia rakudo-moar a581bf: OUTPUT«1.1e+307␤True␤»
20:33 viki m: say 1.111111e307
20:33 camelia rakudo-moar a581bf: OUTPUT«Inf␤»
20:33 masak kyclark_: one way to get around it would be to do `role Ball[$rows, $cols]` and make the appropriate changes
20:33 viki masak: ^
20:33 masak viki: huh; yes, that's worse.
20:33 viki I'm spectesting a fix ATM
20:33 masak oki
20:34 lizmat [Coke]: if you add a signal handler for control-c and let that exit, then you should get a profile
20:34 kyclark_ At line 48, I wanted to iterate over my Bag which has keys like “8 4” and a value of the count of balls at that position.  I settled on the “$positions.list».kv” because it worked, but is there a better way to unpack that?  I could not come up with a pointy block sig that worked.
20:34 kyclark_ Also, I found that Bags don’t work with Lists as the keys, only strings.  This is right, yes?
20:35 viki kyclark_: no, that's wrong
20:35 moritz viki: are you sure? lists aren't value objects
20:35 viki m: dd Bag.new-from-pairs: [<a b c>] => 42;
20:35 camelia rakudo-moar a581bf: OUTPUT«(["a", "b", "c"]=>42).Bag␤»
20:36 [Coke] the ball script spends most of its non-sleep time in sink. :?
20:36 [Coke] lizmat: I cheated in a while loop.
20:36 viki m: my $b = BagHash.new-from-pairs: [<a b c>] => 42; $b{$[<a b c>]}++; dd $b
20:36 camelia rakudo-moar a581bf: OUTPUT«BagHash $b = (["a", "b", "c"]=>42,["a", "b", "c"]=>1).BagHash␤»
20:36 viki m: my $b = BagHash.new-from-pairs: $[<a b c>] => 42; $b{$[<a b c>]}++; dd $b
20:36 camelia rakudo-moar a581bf: OUTPUT«BagHash $b = (["a", "b", "c"]=>1,["a", "b", "c"]=>42).BagHash␤»
20:36 viki Oh right, it's not the same object
20:37 viki m: my $a = [<a b c>]; my $b = BagHash.new-from-pairs: $a => 42; $b{$a}++; dd $b
20:37 camelia rakudo-moar a581bf: OUTPUT«BagHash $b = (["a", "b", "c"]=>43).BagHash␤»
20:37 viki moritz: seems to work ^. What are value objects?
20:37 [Coke] (sink) ah, gnope.
20:38 moritz viki: objects where two equivalent objects also compare equally with ===
20:38 viki Ah
20:38 moritz m: say 1 === 1; say [] === [];
20:38 camelia rakudo-moar a581bf: OUTPUT«True␤False␤»
20:38 viki Well, you can still use them as keys.
20:38 moritz ok
20:38 viki m: say 100000 === 100000; say [] === [];
20:38 camelia rakudo-moar a581bf: OUTPUT«True␤False␤»
20:40 kyclark_ m: dd ((1,1), (2,2), (1,1)).Bag
20:40 camelia rakudo-moar a581bf: OUTPUT«(1=>4,2=>2).Bag␤»
20:40 viki m: for (<a b c c d>).Bag.list -> (:$key, :$value) { say "$key:$value" }
20:40 camelia rakudo-moar a581bf: OUTPUT«a:1␤c:2␤b:1␤d:1␤»
20:40 viki kyclark_: ^ an alternative
20:40 viki There may be a better way
20:40 kyclark_ I keep forgetting about that way!
20:40 viki like .kv on just the Bag without .list first?
20:41 viki Yup
20:41 viki m: for (<a b c c d>).Bag.kv -> $k, $v { say "$k:$v" }
20:41 camelia rakudo-moar a581bf: OUTPUT«a:1␤c:2␤b:1␤d:1␤»
20:41 masak .Bag is a nice short way to say "make a histogram of these things"
20:43 * Xliff wonders why vikiZoffixBorg was giving him the evil eye, earlier this morning.
20:43 viki I don't get why this conditional is there. Wouldn't multiplication by 0 just give zero anyway? https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Actions.nqp#L7218-L7220
20:43 viki Xliff: 'cause you added DateTime.hh-mm-ss but never added tests or docs. An untested code is broken and undocumented code doesn't exists at all.
20:43 Xliff In progress. Not committed.
20:44 kyclark_ OK, new version: http://pastie.org/10958493
20:44 viki Xliff: I already did it :)
20:44 Xliff :P
20:44 Xliff Thx
20:44 viki Ah.. Answer for my question: to make stuff like 0e99999999999 return 0 and not NaN
20:44 [Coke] viki - maybe for speed? you avoid invoking 3 opcodes and an .ast
20:44 viki .oO( I knew I shouldn't have removed it... *rebuilds* )
20:46 bjz joined #perl6
20:46 [Coke] ah
20:54 AlexDaniel I wish it had more balls at the same time
20:54 AlexDaniel ahhhh
20:54 AlexDaniel there is a paramater…
20:55 AlexDaniel OK
20:56 cdg joined #perl6
20:56 MasterDuke_ this may be questionable, but if you do 'my %row is default([]);
20:56 MasterDuke_ you can get rid of the  'if %row{ $this-row }:exists {'
20:56 kyclark_ MovableType is removing some of my code when I try to post as a comment
20:57 kyclark_ Specifically it doesn’t like “||” it would seem.  Is there a workaround?  Do I need to make a new post?  Seems a bit overkill to just follow up on my first version
21:00 AlexDaniel mmhmm 「unless 1 < $!col < $!cols」
21:07 viki kyclark_, just edit the post and add an "Update" section?
21:10 BillSussman joined #perl6
21:19 bjz joined #perl6
21:31 kyclark__ joined #perl6
21:33 Xliff Hrm.
21:33 espadrine joined #perl6
21:33 Xliff Can you add newlines in grammar definitions without the compiler barfing?
21:34 viki barphing how?
21:34 Xliff Ala: grammar X { TOP { <t1>\n<t2>\n'STRING'\n\n } }
21:34 viki I think you need to quote them
21:34 viki "\n"
21:35 Xliff No. Those are literals. I want TOP to be readable rather than cluttered on one line.
21:36 Xliff So those represent newlines in the actual code.
21:36 lizmat which would be whitespace, which should work, no ?
21:36 viki Yeah  you can use literal newlines just like regular whitespace
21:36 Xliff The complaint I'm getting is "two terms in a row"
21:36 viki Well, prove it :) show code
21:37 Xliff I am, borg!
21:38 viki :)
21:39 Xliff https://gist.github.com/Xliff/fef6642960e6bccf67b3b842d9b71914
21:40 FROGGS Xliff: put 'rule' or 'token' before the word 'TOP'
21:40 Xliff D'oh!
21:41 Xliff FROGGS++
21:41 FROGGS :o)
21:43 Xliff Oooh! Grammar::Tracer is awesome!
21:44 bjz joined #perl6
21:45 nicq20 left #perl6
22:00 Xliff Whoop!
22:00 * Xliff does the grammar dance.
22:05 labster joined #perl6
22:08 zakharyas joined #perl6
22:11 lizmat joined #perl6
22:26 stmuk_ https://www.donaldjtrump.com/press-releases/archive/trump%20programs%20visual%20basic
22:27 firstdayonthejob joined #perl6
22:30 stmuk_ unicode works too
22:36 japhb .ask RabidGravy Would Term::Cap allow us to avoid using tput in https://github.com/ab5tract/Terminal-Print/blob/master/lib/Terminal/Print/Commands.pm6#L38 (and thus avoid having to do the crazy dance in which we cache a bunch of terminal escape strings at module precompilation time)?
22:36 yoleaux japhb: I'll pass your message to RabidGravy.
22:37 geekosaur and maybe be a bit more portable too?
22:38 * geekosaur now knows not to try to install that under certain broken terminals/terminal types or on old non-ANSI ttys...
22:38 geekosaur (notably emacs still has a non-ANSI terminal emulator in it)
22:41 japhb geekosaur: I'd be happy if we got portability out of it, yeah.
22:42 japhb geekosaur: Are you saying not to install *Terminal-Print* on non-ANSI ttys, or Term::Cap?
22:42 geekosaur you said Terminal-Print caches strings at precomp time
22:43 geekosaur that's going to screw people not on ANSI emulation, or if it caches strings for one ANSI-extended that differ from other ANSI-extendeds (which can happen)
22:43 japhb Yeah, it gathers the correct termcap info for every "valid" (tested to work) terminal.
22:44 geekosaur ah. that would be better, I figured it was assuming the currently set one was The One
22:44 japhb And keys it on the terminal type string
22:44 japhb Oh heck no, I wouldn't be that silly.
22:44 * geekosaur remembers when caching strings for linux console would get you weird bugs when using them on xterm, and vice versa --- linux console has since been redone a few times and is much closer to xterm/standard ANSI now
22:45 japhb It also knows that it has to gather terminal size info at least at program start, and then every time explicitly requested thereafter (and not cache that, which is a common mistake).  Doesn't yet handle SIGWINCH, but that's coming.
22:46 geekosaur (sometimes I wish I'd kept the old Beehive terminal, just as a severe stress test for terminal output)
22:47 japhb I once had a for-reals TVI-920C (http://terminals-wiki.org/wiki/index.php/TeleVideo_920) heading my "personal computer", and man I wish I still had that thing ....
22:48 geekosaur heh. yep, that'd do it.
22:48 * geekosaur remembers tvi910s
22:49 seatek joined #perl6
22:50 * grondilu does not know much about terminals but remembers that linux consoles are supposed (or were supposed?) to be compatible to "vt100"
22:50 grondilu (somehow the term "vt100" had stuck in my mind)
22:50 geekosaur were supposed. it didn't do a good job of it originally
22:51 japhb grondilu: vt100 was IIRC the big "center of mass" for copycatting and eventually standardization.
22:51 geekosaur (older) xterm was literally the reference software vt100 implementation. the DEC folks went to extremes to guarantee 100% vt100 (and in extended mode vt200) compatibility
22:52 geekosaur and ANSI X3.64 is a superset of VT220
22:52 geekosaur (apparently one of them ran recent xterm against their old test suite and discovered several bugs had crept in since they'd stopped maintaining it)
22:54 geekosaur vt100 won because the other quasistandard used "cookies" to store video attributes --- these displayed as spaces (termcap calls them "sg" / "standout [mode] glitch")
22:55 japhb Of note, as I was researching TUI stuff, I kept coming across this guy: https://en.wikipedia.org/wiki/Thomas_Dickey
22:55 japhb All roads lead to Thomas, apparently.
22:57 grondilu geekosaur:  those trivia notes of yours suit your nickname very well ;-)
22:59 AlexDaniel joined #perl6
23:12 MasterDuke joined #perl6
23:15 geekosaur joined #perl6
23:26 nadim_ joined #perl6
23:28 Rawriful joined #perl6
23:32 samcv is it normal for perl6 --profile to segfault on running an otherwise working program?
23:32 samcv i think it might be segfaulting when i start a proc::async process, i'm guessing
23:33 MasterDuke yeah, that's definitely not supported now
23:33 samcv i have never used it before so was wondering your experiences with it
23:33 samcv ok so segfault is not totally unexpected?
23:34 MasterDuke yep. it's great, but can't be used for concurrent programs. it's not guaranteed to crash, but you can't trust the results if it doesn't
23:34 samcv ah kk. are supplies and channels out as well?
23:35 samcv because i use those too. or is it just proc::async
23:37 MasterDuke i think anything which uses threads is out, but jnthn or timotimo could definitely give you a more conclusive answer
23:40 geekosaur joined #perl6
23:43 jnthn So far as I remember, at a low level the profiler should be able to collect data from all running threads, but isn't able to present them. In reality, it's not really had any attention for multi-threaded programs and so there may be some other place it's tripping up.
23:43 timotimo yes, if you --profile and have multiple threads, you'll definitely get bogus results, or maybe a crash
23:43 jnthn timotimo: Do you know why it crashes?
23:43 timotimo don't think so
23:43 jnthn timotimo: The instrumentation is guarded, and it uses a per-thread data structure to record data...
23:43 jnthn k
23:43 timotimo i'm not sure it even looks at other threads right now
23:44 jnthn Right, it ignores their data.
23:44 timotimo could just be i'm working off of outdated info, because it's been a while since i last tried it
23:44 jnthn I'd expect it to only give data on the main thread.
23:44 timotimo i've had it actually give data from a non-main thread somehow
23:45 jnthn Guess we'll have to try and catch the issue in gdb/valgrind and see what's going on. :)
23:46 jnthn It'd be good to actually get it to present useful data from all threads too, but that's more work.
23:46 jnthn Though more in the UI for presenting it than the VM
23:49 MasterDuke RT #128280 may be a bit out of date now, but i believe i did have some valgrind output
23:49 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128280
23:56 Rawriful joined #perl6

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

Perl 6 | Reference Documentation | Rakudo