Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2016-11-25

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

All times shown according to UTC.

Time Nick Message
01:04 AlexDaniel joined #perl6-dev
02:25 kalkin-_ joined #perl6-dev
02:49 ugjka joined #perl6-dev
05:37 dalek roast: 0300663 | usev6++ | S02-types/list.t:
05:37 dalek roast: Fudge test for RT #130160 on JVM
05:37 dalek roast:
05:37 dalek roast: (it works when run standalone but fails in S02-types/lists.t
05:37 dalek roast: review: https://github.com/perl6/roast/commit/03006637ba
05:37 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130160
06:53 RabidGravy joined #perl6-dev
07:13 seatek joined #perl6-dev
07:44 gfldex m: class A {}; multi sub trait_mod:<is>(Variable, :$foo ($first, Pair $pair, $last) ){}; my $a is foo(1, A => 1, 3) = A.new;
07:44 camelia rakudo-moar 64343d: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Can't use unknown trait 'is foo' in a variable declaration.␤at <tmp>:1␤------> , $last) ){}; my $a is foo(1, A => 1, 3)⏏ = A.new;␤    expecting any of:␤        TypeObject␤        default…»
07:45 gfldex a sub-signature to destructure the named parameter of a trait
07:53 Ven joined #perl6-dev
07:55 Ven joined #perl6-dev
08:09 geekosaur joined #perl6-dev
08:10 [TuxCM] This is Rakudo version 2016.11-53-g64343d7 built on MoarVM version 2016.11-20-g0f7277a
08:10 [TuxCM] csv-ip5xs        3.241
08:10 [TuxCM] test            14.390
08:10 [TuxCM] test-t           6.640
08:10 [TuxCM] csv-parser      14.154
08:32 Ven joined #perl6-dev
08:36 AlexDaniel joined #perl6-dev
09:56 Ven joined #perl6-dev
10:28 lizmat Files=1154, Tests=53781, 208 wallclock secs (12.66 usr  3.61 sys + 1269.92 cusr 122.05 csys = 1408.24 CPU)
11:00 AlexDaniel joined #perl6-dev
11:10 ugjka joined #perl6-dev
11:46 Ven joined #perl6-dev
12:08 Ven joined #perl6-dev
12:12 Ven joined #perl6-dev
12:21 Ven joined #perl6-dev
13:44 Ven joined #perl6-dev
14:02 Ven joined #perl6-dev
14:42 dalek rakudo/nom: fce1a24 | (Zoffix Znet)++ | src/core/Iterable.pm:
14:42 dalek rakudo/nom: Give Iterable.flat() iterator its own .push-all
14:42 dalek rakudo/nom:
14:42 dalek rakudo/nom: Earlier fix[^1] removed custom .push-all() impl. for this Iterator, as crud
14:42 dalek rakudo/nom: brenchmarks showed no performance loss. However, more elaborate benches
14:42 dalek rakudo/nom: indicate the loss can be up to 30% in some cases.
14:42 dalek rakudo/nom:
14:42 dalek rakudo/nom: Re-implement the custom push-all, with the fix[^1] present to regain
14:42 dalek rakudo/nom: lost performance.
14:42 dalek rakudo/nom:
14:42 dalek rakudo/nom: [1] https://github.com/rakudo/rakudo/commit/61a18c064695cfa16f31187abed62d1fe4e2cb5e
14:42 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fce1a2431a
14:43 viki *crude
14:44 jnthn Heh, crud worked too :P
14:44 jnthn (synonym for "crap" where I'm from)
15:12 nine Oh boy. Bailador is 43 times slower than Dancer2 used via Inline::Perl5
15:13 dalek rakudo/nom: 77e9d4b | (Zoffix Znet)++ | src/core/Buf.pm:
15:13 dalek rakudo/nom: Add aritiy-1 infix:<~> for Blobs
15:13 dalek rakudo/nom:
15:13 dalek rakudo/nom: Constructs like [~] @array-of-blobs currently fail when there's only one element
15:13 dalek rakudo/nom: in the list, as in such cases infix:<~>(Str) is used.
15:13 dalek rakudo/nom:
15:13 dalek rakudo/nom: Fix by adding arity-1 infix:<~>(Blob:D) that simply returns its argument
15:13 nine I bet it's EVALing the code generated from the templates on every request.
15:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/77e9d4b545
15:14 viki nine: :o ... in some way, that's pretty amusing :)
15:15 Ven joined #perl6-dev
15:16 dalek roast: b51d3a6 | (Zoffix Znet)++ | S32-container/buf.t:
15:16 dalek roast: Test infix:<~>(Blob:D)
15:16 dalek roast:
15:16 dalek roast: Added in commit
15:16 dalek roast: https://github.com/rakudo/rakudo/commit/77e9d4b545
15:16 dalek roast: review: https://github.com/perl6/roast/commit/b51d3a63aa
15:17 Ven_ joined #perl6-dev
15:29 nine viki: OTOH it's not completely surprising considering that Text::CSV_XS:from<Perl5> is still twice as fast as Text::CSV
15:29 [TuxCM] twice?
15:29 nine ~ 3.2 vs. 6.6 seconds?
15:32 [TuxCM] _XS = 0.033
15:33 nine I'm talking about using it from Perl 6
15:33 [TuxCM] http://tux.nl/Talks/CSV6/speed5.html
15:33 nine Dancer2 in a Perl 5 app is again 4-5 times faster than Dancer2 in Perl 6 which is 43 times as fast as Bailador in Perl 6
15:33 [TuxCM] Ahh
15:40 nine Oh yes, Bailador re-parses the template and re-EVALs the generated Perl 6 code every time one renders a template. That can only be slow as hell :)
15:40 tadzik (yep :P)
15:47 Ven joined #perl6-dev
16:21 dalek roast: a8b70cc | (Zoffix Znet)++ | S16-filehandles/argfiles.t:
16:21 dalek roast: Teach create-temporary-file to take a part of filename
16:21 dalek roast:
16:21 dalek roast: So we could create dmore than one temp file without risk of race
16:21 dalek roast: conditions of creating same-named files.
16:21 dalek roast: review: https://github.com/perl6/roast/commit/a8b70cc2e5
16:27 dalek rakudo/nom: 15f51a5 | (Zoffix Znet)++ | src/core/IO/ArgFiles.pm:
16:27 dalek rakudo/nom: Fix slurp not propagating :bin and :enc args on $*ARGFILES
16:27 dalek rakudo/nom:
16:27 dalek rakudo/nom: Reported by timotimo++ https://irclog.perlgeek.de/perl6/2016-11-25#i_13628118
16:27 dalek rakudo/nom:
16:27 dalek rakudo/nom: The p6box_s removed due to possibility of getting Bufs; the Str version
16:27 dalek rakudo/nom: of slurp-rest already p6box_ss the return value. Also, change @chunks.join
16:27 dalek rakudo/nom: to [~] @chunks, so it calls appropriate infix:<~> op, whether it has Str or Buf
16:27 dalek rakudo/nom: in the @chunks.
16:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/15f51a52bd
16:33 dalek roast: 1db2692 | (Zoffix Znet)++ | S16-filehandles/argfiles.t:
16:33 dalek roast: Test slurp on $*ARGFILES passes through :bin and :enc args
16:33 dalek roast:
16:33 dalek roast: Fixed in Rakudo in
16:33 dalek roast: https://github.com/rakudo/rakudo/commit/15f51a52bd
16:33 dalek roast: review: https://github.com/perl6/roast/commit/1db269245e
17:17 travis-ci joined #perl6-dev
17:17 travis-ci Rakudo build errored. Zoffix Znet 'Fix slurp not propagating :bin and :enc args on $*ARGFILES
17:17 travis-ci https://travis-ci.org/rakudo/rakudo/builds/178884454 https://github.com/rakudo/rakudo/compare/77e9d4b54574...15f51a52bd41
17:17 travis-ci left #perl6-dev
17:17 buggable [travis build above] ✓ All failures are due to timeout (1), missing build log (0), or GitHub connectivity (0).
17:46 viki "Normalization output must be native array of 32-bit integers" is there a simple way to get such an array in NQP?
17:46 timotimo not without a bit of weird amgic
17:46 timotimo magic*
17:47 timotimo i know that because in the last few days i've been wondering about getting smaller int-arrays into nqp
17:47 viki hmm
17:47 viki m: my $codes := nqp::list_i; nqp::strtocodes("foo", nqp::const::NORMALIZE_NFC, $codes);
17:47 camelia rakudo-moar 15f51a: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Could not find nqp::list_i, did you forget 'use nqp;' ?␤at <tmp>:1␤------> my $codes := nqp::list_i⏏; nqp::strtocodes("foo", nqp::const::NOR␤    expecting any of:␤        argument list␤»
17:47 viki Trying to get that inside Perl6/Grammar
17:49 viki well, what I'm trying to do is so .codes == .chars
17:49 viki but in P6/Grammar
17:50 viki and the reason I'm trying to do that is I want a \d+ token but that fails to match  stuff like "7\x[308]"
17:52 timotimo a second, please
17:53 timotimo nqp/t/nqp/102-multidim.t shows how a multi-dim array type gets created, that gives you an idea how to pass arguments to the compose protocol
17:54 timotimo then, you can find the arguments that are interesting inside moarvm's src/6model/reprs/MVMArray.c in the "compose" function
17:54 viki :o
17:55 timotimo so here's my "what" of the day
17:55 timotimo m: say +"0x00000000002e88bb"
17:55 camelia rakudo-moar 15f51a: OUTPUT«3049659␤»
17:55 timotimo i've been meaning to write the number 12290094, and it comes out as 29217008 on the other end
17:56 timotimo and just parsing the hex values there gives me yet another value
17:56 viki m: say "2e88bb".parse-base(16)
17:56 camelia rakudo-moar 15f51a: OUTPUT«3049659␤»
17:56 * viki doesn't see the wat
17:57 timotimo m: my $blob = "hello, and how are you?".encode("utf8"); Buf.new(flat(0 xx 8, ($blob.elems).polymod(256 xx *))[*-8..*])).perl.say
17:57 camelia rakudo-moar 15f51a: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> $blob.elems).polymod(256 xx *))[*-8..*])⏏).perl.say␤»
17:57 timotimo m: my $blob = "hello, and how are you?".encode("utf8"); Buf.new(flat(0 xx 8, ($blob.elems).polymod(256 xx *))[*-8..*]).perl.say
17:57 camelia rakudo-moar 15f51a: OUTPUT«Buf.new(0,0,0,0,0,0,0,23)␤»
17:57 timotimo m: my $blob = ("hello, and how are you?" x 100).encode("utf8"); Buf.new(flat(0 xx 8, ($blob.elems).polymod(256 xx *))[*-8..*]).perl.say; say $blob.elems
17:57 camelia rakudo-moar 15f51a: OUTPUT«Buf.new(0,0,0,0,0,0,252,8)␤2300␤»
17:57 timotimo m: say :256[252, 8]
17:57 camelia rakudo-moar 15f51a: OUTPUT«64520␤»
17:58 timotimo i think i'm doing things the wrongest way ever devised
17:59 viki I'm no idea what you're even doing
17:59 timotimo oh, well
17:59 timotimo you know
17:59 timotimo just encoding a 64 bit number to bytes
18:00 timotimo i'd like to read it with a memcpy(&64_bit_int_variable, source, 8)
18:01 viki But what's with "hello, and how are you?" then? :)
18:01 timotimo the number is how big that piece of data is
18:02 timotimo you see the $blob.elems?
18:03 viki OK.
18:03 viki m: my $blob = ("hello, and how are you?" x 100).encode("utf8"); Buf.new(flat(0 xx 8, ($blob.elems).polymod(256 xx *))[*-8..*]).perl.say; say $blob.elems; say 8*256 + 252
18:03 camelia rakudo-moar 15f51a: OUTPUT«Buf.new(0,0,0,0,0,0,252,8)␤2300␤2300␤»
18:03 timotimo m: use experimental :pack; pack("L", 2300).perl.say
18:03 camelia rakudo-moar 15f51a: OUTPUT«Buf.new(252,8,0,0)␤»
18:03 viki It's working innit?
18:04 timotimo oh, it is?
18:04 timotimo how is my :256[252, 8] not the same as 252 * 255 + 8? ... oh
18:05 viki m: say :256[8, 252]
18:05 camelia rakudo-moar 15f51a: OUTPUT«2300␤»
18:05 viki m: say 64/8
18:05 camelia rakudo-moar 15f51a: OUTPUT«8␤»
18:05 timotimo now what's the magic incantation to make my C program eat it, too ...
18:06 viki the created buf is prolly in reverse?
18:06 viki Should be Buf.new(0,0,0,0,0,0,8,252), no?
18:06 viki oh wait
18:06 viki Yeah
18:07 viki Well, if the 252 in there is the one that is least signficinant bit or whatver
18:07 viki byte
18:07 timotimo m: say 0xbb882e; say 12290094.base(16); say 17621232.base(16)
18:08 camelia rakudo-moar 15f51a: OUTPUT«12290094␤BB882E␤10CE0F0␤»
18:08 timotimo jesus christ
18:09 timotimo i forgot to put the argument to fprint in
18:09 timotimo so it was just printing out what happens to be on the stack/in the register
18:09 viki heh
18:10 timotimo got the right number now! finally!
18:10 timotimo just needed two .reverse in there :)
18:10 timotimo thank you for being such a good rubber duckie
18:11 timotimo can i help you with the 32bit thing in turn?
18:11 viki m: my $blob = ("hello, and how are you?" x 100).encode("utf8"); Buf.new(flat(0 xx 8, ($blob.elems).polymod(256 xx *).reverse)[*-8..*]).perl.say
18:11 camelia rakudo-moar 15f51a: OUTPUT«Buf.new(0,0,0,0,0,0,8,252)␤»
18:12 viki Nah, I'll leave the 32gbit thing for now.
18:12 timotimo heh, 32gbit
18:12 viki Need to do some $work before the end of the week so I'll leave it for tomorrow :)
18:12 timotimo that's fair
18:45 AlexDaniel joined #perl6-dev
19:05 b2gills I should not go three weeks between times looking at this channel. It took me three hours looking through just the commits.
19:05 viki :)
19:05 timotimo uh oh :S
19:05 timotimo i'm glad you're back, in any case :)
19:12 b2gills It didn't help that the power went off twice back when I was upgrading my computer, and had to reinstall from scratch.
19:13 viki m: https://gist.github.com/zoffixznet/af46dda0c4faefe5df7de132fbde9f2f
19:13 camelia rakudo-moar 15f51a: OUTPUT«()␤()␤()␤()␤()␤()␤7␤»
19:13 viki So, is it too crazy to have this token in Perl6/Grammar?
19:14 viki With the immediate purpose of fixing :7̈a, but there may turn up other cases
19:16 b2gills If it does get added, there should be a script somewhere that creates it so that it is easier to update with a new version of Unicode
19:16 viki OK. I have the script https://gist.github.com/zoffixznet/e0cc87a1dfd6006ba169f08b651fb9a0
19:18 timotimo is <:Nd> too slow?
19:18 viki timotimo: it doesn't work.
19:18 timotimo that's bad :)
19:18 viki the combiner obtains Nd property
19:18 timotimo of course it does
19:18 viki :)
19:18 timotimo i remember that now
19:20 jnthn It's not that the combiner obtains the Nd property, it's that the grapheme as a whole has it
19:20 jnthn (Nit pick, but perhaps an important one :))
19:20 b2gills Actually are there any composed variants of Nd values? because if not you could cheat by checking the ordinal in an implementation specific way. basically ask MOAR if it created a synthetic
19:21 jnthn Well, the easy way is chr(ord($x)) eq $x
19:21 RabidGravy joined #perl6-dev
19:21 japhb jnthn++  # Excellent blog post last night; I'm actually rethinking a bit of API because of it.
19:22 jnthn Glad it made some sense. :)
19:22 timotimo things i like: single source of truth. things i like to do: forget to do things well
19:22 * jnthn had a bit of writers block for a while...
19:26 viki b2gills: I know checking .codes == .chars is a viable way, but I've no idea how to "ask MOAR if it created a synthetic"
19:27 timotimo if moar created a synthetic, then the .NFC isn't as long as the .chars
19:28 viki oh, so we're back to that 32-bit array thing :D
19:28 timotimo because then the NFC must contain some not-combined stuff
19:28 timotimo ;(
19:28 timotimo i thought you were going to let it rest
19:28 viki Yeah, I should.
19:29 viki So I'll try that tomorrow. Thinking adding the token will end up with us forgetting to update it one day ....
19:29 timotimo unless you have a little generator script ;)
19:29 viki someone has to run it ;)
19:29 timotimo right
19:29 b2gills If you could ask MOAR what codepoint it internally has, it will be outside of the Unicode range ( actually I think it is negative ) I would assume there is no way currently to do that at the Perl 6 level
19:30 jnthn viki: II can't think of a case where doing $c.ord.chr eq $c would be true *and* you have a synthetic.
19:30 jnthn b2gills: Moar will never leak synthetics :)
19:30 viki jnthn: ok, I'll try that too.
19:31 jnthn viki: Either it's non-synthetic and so it roundtrips the codepoint
19:31 jnthn Or it's synthetic and it doesn't
19:31 viki it's just it's not 1 char, so I have to substr or something for each char
19:31 jnthn Yeah
19:31 viki ok
19:31 jnthn Noting that it'll work out 'cus each char is a grapheme, not a codepoint
19:32 jnthn In the longer run, I think a :NFC or similar adverb in the regex engine would be a way to do this (iirc S05 speculates about that)
19:33 jnthn It's not, however, entirely obvious how we'll implement that
19:33 jnthn (It's surely possible...just needs some thinking)
19:33 timotimo right, it'll be interesting
19:34 jnthn (Especially around the semantics of match objects and extents, which is where it gets really hairy)
19:34 b2gills unfortunately the bus-number for that area of the implementation is entirely too low
19:35 jnthn *nod*
19:35 jnthn The regex engine was one of the last parts of the codebase I understood when I was new to Rakudo :)
19:38 timotimo yeah, we don't have an easy way to get at .orig any more when we match on transformed parts of the source
19:38 timotimo we can't just take the original string and be careful about offsets in different normalizations, because we need to have sub-character indices :|
19:39 jnthn Yes, you can start to see why this hasn't been implemented yet. :)
19:39 timotimo at least we don't have to deal with "we matched these combiners, but not those, and they end up in a totally bullshit order in our orig string compared to NFC!"
19:39 timotimo imagine that, having a to, and also a mask of which combiners in the last (and first!) character ended up in the match as well
19:40 timotimo at least i'm having fun in my current project today %)
19:41 timotimo and i haven't run into a wall yet, so that's nice
19:49 cognominal better running into a Wall
19:49 timotimo heh
22:39 TimToady joined #perl6-dev
23:24 evalable6 joined #perl6-dev

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