Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-27

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:02 Zoffix m: Rat.^roles.say
00:02 camelia rakudo-moar 0961ab: OUTPUT: «((Rational[Int,Int]) (Real) (Numeric))␤»
00:02 Zoffix foo3: ^ fixed now
00:14 mcmillhj joined #perl6
00:14 kurahaupo joined #perl6
00:25 wonner joined #perl6
00:34 aborazmeh joined #perl6
00:34 aborazmeh joined #perl6
00:49 virtualsue joined #perl6
00:53 Khisanth joined #perl6
00:53 astj joined #perl6
00:53 thou m: my $x; 'abc xyz' ~~ /:s <ident> $x=<ident> /; say($x);  # https://github.com/perl6/roast/blob/master/S05-capture/external-aliasing.t#L11
00:53 camelia rakudo-moar 9dba49: OUTPUT: «(Any)␤»
00:53 thou I can't seem to get this to work, although roast looks like it should?
00:54 Zoffix .tell teatime I wrote fudged tests for the Range-as-quantifier-in-regex thing. Unfudge them when you fix the bug. I *think* they're correct, but keep an eye out on wrong tests; I'm not omniscient :) https://github.com/perl6/roast/commit/44937e865e
00:54 yoleaux Zoffix: I'll pass your message to teatime.
00:55 Zoffix thou: I don't see that test file in the list of files that run: https://github.com/rakudo/rakudo/blob/nom/t/spectest.data
00:55 Zoffix There are a couple of such tests left over ones. It's still to be decided whether they need to be kept (I think they'll get tossed in 6.d)
00:55 thou ah, so it's probably not implemented
00:56 geekosaur not the problem
00:56 Zoffix Well, I'm not aware of <ident> being a thing that matches
00:56 geekosaur hm
00:56 Zoffix m: say "foo" ~~ /<ident>/
00:56 camelia rakudo-moar 9dba49: OUTPUT: «「foo」␤ ident => 「foo」␤»
00:56 Zoffix Oh, OK
00:56 thou What I'm doing now is basically / $<x>=[foo] { $x = $<x>.tail } /
00:56 geekosaur ident's a builtin
00:57 geekosaur I get the match failing, so $x not assigned
00:57 thou I'm just trying to avoid having to stuff junk into $/ when I just want to reference it in a closure right after the match basically
00:58 thou e.g. https://github.com/Leont/yamlish/pull/18/commits/500bc29784ce59b6d38484be6486c7c0c03edfc6#diff-48ff2943b33ac7e38bd512b75bcd8c63R242
00:58 thou But it's not a big deal, the $<foo>.tail method is working
01:00 * Zoffix doesn't quite follow why .tail is needed
01:01 thou $<foo> becomes a list of matches
01:01 thou since it's inside a [ ... ]* group
01:02 Zoffix m: "xxxx" ~~ /$<x>="x"*/; say $<x>.^name
01:02 camelia rakudo-moar 9dba49: OUTPUT: «Match␤»
01:03 Zoffix m: my $x; 'abc xyz' ~~ /:s <ident> (<ident>) {$x = ~$0} /; say($x);
01:03 camelia rakudo-moar 9dba49: OUTPUT: «xyz␤»
01:03 Zoffix I see why I thought <ident> didn't exist. Last time I tried it, I typed it as <indent> :)
01:04 thou m: "xxx" ~~ / [$<x>='x' { dd ~$<x> }]* /
01:04 camelia rakudo-moar 9dba49: OUTPUT: «"x"␤"x x"␤"x x x"␤»
01:04 thou m: "xxx" ~~ / [$<x>='x' { dd ~$<x>.tail }]* /
01:04 camelia rakudo-moar 9dba49: OUTPUT: «"x"␤"x"␤"x"␤»
01:04 geekosaur ok, yeh, looks like $foo=<...> is NYI
01:04 Zoffix Ah. Thanks.
01:07 thou m: "xxx" ~~ / [('x') { dd ~$0 }]* /
01:07 camelia rakudo-moar 9dba49: OUTPUT: «"x"␤"x x"␤"x x x"␤»
01:08 thou m: "xxx" ~~ / [('x') { dd ~$0.tail }]* /
01:08 camelia rakudo-moar 9dba49: OUTPUT: «"x"␤"x"␤"x"␤»
01:11 thou Alright, thanks!
01:14 teatime Zoffix++
01:14 yoleaux 00:54Z <Zoffix> teatime: I wrote fudged tests for the Range-as-quantifier-in-regex thing. Unfudge them when you fix the bug. I *think* they're correct, but keep an eye out on wrong tests; I'm not omniscient :) https://github.com/perl6/roast/commit/44937e865e
01:20 astj joined #perl6
01:26 ryn1x joined #perl6
01:26 timrs2998 joined #perl6
01:37 Geth ¦ doc: ecbbf2eff6 | (Brian Duggan)++ | doc/Type/IO/Socket/Async.pod6
01:37 Geth ¦ doc: Fix typo in example.
01:37 Geth ¦ doc:
01:37 Geth ¦ doc: The text says port 3333, the code says 8080
01:37 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ecbbf2eff6
01:54 ilbot3 joined #perl6
01:54 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:55 pierrot 830
01:57 wander4096 joined #perl6
02:06 cdg joined #perl6
02:13 Cabanossi joined #perl6
02:13 mcmillhj joined #perl6
02:30 llfourn joined #perl6
02:52 noganex_ joined #perl6
02:59 mcmillhj joined #perl6
03:04 Xliff Er...
03:04 Xliff s(xmlParserInput)
03:04 Xliff *sigh*
03:06 Xliff Inline::Perl5(
03:06 Xliff *fetch stage failed for Inline::Perl5: Unable to handle source 'http://www.cpan.org/authors/id/N/NI/NINE/Perl6/Inline-Perl5-0.26.tar.gz')
03:06 Xliff Better.
03:07 Xliff ...and zef will not recognize that there is a new version.
03:15 mcmillhj joined #perl6
03:18 mr-foobar joined #perl6
03:21 sftp joined #perl6
03:22 wamba joined #perl6
03:23 timrs2998 joined #perl6
03:24 virtualsue joined #perl6
03:27 Cabanoss- joined #perl6
03:30 mcmillhj joined #perl6
03:32 telex joined #perl6
03:46 mcmillhj joined #perl6
03:57 Cabanossi joined #perl6
04:02 virtualsue joined #perl6
04:02 mcmillhj joined #perl6
04:13 ChoHag joined #perl6
04:18 mcmillhj joined #perl6
04:21 astj_ joined #perl6
04:23 nine_ joined #perl6
04:23 ab5tract_ joined #perl6
04:24 charsbar_ joined #perl6
04:24 jdv79_ joined #perl6
04:25 teatime_ joined #perl6
04:28 FK04 joined #perl6
04:28 xi joined #perl6
04:29 incredible_ joined #perl6
04:29 levex_ joined #perl6
04:30 AlexDaniel joined #perl6
04:30 ccntrq joined #perl6
04:31 andrewalker joined #perl6
04:31 avar joined #perl6
04:31 ChoHag joined #perl6
04:32 BooK joined #perl6
04:33 ggherdov joined #perl6
04:34 mcmillhj joined #perl6
04:37 cibs joined #perl6
04:37 virtualsue joined #perl6
04:37 zacts joined #perl6
04:40 ryn1x joined #perl6
04:41 SCHAPiE joined #perl6
04:47 Geth ¦ doc: 32002de6d8 | (Will "Coke" Coleda)++ | 10 files
04:47 Geth ¦ doc: Make test files that work on repo files respect TEST_FILES
04:47 Geth ¦ doc:
04:47 Geth ¦ doc: TEST_FILES is an env file of comma separated files to test
04:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/32002de6d8
04:47 Geth ¦ doc: 20bfc3d6d6 | (Will "Coke" Coleda)++ | 9 files
04:47 Geth ¦ doc: Rework tests to skip files after the files are selected
04:47 Geth ¦ doc:
04:47 Geth ¦ doc: not only if we're picking the default files; allows us to
04:47 Geth ¦ doc: not care if we pass in a bunch of inappropriate files for a
04:47 Geth ¦ doc: test with TEST_FILES
04:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/20bfc3d6d6
04:47 Geth ¦ doc: 9bf3803415 | (Will "Coke" Coleda)++ | 2 files
04:47 Geth ¦ doc: Run the most recent files on all tests, not just aspell
04:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9bf3803415
04:48 [Coke] in perl6/doc you can now run 'util/xt-recent.sh' which will run make xtest only on the most recently changed files in the commit log.
04:49 mcmillhj joined #perl6
04:50 [Coke] You can also do "TEST_FILES=a,b,c make xtest" if there's you want to test a specific file.
04:51 [Coke] ... If there's a specific file you want to test, I mean.
04:54 [Coke] Note that the xt-recent takes about 35s here vs. 3.5minutes for a full xtest.
04:54 Geth ¦ doc: 05df5f3d57 | (Will "Coke" Coleda)++ | xt/examples-compilation.t
04:54 Geth ¦ doc: whitespace
04:54 Geth ¦ doc: review: https://github.com/perl6/doc/commit/05df5f3d57
04:57 Cabanossi joined #perl6
05:05 mcmillhj joined #perl6
05:14 travis-ci joined #perl6
05:14 travis-ci Doc build errored. Will "Coke" Coleda 'whitespace'
05:14 travis-ci https://travis-ci.org/perl6/doc/builds/280270693 https://github.com/perl6/doc/compare/9bf3803415bb...05df5f3d57ef
05:14 travis-ci left #perl6
05:14 buggable [travis build above] ✓ All failures are due to: timeout (1 failure).
05:15 HoboWithAShotgun joined #perl6
05:21 mcmillhj joined #perl6
05:24 AlexDaniel joined #perl6
05:44 leont joined #perl6
05:48 AlexDaniel joined #perl6
05:57 abraxxa joined #perl6
05:59 ChoHag joined #perl6
06:00 domidumont joined #perl6
06:02 thou joined #perl6
06:04 virtualsue joined #perl6
06:04 domidumont joined #perl6
06:08 domidumont joined #perl6
06:19 knobo joined #perl6
06:21 wander4096 joined #perl6
06:21 thou joined #perl6
06:24 eliv joined #perl6
06:24 eliv joined #perl6
06:26 eater joined #perl6
06:27 Cabanossi joined #perl6
06:29 setty1 joined #perl6
06:31 ufobat joined #perl6
06:50 ken joined #perl6
07:02 tyil are there any documents on making (background) services in perl 6?
07:07 wander4096 joined #perl6
07:07 wander4096 how can i match text in such form
07:07 wander4096 https://gist.github.com/W4anD0eR96/da9cb9414f476fec09fd50c7738094ec
07:08 wander4096 what i need is id ==> venue
07:08 wander4096 below is a try
07:08 wander4096 https://gist.github.com/W4anD0eR96/7f4a760ea3a5d1333c46dc1ea8e3ce0f
07:09 wander4096 but it fails at `id = {W11-0302}'
07:09 wander4096 i try to fix the problem, but get new bugs
07:11 wander4096 since no need of any other lines, maybe clips = <id><a-line><a-line><a-line><venue><a-line><a-line>
07:12 wander4096 but i stuck in match a line properly
07:13 darutoko joined #perl6
07:13 piojo joined #perl6
07:16 cschwenz joined #perl6
07:17 piojo m: say 10.000000000000001 == 10.Num
07:17 camelia rakudo-moar 9dba49: OUTPUT: «True␤»
07:18 piojo Isn't that weird? In other languages, math operations are cast to the more precise version, not the less
07:21 moritz m: say 10.000000000000001.^name
07:21 camelia rakudo-moar 9dba49: OUTPUT: «Rat␤»
07:21 moritz piojo: you can't generally say that Rat is more precise than Num, nor the other way 'around
07:22 moritz there is no one obvious and true way
07:22 moritz m: say 0.01e0 + 0.01e0 + 0.01e0 == 0.03e0
07:22 camelia rakudo-moar 9dba49: OUTPUT: «True␤»
07:22 moritz I wonder how that works :-)
07:22 piojo moritz: I thought Rat had infinite precision, but I haven't thought about this as much as the dev team
07:23 moritz piojo: no, only FatRat has that
07:23 AlexDaniel joined #perl6
07:23 piojo moritz: oh, thanks
07:32 lowbro joined #perl6
07:32 lowbro joined #perl6
07:34 abraxxa joined #perl6
07:35 TEttinger m: say 10.000000000000001.Num == 10.Num
07:35 camelia rakudo-moar 9dba49: OUTPUT: «True␤»
07:35 TEttinger m: say (20 - 10.000000000000001).Num == 10.Num
07:35 camelia rakudo-moar 9dba49: OUTPUT: «True␤»
07:35 TEttinger m: say 20 - 10.000000000000001
07:35 camelia rakudo-moar 9dba49: OUTPUT: «9.999999999999999␤»
07:36 TEttinger interesting, it isn't just flooring
07:36 nadim joined #perl6
07:37 wander4096 m: say 10.000000000000001 == 10.FatRat
07:37 camelia rakudo-moar 9dba49: OUTPUT: «False␤»
07:37 wander4096 m: say 10.000000000000001 == 10.Rat
07:37 camelia rakudo-moar 9dba49: OUTPUT: «False␤»
07:39 pmurias joined #perl6
07:40 patrickz joined #perl6
07:48 Guest2284 joined #perl6
07:51 AlexDaniel joined #perl6
07:52 committable6 joined #perl6
07:52 quotable6 joined #perl6
07:52 evalable6 joined #perl6
07:52 bloatable6 joined #perl6
07:52 unicodable6 joined #perl6
07:52 releasable6 joined #perl6
07:52 coverable6 joined #perl6
07:52 nativecallable6 joined #perl6
07:52 greppable6 joined #perl6
07:52 benchable6 joined #perl6
07:52 bisectable6 joined #perl6
07:52 squashable6 joined #perl6
07:52 statisfiable6 joined #perl6
07:57 AlexDaniel squashable6: status
07:57 squashable6 AlexDaniel, Next SQUASHathon in 9 days and ≈2 hours (2017-10-07 UTC-12⌁UTC+14)
07:57 wamba joined #perl6
07:57 piojo m: my $n = 27.09269; say $n.WHAT; say $n.Num.Rat == $n;
07:57 camelia rakudo-moar 9dba49: OUTPUT: «(Rat)␤False␤»
07:58 piojo m: my $n = 27.09269; say $n.WHAT; my $diff = $n-$n.Num.Rat; say $diff.WHAT; say $diff.perl;
07:58 camelia rakudo-moar 9dba49: OUTPUT: «(Rat)␤(Rat)␤<27/38300000>␤»
07:59 piojo m: my $n = 27.09269; say $n.perl; say $n.Num.perl;
07:59 camelia rakudo-moar 9dba49: OUTPUT: «27.09269␤27.09269e0␤»
07:59 piojo Bug?
08:07 jonas1 joined #perl6
08:09 dakkar joined #perl6
08:12 Cabanossi joined #perl6
08:14 sproctor joined #perl6
08:15 ufobat joined #perl6
08:15 xinming joined #perl6
08:17 DrForr Heh. Work email topic - '[puppet] RAT in kitchen
08:20 DrForr s/$/'/
08:22 cdg joined #perl6
08:25 wamba joined #perl6
08:27 [particle] joined #perl6
08:28 robertle joined #perl6
08:33 lizmat .
08:36 u-ou .
08:42 gfldex joined #perl6
08:44 Guest2284 joined #perl6
08:49 nadim joined #perl6
08:53 AlexDaniel joined #perl6
09:03 sftp joined #perl6
09:11 El_Che DrForr: where is work nowadays?
09:12 * DrForr sighs deeply.
09:12 DrForr GoodData in Prague.
09:13 El_Che why the sigh?
09:13 DrForr Just really not liking the seemingly constant change, but that's how the work environment is nowadays I guess.
09:15 El_Che I see. It sounds tiring indeed
09:18 El_Che I'll be close to the GoodData location soon :) -> Open Source Summit
09:19 DrForr Would that by chance be at the Hilton here in Prague?
09:19 El_Che around the corner: http://events.linuxfoundation.org/events/open-source-summit-europe
09:19 El_Che yep
09:19 El_Che the hilton
09:19 DrForr I saw a few people with... Aha, it is.
09:19 El_Che (I am not staying there, but a colleague is)
09:19 DrForr I saw 3 people with SUSE backpacks on my walk to work.
09:19 El_Che (I like to walk to a venue, no everyone does)
09:20 El_Che still a month to go
09:20 El_Che thus should be an other event
09:20 DrForr Do you have my Romanian number? I'll *hopefully* be in town.
09:21 El_Che not sure, I'll look it up (maybe on one of the fosdem mails)
09:21 El_Che thx
09:21 El_Che The undersell Linus Torvalds on the page: "Linus Torvalds - Linux Foundation Fellow"
09:21 El_Che lol
09:22 moritz nice chap, cool fellow :-)
09:25 amalia___ joined #perl6
09:25 Aaronepower joined #perl6
09:25 El_Che "Donald Trump - Famous golver and prolific tweeter user"
09:26 El_Che s/golver/golfer/
09:26 stmuk "I am your God" - Linus
09:26 El_Che "Larry Wall - Linguïst and creator of rn"
09:31 El_Che t
09:34 mr-foobar joined #perl6
09:34 DrForr Probably too late to submit a talk.
09:40 Xliff If a NativeCall routine returns NULL, will that be interpreted as Nil, or the specified return type?
09:46 Morfent joined #perl6
09:48 nowan joined #perl6
09:53 jnthn Xliff: Type object of the specified return type
10:00 Xliff jnthn++: Thanks
10:01 Xliff m: use NativeCall; my int32 $a = int32; say "a" if $a;
10:01 camelia rakudo-moar 9dba49: OUTPUT: «Cannot unbox a type object (int32) to int.␤  in block <unit> at <tmp> line 1␤␤»
10:01 Xliff Hrm.
10:02 jnthn Native types don't have a NULL :)
10:02 Xliff OK, well if a returned value is set to the type object? Will that still be untruthy?
10:02 jnthn Yes, type object are untruthy and undefined
10:02 Xliff YAY!
10:03 Xliff I keep forgetting old lessones I leanred during my first experiments with NativeCall a year ago.
10:03 Xliff s/ones/ons/
10:04 AlexDaniel joined #perl6
10:07 AlexDaniel joined #perl6
10:11 piojo m: my $n = 27.09269; say $n.perl; say $n.Num.perl; say $n == $n.Num; say ($n - $n.Num);
10:11 camelia rakudo-moar 9dba49: OUTPUT: «27.09269␤27.09269e0␤True␤0␤»
10:11 piojo m: my $n = 27.09269; say $n.WHAT; my $diff = $n-$n.Num.Rat; say $diff.WHAT; say $diff.perl;
10:11 camelia rakudo-moar 9dba49: OUTPUT: «(Rat)␤(Rat)␤<27/38300000>␤»
10:12 piojo m: my $n = 27.09269; say $n.perl; say $n.Num.Rat.perl; my $diff = $n-$n.Num.Rat; say $diff.WHAT; say $diff.perl;
10:12 camelia rakudo-moar 9dba49: OUTPUT: «27.09269␤<20753/766>␤(Rat)␤<27/38300000>␤»
10:12 Zoffix Num is floating point
10:13 piojo Zoffix: I know, but this is a number that should be represented exactly
10:13 Zoffix Ah, OK
10:13 piojo err, for single precision float
10:13 piojo maybe double precision has different exact numbers
10:13 piojo thx :)
10:15 piojo m: my $n = 27.09269; say $n.perl; say $n.Num.perl;
10:15 camelia rakudo-moar 9dba49: OUTPUT: «27.09269␤27.09269e0␤»
10:15 piojo so they are numerically the same, as Num and as Rat. Right?
10:16 piojo m: my $n = 27.09269; say $n.WHAT; say $n.perl; say $n.Num.perl; say $n.Num.Rat == $n
10:16 camelia rakudo-moar 9dba49: OUTPUT: «(Rat)␤27.09269␤27.09269e0␤False␤»
10:16 Zoffix Maybe. I wouldn't trust .perl too much when displaying these TBH
10:16 Zoffix s: 2.2, 'perl', \()
10:16 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/9dba498f7/src/core/Rat.pm#L5
10:16 Zoffix s: 2e2, 'perl', \()
10:16 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/9dba498f7/src/core/Num.pm#L34
10:16 tbrowder .tell timotimo problem seems to be a CGI script cannot use a “use lib </some/path/lib>;” to find an uninstalled module.
10:16 yoleaux tbrowder: I'll pass your message to timotimo.
10:17 Zoffix s: 2e2, 'Str', \()
10:17 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/9dba498f7/src/core/Num.pm#L97
10:17 Zoffix Well, at least the Rat one. I see it does divs and reductions
10:17 piojo m: my $n = 27.09269; dd $n; dd $n.Num;
10:17 camelia rakudo-moar 9dba49: OUTPUT: «Rat $n = 27.09269␤27.09269e0␤»
10:17 Zoffix dd is just .perl with a bowtie
10:18 tbrowder the excption looks like it’s from rakudo
10:18 piojo Zoffix: okay, fair enough. Is there any way to see a number's full value?
10:18 Guest2284 joined #perl6
10:20 margeas joined #perl6
10:20 piojo I will just use C++ to check this :P
10:20 Zoffix m: say 2.2.nude
10:20 camelia rakudo-moar 9dba49: OUTPUT: «(11 5)␤»
10:21 Zoffix OK
10:22 Zoffix I guess what I'm saying is: if you're spotting a possible bug in precision, it's equally possible the code generating Str/Num views of Rat could have a bug hiding the imprecision
10:23 piojo m: C++ agrees that this is represented exactly as a double
10:23 camelia rakudo-moar 9dba49: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3C++7⏏5 agrees that this is represented exactly␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement m…»
10:23 piojo Zoffix: it should pass round trip conversion
10:24 Zoffix Str, maybe, but not Num
10:24 Zoffix Actually no, neither has to
10:24 piojo Zoffix: Num is a double-precision float, right?
10:24 Zoffix .perl should tho
10:24 piojo And we're dealing with a number that's represented exactly
10:24 Zoffix piojo: are you talking about your number? I meant Rat representation in general
10:25 piojo Zoffix: yes, my number
10:25 piojo discovered because a program was failing that shouldn't have
10:25 piojo dealing with serialized numbers, which were parsed into Rat--this is reasonable
10:25 ChoHag joined #perl6
10:25 Zoffix m: ⅓.Str.Rat.nude.say; ⅓.Num.Rat.nude.say; ⅓.perl.EVAL.nude.say
10:25 camelia rakudo-moar 9dba49: OUTPUT: «(333333 1000000)␤(1 3)␤(1 3)␤»
10:25 piojo but my "convert to Num if it won't lose any precision" logic failed because the "won't lose precision" thing was giving the wrong value
10:26 Zoffix m: say ⅓.Num
10:26 camelia rakudo-moar 9dba49: OUTPUT: «0.333333333333333␤»
10:26 piojo m: my $n = 27.09269; say $n.nude; say $n.Num.nude; say $n.Num.Rat.nude;
10:26 camelia rakudo-moar 9dba49: OUTPUT: «(2709269 100000)␤No such method 'nude' for invocant of type 'Num'. Did you mean any of these?␤    none␤    note␤␤  in block <unit> at <tmp> line 1␤␤»
10:26 Zoffix m: say 27.09269.nude; say 27.09269.Num.nude
10:26 camelia rakudo-moar 9dba49: OUTPUT: «(2709269 100000)␤No such method 'nude' for invocant of type 'Num'. Did you mean any of these?␤    none␤    note␤␤  in block <unit> at <tmp> line 1␤␤»
10:27 Zoffix m: say 27.09269.nude; say 27.09269.Num.Rat.nude
10:27 camelia rakudo-moar 9dba49: OUTPUT: «(2709269 100000)␤(20753 766)␤»
10:27 jnthn m: say (2709269e0 / 100000e0) == 27.09269e0
10:27 camelia rakudo-moar : OUTPUT: «True␤»
10:27 Zoffix yeah, looks like it's losing something or other. I see it converted .33333333333333 to 1/3, so it looks like it tries to be smarter than just slapping a denominator onto it
10:28 piojo Zoffix: oh, that's interesting
10:28 Guest2284 joined #perl6
10:28 Zoffix m: my $r = FatRat.new: 2709269, 100000; say $r.nude; say $r.Num.FatRat.nude
10:28 camelia rakudo-moar 9dba49: OUTPUT: «(2709269 100000)␤(20753 766)␤»
10:28 * Zoffix shrugs
10:29 jnthn (I wondered if the issue could be that all it has is the numerator/denominator, not the original values, and doing the floating point conversion/division of each of those doesn't work out, but it seems that it does)
10:30 eliasr joined #perl6
10:31 piojo I'll file a bug
10:32 timotimo .tell tbrowder what user does the script run as? what are its permissions? could it, for example, fail to create a precomp folder in that lib folder?
10:32 yoleaux 10:16Z <tbrowder> timotimo: problem seems to be a CGI script cannot use a “use lib </some/path/lib>;” to find an uninstalled module.
10:32 yoleaux timotimo: I'll pass your message to tbrowder.
10:36 Zoffix m: say 27.09269.nude; say 27.09269.Num.Rat(1e-10).nude
10:36 camelia rakudo-moar 9dba49: OUTPUT: «(2709269 100000)␤(2709269 100000)␤»
10:37 Zoffix piojo: ^ turns out it works if you set smaller epsilon (default is 1e-6)
10:40 knobo joined #perl6
10:47 tbrowder timotimo: it looks definitely like a rakudo bug. i can demo it with a short script using cro server and client.
10:47 yoleaux 10:32Z <timotimo> tbrowder: what user does the script run as? what are its permissions? could it, for example, fail to create a precomp folder in that lib folder?
10:47 Geth ¦ doc: 8de3bbc0de | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Num.pod6
10:47 Geth ¦ doc: Document Num.? methods
10:47 Geth ¦ doc:
10:47 Geth ¦ doc: The .Rat is already documented as being provided by Real, but Num
10:47 Geth ¦ doc: has its own impl of it. The .FatRat isn't documented and isn't provided
10:47 Geth ¦ doc: by Real (but probably should be?)
10:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8de3bbc0de
10:47 tbrowder good question, but
10:48 tbrowder good questions. i will look...
10:51 tbrowder i don’t see any .precomp in the local lib, but i think that’s because it never finds the lib. the exception msg shows it looks in the right place but doesn’t see it.
10:52 tbrowder let me tidy the script and i’ll post it.
10:56 ChoHag joined #perl6
10:58 Guest2284 joined #perl6
11:00 domidumont joined #perl6
11:03 piojo Zoffix: oh! Thanks for finding that
11:03 tbrowder timotimo: looks like i cried wolf again. found a typo in local script. ?
11:03 zakharyas joined #perl6
11:03 tbrowder path was wrong...
11:04 piojo Zoffix: let me tell you my use case, and try to convince you this should be changed somehow (if possible)...
11:06 piojo Zoffix: the original data was a floating point number, serialized to JSON and sent over the network. A server picked it up and treated it as a Rat (since that seems to be the default type for numbers in most cases). I tried to add it to a database, found that I had to convert it to Num for it to be valid, but upon doing so, the value isn't right anymor
11:06 piojo oh, wait--if it's the 2nd conversion that's wrong, then the part I've described so far has no issue
11:07 piojo So when it's deserialized, it's turned into a Rat with epsilon=0
11:08 piojo at least, that's how it seems, since it's read from JSON or from the REPL with full precision
11:08 rindolf joined #perl6
11:08 piojo so the only part that's wrong is the way I wrote the round-trip conversion check
11:14 travis-ci joined #perl6
11:14 travis-ci Doc build passed. Zoffix Znet 'Document Num.? methods
11:14 travis-ci https://travis-ci.org/perl6/doc/builds/280372695 https://github.com/perl6/doc/compare/05df5f3d57ef...8de3bbc0de31
11:14 travis-ci left #perl6
11:19 piojo Zoffix: little copy/paste issue with FatRat here: https://github.com/perl6/doc/compare/05df5f3d57ef...8de3bbc0de31
11:27 tbrowder ref travis: are numbered rakudo versions faster than “latest” for testing?
11:41 timotimo how do you mean "faster"?
11:46 pmurias http://cr.openjdk.java.net/~rpressler/loom/Loom-Proposal.html # fibers & continuations comming to JVM
11:49 moritz tbrowder: try it and see?
11:49 itaipu joined #perl6
12:01 Zoffix piojo: you could also store it as two Ints that you Rat-ify back
12:02 Zoffix piojo: I missed what I was meant to be convinced about....
12:02 virtualsue joined #perl6
12:02 Geth ¦ doc: jstuder-gh++ created pull request #1582: Remove Duplicate Code From Supply Migrate Example
12:02 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1582
12:03 Geth ¦ doc: 49568f39cc | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Num.pod6
12:03 Geth ¦ doc: Fix typo; piojo++
12:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/49568f39cc
12:04 Geth ¦ doc: 9bc1a755e9 | (Jeremy Studer)++ (committed by Zoffix Znet) | doc/Type/Supply.pod6
12:04 Geth ¦ doc: Remove Duplicate Code From Supply Migrate Example (#1582)
12:04 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9bc1a755e9
12:08 Zoffix tbrowder: pretty sure all versions are built with rakudobrew, so no, it won't be faster. Ask gfldex; I recall he made a .travisyml that runs fast
12:14 Geth_ ¦ DBIish: 432f1ad2c5 | (Jonathan Stowe)++ | META6.json
12:14 Geth_ ¦ DBIish: Up version
12:14 Geth_ ¦ DBIish: review: https://github.com/perl6/DBIish/commit/432f1ad2c5
12:14 Geth_ ¦ DBIish: aad9a96465 | (Jonathan Stowe)++ | 4 files
12:14 Geth_ ¦ DBIish: Use the proper DEPRECATED() sub
12:14 Geth_ ¦ DBIish:
12:14 Geth_ ¦ DBIish: fixes #102
12:14 Geth_ ¦ DBIish: review: https://github.com/perl6/DBIish/commit/aad9a96465
12:17 * Zoffix swaps geths
12:18 Zoffix hm
12:19 Zoffix Again push webhooks without commits :/
12:19 Zoffix stupid github
12:20 Geth ¦ DBIish: 432f1ad2c5 | (Jonathan Stowe)++ | META6.json
12:20 Geth ¦ DBIish: Up version
12:20 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/432f1ad2c5
12:20 Geth ¦ DBIish: aad9a96465 | (Jonathan Stowe)++ | 4 files
12:20 Geth ¦ DBIish: Use the proper DEPRECATED() sub
12:20 Geth ¦ DBIish:
12:20 Geth ¦ DBIish: fixes #102
12:20 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/aad9a96465
12:20 Zoffix k
12:23 piojo Zoffix: Sorry, I stopped because I realized the *core* part wasn't wrong, just my attempt at checking equality
12:24 piojo I should have been clearer that I changed my mind--nothing was fundamentally bad about the current API
12:25 piojo But it IS a little icky that a default number is a Rat, but conversion to Rat will give reduced precision compared to the default Rat
12:25 HoboWithAShotgun joined #perl6
12:25 piojo Not a serious issue, though, since it only comes up when you use conversion operators
12:29 Zoffix piojo: I don't get what a "default number" is... :/
12:32 Zoffix m: '2e0'.Numeric.^name.say
12:32 camelia rakudo-moar 9af560: OUTPUT: «Num␤»
12:32 piojo Zoffix: Sorry, I'm being hand-wavy. I mean most small floating point numbers, when present in the REPL or a .p6 script
12:32 piojo m: say 1.93384.WHAT
12:32 camelia rakudo-moar 9af560: OUTPUT: «(Rat)␤»
12:33 piojo I believe Rat and Int will cover most common numbers that are written in a script or parsed from some input.
12:34 piojo (For example, JSON::Fast turns these numbers into Rat as well)
12:34 Zoffix piojo: but that's not the "default number". You're using the syntax for a Rat literal and it gives you a Rat literal.
12:34 Zoffix Well, that's JSON::Fast's problem :) It can turn them into whatever it wants :)
12:34 Zoffix m: say 1.93384e0.^name
12:34 camelia rakudo-moar 9af560: OUTPUT: «Num␤»
12:35 abraxxa joined #perl6
12:35 Zoffix m: my $n = '1.93384'; $n.&[~]('e0').Numeric.^name.say
12:35 camelia rakudo-moar 9af560: OUTPUT: «Num␤»
12:35 Zoffix ehehe
12:35 piojo Zoffix: I see what you mean
12:36 piojo But I don't see what you did there :)
12:36 Zoffix m: my $n = '1.93384'; ($n ~ 'e0').Numeric.^name.say
12:36 camelia rakudo-moar 9af560: OUTPUT: «Num␤»
12:36 piojo I guess I'm bringing too much baggage from other languages where \d+\.\d+ means floating point or double
12:36 Zoffix attached 'e0' to the end of the string, so the .Numeric parses it as a Num from the get-go
12:38 piojo Zoffix: I wouldn't go so far as to admit my argument has no merit, though--what I called "default" numbers is still the canonical way to write a number (math, not perl)
12:38 * [Coke] waves
12:39 * Zoffix particle
12:40 nadim joined #perl6
12:40 piojo Zoffix: As far as I can tell, the parser special-cases its input--everything is parsed from script/REPL with epsilon=0, right?
12:40 tbrowder Zoffix: thanks
12:41 abraxxa joined #perl6
12:41 piojo so it ends up feeling like a "perl" Rat has a higher precision than an explicit Rat
12:41 piojo I'm not saying this is terrible. It is merely awkward.
12:41 ChoHag joined #perl6
12:42 * Zoffix has no idea what this conversation is about anymore
12:42 tbrowder .tell gfldex Zoffix says you have a fast travis yml, can you let me see it? thanks
12:42 yoleaux tbrowder: I'll pass your message to gfldex.
12:42 piojo Zoffix: no worries
12:43 abraxxa joined #perl6
12:46 ryn1x joined #perl6
12:47 Zoffix There *is* a bug tho in how 1.1121 literals are parsed
12:47 Zoffix m: (9.99999999999999999999999999999999999999999999999).nude.say
12:47 camelia rakudo-moar 9af560: OUTPUT: «(999999999999999999999999999999999999999999999999 100000000000000000000000000000000000000000000000)␤»
12:47 Zoffix ^ Rat denominator is supposed to be uint64 maximum.
12:48 Zoffix And currently the planned fix is to make that ^ a RatStr
12:48 abraxxa joined #perl6
12:57 ChoHag joined #perl6
12:57 mcmillhj joined #perl6
12:57 zakharyas joined #perl6
12:57 Cabanossi joined #perl6
13:04 nadim joined #perl6
13:08 cdg joined #perl6
13:10 cdg joined #perl6
13:12 cdg_ joined #perl6
13:15 nattefrost joined #perl6
13:15 knobo joined #perl6
13:24 itaipu joined #perl6
13:31 Xliff Is the OpenSSL module working? I am getting test errors when trying to install it.
13:31 itaipu joined #perl6
13:31 Xliff Test Summary Report
13:31 Xliff -------------------
13:31 Xliff t/15-issue-36.t      (Wstat: 512 Tests: 4 Failed: 2)
13:32 Zoffix m: sub foo { $^v.uc }; my $x = "meow"; $x .= &foo; say $x
13:32 camelia rakudo-moar 9af560: OUTPUT: «MEOW␤»
13:32 Zoffix <3 .= &sub form
13:33 wamba joined #perl6
13:35 HoboWithAShotgun joined #perl6
13:37 Zoffix m: my $file = "meow"; my $ver = "6.c"; my $new-file = "$file{ ".$ver" if $ver.contains: 'propos'}"; dd $new-file
13:37 camelia rakudo-moar 9af560: OUTPUT: «Str $new-file = ""␤»
13:37 Zoffix spot the bug :P
13:38 Xliff :P
13:38 Xliff Where's the }?
13:38 Zoffix the }?
13:38 Xliff Won't string interpolation complain since there is no closing curly in $new-file?
13:38 Zoffix It's there
13:40 Xliff Oh, ew.
13:40 Xliff Zoffix--: Malicious use of double quotes.
13:40 nadim joined #perl6
13:40 skids joined #perl6
13:40 Zoffix The bug is (in this program) is $file interpreted as a hash
13:41 Zoffix m: my $file = "meow"; my $ver = "6.c"; my $new-file = "$file { ".$ver" if $ver.contains: 'propos'}"; dd $new-file
13:41 Xliff Yes. I was getting there.
13:41 camelia rakudo-moar 9af560: OUTPUT: «Str $new-file = "meow "␤»
13:41 Xliff Still... my eyes saw an unterminated {} in a string.
13:41 Xliff I had to cross them to see the '}'
13:41 tyil I'm trying to make a perl program fork into the background, so it can run as a service, but once it forks, moar starts using 400% cpu
13:41 tyil script is here: https://cry.nu/p/j4ax
13:42 DrForr Xliff: braiding makes that interesting :)
13:42 tyil once I can figure this out in a clean fashion I'll see if I can make a fancy module for it
13:43 Xliff DrForr: Braiding? Do I really want to know? Please let it be about hair.
13:44 mspo tyil: are you looping at all?  shouldn't it just fork, run, and exit/
13:44 mspo oh does baile() loop?
13:44 tyil mspo: it starts up a bailador process, which should already do the looping
13:44 mspo k
13:44 mspo tyil: does it busy loop without the forking?
13:44 tyil busy loop?
13:45 Zoffix Xliff: when Rakudo is parsed, it's parsed with a braid of 3 languages: main, quote, and regex. So you can have nested quotes
13:45 mspo strace it :)
13:45 Zoffix (or 4, perl5regex?)
13:45 tyil (baile() correctly loops if its not forked, if that what you mean)
13:45 Xliff Zoffix++ #explanation
13:45 mspo tyil: yeah that's what I was asking
13:45 tyil I've never made a service before, so I'm not familiar with all the fancy terminology :(
13:45 tyil I know of strace, I havent used it before I think
13:46 mspo try it out
13:46 mspo it might show something obvious or it might not
13:47 DrForr More to the point they're not "nested" because the quoted string belongs in a different strand of the braid, so it operates under that language's nesting rules.
13:50 tyil mspo: https://a.uguu.se/yRGDtJeSqleO_strace.log it doesnt reveal much obvious to me right now :p
13:51 Xliff DrForr: Tell that to my eyes... that know nothing of this 'braaaydiingggg'.
13:51 mspo tyil: you probably need to run it with -f so it follows your fork
13:51 knobo joined #perl6
13:52 Xliff "$file{ ".$ver" if $something == "blah" }" -- Is just evil.
13:52 tyil ah
13:52 mspo otherwise I just see a lot of memory stuff
13:52 mspo and then clone(), stuff, exit
13:54 ugexe m: with 42 { (1,).map: {say $_; say $^a} }
13:54 camelia rakudo-moar 9af560: OUTPUT: «42␤1␤»
13:54 gfldex_work joined #perl6
13:54 gfldex_work tbrowder: https://gfldex.wordpress.com/2017/04/14/speeding-up-travis/
13:55 tyil mspo: https://a.uguu.se/2ijpQ3AYOH5B_strace.log it seems to clone a lot
13:55 gfldex_work tbrowder: please note the comments, there is more then one way to be fast
13:57 DrForr 'exit -1;' is fast but may not be the most helpful approach :)
13:57 mspo yeah you produced 22 threads
13:57 ugexe you can also make your travis script push the rakudo directory to github once, then afterwards just download and untar the archive to install (a joke, but it actually works)
13:59 tyil mspo: thats something that shouldnt happen, right? :p
13:59 mspo shouldn't you be checking if pid is == 0 or > 0?
13:59 mspo not sure about < 0
13:59 tyil I'm trying to follow some linux daemon howto, which tells me the return of getpid is -1 on failure
13:59 tyil and > 0 if forking succeeded
14:02 tyil but if I change one of the checks the latter check to == 0, it seems to not spawn a plethora of threads, but continue on the code in run()
14:02 mspo yeah a child will get $pid = 0
14:02 mspo parent will get pid > 0
14:03 mspo the parent's $pid (of > 0) will be the actual pid of the child
14:04 tyil ok, so I should check if the pid was 0, and exit if it is
14:04 tyil since 0 is the parent, and the parent needs to die
14:04 tyil or am I reading wrong
14:05 Zoffix Xliff: https://twitter.com/zoffix/status/821800160569212930
14:05 mspo tyil: 0 is the child; run() if 0
14:05 mspo tyil: if you want to kill the parent, exit if > 0
14:06 mspo tyil: and just bail out if < 0 because you couldn't fork and probably broke something  :)
14:07 timotimo still a bit surprising forking works out with moarvm, as we do use threads
14:07 tyil if $pid < 0 { die "fork failed" }   if $pid > 0 { exit 0; } # to gracefully stop the parent process
14:07 ugexe m: with 42 { say $^a }; # i dunno if i love or hate that this works like this
14:07 timotimo and i don't recall seeing any setup code for how threads should handle a fork
14:07 camelia rakudo-moar 9af560: OUTPUT: «42␤»
14:08 tyil all code after that has $pid as 0, thus is only ran by the child
14:08 mspo timotimo: it should probably be done in BEGIN, which should be guarateed to be single threaded or something
14:08 mspo I just made that up
14:09 timotimo now that we have spesh on a separate thread, there is no point in user code where there aren't threads
14:10 Zoffix All rakudo programs are multi-threaded. Even empty ones use more than one thread
14:10 mspo so p6 isn't fork safe?
14:10 * Zoffix shrugs
14:11 mspo or even setuid, etc safe
14:12 Cabanossi joined #perl6
14:13 timotimo oh, those are per process, not per "process"
14:14 mspo there's a whole drama surrounding golang's usage in "system" space and people discovering that it doesn't actually work
14:14 nadim joined #perl6
14:15 timotimo oh dang
14:15 mspo because the runtime offers no escape hatch doing setup code before spinning up threads
14:15 mspo I mean you can just say that you can't do it up front (like erlang would)
14:16 Zoffix .oO( we could add a phaser... )
14:16 ugexe cant just set max threads to 1?
14:16 timotimo no
14:16 timotimo the spesh thread starts up before the user program is even considered
14:16 mspo here's a more compicated version of the issue: https://www.weave.works/blog/linux-namespaces-and-go-don-t-mix
14:17 timotimo what we could have is an evnironment variable
14:17 mspo but it's basically the same as go not being able to do the fork/drop-privileges dance
14:18 mspo a phaser (BEGIN_SINGLE_THREAD) or en ENV that you can change at runtime seem like the best options
14:18 mspo when I've thought about it
14:18 timotimo not fork, but how about evaling a new program?
14:18 mspo so you start with THREADS=1, do namespace/fork/privleges/whatever, set THREADS=NUMCPUS
14:18 tyil mspo: if I replace the run; with loop { say "pomf"; sleep .5; }, it seems to work properly, if I then replace the say "pomf" with say $config.get() and add the my $config Config .=new(), it still works, but when I add the $config.read() part, it loops twice and then just uses a lot of cpu
14:18 timotimo we don't allocate "just numcpus" threads now, though
14:19 timotimo we check how much cpu usage there is to see if spawning new threads would help
14:19 mspo anyway the 80% use-case is initialization/setup code
14:20 timotimo maybe it'd be better to have a commandline flag
14:20 timotimo i can even imagine a separate binary for no-threads-until-a-certain-point situations
14:21 mspo here's more on the golang stuff: https://github.com/golang/go/issues/1435
14:21 timotimo the spesh worker can just wait until a specific instruction has been fired
14:22 mspo anyway it's a runtime decision if you want to support that level of control or not :)
14:23 weabot is there a language-provided way to limit recursion in perl 6?
14:23 weabot to avoid infinite recursion?
14:23 timotimo there is not
14:24 timotimo only running out of memory or counting recursion levels yourself
14:24 weabot alright thanks
14:26 troys joined #perl6
14:26 rindolf joined #perl6
14:32 Xliff Zoffix: AAAIIEEE!
14:32 Xliff Zoffy: Why do you hate me so? :)
14:32 Zoffix :)
14:42 levex joined #perl6
14:45 epony joined #perl6
14:46 sftp joined #perl6
14:46 HoboWithAShotgun how would i split a string into chunks of two characters? in p5 i'd use unpack
14:47 ilmari m: "some string".comb(2).say
14:47 camelia rakudo-moar f62950: OUTPUT: «(so me  s tr in g)␤»
14:54 HoboWithAShotgun m: sub split-rgb ( RGBString $rgb ) { return $rgb.substr(1).comb(2).map: { "0x$_".Int }; }; say split-rgb("#FFAA0F");
14:54 camelia rakudo-moar 36122f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'RGBString' in parameter declaration.␤at <tmp>:1␤------> 3sub split-rgb ( RGBString7⏏5 $rgb ) { return $rgb.substr(1).comb(2).␤»
14:54 HoboWithAShotgun m: sub split-rgb ( $rgb ) { return $rgb.substr(1).comb(2).map: { "0x$_".Int }; }; say split-rgb("#FFAA0F");
14:54 camelia rakudo-moar 36122f: OUTPUT: «(255 170 15)␤»
14:54 HoboWithAShotgun yay. thanks
14:57 Cabanossi joined #perl6
14:57 Zoffix I think there's a module for doing this
14:57 Zoffix buggable: eco Color
14:57 buggable Zoffix, Color 'Format conversion, manipulation, and math operations on colours': https://github.com/zoffixznet/perl6-Color 5 other matching results: https://modules.perl6.org/s/Color
14:59 Zoffix m: sub split-rgb { $^s.comb(/<:hex>**2/)».parse-base: 16 }; "#FFAA0F".&split-rgb.say
14:59 camelia rakudo-moar 36122f: OUTPUT: «(255 170 15)␤»
14:59 Zoffix m: sub split-rgb { $^s.comb(/<:hex>**2/)».parse-base: 16 }; "FFAA0F".&split-rgb.say
14:59 camelia rakudo-moar 36122f: OUTPUT: «(255 170 15)␤»
15:00 nadim joined #perl6
15:01 Zoffix hm.. what's with the ded *able bots :/
15:03 Zoffix ===SORRY!===
15:03 Zoffix Cannot locate symbol 'SSL_load_error_strings' in native library 'libssl.so'
15:03 Zoffix on the bot server when I try perl6 bin/Committable.p6
15:04 Zoffix .tell AlexDaniel something worng with the bots. They're all dead and if I try to run one, I get "Cannot locate symbol 'SSL_load_error_strings' in native library 'libssl.so'"
15:04 yoleaux Zoffix: I'll pass your message to AlexDaniel.
15:05 mr-foobar joined #perl6
15:05 jnthn I have a hazy memory that that is some kind of libssl version thingy
15:05 jnthn I think I merged an IO::Socket::Async::SSL patch
15:05 Zoffix hm, I think IRC::Client uses that module /me tries updating
15:06 Zoffix But what I wanted to show with the bot is how awesome the Color module is ^_^ $ perl6 -e 'use Color; Color.new("#FFAA0F").rgb.say'
15:06 Zoffix (255 170 15)
15:08 kurahaupo joined #perl6
15:08 committable6 joined #perl6
15:09 committable6 joined #perl6
15:09 unicodable6 joined #perl6
15:09 bloatable6 joined #perl6
15:09 quotable6 joined #perl6
15:09 benchable6 joined #perl6
15:09 coverable6 joined #perl6
15:09 bisectable6 joined #perl6
15:09 nativecallable6 joined #perl6
15:09 releasable6 joined #perl6
15:09 evalable6 joined #perl6
15:09 greppable6 joined #perl6
15:09 squashable6 joined #perl6
15:09 statisfiable6 joined #perl6
15:09 Zoffix jnthn++ that was it :D
15:09 thou joined #perl6
15:09 Zoffix .tell AlexDaniel nm, just needed to update IO::Socket::Async::SSL
15:09 yoleaux Zoffix: I'll pass your message to AlexDaniel.
15:09 jnthn Yay :)
15:09 Zoffix c: HEAD use lib <data/all-modules/zoffixznet/perl6-Color/lib>; use Color; Color.new("#FFAA0F").rgb.say
15:09 committable6 Zoffix, ¦HEAD(36122f1): «(255 170 15)»
15:10 Xliff m: my $m = "Mmmm"; say $m.^name
15:10 Xliff Is de bot dead?
15:10 camelia rakudo-moar 36122f: OUTPUT: «Str␤»
15:10 moritz m: say 42
15:10 camelia rakudo-moar 36122f: OUTPUT: «42␤»
15:10 thou joined #perl6
15:11 Xliff No just lagged.
15:11 Xliff OK, so what is a slick way to get the variable to print out it's name.
15:11 Zoffix m: my $m = "Mmmm"; say $m.VAR.name
15:11 camelia rakudo-moar 2a512f: OUTPUT: «$m␤»
15:11 Xliff Take the above, I would like that to output "m"
15:11 Xliff Ah... that one.
15:11 Zoffix it don't always work; all depends on how you get it
15:11 Zoffix m: my $m := "Mmmm"; say $m.VAR.name
15:11 camelia rakudo-moar 2a512f: OUTPUT: «No such method 'name' for invocant of type 'Str'. Did you mean any of these?␤    none␤    note␤    take␤␤  in block <unit> at <tmp> line 1␤␤»
15:12 Zoffix m: my $m = "Mmmm"; -> \m is raw { say m.VAR.name }($m)
15:12 camelia rakudo-moar 2a512f: OUTPUT: «$m␤»
15:12 Xliff Right. Coz that is a bind.
15:12 Zoffix m: my $m = "Mmmm"; -> \meows is raw { say meows.VAR.name }($m)
15:12 camelia rakudo-moar 2a512f: OUTPUT: «$m␤»
15:12 Zoffix s/is raw//; :)
15:13 Zoffix m: my $m = "Mmmm"; my $not-m := $m; say $not-m.VAR.name
15:13 camelia rakudo-moar 2a512f: OUTPUT: «$m␤»
15:14 Zoffix So basically you can get the variable name of the original container. But that container might be bound some other variable (at least how as far as I understand all this stuff)
15:15 yht joined #perl6
15:16 jnthn Yes. What you're actually getting is the name of is the Scalar container.
15:23 itaipu joined #perl6
15:30 grondilu joined #perl6
15:31 * grondilu whishes !SomeType would mean $_ !~~ SomeType
15:31 grondilu m: subset Odd of Int where $_ % 2; say 2 ~~ !Odd
15:31 camelia rakudo-moar 2a512f: OUTPUT: «True␤»
15:31 grondilu m: subset Odd of Int where $_ % 2; say 3 ~~ !Odd
15:31 camelia rakudo-moar 2a512f: OUTPUT: «True␤»
15:32 mst joined #perl6
15:32 Zoffix m: subset Odd of Int where $_ % 2; say !Odd
15:32 camelia rakudo-moar 2a512f: OUTPUT: «True␤»
15:32 Zoffix That's what you're comparing against
15:32 Zoffix m: subset Odd of Int where $_ % 2; say 3 !~~ Odd
15:32 camelia rakudo-moar 2a512f: OUTPUT: «True␤»
15:32 Zoffix :(
15:33 Zoffix m: subset Odd of Int where * !%% 2; say 3 !~~ Odd
15:33 camelia rakudo-moar 2a512f: OUTPUT: «False␤»
15:33 grondilu m: subset Odd of Int where $_ % 2; say Odd.WHAT
15:33 camelia rakudo-moar 2a512f: OUTPUT: «(Odd)␤»
15:35 grondilu m: multi prefix:<!>(U: $type) { $type.none }; subset Odd of Int where { $_ % 2 }; say 2 ~~ !Odd
15:35 camelia rakudo-moar 2a512f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'U' in parameter declaration.␤at <tmp>:1␤------> 3multi prefix:<!>(U7⏏5: $type) { $type.none }; subset Odd of I␤»
15:36 grondilu m: multi prefix:<!>($type:U) { $type.none }; subset Odd of Int where { $_ % 2 }; say 2 ~~ !Odd
15:36 camelia rakudo-moar 2a512f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'U' in parameter declaration.␤at <tmp>:1␤------> 3multi prefix:<!>($type:U7⏏5) { $type.none }; subset Odd of Int wher␤»
15:36 Zoffix grondilu: I think that's the wrong way to write that `where` clause. You're numerically smartmatching the result of `%` against the original value
15:36 grondilu am I?
15:37 Zoffix Yes.
15:37 grondilu * % 2 I guess then
15:37 Zoffix Yup, that'll work, 'cause that's a closure
15:37 grondilu I thought any $_ expression was interpreted as a block
15:37 Zoffix nope
15:38 Zoffix It thunks it, and the result of that thunk is used for smartmatching.
15:38 moritz note that boolean results also work, becase ~~ True is always true and ~~ False is always False
15:38 Zoffix Yeah. In this case though, the result is numeric
15:38 Zoffix $_ !%% 2 would work
15:42 Xliff Um. How can I tell a superclass to trust any descended subclass?
15:43 Xliff I think depending on the superclass to trust every sub that needs it is rather onerous.
15:43 grondilu not related : does the declaration order matter for the dispatch of multi methods?
15:44 grondilu because I wrote method calls that I thought would be ambiguous but somehow I get no error on execution.
15:46 grondilu Xliff: there is a "trust" keyword
15:46 Zoffix Yeah, it matters in some cases
15:46 grondilu not sure it implemented yet though
15:46 moritz m: class A { multi method x() { say 1 }; ulti method x() { say 2 } }; A.x()
15:46 grondilu *it's
15:46 camelia rakudo-moar 2a512f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot have a multi candidate for 'x' when an only method is also in the package 'A'␤at <tmp>:1␤»
15:46 Zoffix m: multi x($ where 42) {say "here"}; multi x($ where .so) { say "there" }; x 42
15:46 camelia rakudo-moar 2a512f: OUTPUT: «here␤»
15:46 moritz m: class A { multi method x() { say 1 }; multi method x() { say 2 } }; A.x()
15:46 camelia rakudo-moar 2a512f: OUTPUT: «Ambiguous call to 'x'; these signatures all match:␤:(A $: *%_)␤:(A $: *%_)␤  in block <unit> at <tmp> line 1␤␤»
15:46 Zoffix m: multi x($ where .so) { say "there" }; multi x($ where 42) {say "here"}; x 42
15:46 camelia rakudo-moar 2a512f: OUTPUT: «there␤»
15:48 grondilu there is no ambiguity here though
15:48 grondilu oh wait
15:48 grondilu there is
15:48 domidumont joined #perl6
15:48 grondilu so the order prevails with where clauses?
15:50 grondilu m: multi x($ where 42) { say "there" }; multi x($ where .so) { say "here" }; x 42
15:50 camelia rakudo-moar 2a512f: OUTPUT: «there␤»
15:50 Zoffix Yeah
15:50 Zoffix There's also an RFC ticket for that https://rt.perl.org/Ticket/Display.html?id=123577#ticket-history
15:50 Xliff grondilu: Yes, but I don't want to have to use that for EVERY descendent class that may need to use it. This is an API. There's know way I can know!
15:51 Xliff I guess I will need accessors.
15:52 rindolf joined #perl6
15:52 grondilu Xliff: if it's an API you can write in your docs that any descendant should explicity trust its own descendants
15:53 grondilu (though I suppose you can't trust your user classes as you don't know their names)
15:53 grondilu (so there is that)
15:54 grondilu yeah, better write explicit public accessors
15:54 Xliff Yeah, just did. Read only accessors, and I get a MoarVM panic.
15:58 Xliff Golf'd
15:58 Xliff m: class A { has $.a; submethod BUILD(:$a) { $!a = $a; }; method new($a) { self.bless(:$a); }; method a { $.a }; }; class B is A { has $.b; submethod BUILD(:$a, :$b) { $!b = $b; nextwith(:$a); }; method new($a, $b) { self.bless(:$a, :$b) }; method test { say $.b; say self.a; } }; my $b = B.new(1, 2); $b.test;
15:59 camelia rakudo-moar 56193b: OUTPUT: «2␤MoarVM panic: Memory allocation failed; could not allocate 319328 bytes␤»
16:01 Xliff If I remove the call to self.a -- no panic.
16:01 Xliff m: class A { has $.a; submethod BUILD(:$a) { $!a = $a; }; method new($a) { self.bless(:$a); }; method a { $.a }; }; class B is A { has $.b; submethod BUILD(:$a, :$b) { $!b = $b; nextwith(:$a); }; method new($a, $b) { self.bless(:$a, :$b) }; method test { say $.b; } }; my $b = B.new(1, 2); $b.test;
16:01 camelia rakudo-moar 56193b: OUTPUT: «2␤»
16:02 Xliff m: class A { has $.a; submethod BUILD(:$a) { $!a = $a; }; method new($a) { self.bless(:$a); }; method a { $.a }; }; class B is A { has $.b; submethod BUILD(:$a, :$b) { $!b = $b; nextwith(:$a); }; method new($a, $b) { self.bless(:$a, :$b) }; method test { say $.b; } }; my $a = A.new(42); $a.a;
16:02 camelia rakudo-moar 56193b: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 319376 bytes␤»
16:02 Xliff Ooor... not
16:02 Xliff m: class A { has $.a; submethod BUILD(:$a) { $!a = $a; }; method new($a) { self.bless(:$a); }; method a { $!a }; }; class B is A { has $.b; submethod BUILD(:$a, :$b) { $!b = $b; nextwith(:$a); }; method new($a, $b) { self.bless(:$a, :$b) }; method test { say $.b; } }; my $a = A.new(42); $a.a;
16:02 camelia rakudo-moar 56193b: ( no output )
16:03 Xliff m: class A { has $.a; submethod BUILD(:$a) { $!a = $a; }; method new($a) { self.bless(:$a); }; method a { $!a }; }; class B is A { has $.b; submethod BUILD(:$a, :$b) { $!b = $b; nextwith(:$a); }; method new($a, $b) { self.bless(:$a, :$b) }; method test { say $.b; } }; my $a = A.new(42); $a.a.say;
16:03 camelia rakudo-moar 56193b: OUTPUT: «42␤»
16:03 Xliff OK, so endless look because it calls ... itself?
16:03 Xliff s/look/loop/
16:06 Zoffix $.a is a method call
16:07 Zoffix `has $.a;` is a shortcut for `has $!a; method a { $!a }`; If you call `$.a` inside `method a` then yeah, it'll infiniloop
16:08 Zoffix Alright. Time to get 6.d in shape
16:08 Zoffix \o
16:08 Zoffix left #perl6
16:12 Xliff .tell Zoffix So in this situation, should I not RT the infiniloop? Maybe add a caveat to the docs?
16:12 yoleaux Xliff: I'll pass your message to Zoffix.
16:12 Cabanossi joined #perl6
16:13 xinming joined #perl6
16:17 Zoffix joined #perl6
16:17 leont joined #perl6
16:18 Zoffix Xliff: no, there's no bug. The docs should make it clear that `$.a` is a method call. I wouldn't exactly call it a caveat tho
16:18 * Zoffix &
16:18 Zoffix left #perl6
16:30 wamba joined #perl6
16:31 gregf_ joined #perl6
16:36 mr-foobar joined #perl6
16:39 domidumont joined #perl6
16:41 khw joined #perl6
16:42 domidumont joined #perl6
16:46 ryn1x joined #perl6
16:49 robertle joined #perl6
16:53 kshannon joined #perl6
16:54 leont joined #perl6
16:58 Guest2284 joined #perl6
17:01 cdg joined #perl6
17:04 cdg_ joined #perl6
17:05 mr-foobar joined #perl6
17:06 patrickz joined #perl6
17:08 AlexDaniel joined #perl6
17:09 AlexDaniel squashable6: status
17:09 yoleaux 15:04Z <Zoffix> AlexDaniel: something worng with the bots. They're all dead and if I try to run one, I get "Cannot locate symbol 'SSL_load_error_strings' in native library 'libssl.so'"
17:09 squashable6 AlexDaniel, Next SQUASHathon in 8 days and ≈16 hours (2017-10-07 UTC-12⌁UTC+14)
17:09 yoleaux 15:09Z <Zoffix> AlexDaniel: nm, just needed to update IO::Socket::Async::SSL
17:10 AlexDaniel thanks
17:41 patrickz_ joined #perl6
17:45 darkmorph joined #perl6
17:49 hythm Hi, I'm writing app with Bailador and IoC, All the routes are in TWEAK method of the App class here: https://github.com/hythm7/movieo/blob/master/lib/Movieo.pm?ts=2 , I would like to organize the routes in better way for, example routes under /movie is on separate file, routes under /tvshows on separate file, and so on. but I'm not sure how to do that, Any suggestion?
17:52 moritz hythm: disclaimer: I know nearly nothing about Bailador; maybe ufobat has a better idea :-)
17:52 moritz hythm: but those route setups all look like simple data structures passed to the get or post function
17:52 moritz hythm: so you could easily have separate modules that all have routes() method
17:53 Aaronepower joined #perl6
17:53 patrickz joined #perl6
17:53 Util joined #perl6
17:53 moritz and they all return a hash of the form get => { '/movie/edit/:id'=> { ... }, more get methods here }, post => { '/movie/edit/:id'=> { ... } },
17:54 moritz and then you can load as many modules as you want, call their routes method, iterate over the result, call get() and post() as appropriate
17:54 sprocket joined #perl6
17:55 hythm moritz: I'm actually following ufobat's app "VoteImproved" as a template for organizing the code, but in my case I have many routes, thats why I needed to organize them.
17:55 sprocket hello #perl6!
17:55 moritz \o sprocket
17:56 hythm moritz: sounds a good idea, I will look into doing it as separate modules
17:56 sprocket question regarding initializing arrays - if i declare an array with: “my @buffer := CArray[uint8];”, how can i initialize the first $x places of that array to, for example, zero
17:56 moritz hythm: or maybe those separate modules can call get() and post() themselves instead of returning the data structure; dunno if Bailador likes that :-)
17:56 thundergnat joined #perl6
17:56 sprocket in p5 there’s a list multiplier operator, is there one in p6 as well?
17:56 moritz m: say 0 xx 5;
17:56 camelia rakudo-moar bb0eba: OUTPUT: «(0 0 0 0 0)␤»
17:57 sprocket oh, hey, there it is :)
17:57 sprocket thanks, moritz!
17:57 Rawriful joined #perl6
17:57 hythm moritz: will try these options and see how it lokks
17:58 thundergnat Is there any way in Perl 6, to tell how many elements have been reified in a lazily generated array?
17:58 thundergnat m: my @a = 'a bunch of words,'.words, { 'some more random words,'.words } ... *; say @a[^10]; # say @a.reified.elems?
17:58 camelia rakudo-moar bb0eba: OUTPUT: «This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at <tmp> line 1␤␤»
18:00 moritz thundergnat: I don't think so. That's pretty much internal to Array or List
18:01 moritz thundergnat: if you need more control over that, a lazy list is probably the wrong tool, because it's meant to automagically handle all that
18:02 ChoHag joined #perl6
18:02 leont joined #perl6
18:04 mr-foobar joined #perl6
18:05 thundergnat moritz I suspected as much but wondered . Thanks
18:05 perlpilot thundergnat: why did you want it ooc?
18:06 Xliff What's the best way to pass initialization parameters (ala via new) from a sub-class to a super-classes submethod BUILD?
18:07 Xliff I thought that callwith and nextwith would work, but given this class tree -- A<-B-<-C, where A is the base class, I can't seem to get information from class C to class A.
18:07 perlpilot Xliff: submethods don't participate in inheritance
18:07 Xliff So how can I properly initialize all attributes in a class chain?
18:08 Xliff I can't naturally get B's attributes from C.
18:08 Xliff And the same applies to A from b.
18:08 Xliff So if submethods aren't the way, then how should it be done?
18:09 Xliff set accessors?
18:09 timotimo put all stuff you need in the arguments you bless with and each class in the inheritance chain runs their own BUILD and/or TWEAK
18:10 Xliff So I can set members from A via C by C's self.bless call in new()?
18:10 thundergnat perlpilot: Sorry, other conversations going on elswhere. It isn't anything critical. A lazy list works out really well for what I am trying to do, I just wondered if there was some way to query the number of reified elements.
18:10 Xliff And would TWEAK be run after BUILD?
18:10 espadrine joined #perl6
18:11 moritz Xliff: TWEAK rusn after BUILD, yes
18:11 Xliff k
18:11 patrickz_ joined #perl6
18:12 timotimo yeah, the .new would be responsible in that case
18:12 cdg joined #perl6
18:13 nowan joined #perl6
18:14 Geth ¦ doc: a783b06494 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
18:14 Geth ¦ doc: Postpone .child -> .child (secure) swap to 6.e
18:14 Geth ¦ doc:
18:14 Geth ¦ doc: Postponed until 6.e because there's a huge amount of ecosystem usage
18:14 Geth ¦ doc: and the IO::Path.add that is the alternative is too new for module
18:14 Geth ¦ doc: authors to reliably switch to using it.
18:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a783b06494
18:19 Xliff OK, that worked. But there are still situations where I think this may fall short.
18:19 Xliff It's C-think, but...
18:19 xinming joined #perl6
18:20 Xliff One thing I can think of is when the value set to superclass attributes need to be affected by the subclass.
18:21 Xliff I think I can work around those with accessors and TWEAK, but I don't know if TWEAK can take parameters? Where is TWEAK documented?
18:24 Ven`` joined #perl6
18:25 perlpilot Xliff: https://docs.perl6.org/language/objects#index-entry-TWEAK
18:25 perlpilot though, there's not much there.
18:27 Cabanossi joined #perl6
18:27 ChoHag joined #perl6
18:28 cdg_ joined #perl6
18:32 timotimo TWEAK takes the same parameters as BUILD does
18:33 timotimo hm, the TWEAK there looks weird, may be missing a format code
18:34 sjn o/
18:35 * sjn was at the 50 year anniversial lectures for the Simula language today o/
18:35 japhb joined #perl6
18:37 timotimo ooh cool
18:38 andrzejku_ joined #perl6
18:38 * moritz is slightly suspicious of programming languages older than himself :-)
18:39 mspo perl was born in 1987
18:39 mspo there are probably a number of people here younger
18:39 mspo or do young people all use the slack? :)
18:42 japhb Wait, so this December we celebrate 30 years of Perl?  That's pretty cool.
18:43 leont Yeah
18:43 leont https://perl5.git.perl.org/perl.git/commit/8d063cd8450e59ea1c611a2f4f5a21059a2804f1
18:53 stmuk Lisp is 60 next year :O
18:53 yoleaux 15:40Z <Zoffix> stmuk: why is t/harness6 blocked from using more than 1 test job? It works fine for me. What exactly is wrong with it?
18:53 yoleaux 15:44Z <Zoffix> stmuk: never mind. Apparently the orignal problem was fixed already. I removed the plug that made harness die on JOBS>1
18:53 Ven`` joined #perl6
18:58 Xliff perlpilot++: Yes. I see it. That is fairly sparse. Is there better information in the Synopsis which describes this feature?
19:00 Xliff In a month or so, someone will need to amend the /topic.
19:00 Xliff I say we all get drunk with each other over IRC on 12-17
19:01 Xliff or 17-12 for you odd ppls.
19:05 daxim joined #perl6
19:14 sprocket joined #perl6
19:24 ufobat hythm, as long as you "use Bailador" you have the bailador DSL and cann call get and post, to setup routes, wherever you like
19:26 ufobat hythm, maybe you dont want to use IoC? https://github.com/Bailador/Bailador/blob/dev/examples/controllers/controllers.pl6
19:29 ufobat hythm, moritz, i think it is not neccessary that you return anything in a "routes" method. What if you have a "setup-routes()" method and those simply set up the routes with the bailador specific DSL
19:30 moritz ufobat: that's what I suggested later :-)
19:31 ufobat as usual, i am faster at typing than thinking or reading :)
19:32 ufobat the same applies if you use IoC
19:33 Hor|zon joined #perl6
19:35 mr-foobar joined #perl6
19:37 hythm ufobat, moritz, yes, setup-route method sounds cleaner in my opinion. I will try that. Thank you both for answering
19:38 ufobat :)
19:45 TEttinger joined #perl6
19:45 notostraca joined #perl6
19:45 tyil so, I'm still trying to get a process to fork into the background properly, but it still isn't working quite the way I want
19:46 tyil I made a small script to make sure my other code isnt breaking it
19:46 tyil https://cry.nu/p/28or
19:46 tyil but rn the loop { } runs 19 times on every run thus far
19:46 tyil and then just stops
19:46 tyil but there's still a moar process consuming cpu running
19:48 tyil oh, for one run it seemed to go better, hitting 1094 runs before I killed it, but the run after it iterates 19 times again
19:49 sprocket joined #perl6
19:49 * jnthn suspects fork + multi-threaded VM = pain
19:49 jnthn Since fork only clones one thread - the one that called it
19:50 jnthn So suddenly you've got an instance of the VM missing most of its threads
19:50 tyil I kinda want to be able to properly fork into the bg somehow, so I can run this as a service
19:50 tyil hmm
19:51 robertle there is also something weird around fork and locks, as the locks get copied/cloned in whatever their current state is...
19:51 jnthn That also
19:51 tyil I find it odd that it consequently stops at 19 tho
19:51 jnthn That's probably when it needs to do a GC run
19:52 jnthn I'd guess so, anyway
19:52 patrickz joined #perl6
19:52 jnthn And that it then tries to get the background optimization thread to join in and...it ain't there.
19:52 geekosaur jnthn, you can stop suspecting. that's why python doesn;t do threads, perl 5 does ithreads, and ghc warns not to have multiple threads before forkProcess
19:53 geekosaur the edge cases are nasty and hairy
19:53 jnthn OK, then I guess I might as well just switch to saying "don't do fork in MoarVM, it won't ever work"
19:54 tyil so its impossible in perl 6 to make services which run in the background? :<
19:54 tyil also, the current run seems to work correctly, going at 31k+ iterations now
19:54 geekosaur fork first, thread only after
19:54 geekosaur this even appleis to C
19:54 jnthn That doesn't help for VMs that start their own internal threads
19:55 tyil geekosaur: fork is the first thing that happens in that script's MAIN sub tho
19:55 jnthn So, anything that does concurrent GC, or background optimization.
19:55 geekosaur potentially you can handle those cases, although you need careful accounting
19:55 tyil it seems to rarely actually work, but most of the times it'll stop after 19 iterations
19:55 jnthn Yeah, I see there's some handler that is called but...
19:56 jnthn It looks incredibly tricky to pull off
19:57 tyil what edgecase am I hitting here where it accidentally works?
19:58 geekosaur the most common failure mode is that some thread is holding e.g. a mutex (or a userspace lock) during the fork
19:58 geekosaur the thread goes away but the lock is process level and remains, with nithing around to know to unlock it
19:58 geekosaur so then things work until something else needs that lock and suddenly you deadlock
19:59 tyil in the script I linked it worked on my last try, but the tries before that, with the exact same code, all stopped functioning at the 19th iteration
19:59 geekosaur this applies to any process level resource: filehandles, mutexes, etc.
19:59 HoboWithAShotgun m: say 1.111111111111111111111
19:59 camelia rakudo-moar 4c337e: OUTPUT: «1.11111111111111111604544␤»
19:59 ChoHag joined #perl6
20:00 geekosaur I couldn't tell you why it sometimes works because I don't know internal details concerning what locks are held when
20:01 tyil ah
20:01 geekosaur I know what's going on and in fact was explaining essentially the same problem in #haskell about a half hour ago >.>
20:01 geekosaur and have in the past explained it for perl 5, etc.
20:01 jnthn I know the details and know there's more than one possibility for which lock it could be :)
20:01 geekosaur yep, that also complicates things :)
20:02 tyil would it be possible to make background services in perl 6 a viable thing, or should I give up hope ;~;
20:02 geekosaur it might be easiest to do the backgrounding as a scaffold (e.g. shell script)
20:02 tyil I'm not familiar with internals of anything, except frogs, so I have no idea how much effort it would be
20:03 tyil geekosaur: basically, make a shell script which forks into the background, and then runs the perl application?
20:03 cdg joined #perl6
20:03 ufobat isnt fork() just creating a clone of the process? dont you get a copy of all mutexes/locks and threads? how could for example a thread "be not there" while there is still a ramaining mutex
20:03 geekosaur this kind of thing is also why e.g. systemd (and other system managers like Apple's launchd) manages backgrounding itself. it's a Hard Problem(tm)
20:04 geekosaur ufobat, you get a copy of all mutexes and all flehandles.
20:04 geekosaur but you  only get the currently executing thread and it becomes the main thread of the new process
20:04 tyil sadly I think systemd is the worst way to solve a problem, so thats not an option
20:04 ufobat AH!
20:04 tyil that, and BSD doesnt support systemd at all
20:04 tyil and I intend to run this service on a BSD server once its done
20:04 geekosaur conceptually systemd is a very good solution. practically, it's so badly implemented as to not be a solution
20:05 ufobat and there is no way to "clone" other threads as well?
20:05 mr-foobar joined #perl6
20:05 geekosaur ufobat, no, and if you think about it, it's a bad idea
20:05 tyil that I can agree with, if the systemd concept would also drop its desire to do literally everything
20:05 geekosaur consider: parent process has a thread that has aquired a mutex so it can have exclusive access to some resource
20:05 geekosaur another thread fork()s
20:06 geekosaur if you clone all threads then both parent and child processes now think they own that resource
20:06 geekosaur *then threads in both
20:06 geekosaur if it's something like a database file where you want only one writer across an entire system or you will lose data, this is data loss about to happen
20:06 ufobat yeah as a general rule you're right, but if you as a programmer know which threads you have and wait for a "good point in time" to fork you could have a reasonable result
20:07 geekosaur except you don't
20:07 geekosaur consider that we generally, for good reason, do 2-level locking
20:08 ufobat what is that?
20:08 geekosaur the actual lock is a memory location, we use a fast-mutex (futex in linux terms) to synchronize access to that memory location, but do not otherwise hold process/kernel level locks when that location is "locked"
20:09 geekosaur but now user code has to knwo about that memory location to know if it's a good time to fork or not
20:09 leont Threads are why pthreads has a at_fork function, so you can fix up the locking -_-
20:09 jnthn s/Threads/Forks/ ?
20:09 jnthn oh, or maybe not :)
20:09 geekosaur and the more things that have to know about these locks, the more expensive threading, and forking, and locking get for everyone
20:09 jnthn Can prase it both ways :)
20:10 leont jnthn: no, I meant that literally
20:10 geekosaur you *can* solve it but you end up with avery heavy solution like perl 5's interpreter-per-thread
20:10 notostraca joined #perl6
20:10 leont at_fork also meant that fork suddenly wasn't async-signal safe anymore, something POSIX didn't immediately realise
20:11 leont (because the at_fork handlers invariably aren't async-signal-safe
20:11 tyil back
20:11 ufobat okay :-) thanks for the explanation
20:11 tyil geekosaur, ufobat, jnthn: thanks for the information, I'll try my hand at a posix-shell wrapper that does the forking for me, and write a small article to help other users in case they wonder
20:12 leont IME, you can have at most 2 out of forks, threads and a higher level programming language
20:12 geekosaur yeh, I've been collecting my comments about the haskell version because it;s come up in the past as well, and need to turn them into a haskell wiki article at some point
20:13 tyil tfw found the first thing perl 6 is "bad" at in my experience :(
20:13 geekosaur it wouldn;t be directly applicable to perl 6 but most of the same issues apply in some sense to any other language. C squeaks by only by not having higher level data structures
20:13 cdg_ joined #perl6
20:13 geekosaur but as soon as your user code adds them in order to do real work, you run into them again
20:14 moritz C doesn't automatically start a a thread pool scheduler for you that can hold on to locks
20:14 geekosaur (and libc has some, which is where that aync-signal-safe stuff comes in)
20:15 jnthn geekosaur++ # lots of useful details
20:16 jnthn My feeling from all this is that trying to make MoarVM do better at fork is probably going to lead to it both still being bad at it *and* getting worse at other stuff while trying to achieve that.
20:17 jnthn "A strange game. The only winning move is not to play."
20:17 ufobat :D
20:18 raschipi joined #perl6
20:19 wamba joined #perl6
20:28 HoboWithAShotgun one day we will have perl 6 compile to c++ source with native integration of c++ libraries
20:28 HoboWithAShotgun make it happen j :)
20:31 leont They're way too different for that to make sense
20:31 tyil in case anyone wonders, https://cry.nu/p/6ceb
20:31 tyil seems to do the forking as a shell wrapper
20:32 tyil additional bonus, it sets -Ilib for me :p
20:37 mr-foobar joined #perl6
20:48 tyil can I reassign $*IN to a filehandle so all output gets written to a file instead of STDIN?
20:49 leont It's a normal contextual variable
20:52 tyil $*OUT and STDOUT* sorry
20:52 Ven`` same answer :P
20:52 tyil ye, just to clarify :p
20:55 lizmat my $*OUT = open("foo", :w )
20:56 tyil tfw she left immediatly
20:56 tyil :(
20:57 lizmat joined #perl6
20:57 tyil wb lizmat
20:58 lizmat yeah, flaky Ziggo wifi  :(
21:12 setty1 joined #perl6
21:20 itaipu joined #perl6
21:32 timrs2998 joined #perl6
21:52 headcase joined #perl6
21:54 rgrau joined #perl6
22:02 sprocket joined #perl6
22:04 AlexDaniel joined #perl6
22:06 Xliff m: class A { has $!func; method test { &( $!func )("foo"); }; method setFunc($f) { $!func = $f }; }; class B is A { submethod TWEAK { sub a { say "FOO!"; }; self.setFunc(&a); }; }; my $b = B.new(); $b.test;
22:06 camelia rakudo-moar 4c337e: OUTPUT: «Too many positionals passed; expected 0 arguments but got 1␤  in sub a at <tmp> line 1␤  in method test at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:07 Xliff m: class A { has $!func; method test { &( $!func )("foo"); }; method setFunc($f) { $!func = $f }; }; class B is A { submethod TWEAK { sub a($bar) { say "FOO!{$bar}"; }; self.setFunc(&a); }; }; my $b = B.new(); $b.test;
22:07 camelia rakudo-moar 4c337e: OUTPUT: «FOO!foo␤»
22:09 Xliff Can someone tell me why I am getting this:
22:09 Xliff Variable '$server' is not declared. Did you mean '$!server'?
22:09 Xliff at /home/cbwood/projects/p6-webservice-eveonline/scripts/../lib/WebService/EveOnline/RESTBase.pm6 (WebService::EveOnline::RESTBase):42
22:09 Xliff ------>         method getServer(⏏$server) {
22:10 Xliff From here:
22:11 Xliff https://github.com/Xliff/p6-webservice-eveonline/blob/master/lib/WebService/EveOnline/RESTBase.pm6
22:11 thou joined #perl6
22:11 Xliff Rather...
22:11 Xliff https://github.com/Xliff/p6-webservice-eveonline/blob/master/lib/WebService/EveOnline/RESTBase.pm6#L27
22:11 Xliff If I take out the contents to TWEAK, it compiles. Is this not legal?
22:16 lizmat if self.setCacheNameFunc(&cache_name_func); returns a Failure, then you will get that.  Could that be the case?
22:17 lizmat night #perl6!@
22:17 lizmat afk&
22:18 jnthn Xliff: I don't spot it (but I'm super tired), but often that's a run-away quote and it's trying to interpolate $server
22:19 Xliff jnthn: I found it.
22:19 timotimo Xliff: i think your use of || is wrong in the getServer function
22:19 timotimo you either need | there to get a junction or use a regex
22:20 timotimo Xliff: so where was the issue?
22:20 Xliff timotimo++: ohh! A totally separate bug!
22:20 Xliff https://github.com/Xliff/p6-webservice-eveonline/blob/master/lib/WebService/EveOnline/RESTBase.pm6#L31
22:21 Xliff jnthn++ was right. The regex is incomplete and being interpreted as a string.
22:21 pilne joined #perl6
22:21 timotimo oh!
22:21 Xliff I don't know HOW that 's' got there, but it did (probably missed an Alt-F) and totally changed the code.
22:21 timotimo it's an s/// without the part after the /
22:21 Xliff Exactly.
22:21 Xliff Crap that drives me up the wall!
22:22 timotimo that needs an "in regex" version, too
22:22 timotimo the error message i mean
22:22 timotimo not only "inside double quoted string"
22:23 committable6 joined #perl6
22:26 u-ou I like perl 5 . but I love perl 6.
22:27 Cabanossi joined #perl6
22:32 skids joined #perl6
22:35 headcase joined #perl6
22:39 sprocket joined #perl6
22:45 kerframil joined #perl6
22:50 HoboWithAShotgun m: say 3e-1 - .3
22:50 camelia rakudo-moar 63cf24: OUTPUT: «5.55111512312578e-17␤»
22:50 HoboWithAShotgun m: say (3e-1).WHAT
22:50 camelia rakudo-moar 63cf24: OUTPUT: «(Num)␤»
22:51 HoboWithAShotgun Shouldn't that be a Rat?
22:52 HoboWithAShotgun m: say 3e-1.Num - .3
22:52 camelia rakudo-moar 63cf24: OUTPUT: «5.55111512312578e-17␤»
22:52 HoboWithAShotgun m: say 3e-1 - .3.Num
22:52 camelia rakudo-moar 63cf24: OUTPUT: «5.55111512312578e-17␤»
22:52 timotimo you get a Num if you use that exponent syntax
22:53 timotimo that's our "escape hatch" to get a num when you would otherwise get a rat
22:53 HoboWithAShotgun i know, i would have expected a rat when the base is an int
22:53 timotimo nah, for that you'll need the actual * 10 ** 123
22:53 HoboWithAShotgun oh
22:54 HoboWithAShotgun m: say 3e-1 - (1/3).Num
22:54 camelia rakudo-moar 63cf24: OUTPUT: «-0.0333333333333333␤»
22:55 HoboWithAShotgun bah,  i am tired
22:55 HoboWithAShotgun food, bed, cya
22:56 sprocket joined #perl6
23:02 headcase_ joined #perl6
23:11 Xliff Why is Grammar::Tracer saying that rules are matching when my Grammar.parse($s) returns Nil?
23:11 epony joined #perl6
23:13 timotimo could be you're not matching from begininng to end
23:13 timotimo try if subparse  will match
23:14 timotimo Xliff ^
23:14 sprocket joined #perl6
23:14 Xliff Yep. That's weird.
23:15 Xliff And Tracer seems to imply that I AM matching from beginning to end. There is no overall fail mark.
23:16 headcase joined #perl6
23:17 timotimo right, it doesn't know about the parse/subparse difference
23:17 timotimo it totally should
23:18 Xliff kk
23:18 Xliff I am now seeing what I want. Thanks, timotimo++
23:18 timotimo yay
23:18 Xliff HTTP::UserAgent has a bug in the header parser grammar.
23:19 timotimo one last good deed before i go to bed
23:19 Xliff message-header => 「expires: Wed, 27 Sep 2017 23:02:16 GMT」
23:19 Xliff field-name => 「expires」
23:19 Xliff field-value => 「 Wed, 27 Sep 2017 23:02:16 GMT」
23:19 Xliff field-content => 「ed, 27 Sep 2017 23:02:16 GMT」
23:19 Xliff See the problem?
23:19 timotimo yeah, it drops the W there
23:19 timotimo not sure why
23:19 Xliff Note, that for some reason, it does NOT drop the T in Tue!
23:20 Xliff Now to study the grammar.
23:20 timotimo haha
23:20 timotimo it has w instead of \w?
23:20 Xliff Think so.
23:21 Xliff Cos that's the only DOW it drops.
23:21 timotimo do you remember the "printer doesn't print on wednesdays" thing? :D
23:21 timotimo tuesdays*
23:22 Xliff https://github.com/sergot/http-useragent/blob/master/lib/HTTP/Header.pm6#L18
23:22 Xliff LOL, tt
23:22 timotimo huh, what
23:22 timotimo what's the use case for this special case?
23:22 timotimo surely there's a test that covers this?
23:23 ugexe ETag
23:23 timotimo lives-ok { $h.parse('ETag: W/"1201-51b0ce7ad3900"') }, "parse";
23:23 Xliff Is there some kind of field modifier for http headers that need W?
23:23 timotimo yeah
23:23 timotimo i have no idea why this is a thing
23:23 Xliff Well, CRAP.
23:23 geekosaur 'is this doesn't print on tuesdays hard, or 500 mile email hard?'
23:24 timotimo geekosaur: <3
23:24 Xliff geekosaur: That remains to be seen.
23:24 timotimo strong vs weak etag validators
23:24 Xliff Now is that the only time we need this?
23:25 geekosaur surely that can go into the ETag handler?
23:25 ugexe in any case that should be happening in the actions, not the grammar
23:25 Xliff IIF field-name == "ETag'?
23:25 Xliff ugexe: Y
23:25 Xliff FWIW: There is no "etag handler"
23:25 timotimo at the moment it's ignoring weak vs strong completely, and i'm not sure it even does anything with etag in general
23:26 Xliff Any value that starts with a "W" will get it choped.
23:26 timotimo yeah, i'd call that wrong
23:26 timotimo also, why is the / optional there?
23:27 Xliff So if the field-name MUST be etag, I can change the Actions to fix it.
23:27 Xliff And just drop that out of the grammar.
23:27 BenGoldberg joined #perl6
23:27 timotimo that would be preferable, i'd say
23:27 Xliff OK. Yay! Another thing I get to fix! :)
23:28 timotimo thank you for your hard work :)
23:29 Geth ¦ doc: c8cc4801f1 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
23:29 Geth ¦ doc: Add that IO::Path.chdir will be entirely removed in 6.e
23:29 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c8cc4801f1
23:29 Geth ¦ doc: e0e32d0092 | (Wenzel P. P. Peppmeyer)++ (committed by Zoffix Znet) | doc/Language/functions.pod6
23:29 Geth ¦ doc: note multi hiding via non-multi in lexical scope (#1574)
23:29 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e0e32d0092
23:30 greppable6 joined #perl6
23:31 Xliff Oh...
23:31 Xliff W8....
23:32 Xliff If that's not done there than the grammar cannot properly process both ETag values and quoted ones.
23:32 Xliff >_<
23:33 timotimo hm, so either it has to be w/" or W/"
23:33 headcase_ joined #perl6
23:33 timotimo maybe it's enough for now to require the / to be there
23:33 timotimo or is that really optional?
23:35 epony joined #perl6
23:36 Xliff Doesn't look like the / is optional for ETag.
23:37 Xliff The problem, however, is that the existing grammar will work for ETags, but will fail for ANY value that starts with 'W' and not followed by /
23:37 Xliff I will need to test that.
23:39 Xliff ... "<!before \h> ['W/' | 'w/']?" looks to work.
23:39 timotimo i'm going to bed
23:39 timotimo seeya!
23:39 Xliff nn
23:40 ugexe that still seems broke for any header field other than etag that could start with W/
23:40 timotimo i'd say perhaps require the " " as well
23:41 timotimo at the moment you can start a header's value with " but not end it with one
23:41 timotimo or start it without and end it with one
23:41 timotimo it won't be included either way
23:41 ugexe its a valid start to base64 value
23:41 timotimo oh
23:41 ugexe W/ is (why it cant be ignored)
23:42 Xliff So yeah. Doing that works for ETags, too
23:42 Xliff So unless someone can find an instance where the '/' is optional, I'm going with this.
23:43 Xliff Oh,
23:43 ugexe what about `Custom-Auth-Header: W/7fhEfhkjafeHF`
23:43 Xliff ugexe++ # I didn't think about that.
23:43 headcase joined #perl6
23:45 Xliff So now doing: <!before \h> ( ['W/' | 'w/'] )?
23:45 Xliff And if field-name is not "ETag"; then $/0 will be added back to field-value
23:56 Xal joined #perl6
23:56 headcase joined #perl6
23:59 cdg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo