»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
timotimo but it's quite clear that you rproblem isn't that one, it's the core setting build 00:01
or perhasp install-core-distributions or what it's called
but less likely to be a problem
ajr_ Timotimo - any suggestions for the next step in debugging? 00:05
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.
dalek c: d1fe150 | gfldex++ | doc/Type/IO.pod6:
tell the trap that is Cool.IO. We need that because searching for
00:16
synopsebot6 Link: doc.perl6.org/type/IO
samcv hmm anybody know a way to get this working? 00:33
m: my $a = ' '; 'a b c' ~~ s:sigspace/<$a>/space/
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}␤»
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:34
gfldex m: my $a = 'a'; my $b = 'a b c'; $b ~~ s:sigspace/<$a>/space/ 00:35
camelia ( no output )
AlexDaniel m: my $a = ' '; say 'a b c' ~~ s/<{$a}>/space/
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}␤»
gfldex samcv: you may have found a bug
samcv i was reading the design docs, but didn't see anything about this not being allowed
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␤»
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}␤»
AlexDaniel pffffffft
committable6: 6c my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
committable6 AlexDaniel, gist.github.com/c951b19cef1635b35a...a8453fae36
samcv m: my $a = 'a '; 'a b c' ~~ s:sigspace/<$a>/space/
camelia rakudo-moar c00061: OUTPUT«Cannot modify an immutable Str␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel committable6: all my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
samcv oops
m: my $a = 'a '; my $b = 'a b c'; $b ~~ s:sigspace/<$a>/space/; say $b
camelia rakudo-moar c00061: OUTPUT«space b c␤»
committable6 AlexDaniel, gist.github.com/283790325417cb4e76...54d298c3f8
AlexDaniel wtf is EVAL_0 ??? 00:38
gfldex m: my $a = ' '; my $b = 'a b c'; my regex R { <$a> }; say $b ~~ &R
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}␤»
samcv but yeah if you try substituting ' a', it only substitutes the 'a' part. and ignores the space
so ignores spaces for that too 00:39
gfldex m: my $a = ' '; my $b = 'a b c'; my token R { <$a> }; say $b ~~ &R
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}␤»
AlexDaniel samcv: please rakudobug
samcv ok :) thanks
gfldex wait
m: my $a = ' '; my $b = 'a b c'; my token R { '<$a>' }; say $b ~~ &R
camelia rakudo-moar c00061: OUTPUT«Nil␤»
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␤»
gfldex m: my $a = ' '; my $b = 'a b c'; my regex R { '<$a>' }; say $b ~~ &R
camelia rakudo-moar c00061: OUTPUT«Nil␤»
gfldex well, rakudobug away but please note the lack of documentation
AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
camelia rakudo-moar c00061: OUTPUT«aspaceb c␤»
AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/g; say $b
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␤»
AlexDaniel m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b 00:41
camelia rakudo-moar c00061: OUTPUT«aspacebspacec␤»
gfldex samcv: do you understand the difference?
AlexDaniel m: my $a = ‘‘a’ ~ ‘ ’’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b
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’ ~ ‘…»
samcv what AlexDaniel is evaluating right now? 00:42
gfldex yes
samcv <AlexDaniel> m: my $a = ‘‘ ’’; my $b = ‘a b c’; $b ~~ s/<{$a}>/space/; say $b
AlexDaniel m: my $a = ‘{‘a’ ~ ‘ ’}’; my $b = ‘a b c’; $b ~~ s:g/<{$a}>/space/; say $b
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␤…»
samcv yeah
i get the {} you are using
the quoting construct no
AlexDaniel personally I don't get anything 00:43
how come it is attempting to EVAL it
gfldex still this is a ENODOC
that's the filename
AlexDaniel filename of what?
gfldex at /home/camelia/EVAL_0:1
AlexDaniel so why does it use a temp file for that?
gfldex line 1 in the file
AlexDaniel and why does it EVAL it at all 00:44
gfldex camelia always did it that way
AlexDaniel no, camelia does not use EVAL file
gfldex it doesn't eval it
AlexDaniel it does
AlexDaniel that's why I got MONKEY-SEE-NO-EVAL error 00:44
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
AlexDaniel samcv: "' '" is what works, basically 00:46
samcv ah so "' '" is like ‘‘ ’’ ?
AlexDaniel m: say ‘hello ‘world’’
camelia rakudo-moar c00061: OUTPUT«hello ‘world’␤»
gfldex m: say «hello «world»» 00:48
camelia rakudo-moar c00061: OUTPUT«(hello « world »)␤»
AlexDaniel that's not a string though
gfldex indeed
AlexDaniel so let's say I have a string right 00:50
and I want it to match it
what do I do?
<{}> EVALs the string as a regex
gfldex ‘‘ is another ENODOC
AlexDaniel m: my $a = ‘.’; say ‘hello world.’ ~~ /<{$a}>/ 00:51
camelia rakudo-moar c00061: OUTPUT«「h」␤»
AlexDaniel no, I want it to match a dot!
gfldex m: my $a = ‘\.’; say ‘hello world.’ ~~ /<$a>/ 00:51
camelia rakudo-moar c00061: OUTPUT«「.」␤»
samcv that won't match a dot though
gfldex m: my $a = ‘\.’; say ‘hello world.’ ~~ /<{$a}>/ 00:52
camelia rakudo-moar c00061: OUTPUT«「.」␤»
gfldex m: my $a = ‘\ ’; say ‘hello world.’ ~~ /<{$a}>/
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}␤»
AlexDaniel well no, I have no idea what's inside $a
gfldex m: my $a = ‘\ ’; say ‘hello world.’ ~~ /<$a>/
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}␤»
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␤»
samcv as i'm seeing in the design docs 00:54
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」␤»
AlexDaniel yes, EVAL protection saves it here, but still 🤦 00:59
AlexDaniel alright, so to abuse this I have to search for places in Grammar.nqp without <!RESTRICTED> 01:12
samcv what does ‘‘ ’’ do if i may ask? 01:14
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
samcv: because it will be EVAL-ed 01:16
samcv: even though there is partial protection, you don't want that
samcv yeah
AlexDaniel now ‘‘ ’’ is just a string "‘ ’" 01:17
just quote, space, unquote
once it is EVAL-ed, your regex will turn into /‘ ’/
samcv ahhh
AlexDaniel and that's what matches the space
samcv ok :)
that makes sense
AlexDaniel but… please don't do that :/
samcv so it's not a bug it's just an undocumented thing right. 01:18
AlexDaniel um, well… actually…
samcv it ignores any spaces when you use s:ss with <$var>
even if it's not blank
AlexDaniel well the question here is “how do I match some Str variable from a regex?” 01:20
because <{}> is clearly not that
ah wait, isn't it just $a?
samcv well. that makes it literal 01:21
so like
AlexDaniel m: my $a = ‘ ’; my $b = ‘a b c’; $b ~~ s:g/$a/space/; say $b
camelia rakudo-moar c00061: OUTPUT«aspacebspacec␤»
AlexDaniel there we go! Alright…
AlexDaniel bangs his head against the wall
samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/$a/space/;
camelia ( no output )
samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/<$a>/space/; 01:22
camelia ( no output )
AlexDaniel why would you need :ss ? :)
samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/<$a>/space/; say $b;
camelia rakudo-moar c00061: OUTPUT«space b c␤»
samcv m: my $a = '.'; my $b = 'a b c'; $b ~~ s:ss/$a/space/; say $b;
camelia rakudo-moar c00061: OUTPUT«a b c␤»
samcv hah AlexDaniel
AlexDaniel for some reason I forgot that you can just write $a and was expecting it to be <~{}> or whatever… 01:23
dammit
samcv but the perl 6 design docs seem to suggest <$a> just does interpolation of the variable
so a space should work i think...
AlexDaniel NO, it EVALs it!!
samcv doesn't it eval text you put in there regardless 01:24
AlexDaniel github.com/rakudo/rakudo/blob/91a7...or.pm#L466
↑ here is what happens
no, just matching a variable is not equal to EVAL-ing the damn thing :)
samcv no that's not what i'm saying 01:25
samcv s/stuff here/thing/ the 'stuff here' is evaled right 01:25
you have typed into the file
AlexDaniel samcv: what part of the “design docs” are you referring to, by the way?
samcv design.perl6.org/S05.html#Variable...erpolation 01:26
AlexDaniel samcv: well not really, because stuff in / / is just parsed as a regex language 01:26
for example
samcv ah okay
i understand.
AlexDaniel m: say “hello {“world” ~ “{ 25 + 50}”}” 01:27
camelia rakudo-moar c00061: OUTPUT«hello world75␤»
AlexDaniel nothing is EVAL-ed, that's just the way it parses it
AlexDaniel “To interpolate a Regex object, use <$var> instead.” 01:29
so it does what it says
samcv ok so by interpolate it does more than just plop the value in there seems to be what you're saying 01:30
making it less safe than if the code were typed into the regex in the program file
so i guess the interpolation it mentions does more than i thought it? 01:31
AlexDaniel gfldex: here ↑, our documentation should clarify all that 01:32
dalek c: 810ec37 | coke++ | doc/Type/IO.pod6:
fix spelling
01:33
synopsebot6 Link: doc.perl6.org/type/IO
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;␤␤»
samcv ss is not allowed on match but the language section of perl 6 docs do not mention that is the case
AlexDaniel well, first of all it is just :s 01:49
secondly, it is allowed
m: say ‘a b c’ ~~ m:s/a b/
camelia rakudo-moar c00061: OUTPUT«「a b」␤»
samcv ah ok 01:50
AlexDaniel but / / is still treated as a Null regex, for whatever reason
so just use quotes
m: say ‘a b c’ ~~ m/‘ ’/
camelia rakudo-moar c00061: OUTPUT«「 」␤»
AlexDaniel (or whatever other quotes you prefer)
samcv ah ok. i was getting same space and sigspace mixed up
though ss implies s, but thank you 01:51
dalek c: 19ddd2e | coke++ | util/xt-recent-aspell.p6:
provide a much faster spelling test for recent checks
01:52
samcv m: my $a = ' a'; say $a ~~ m:s/ a/; 01:53
camelia rakudo-moar c00061: OUTPUT«「a」␤»
samcv m: my $a = ' '; say $a ~~ m:s/ /;
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/;␤»
samcv yeah it does not like only a space even with sigspace on
AlexDaniel maybe it is a bug, I don't know 01:54
jdv79 is it right to use ${} to pass a hashref to a I::P5 func? 02:30
seems wrong but i forget 02:31
dalek c: f0364aa | gfldex++ | doc/Language/typesystem.pod6:
not all types have a type object (the paragraph is still not good)
02:49
synopsebot6 Link: doc.perl6.org/language/typesystem
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 …»
samcv interesting...
gfldex m: my $a = /' '/; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
camelia rakudo-moar c00061: OUTPUT«alefta␤»
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;
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/; ␤»
gfldex m: my $a = rx:s/\s/; my $b = 'a a', $b ~~ s:s/<$a>/left/; say $b;
camelia rakudo-moar c00061: OUTPUT«alefta␤»
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
samcv: did you check roast for sigspace? 03:20
samcv i will do that now 03:21
samcv gfldex, it doesn't test for leading/trailing spaces, or just only whitespace 03:32
samcv it seems that maybe this is the correct functionality, that it ignores leading and trailing space, making 03:39
m: say 'a' ~~ m:s/ a /
camelia rakudo-moar c00061: OUTPUT«「a」␤»
samcv so it seems trailing whitespace is allowed, from reading more into the docs 03:43
it seems to imply that, but i will try and read more of it
it seems leading whitespace is ignored, specifically it says that, so i think not matching m:s/ / is not a bug, but not matching m:s/a / may be 03:44
samcv yes i think it's a bug. the docs say that you can only have whitespace ignored after something. and that m:s/ a b c/ is the same as m/ a <.ws> b <.ws> c / 03:58
and none of the examples in S05 ever use an extra space at the end in their examples.. but they show a leading space. so that seems intentional 03:59
m: say 'a ' ~~ m/ a <.ws> /
camelia rakudo-moar c00061: OUTPUT«「a 」␤»
samcv Only whitespace sequences immediately following a matching construct (atom, quantified atom, or assertion) are eligible. Hence, initial whitespace is ignored at the front of any regex 04:03
^ what it says
samcv added that info to the rakudo bug with that info 04:15
lizmat clickbaits p6weekly.wordpress.com/2016/11/07/...t-a-boost/ 08:18
gfldex while we are at clickbaits, we need to think about our homepage and the docs again: news.ycombinator.com/item?id=12889082 08:19
CIAvash lizmat++ 08:23
El_Che thank you, lizmat 08:34
moritz lizmat++ 09:03
MasterDuke_ .tell moritz looks like the bot that logs to irclog.perlgeek.de is down on the various Perl 6 related channels 13:03
yoleaux MasterDuke_: I'll pass your message to moritz.
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
moritz MasterDuke_: thanks for letting me know!
MasterDuke_ np
moritz looks like 10 hours ago, it lost its connection to mysql, retried a few times, and then systemd gave up 13:07
MasterDuke_ all that scintillating conversation lost, like tears in the rain... 13:09
moritz adds RestartSec=60 to the ilbot systemd service file
whta I'd really like to add is a quadratic backoff, but I don't think systemd implements that 13:10
MasterDuke_ maybe hack something in with ExecStartPre? 13:14
cpin` hi all - have been looking at RT#129363 and think I have something, but would appreciate some advice/discussion... 13:15
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129363
cpin` initial hacking at: github.com/cpin/rakudo/commit/43cb...68a039257a
spectest passes, as does manually testing - however, new here so might be some naive assumptions in there 13:16
moritz cpin`: the type constraint in the new multi is Associative, but you call hash() as a coercer 13:17
cpin` (tests: github.com/cpin/roast/commit/dda25...12a2cdcbd)
moritz cpin`: maybe try h.WHAT.new(...) instead of hash() ?
cpin` moritz: ok - that may take some explaining - i took the majority of the existing code from `deepmap`... 13:18
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?
moritz yes
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?
MasterDuke_ cpin`: just a style thing, but you have a couple 'deep => $deep'. i think most of the core uses the ':$deep' syntax
moritz cpin`: and Bag, iirc
cpin` moritz: ah, yes
moritz cpin`: yes, worth a PR
cpin` MasterDuke_: ok, will check that out - thanks
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? github.com/cpin/rakudo/commit/43cb...6487ddR563
cpin` moritz: great - as I assumed. thanks!
MasterDuke_: nope - don't think so. artifact of debugging... 13:26
MasterDuke_ cpin`: you could also ask for comments in #perl6-dev 13:28
FROGGS o/ 13:55
nadim Hi P6, just dropped in to say "Keep up the good work" and thank you. 14:10
lizmat nadim: thanks for the kind words 14:12
nicq20 Hello o/ 14:15
MasterDuke_ cpin`: can't the nqp::if here ( github.com/cpin/rakudo/blob/1ee524...#L558-L566 ) be refactored to: nqp::if($deep && nqp::istype($value, Iterable), ($result := coremap(&!block, $value, :$deep).item), ($result := &!block($value))) 14:16
cpin` MasterDuke_: i suspect so... 14:24
nadim lizmat: greatly deserved 14:28
viki eyes Xliff 14:50
dalek c: 1dfcb50 | (Zoffix Znet)++ | doc/Language/typesystem.pod6:
Fix incorrect URL
15:04
synopsebot6 Link: doc.perl6.org/language/typesystem
dalek c: aa0945b | (Zoffix Znet)++ | doc/Type/DateTime.pod6:
Document DateTime.hh-mm-ss
15:14
synopsebot6 Link: doc.perl6.org/type/DateTime
viki It's so quiet in here, I can hear myself breathing... 16:24
profan *heavy breathing* 16:25
nicq20 Echo! echo, echo....
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!
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
dylanwh there are people in trucks driving around screaming at people here... #florida.
viki heh 16:29
[Coke] well, viki's half right, anyway.
viki At least I'm already in Canada, so I don't have to move ;) 16:30
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:13
viki It returns it. 17:15
m: dd start sleep 1;
camelia rakudo-moar a581bf: OUTPUT«Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Planned)␤»
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.
*running in it
viki
.oO( if there's nobody there to catch it, is a sunk Promise ever broken? )
17:18
:}
m: start { sleep 2; die "egahds" }; sleep 4; say "all'swell"
camelia rakudo-moar a581bf: OUTPUT«all'swell␤»
viki eheh 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␤»
viki :o
moritz a very solipsistic view :-)
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"
camelia rakudo-moar a581bf: OUTPUT«===SORRY!===␤egahds␤»
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␤»
viki :(
Oh, it dies in await
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␤»
viki :D
hankache hello #perl6 17:48
viki \o\ 17:50
viki m: 42 18:16
camelia rakudo-moar a581bf: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
viki m: 42e1000000000000 18:16
camelia ( no output )
viki m: Inf 18:17
camelia ( no output )
grondilu had never seen use MONKEY; before 18:46
grondilu m: use MONKEY-TYPING; 18:47
camelia ( no output )
grondilu m: use MONKEY;
camelia ( no output )
perlpilot there are many MONKEYs 18:48
AlexDaniel … and most of them do nothing 18:50
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:03
perlpilot doesn't much sound like an optimization :) 19:06
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
timotimo you can see the --optimize that gets passed in your "make" output
viki
.oO( just copy the internal sprintf impl. into your bench file and compare next to your own... )
19:10
viki It's all nqp code anyway 19:11
timotimo good point
viki m: say ("1." ~ "1" x 308).EVAL 19:24
camelia rakudo-moar a581bf: OUTPUT«1.11111111111111109384097517249756492674350738525390625␤»
viki m: say ("1." ~ "1" x 309).EVAL
:}
camelia rakudo-moar a581bf: OUTPUT«(timeout)»
TimToady yer mean! 19:25
mst TimToady: well you're ... ... ... median!"
TimToady that's my usual mode... 19:26
nicq20 Trying to think of a "range" joke... 19:26
mst I prefer to be a non-standard deviant
hankache hmm outliers :) 19:27
kyclark_ I’m back with more bouncy balls. I got some good feedback on reddit, and I’ve made some changes. pastie.org/10958479 20:21
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
Before I post a new version, I’d like feedback on this, specifically around lines 58-62
RabidGravy nice :) 20:24
[Coke] why PosInt? 20:27
oh. nevermind, missed the subset. :)
[Coke] thinks he was thinking IntStr, maybe.
could be faster with --balls=100_000 :) 20:28
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
viki kyclark_: also, my understanding is this won't be thread safe: for $positions.list».kv -> ($pos, $count) {
masak kyclark_: nice! 20:31
viki IIRC jnthn said » would initially be just doing what .hyper does... and that gives a HyperSeq
masak kyclark_: agree with viki, but the nicest way to write it IMO would be `Ball.new(:$rows, :$cols) xx $balls`
viki masak++ that is indeed much better
masak kyclark_: something bothers me about that passing-in of $rows and $cols, by the way.
kyclark_ Wow, interesting. I would not have come up with that.
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.
[Coke] huh. added a --profile when invoking the bouncy balls, but when you hit ^C to exit out, no profile.
viki m: say say 1.1e307 20:33
camelia rakudo-moar a581bf: OUTPUT«1.1e+307␤True␤»
viki m: say 1.111111e307
camelia rakudo-moar a581bf: OUTPUT«Inf␤»
masak kyclark_: one way to get around it would be to do `role Ball[$rows, $cols]` and make the appropriate changes
viki masak: ^
masak viki: huh; yes, that's worse.
viki I'm spectesting a fix ATM
masak oki
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.
Also, I found that Bags don’t work with Lists as the keys, only strings. This is right, yes?
viki kyclark_: no, that's wrong 20:35
moritz viki: are you sure? lists aren't value objects
viki m: dd Bag.new-from-pairs: [<a b c>] => 42;
camelia rakudo-moar a581bf: OUTPUT«(["a", "b", "c"]=>42).Bag␤»
[Coke] the ball script spends most of its non-sleep time in sink. :? 20:36
lizmat: I cheated in a while loop.
viki m: my $b = BagHash.new-from-pairs: [<a b c>] => 42; $b{$[<a b c>]}++; dd $b
camelia rakudo-moar a581bf: OUTPUT«BagHash $b = (["a", "b", "c"]=>42,["a", "b", "c"]=>1).BagHash␤»
viki m: my $b = BagHash.new-from-pairs: $[<a b c>] => 42; $b{$[<a b c>]}++; dd $b
camelia rakudo-moar a581bf: OUTPUT«BagHash $b = (["a", "b", "c"]=>1,["a", "b", "c"]=>42).BagHash␤»
viki Oh right, it's not the same object
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␤»
viki moritz: seems to work ^. What are value objects?
[Coke] (sink) ah, gnope.
moritz viki: objects where two equivalent objects also compare equally with === 20:38
viki Ah
moritz m: say 1 === 1; say [] === [];
camelia rakudo-moar a581bf: OUTPUT«True␤False␤»
viki Well, you can still use them as keys.
moritz ok
viki m: say 100000 === 100000; say [] === [];
camelia rakudo-moar a581bf: OUTPUT«True␤False␤»
kyclark_ m: dd ((1,1), (2,2), (1,1)).Bag 20:40
camelia rakudo-moar a581bf: OUTPUT«(1=>4,2=>2).Bag␤»
viki m: for (<a b c c d>).Bag.list -> (:$key, :$value) { say "$key:$value" }
camelia rakudo-moar a581bf: OUTPUT«a:1␤c:2␤b:1␤d:1␤»
viki kyclark_: ^ an alternative
There may be a better way
kyclark_ I keep forgetting about that way!
viki like .kv on just the Bag without .list first?
Yup 20:41
m: for (<a b c c d>).Bag.kv -> $k, $v { say "$k:$v" }
camelia rakudo-moar a581bf: OUTPUT«a:1␤c:2␤b:1␤d:1␤»
masak .Bag is a nice short way to say "make a histogram of these things"
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? github.com/rakudo/rakudo/blob/nom/...7218-L7220
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.
Xliff In progress. Not committed. 20:44
kyclark_ OK, new version: pastie.org/10958493
viki Xliff: I already did it :)
Xliff :P
Thx
viki Ah.. Answer for my question: to make stuff like 0e99999999999 return 0 and not NaN
[Coke] viki - maybe for speed? you avoid invoking 3 opcodes and an .ast
viki
.oO( I knew I shouldn't have removed it... *rebuilds* )
20:44
[Coke] ah 20:46
AlexDaniel I wish it had more balls at the same time 20:54
ahhhh
there is a paramater…
OK 20:55
MasterDuke_ this may be questionable, but if you do 'my %row is default([]); 20:56
you can get rid of the 'if %row{ $this-row }:exists {'
kyclark_ MovableType is removing some of my code when I try to post as a comment 20:57
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
AlexDaniel mmhmm 「unless 1 < $!col < $!cols」 21:00
viki kyclark_, just edit the post and add an "Update" section? 21:07
Xliff Hrm. 21:33
Xliff Can you add newlines in grammar definitions without the compiler barfing? 21:33
viki barphing how? 21:34
Xliff Ala: grammar X { TOP { <t1>\n<t2>\n'STRING'\n\n } }
viki I think you need to quote them
"\n"
Xliff No. Those are literals. I want TOP to be readable rather than cluttered on one line. 21:35
So those represent newlines in the actual code. 21:36
lizmat which would be whitespace, which should work, no ?
viki Yeah you can use literal newlines just like regular whitespace
Xliff The complaint I'm getting is "two terms in a row"
viki Well, prove it :) show code
Xliff I am, borg! 21:37
viki :) 21:38
Xliff gist.github.com/Xliff/fef6642960e6...42d9b71914 21:39
FROGGS Xliff: put 'rule' or 'token' before the word 'TOP' 21:40
Xliff D'oh!
FROGGS++ 21:41
FROGGS :o) 21:41
Xliff Oooh! Grammar::Tracer is awesome! 21:43
Xliff Whoop! 22:00
Xliff does the grammar dance. 22:01
stmuk_ www.donaldjtrump.com/press-release...al%20basic 22:26
stmuk_ unicode works too 22:30
japhb .ask RabidGravy Would Term::Cap allow us to avoid using tput in github.com/ab5tract/Terminal-Print...ds.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.
geekosaur and maybe be a bit more portable too? 22:37
geekosaur now knows not to try to install that under certain broken terminals/terminal types or on old non-ANSI ttys... 22:38
(notably emacs still has a non-ANSI terminal emulator in it)
japhb geekosaur: I'd be happy if we got portability out of it, yeah. 22:41
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
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.
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
Oh heck no, I wouldn't be that silly.
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.
geekosaur (sometimes I wish I'd kept the old Beehive terminal, just as a severe stress test for terminal output) 22:46
japhb I once had a for-reals TVI-920C (terminals-wiki.org/wiki/index.php/TeleVideo_920) heading my "personal computer", and man I wish I still had that thing .... 22:47
geekosaur heh. yep, that'd do it. 22:48
geekosaur remembers tvi910s
grondilu does not know much about terminals but remembers that linux consoles are supposed (or were supposed?) to be compatible to "vt100" 22:50
(somehow the term "vt100" had stuck in my mind)
geekosaur were supposed. it didn't do a good job of it originally
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
and ANSI X3.64 is a superset of VT220 22:52
(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)
vt100 won because the other quasistandard used "cookies" to store video attributes --- these displayed as spaces (termcap calls them "sg" / "standout [mode] glitch") 22:54
japhb Of note, as I was researching TUI stuff, I kept coming across this guy: en.wikipedia.org/wiki/Thomas_Dickey 22:55
All roads lead to Thomas, apparently.
grondilu geekosaur: those trivia notes of yours suit your nickname very well ;-) 22:57
samcv is it normal for perl6 --profile to segfault on running an otherwise working program? 23:32
i think it might be segfaulting when i start a proc::async process, i'm guessing
MasterDuke yeah, that's definitely not supported now 23:33
samcv i have never used it before so was wondering your experiences with it
ok so segfault is not totally unexpected?
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?
because i use those too. or is it just proc::async 23:35
MasterDuke i think anything which uses threads is out, but jnthn or timotimo could definitely give you a more conclusive answer 23:37
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
jnthn timotimo: Do you know why it crashes?
timotimo don't think so
jnthn timotimo: The instrumentation is guarded, and it uses a per-thread data structure to record data...
k
timotimo i'm not sure it even looks at other threads right now
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
jnthn I'd expect it to only give data on the main thread.
timotimo i've had it actually give data from a non-main thread somehow
jnthn Guess we'll have to try and catch the issue in gdb/valgrind and see what's going on. :) 23:45
jnthn It'd be good to actually get it to present useful data from all threads too, but that's more work. 23:46
Though more in the UI for presenting it than the VM
MasterDuke RT #128280 may be a bit out of date now, but i believe i did have some valgrind output 23:49
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128280