»ö« 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.
00:07 psychoslave left 00:13 itaylor57 joined 00:21 someuser left 00:27 markong left 00:30 itaylor57 left 00:32 wamba left, itaylor57 joined 00:33 astj_ joined, astj left 00:45 BenGoldberg joined 00:52 rindolf left
lookatme The REPL raise an exception in first using after update rakudo 01:07
say 123;
Internal error: unhandled encoding
in method CALL-ME at /usr/local/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 587
in method readline at /home/sgzxl/.perl6/sources/D8BAC826F02BBAA2CCDEFC8B60D90C2AF8713C3F (Readline) line 1391
evalable6 123
Zoffix lookatme: what's your perl6 -v? 01:16
01:18 aindilis joined
lookatme I think its 2017.10 before update 01:19
and then is 2017.12
Zoffix No issues with 2017.12.11… 01:21
lookatme It's ok now, just in first time 01:22
Zoffix weird
lookatme yeah
Zoffix m: %*ENV<PATH> = join ($*DISTRO.is-win ?? ";" !! ":"), "extra-path", $*SPEC.path; dd %*ENV<PATH> 01:26
camelia Str <element> = "extra-path:/home/camelia/perl5/perlbrew/bin:/home/camelia/perl5/perlbrew/perls/perl-5.20.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Zoffix Feels like the $*SPECs could use some routine/arg that does ^ this for the user 01:27
01:29 traxex_ left
Zoffix meh 01:29
lookatme yeah, good idea 01:38
But I thought it has one :) 01:39
in Perl6 thinking
Zoffix nope 01:40
AlexDaniel hmm never ever needed to change PATH from perl 6 01:42
although I use “run” all the time
maybe that's just me
lookatme yeah, maybe help when run some external tools 01:45
Zoffix Just needed it for first time here: github.com/zoffixznet/rdev/blob/ma...#L126-L130 01:46
Though there may be Other Ways™. I just translated a piece of bash script.
01:48 espadrine left 01:50 traxex joined 01:59 giraffe joined
Zoffix AlexDaniel: I solved the issue of release delays being hard to work with: irclog.perlgeek.de/perl6/2017-12-20#i_15602495 02:00
Or rather, I will, the next time it happens. Just gonna add a command to my Z-Script Awesome Rakudo Build Helper :) 02:01
It already does the separate-checkouts stuff.
Z-Script being this: github.com/zoffixznet/rdev 02:02
It's so awesome, I can't believe it took me a year to make it :)
AlexDaniel Zoffix: fwiw some of the stuff in rdev I kinda want to see in the main makefile… :) Not sure if that's a good idea but grrr, a separate script to do the basics 🤷
Zoffix Yeah, maybe. But the maintenance burden for it is a lot lower than a makefile 02:03
AlexDaniel sure. Maybe later when it's stable?
Zoffix Well, at least for me, since I know Perl 6 but not makefile/bash :)
AlexDaniel
.oO( 1. rewrite everything using sake 2. look at the code and realize how beautiful everything is now 3. ?????? 4. Oh, now you can't build rakudo without having rakudo already built, may the force be with you! )
02:07
Loss! 02:08
Zoffix Heh. On all my boxes I have "stable" rakudo installed and the dev stuff is separate. 02:09
02:13 Zoffix left 02:17 syntaxman joined, syntaxman left, syntaxman joined 02:38 pilne left 02:39 AlexDaniel left 02:46 ilbot3 left 02:57 ilbot3 joined, ChanServ sets mode: +v ilbot3 03:09 Kaiepi left 03:10 Kaiepi joined 03:14 epony joined 03:16 epony left, epony joined 03:17 unicodable6 left, squashable6 left, benchable6 left, reportable6 left, unicodable6 joined, ChanServ sets mode: +v unicodable6, squashable6 joined, ChanServ sets mode: +v squashable6, benchable6 joined, ChanServ sets mode: +v benchable6, reportable6 joined 03:25 konsolebox left 03:26 konsolebox joined 04:18 aindilis` joined, aindilis left 04:39 BenGoldberg left 04:58 Cabanossi left 05:00 Cabanossi joined 05:01 edehont joined 05:03 edehont left 05:18 sena_kun joined 05:34 astj_ left, astj joined 05:38 kerframil joined 05:39 astj left
Guest49524 does perl6 have these? perldoc.perl.org/functions/-X.html 05:43
05:45 sena_kun left
geekosaur they're adverbs in the IO::Path class 05:48
05:48 darutoko joined
geekosaur (and methods but the adverb form is often more convenient) 05:48
05:50 astj joined, Zoffix joined
Zoffix Guest49524: docs.perl6.org/type/IO::Path#File_..._operators 05:51
FWIW: there are no adverbs. It's just smartmatch-with-Pair syntax that calls the method names.
m: say 42 ~~ :abs 05:52
camelia True
Zoffix m: say 42 ~~ :!abs
camelia False
Zoffix docs.perl6.org/type/Pair#method_ACCEPTS
Guest49524 how do you get the path of the script you are running? 06:07
Zoffix $*PROGRAM 06:08
huggable: FindBin
huggable Zoffix, use lib $*PROGRAM.sibling: '../lib'; # finds lib/ for scripts in bin/ or t/
Guest49524 is there a docs page for it? I need the full path 06:11
Zoffix Guest49524: $*PROGRAM.absolute
Guest49524: it's an IO::Path object
huggable: IO::Path
huggable Zoffix, File or directory path: docs.perl6.org/type/IO::Path
Guest49524 $*PROGRAM.absolute.IO.dirname 06:25
Zoffix Guest49524: what are you trying to do?
Guest49524 is there a shorter way to do that?
get the directory path of the running script without me knowing what directory it is? 06:26
Zoffix Yeah, but then what are you doing with it?
Guest49524 there is a directory in that directory with files for the script to use
Zoffix Guest49524: $*PROGRAM.sibling('directory-with-files-to-use') 06:27
There's also .parent and .add methods you can use to "navigate" a path (like, transform one path to another) 06:28
06:37 khw left 06:42 enheh joined 06:46 enheh left
Guest49524 thanks 06:52
06:58 xcm joined 07:00 geospeck joined
Guest49524 say qqx{$script} if $script ~~ :e & :f & :rwx; 07:01
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/_Zklrc4XNB
Variable '$script' is not declared
at /tmp/_Zklrc4XNB:1
------> 03say qqx{08⏏04$script} if $script ~~ :e & :f & :rwx;
Guest49524 say qqx{$script} or die;
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/APGroY4ZYg
Variable '$script' is not declared
at /tmp/APGroY4ZYg:1
------> 03say qqx{08⏏04$script} or die;
Guest49524 which of those is better?
Zoffix :e test is useless, the other two already check existence 07:02
AlexDaniel`: FWIW I see the bot get triggered by stray code more often than by someone forgetting the "m:" irclog.perlgeek.de/perl6/2017-12-26#i_15622312 07:03
Guest49524: and second one has wrong condition; you're testing return value of `say` which is always True 07:05
if shell $script, :out { $^p.out.slurp(:close).say } else { die "Could not run the $script" } 07:07
Well, if you're just `say`ing it, you likely don't need to capture its STDOUT and can just let it be carried forward:
shell $script; # it'll explode automagically when sunk 07:08
Relevant docs: docs.perl6.org/type/Proc#method_new 07:09
Guest49524 but it says the other two fail with X::IO::DoesNotExist ? and is not `or die` like a (try) catch all for exception handling?
Zoffix Guest49524: `fail` means return a Failure object ( docs.perl6.org/type/Failure ) these are "lazy" Exceptions in that they don't explode and get disarmed when evaluated in .Bool context or are tested for .defined'ness and smartmatch (`~~` op) ensures they're not exploded, so `$script ~~ :f & :rwx` will aways give either True or False. 07:12
Guest49524: The `$foo or die` the same as `die unless $foo`. The `or` operator has precedence lower than the precedence of a subcall, so your code is like `say(…) or die` or `die unless say(…)` and say() always returns True, so that'll never die 07:13
07:13 parv joined
Zoffix Guest49524: and no, we don't have the `or die` idiom. That's Perl 5's thing. In Perl 6, many things return Failure objects and they explode when sunk (when used in void context) 07:14
07:14 sunnavy_ is now known as sunnavy
Zoffix m: sub do-thing-or-explode { rand > ½ and fail "boom!"; "no boom this time" }; do-thing-or-explode 07:14
camelia ( no output )
Zoffix m: sub do-thing-or-explode { rand > ½ and fail "boom!"; "no boom this time" }; do-thing-or-explode.say
camelia no boom this time
Zoffix m: sub do-thing-or-explode { rand > ½ and fail "boom!"; "no boom this time" }; do-thing-or-explode.say 07:15
camelia no boom this time
Zoffix m: sub do-thing-or-explode { rand > ½ and fail "boom!"; "no boom this time" }; do-thing-or-explode.say
camelia no boom this time
Zoffix :(
m: sub do-thing-or-explode { rand > .00001 and fail "boom!"; "no boom this time" }; do-thing-or-explode.say
camelia boom!
in sub do-thing-or-explode at <tmp> line 1
in block <unit> at <tmp> line 1
Guest49524 sometimes you just want it to halt & catch fire?
Zoffix m: sub do-thing-or-explode { rand > .00001 and fail "boom!"; "no boom this time" }; do-thing-or-explode() orelse "Whoa who whoa.. Looks like somethind {.mess}".say 07:16
camelia Whoa who whoa.. Looks like somethind (HANDLED) boom!
in sub do-thing-or-explode at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: sub do-thing-or-explode { rand > .00001 and fail "boom!"; "no boom this time" }; do-thing-or-explode() orelse "Whoa who whoa.. Looks like something said `{.exception.message}`".say
camelia Whoa who whoa.. Looks like something said `boom!`
Zoffix Guest49524: well, yeah, that's what Failures do if you don't "handle" them (evaluate in Bool or defined contexts)
^ like above, `orelse` op handles that Failure because it checks .defined'ness, and so nothing gets thrown 07:17
Bascially Failures let you handle Exceptions using boolean/definedness constructs rather than `try { CATCH {} }` stuff (tho we have that too, if that's your thing)
m: sub do-thing-or-explode { rand > .00001 and fail "boom!"; "no boom this time" }; try { do-thing-or-explode(); CATCH { default { "Whoa who whoa.. Looks like something said `{.message}`".say } } } 07:18
camelia Whoa who whoa.. Looks like something said `boom!`
Zoffix (`try` block automatically enables `use fatal` pragma which lexically makes Failures explosive right away)
07:20 konsolebox left
Zoffix and shell() returns Proc object which throws when sunk if the exitcode isn't zero 07:21
Guest49524 my $say = qqx{"_$script"} or die; 07:26
07:27 konsolebox joined 07:32 konsolebox left 07:34 konsolebox joined
Zoffix finally tries out Cro 07:37
Performance is A LOT better than what I was expecting.
07:56 konsolebox left 08:00 konsolebox joined, domidumont joined 08:05 domidumont left, domidumont joined 08:06 psychoslave joined 08:26 philomath_ joined 08:37 psychoslave left 08:38 setty1 joined 08:39 domidumont left 08:41 domidumont joined 08:46 psychoslave joined
Voldenet Zoffix: Really? The last time I tested it was quite terrible - how many requests per second? 08:57
moritz isn't "time per request" the more interesting measure? 08:59
you can typically scale requests per second with more cores
09:00 aindilis` left
Voldenet moritz: they are both interesting, some servers are highly concurrent but not very fast 09:03
09:09 psychoslave left, wamba joined
Voldenet I'm more interested in requests per second because it means cheaper servers ;P 09:10
uh, hm, time per request means that too though
09:20 astj left, astj joined 09:23 psychoslave joined 09:26 xcm left 09:29 psychoslave left 09:34 domidumont left 09:35 woolfy joined 09:36 woolfy left 09:37 rindolf joined 09:38 philomath_ left 09:42 geospeck left 09:43 psychoslave joined 09:53 konsolebox left 09:54 konsolebox joined 10:02 psychoslave left 10:03 pmurias joined 10:08 R0b0t1 left 10:09 lizmat left, pmurias left 10:10 lizmat joined 10:16 psychoslave joined 10:21 faraco joined 10:23 psychoslave left 10:27 faraco left 10:35 itaylor57 left, itaylor57 joined 10:43 psychoslave joined 10:52 psychoslave left 10:54 eliasr joined 10:57 konsolebox left 11:00 konsolebox joined 11:11 psychoslave joined 11:13 parv left 11:17 FROGGS joined, sena_kun joined 11:18 pmooney joined
Guest49524 how do you run an external program and interact with it? 11:21
FROGGS morning
Guest49524 FROGGS: night
FROGGS Guest49524: see docs.perl6.org/language/ipc
11:22 pmurias joined
Guest49524 FROGGS: run and shell and qx and qqx do not work interactively 11:22
11:22 psychoslave left
FROGGS Guest49524: and what about async mentioned at the bottom? 11:23
I dunno what you need
pmooney which channel can I ask about the perl6 docs, in particular docs.perl6.org/language/classtut ??? 11:24
moritz here
pmooney cool 11:25
to my eyes, the method add-dependency is confusing. Its in the example class for Task but is not actually used. Am I right? 11:26
stepping away from computer for a short while, back soon 11:29
moritz pmooney: it's not used, but you could use it 11:31
it's part of Task's API
11:34 konsolebox left 11:36 konsolebox joined
buggable New CPAN upload: Sparky-0.0.24.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/....24.tar.gz 11:38
Guest49524 FROGGS: async cannot handle pipes? 11:42
11:42 pmooney left
FROGGS I'm not sure 11:43
11:44 geospeck joined
lizmat clickbaits p6weekly.wordpress.com/2017/12/25/...s-no-more/ 11:44
11:52 setty1 left 11:57 eythian left 11:58 eythian joined 11:59 konsolebox left 12:00 markong joined 12:01 konsolebox joined 12:02 geospeck left, geospeck joined 12:04 piojo_ joined
Guest49524 docs.perl6.org/type/Proc::Async 12:11
No such method 'bind-stdin' for invocant of type 'Proc::Async'
that should allow piping 12:12
12:12 flatwhite joined 12:13 kerframil left
lizmat Guest49524: it may not be documented yet, but that method definitely exists in the Proc::Async code 12:14
github.com/rakudo/rakudo/blob/mast...nc.pm#L226 12:16
12:16 R0b0t1 joined
Guest49524 lizmat: it only has a non working example in the docs 12:18
lizmat if it's not working, we would greatly appreciate a Github Issue on the rakudo repo :-)
jnthn Guest49524: perl6 --version - perhaps you have a version older than that method? 12:19
Guest49524 how?
jnthn: This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda implementing Perl 6.c.
Geth doc: 564aae20bb | (Elizabeth Mattijsen)++ | 2 files
Minimal documentation of use newline / $?LF
lizmat Guest49524: ah, yes, that would explain 12:20
Voldenet Guest49524: I've checked on 2017.10 and it does handle pipes
El_Che lizmat: does the rakudo test suite accept the TEST_VERBOSE=1 option?
lizmat not sure, /me checks
I don't see a difference in behaviour 12:21
El_Che so, no :)
Voldenet Guest49524: ix.io/DoK the code I've used to test piping, looks like it's working 12:22
12:22 R0b0t1 left 12:23 geospeck left 12:26 pmurias left
jnthn Guest49524: I don't remember exactly what month bind-stdin went in, but it was summer this year. So that'll be why the error - that method didn't exist back in 2017.04 12:29
timotimo github.com/rakudo/rakudo/commit/dc...35eacb173c - looks like 2017.06 is the first release to haev it 12:35
we should introduce a networking component to rakudo that regularly (once or twice a month) downloads a text file that lists all methods for all core setting classes and what release they first went in on, and then when we get a "method not found" exception for a class in the core setting we should search that file :P 12:36
lizmat
.oO( and then download a patch, install that, and continue after the exception :-)
12:40
12:44 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6
timotimo i didn't want to go quite that far :) 12:45
12:57 xinming_ joined 13:01 xinming left 13:03 Guest49524 left, flatwhite is now known as kerframil 13:04 pecastro joined 13:05 vichib left 13:08 geospeck joined 13:09 mahafyi joined 13:10 itaipu joined 13:15 AlexDaniel joined 13:23 pecastro left 13:27 R0b0t1 joined 13:28 psychoslave joined 13:38 itaylor57 left
teatime "30 things about Perl on its 30th birthday" weird, I would have guessed Perl as older than that. 13:47
quite young really, for such an influential language. 13:48
13:50 hummy2 joined 13:52 ggoebel left
hummy2 Hi need to instll plod.shar for systemadministrators 13:52
masak teatime: Fortran is 60 years old. our whole industry is extremely new. 13:53
teatime I suppose you are right.l 14:02
also I am old :/
14:02 MasterDuke joined 14:03 Aaronepo_ joined 14:04 Aaronepower left, hummy2 left 14:06 psychoslave left
mspo docs.perl6.org/language/5to6-perlsyn#Goto 14:07
14:09 Aaronepo_ left 14:11 kerframil left 14:16 ggoebel joined 14:18 eliasr left 14:19 hummy joined
hummy have installed gentoo foss-cloud. now want to make logs for management purposes. plod is tool but dont know how to install plod.shar file 14:23
14:26 psychoslave joined 14:35 konsolebox left 14:37 konsolebox joined 14:38 cognominal joined
moritz hummy: wrong channel, maybe? 14:53
14:57 hummy2 joined 14:58 hummy left, psychoslave left, psychoslave joined 15:10 cognominal left, MasterDuke left 15:11 cognominal joined 15:16 psychoslave left 15:28 xcm joined 15:37 psychoslave joined 15:38 telex left 15:40 telex joined 15:41 konsolebox left 15:43 konsolebox joined
Summertime for the following: say do loop { state $x = 0; last if ++$x > 2; $x; }; 15:49
why doesn't the state stay... statey? it seems to get reset each loop?
switching to: loop { state $x = 0; last if ++$x > 2; $x.say; } 15:50
the state works, but then you can't get the values out as easily 15:51
moritz Summertime: state behaves like an outer lexical variable
Summertime: if the outer lexical scope is re-entered, the state variable is reset
Summertime what would be the outer scope? it wouldn't have a reason to re-enter from... uh... say? would it? 15:53
16:02 hummy2 left
Summertime say do for ^10 { state $x = 0; last if ++$x > 2; $x; } # seems to work fine too, just seems specific to loop's scope when used as an expression(?)? 16:03
AlexDaniel to me that looks like a bug
6c: say do loop { state $x = 0; last if ++$x > 2; say $x; };
16:04 committable6 left
AlexDaniel uh 16:04
16:04 committable6 joined, ChanServ sets mode: +v committable6, coverable6 left, nativecallable6 left, statisfiable6 left, quotable6 left, releasable6 left 16:05 coverable6 joined, ChanServ sets mode: +v coverable6, nativecallable6 joined
AlexDaniel 6c: say do loop { state $x = 0; last if ++$x > 2; say $x; }; 16:05
16:05 quotable6 joined, ChanServ sets mode: +v quotable6, releasable6 joined, statisfiable6 joined, ChanServ sets mode: +v statisfiable6, committable6 left
AlexDaniel committable you kidding me! 16:05
b2gills m: do loop { state $x = 0; $x.say; last if ++$x > 2; $x; }
camelia WARNINGS for <tmp>:
0
1
2
Useless use of $x in sink context (line 1)
16:05 committable6 joined
b2gills m: say do loop { state $x = 0; $x.say; last if ++$x > 2; $x; } 16:06
Summertime the poor innocent bots vv
camelia (timeout)0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0…
b2gills That is definitely a bug. 16:08
AlexDaniel 6c: my $global; say do loop { state $x = 0; last if ++$x > 2; say $x; last if $global++ > 10 };
committable6 AlexDaniel, ¦6c (26 commits): «1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤()␤»
AlexDaniel c: all my $global; say do loop { state $x = 0; last if ++$x > 2; say $x; last if $global++ > 10 };
committable6 AlexDaniel, gist.github.com/1392eb375ae2fc25a3...a7917fe961 16:09
AlexDaniel c: all my $global; say do loop { state $x = 0; last if ++$x > 2; last if $global++ > 10; $x }; 16:10
b2gills m: say do for 1..* { state $x = 0; $x.say; last if ++$x > 2; $x; } # it should work more like this
camelia 0
1
2
(3 3)
committable6 AlexDaniel, gist.github.com/535b15bc50aa0fdb63...7070c8ef74
Summertime hmm, should I report it to morevm/morevm? or some other repo...?
AlexDaniel huggable: rakudobug 16:11
huggable AlexDaniel, Report bugs on github.com/rakudo/rakudo/issues/new If you don't have access to GitHub, you can email your report to [email@hidden.address] . See also: github.com/rakudo/rakudo/wiki/rt-introduction
AlexDaniel Summertime: ↑
Summertime ah, thanks!
AlexDaniel j: say 42
camelia 42
AlexDaniel j: my $global; say do loop { state $x = 0; last if ++$x > 2; last if $global++ > 10; $x };
camelia (1 2)
AlexDaniel well, heh, that works on jvm?? :D
16:16 rindolf left 16:19 Kaiepi left 16:22 Kaiepi joined 16:24 psychoslave left
Summertime and done, thanks for the feedback and extra testing, I was getting a bit confused trying to work out why it wasn't working 16:24
16:29 Kaiepi left 16:30 Kaiepi joined, cognominal left 16:39 mingdao left, mingdao joined 16:50 geospeck_ joined 16:51 geospeck_ left
Summertime j: say do loop { state $x = 0; last if ++$x > 2; $x } 16:51
camelia (1 2)
Summertime j: say do for ^5 { state $x = 0; last if ++$x > 2; $x }
camelia (3 3)
Summertime that'd be because loop is lazy?
16:54 geospeck left
lizmat m: do loop { state $x = 0; last if ++$x > 2; say $x; $x } 16:57
camelia WARNINGS for <tmp>:
1
2
Useless use of $x in sink context (line 1)
lizmat m: say do loop { state $x = 0; last if ++$x > 2; say $x; $x }
camelia (timeout)1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1…
lizmat seems to be some interaction between say and do and loop that causes a new scope to be cloned
16:58 geospeck joined 17:00 khw joined 17:06 cognominal joined 17:08 setty1 joined, itaipu left 17:09 mahafyi left 17:24 piojo_ left 17:31 rindolf joined, andrzejku joined
andrzejku hey 17:39
people
moritz \o 17:43
andrzejku moritz :) 17:47
17:53 albongo left 17:54 obfusk left 17:55 albongo joined 17:58 pmurias joined 18:03 Kaiepi left 18:04 Kaiepi joined 18:05 geospeck left, jast left 18:06 natrys joined 18:08 jast joined 18:19 mingdao left
Zoffix Voldenet: don't really care about requests per second. I'm not Facebook and rarely would have more than a couple. 18:24
18:27 rgrau joined 18:34 andrzejku left 18:36 andrzejku joined
Zoffix El_Che: you can just add a command on travis to run perl6 t/02-rakudo/whatvertest-that-fails.t 18:37
oh you already did it; nm
18:38 pmurias left, pmurias joined
Geth doc: 5893559b9f | (Jeremy Studer)++ (committed by Zoffix Znet) | 3 files
Rewrite, remove inaccurate Range truncation info (#1681)

  * Rewrite, remove inaccurate Range trucation info
Previously, this section stated that:
  * All ranges (including non-lazy ones) will truncate the output/ omit
... (51 more lines)
18:40
18:46 darutoko left 18:50 espadrine joined 18:54 pecastro joined 19:03 mingdao joined, mingdao left 19:05 itaylor57 joined, dugword joined, dugword left 19:12 mingdao joined 19:19 pecastro left 19:22 andrzejku left 19:24 ggoebel left 19:25 cdg joined 19:26 traxex left 19:30 pmurias left 19:31 pilne joined, traxex joined 19:37 traxex left 19:38 pecastro joined 19:42 traxex joined 19:43 domidumont joined 19:44 cdg left, cdg joined 19:49 cdg left, pecastro left 19:53 pmurias joined 19:54 traxex left, traxex joined 19:58 xinming_ left 20:02 Zoffix left 20:09 pmurias left, traxex left 20:13 traxex joined 20:23 bisectable6 left, bloatable6 left, bisectable6 joined, ChanServ sets mode: +v bisectable6, bloatable6 joined, ChanServ sets mode: +v bloatable6 20:25 andrzejku joined 20:27 cdg joined, andrzejku left 20:28 traxex left, traxex joined, andrzejku joined 20:30 traxex left 20:33 traxex joined, pmurias joined 20:39 dugword joined 20:45 domidumont left 20:47 setty1 left, xinming joined 20:51 dugword left 20:58 evalable6 left, evalable6 joined 21:06 cdg left 21:10 psychoslave joined 21:19 dugword joined 21:25 Zoffix joined
Zoffix timotimo: is JSON::Fast shoving {"0": null} for object by-design? 21:26
Zoffix was expecting .Capture to be used
timotimo that doesn't sound right, yeah
well, can't really use capture, because no support for mixed positional and keyed in json objects 21:27
Zoffix Ah
timotimo looks like it uses .keys
and then accesses it via { }
21:27 dugword left
Zoffix Ah 21:28
moritz star: use JSON::Tiny; say to-json( class { $.x }.new(:x(42)) )
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable $.x used where no 'self' is available
at <tmp>:1
------> 3use JSON::Tiny; say to-json( class { $.x7⏏5 }.new(:x(42)) )
expecting any of:
term
timotimo need "has"
moritz star: use JSON::Tiny; say to-json( class { has $.x }.new(:x(42)) )
camelia Can't serialize an object of type <anon|87187968>
in sub to-json at /home/camelia/star-2017.07/share/perl6/site/sources/9B467EEF9267A777BB53BAA2F19BE2C9D756BEED (JSON::Tiny) line 51
in block <unit> at <tmp> line 1
moritz thanks timotimo
Zoffix star: use JSON::Tiny; say to-json (class { has $.x }.new(:x(42)),)».Capture 21:29
camelia Can't serialize an object of type Capture
in sub to-json at /home/camelia/star-2017.07/share/perl6/site/sources/9B467EEF9267A777BB53BAA2F19BE2C9D756BEED (JSON::Tiny) line 51
in sub to-json at /home/camelia/star-2017.07/share/perl6/site/sources/9B467E…
Zoffix bah
Well, doing ».Capture Did The Right Thing with JSON::Fast :)
timotimo it does, eh?
Zoffix star: use JSON::Fast; say to-json (class { has $.x }.new(:x(42)),)».Capture 21:30
camelia [
{
"x": 42
}
]
timotimo how is it supposed to handle things that give both positionals and nameds in the capture?
Zoffix star: use JSON::Fast; say to-json class { method Capture { \(<a b c>, :42foo) } }.Capture 21:31
camelia {
"0": null,
"foo": 42
}
21:31 obfusk joined
timotimo that looks wrong 21:31
Zoffix mhm
timotimo m: say \(<a b c>, :42foo).keys
camelia (0 foo)
timotimo m: say \(\<a b c>, :42foo).keys
camelia (0 foo)
timotimo m: say \(|<a b c>, :42foo).keys
camelia (0 1 2 foo)
timotimo you did the capture wrong :)
but it'll not do the right thing with those keys 21:32
Zoffix star: use JSON::Fast; say to-json class { method Capture { \(|<a b c>, :42foo) } }.Capture
camelia {
"0": null,
"1": null,
"2": null,
"foo": 42
}
timotimo or does json support integer keys?
i don't think it does
moritz it does not
Zoffix FWIW, Perl5's Mojo::JSON and several other JSON modules try to call .TO-JSON on objects they don't recognize 21:33
timotimo hm, yeah, we could implement that in both our json modules
tiny and fast, i mean
moritz Zoffix: .TO_JSON, maybe?
timotimo i'd've maybe said either .Json or .JSON
moritz likes AS-JSON better than TO-JSON 21:34
"to" implies an in-place conversion
Zoffix moritz: they use .TO_JSON yeah, but IMO P6 version should be the status quo kebob-case
timotimo to-json doesn't do that either :)
moritz fwiw JSON::Tiny won't be the first mover when it comes to such a method, but will accept patches if other modules come to a consensus 21:39
it's not JSON::Experimental after all :-) 21:40
21:43 xcm left 21:44 xcm joined
timotimo gfldex had found some rather big speed improvements by making all escapes based on \u sequences rather than the different ones we have 21:45
i might be able to combine both approaches, actually 21:47
oh, but that code isn't able to handle surrogate pairs
21:49 leah2 left, Zoffix left, pmurias left
timotimo zoffix, got a good idea for when a capture has both positionals and string keys "0", "1", "2" for example 21:50
22:02 andrzejku left 22:03 leah2 joined 22:07 aindilis joined 22:25 rgrau left 22:27 andrzejku joined, aindilis left, aindilis` joined
gfldex timotimo: i found that speeding to-json up breaks tests of quite a few modules that make the assumption that JSON round trips are easy 22:31
22:37 aindilis` left 22:39 devmikey joined
timotimo i feared as much :( 22:39
gfldex we have to break those at some point
because that assumption is simply false
timotimo i think i'll steal your str-escape but make it output \t and friends again instead of \u... 22:40
22:43 andrzejku left 22:44 rindolf left 22:55 nebuchadnezzar left 23:05 sena_kun left
timotimo looks like i found a way to make it rather a bit slower 23:06
um, huh 23:09
gfldex: did you test the str-escape change with strings that have to-be-escaped things in them? because it seems incredibly slow compared to the old code
lizmat m: say Mu ~~ (*); say Mu ~~ Whatever # why the difference ? 23:14
camelia True
False
timotimo gfldex: with my old code it does a 5k string with some special chars in it in just 1.02 seconds, whereas your code spends 112 seconds (this is for to-json-ing the same string 1k times) 23:15
lizmat sleep& 23:16
teatime lizmat: they seem totally different. Mu ~~ Whatever should def. be false. I dunno enough about whatever star to know what Mu ~~ (*) should be, however it's actually False on my 2017.09 install. 23:17
lizmat m: say (*).WHAT # should be a bare Whatever afaics 23:19
camelia (Whatever)
lizmat ah, it's a test that Zoffix added today... 23:20
I think the test is wrong :-)
really sleep& 23:21
dogbert17 anyone have time for a nOoB question?
teatime I've never been denied :)
23:21 aindilis joined
dogbert17 say (1, 0, -1) Z+ (1,0,-1); # this does what I expect 23:21
evalable6 (2 0 -2)
dogbert17 my %dirs = (ne => (1, 0, -1)); say %dirs<ne> Z+ %dirs<ne>; # but this doesn't
m: my %dirs = (ne => (1, 0, -1)); say %dirs<ne> Z+ %dirs<ne>; # but this doesn't 23:22
camelia (6)
23:22 Zoffix joined
dogbert17 expected the second example to give the same answer as the first 23:22
Zoffix lizmat: why is the test wrong? (*) is Whatever:D and accepts everything, while Whatever is Whatever:U and it's a type-check smartmatch
23:23 devmikey left
Zoffix m: my %dirs = (ne => (1, 0, -1)); say %dirs<ne><> Z+ %dirs<ne><>; 23:23
camelia (2 0 -2)
Zoffix dogbert17: their conted
dogbert17 huh 23:24
Zoffix huggable: decont
huggable Zoffix, Article on containers and decont: perl6advent.wordpress.com/2017/12/...oneandonly
Zoffix m: dd (1, 2, 3) Z+ (4, 5, 6) 23:25
camelia (5, 7, 9).Seq
dogbert17 Zoffix++, lol guess I'll have to read it :-)
Zoffix m: dd $(1, 2, 3) Z+ $(4, 5, 6)
camelia (6,).Seq
Zoffix s/their/tehy're/;
dogbert17 is actually working on an AoC problem 23:26
Zoffix lizmat: note, that along with the test there was a rakudo commit; you'll need it for test to pass 23:27
timotimo: what if the named portion has "0", "1", "2" as keys? 23:31
{ "list": [0, 1, 2], "named": { "foo": 42 } } 23:32
23:32 cdg joined
Zoffix star: use JSON::Fast; dd from-json 「[ 0, 1, 2, { "foo": 42 } ]」 23:33
camelia $[0, 1, 2, {:foo(42)}]
Zoffix star: use JSON::Fast; dd from-json 「[[0, 1, 2], { "foo": 42 }]」
camelia $[[0, 1, 2], {:foo(42)}]
23:44 natrys left, Zoffix left 23:51 eythian left 23:55 eythian joined, eythian left, eythian joined 23:59 eythian left