Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-05-18

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

All times shown according to UTC.

Time Nick Message
00:01 Zoffix huggable: release commits
00:01 huggable Zoffix, ./perl6 -e 'my @releases = map {sprintf "%d-%02d", .year, .month}, (Date.new(:2015year :12month), *.later(:month) ... Date.new: :2017year, :4month); for @releases.map(*.split("-").join: ".").rotor: 2 => -1  { print qqx/printf "\e[0m\e[1;33m%s - %-7s: \e[0;32m" {.[0]} {.[1]}; git log --oneline "{.[0]}...{.[1]}" | wc -l/ };'; printf "\e[0m"
00:02 Zoffix There fixed version with perl 6 as glue :)
00:05 Zoffix ah, I forgot HEAD now -_-
00:05 * Zoffix gives up
00:06 BenGoldberg If you throw your hands up in the air, what will you catch them with?
00:18 japhb BenGoldberg: If you throw your hands up in the air, then clearly you just don't care.
00:25 TimToady what if you just throw them up a little in your mouth?
00:28 BenGoldberg Actually, I've got these retracting keyreel things to pull my hands back to my wrists, to convince the other Creatures that I'm like, telekinetic, or something.
00:28 BenGoldberg I got the idea from a book, "Messing With Monster."
00:29 AlexDaniel Zoffix: is it supposed to say “use smartmatch with junctions”? https://github.com/perl6/doc/commit/860333f5787f5a046534762879afcb1633ece6ec
00:30 AlexDaniel ah no, I got the idea
00:30 AlexDaniel nevermind
00:47 timotimo ugh, why am i doing stuff with bar charts in the terminal again
00:52 AlexDani` joined #perl6-dev
00:59 timotimo oh. my. word.
00:59 timotimo @output[0] ~= color("red on_blue")  -  "but i want to put it in front, not at the end!  -  "oh, no problem!"  -  @output[0] [R~]= color("red on_blue")
00:59 timotimo <3
01:03 timotimo http://imgur.com/a/wD42N
01:03 timotimo those are some very split bars!
01:04 timotimo though it looks like it's wrong
01:04 timotimo ah, but of course
01:08 timotimo well, i ought to sleep
01:16 ugexe lizmat: https://i.imgur.com/TVP5PMe.jpg
01:18 Zoffix :O
01:19 Zoffix ugexe: what does it do when you press it?
01:19 ugexe i dont want to think of all the button variants zoffix would think of
01:20 ugexe nothing because i havent bothered to learn that much of this app
01:20 Zoffix heh
01:21 ugexe maybe have some set to different releases of perl6, so i can just click different camelias to quickly change env
01:29 BenGoldberg So like perlbrew, but clickable?
01:30 ugexe and colorful
01:49 ilbot3 joined #perl6-dev
01:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
06:23 [Tux] This is Rakudo version 2017.04.3-280-gf3f99b3ac built on MoarVM version 2017.04-64-g6d5ea042
06:24 [Tux] csv-ip5xs        2.502
06:24 [Tux] test            12.841
06:24 [Tux] test-t           4.315 - 4.352
06:24 [Tux] csv-parser      12.841
06:55 jsimonet joined #perl6-dev
08:44 lizmat .
10:01 Zoffix tadzik: yes, I meant asap. why wait
10:01 Zoffix just to get a ton of merge conflicts
10:01 tadzik %)
10:02 tadzik why wait! https://www.youtube.com/watch?v=Fe4qEschyCQ
10:06 lizmat joined #perl6-dev
10:11 Zoffix uhh...
10:12 Zoffix that's the weirdest video
10:14 tadzik it's a part of ASDF movie
10:14 tadzik (which, as the name suggests, is a series)
10:14 tadzik can seem odd if you're not into absurd humour though :)
10:15 jnthn .oO( I like trains! )
10:26 timotimo i like when i trains
10:33 lizmat i like when it rains
10:33 lizmat actually, not really  :-)
10:43 timotimo https://imgur.com/a/wD42N - immediately after going to bed i noticed i actually didn't even use the eighths block thingies
10:43 timotimo now i do and it looks a little better
10:55 tadzik timotimo: wow, what's that :)
10:56 * lizmat stops banging her head on System::Info for now
10:56 lizmat RT #131324
10:56 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131324
10:57 timotimo tadzik: you know those partial blocks that unicode defines?
10:57 jnthn lizmat: You forgot to export it?
10:57 timotimo u: LEFT BLOCK
10:57 unicodable6 timotimo, U+2589 LEFT SEVEN EIGHTHS BLOCK [So] (▉)
10:57 unicodable6 timotimo, U+258A LEFT THREE QUARTERS BLOCK [So] (▊)
10:57 unicodable6 timotimo, 7 characters in total: https://gist.github.com/280194f245df11f1207fe730442ca134
10:57 jnthn lizmat: Would need to be my class A is export { }
10:57 tadzik timotimo: ye
10:57 timotimo this is "simply" bar graphs made with these blocks
10:58 timotimo the next step that'll be necessary is splitting it across lines
10:58 lizmat jnthn: A is not composable, so B cannot compose it  :-(
10:58 timotimo because we can only have one split per character in the terminal
10:58 jnthn lizmat: wat...but you didn't try to...
10:59 jnthn That error would be for "also does"... :S
10:59 lizmat no, I added the "is export"
10:59 lizmat argh
10:59 lizmat yup
10:59 * lizmat is clearly not recovered yet
11:02 jnthn Many eyes make at least the occasional bug shallow :)
11:02 lizmat hehe  yup
11:05 jnthn lunch, then plan to do some Perl 6 bits this afternoon :)
11:05 jnthn bbiab
11:06 lizmat hmmm.. still doesn't solve my System::Info issue
11:06 * lizmat steps away from the keyboard for a while
11:28 Geth ¦ rakudo: CurtTilmes++ created pull request #1084: Replace panda with zef in README
11:28 Geth ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/1084
11:32 Geth ¦ rakudo/nom: e89ba827ce | (Curt Tilmes)++ (committed by Moritz Lenz) | README.md
11:32 Geth ¦ rakudo/nom: Replace panda with zef in README
11:32 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e89ba827ce
11:49 * masak .oO( the panda is deprecated, long live the zef )
11:50 lizmat masak: see also "The End Of An Era" section in https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/
11:51 lizmat afk again&
11:52 masak aye, I read it :) lizmat++ tadzik++
11:53 tadzik :]
11:54 tadzik another fun blast from the past: look what https://github.com/perl6/modules.perl6.org is forked from :P
12:25 masak oooouuuh
12:26 * masak .oO( pro tip: if you want your prototype not to live forever like a zombie, put "proto" in the name )
12:26 jnthn .oO( proto tip )
12:28 Zoffix m: package Foo { our $*t is export = 42 }; import Foo; dd $*t
12:28 camelia rakudo-moar e89ba8: OUTPUT: «Any $*t = Any␤»
12:28 Zoffix Any way to make it export the value as well?
12:29 [Coke] tadzik++ #panda
12:46 * Zoffix solves it with exporting a normal var and doing ($*Tester//$Tester) instead
12:52 Zoffix m: role Foo { method !bar {…} }; class Bar does Foo {}
12:52 camelia rakudo-moar e89ba8: ( no output )
12:52 Zoffix m: role Foo { method bar {…} }; class Bar does Foo {}
12:52 camelia rakudo-moar e89ba8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Method 'bar' must be implemented by Bar because it is required by roles: Foo.␤at <tmp>:1␤»
12:53 * Zoffix would've thought the same syntax would've required to implement a private method too
12:53 Zoffix m: role Foo { method !bar {…} }; class Bar does Foo { method meow { self!bar } }.meow
12:53 camelia rakudo-moar e89ba8: OUTPUT: «Stub code executed␤  in method bar at <tmp> line 1␤  in method meow at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:53 Zoffix m: role Foo { method !bar {…} }; class Bar does Foo { method meow { self!bar.so } }.meow
12:53 camelia rakudo-moar e89ba8: ( no output )
12:53 Zoffix m: role Foo { method !bar {…} }; class Bar does Foo { method meow { self!bar.so } }.meow.sayt
12:53 camelia rakudo-moar e89ba8: OUTPUT: «No such method 'sayt' for invocant of type 'Bool'␤  in block <unit> at <tmp> line 1␤␤»
12:53 Zoffix m: role Foo { method !bar {…} }; class Bar does Foo { method meow { self!bar.so } }.meow.say
12:53 camelia rakudo-moar e89ba8: OUTPUT: «False␤»
12:53 Zoffix ^ had this bug in my code because it didn't :(
12:54 timotimo private methods are not part of an object's API, roles are about API, that's the reasoning behind that
12:55 Zoffix m: role Foo { method !bar {!!! ::?CLASS.^name ~ ' must implement !bar' } }; class Bar does Foo { method meow { self!bar.so } }.meow
12:55 camelia rakudo-moar e89ba8: OUTPUT: «Bar must implement !bar␤  in method bar at <tmp> line 1␤  in method meow at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:55 * Zoffix goes with that...
12:56 Zoffix timotimo: feels like an excuse rather than reasoning.
12:58 Zoffix m: role Foo { method meow { self!bar }; method !bar { say "hi" } }; class Bar does Foo {  }.meow
12:58 camelia rakudo-moar e89ba8: OUTPUT: «hi␤»
12:59 Zoffix A role can require implementation of functionality that doesn't need to be part of object's public API
13:01 Zoffix role IO::UFO { method !fetch-chunk { … }; method get { self!fetch-chunk.get }; method lines { self!fetch-chunk.lines }; method slurp { self!fetch-chunk.slurp } }; class IO::Web does IO::UFO { has $.url; method !fetch-chunk { use WWW; get $!url } }
13:05 timotimo mhm
13:09 * jnthn wonders why we have the IO::Socket role
13:09 jnthn The only thing that does it is IO::Socket::INET
13:10 jnthn And it's not clear how it could be successfully implemented/used in userspace
13:10 mst jnthn: because one day somebody's going to implement IO::Socket::UNIX
13:11 mst (this is a guess and maybe it isn't worth keeping the role for the moment even if I'm right)
13:12 jnthn If so, there's further confusion still 'cus a lexical module listing constants sat inside of IO::Socket::INET has PF_LOCAL and PF_UNIX defined...
13:13 jnthn But yeah, that is a good reason to keep the role :)
13:13 jnthn The sync socket code seems quite unloved
13:13 Geth ¦ rakudo/nom: 541597b82d | (Elizabeth Mattijsen)++ | src/core/Compiler.pm
13:13 Geth ¦ rakudo/nom: Make System::Info info fetch a bit more picky
13:13 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/541597b82d
13:16 timotimo tadzik: https://github.com/timo/p6profiler-tools/blob/master/stacked_bars.p6 - terrible code
13:17 tadzik I love terrible code!
13:17 lizmat commute to Cologne&
13:18 timotimo annoyingly, it's not possible to display every kind of graph, even when i split graphs across lines
13:18 timotimo because there could be pieces that are shorter than a character, and there's no unicode characters for that
13:18 timotimo so ... sixel it is! :P
13:24 Geth ¦ rakudo/refactor-socket-encoding: d6fd249138 | (Jonathan Worthington)++ | 2 files
13:24 Geth ¦ rakudo/refactor-socket-encoding: Moving encoding and line ending bits to IO::Socket
13:24 Geth ¦ rakudo/refactor-socket-encoding:
13:24 Geth ¦ rakudo/refactor-socket-encoding: These are general rather than specific to a particular type of socket.
13:24 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/d6fd249138
13:24 Geth ¦ rakudo/refactor-socket-encoding: 75693b0b3a | (Jonathan Worthington)++ | src/core/IO/Socket/INET.pm
13:24 Geth ¦ rakudo/refactor-socket-encoding: Toss IO::Socket::INET.ins.
13:24 Geth ¦ rakudo/refactor-socket-encoding:
13:24 Geth ¦ rakudo/refactor-socket-encoding: The ins method for counting the number of lines read in is long gone
13:24 Geth ¦ rakudo/refactor-socket-encoding: from IO::Handle; this is a relic of when it was there. It was neither
13:24 Geth ¦ rakudo/refactor-socket-encoding: tested nor documented.
13:24 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/75693b0b3a
13:24 Geth ¦ rakudo/refactor-socket-encoding: 187dea004d | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:24 Geth ¦ rakudo/refactor-socket-encoding: Fix leftover of when \n was not always \x0A.
13:24 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/187dea004d
13:28 Geth ¦ rakudo/refactor-socket-encoding: 9cec940808 | (Jonathan Worthington)++ | 2 files
13:28 Geth ¦ rakudo/refactor-socket-encoding: Move get and lines to IO::Socket role.
13:28 Geth ¦ rakudo/refactor-socket-encoding:
13:28 Geth ¦ rakudo/refactor-socket-encoding: These also will be generic over different kinds of socket. Means they
13:28 Geth ¦ rakudo/refactor-socket-encoding: now sit with read and recv.
13:28 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/9cec940808
13:30 timotimo (except almost no terminal supports sixel so far)
13:37 Geth ¦ rakudo/refactor-socket-encoding: fb9b15701e | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:37 Geth ¦ rakudo/refactor-socket-encoding: Use consistent code style.
13:37 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/fb9b15701e
13:37 Geth ¦ rakudo/refactor-socket-encoding: 12d31e3614 | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:37 Geth ¦ rakudo/refactor-socket-encoding: Provide configuration nl-out on sync sockets.
13:37 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/12d31e3614
13:44 Geth ¦ rakudo/refactor-socket-encoding: eb50e7472c | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:44 Geth ¦ rakudo/refactor-socket-encoding: Do encoding of socket writes in Perl 6 space.
13:44 Geth ¦ rakudo/refactor-socket-encoding:
13:44 Geth ¦ rakudo/refactor-socket-encoding: This eliminates the use of VM-level string output on sockets.
13:44 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/eb50e7472c
13:48 Geth ¦ rakudo/refactor-socket-encoding: cb404c4370 | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:48 Geth ¦ rakudo/refactor-socket-encoding: Toss NYI IO::Socket.poll method.
13:48 Geth ¦ rakudo/refactor-socket-encoding:
13:48 Geth ¦ rakudo/refactor-socket-encoding: There's no meniton of it in docs nor tests, and having it show up in
13:48 Geth ¦ rakudo/refactor-socket-encoding: introspection when it only throws to say it's NYI is unhelpful. Plus,
13:48 Geth ¦ rakudo/refactor-socket-encoding: there's IO::Socket::Async for doing non-blocking socket stuff in a
13:48 Geth ¦ rakudo/refactor-socket-encoding: more scalable way.
13:48 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/cb404c4370
13:59 Geth ¦ rakudo/refactor-socket-encoding: f911ce1c6b | (Jonathan Worthington)++ | src/core/IO/Socket.pm
13:59 Geth ¦ rakudo/refactor-socket-encoding: Remove JVM workaround in IO::Socket.recv.
13:59 Geth ¦ rakudo/refactor-socket-encoding:
13:59 Geth ¦ rakudo/refactor-socket-encoding: For the binary path, recv should really mean a single call down to
13:59 Geth ¦ rakudo/refactor-socket-encoding: the networking libraries to recv something. The string path is about
13:59 Geth ¦ rakudo/refactor-socket-encoding: to be refactored to use the streaming string decoder (which, yes,
13:59 Geth ¦ rakudo/refactor-socket-encoding: needs work on JVM; that will be done before this branch is merged).
13:59 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/f911ce1c6b
15:01 dct joined #perl6-dev
15:07 brrt joined #perl6-dev
15:19 Geth ¦ rakudo/refactor-socket-encoding: 0a7c7b6d60 | (Jonathan Worthington)++ | 2 files
15:19 Geth ¦ rakudo/refactor-socket-encoding: Re-work IO::Socket.recv to use decode stream.
15:19 Geth ¦ rakudo/refactor-socket-encoding:
15:19 Geth ¦ rakudo/refactor-socket-encoding: This means it doesn't use VM-level string I/O any more. Doing this
15:19 Geth ¦ rakudo/refactor-socket-encoding: also shows up that the semantics of .recv in chars mode need a more
15:19 Geth ¦ rakudo/refactor-socket-encoding: careful look, as it seems it's possible that it could end up trying to
15:19 Geth ¦ rakudo/refactor-socket-encoding: decode parts of multi-byte sequences (which will then blow up). The
15:19 Geth ¦ rakudo/refactor-socket-encoding: semantics here match what we were already doing in the VM, keeping the
15:19 Geth ¦ rakudo/refactor-socket-encoding: test suite happy. It's worth considering if there are better semantics
15:19 Geth ¦ rakudo/refactor-socket-encoding: we could adopt that would keep it similarly happy.
15:19 Geth ¦ rakudo/refactor-socket-encoding: review: https://github.com/rakudo/rakudo/commit/0a7c7b6d60
15:21 AlexDani` joined #perl6-dev
15:34 jnthn Well, there's a start. :)
15:35 * jnthn goes for some rest
15:39 Zoffix Hm, the page for release stats has a unidinasaur puking up a rainbow: https://perl6.fail/release/stats
15:39 * Zoffix wonders if it's a bad omen :)
15:48 Zoffix NeuralAnomaly: blockers
15:48 NeuralAnomaly Zoffix, There are 2 release blockers. See http://perl6.fail/release/blockers
15:48 NeuralAnomaly Zoffix, http://perl6.fail/131306 : Incorrect results with `uint32` types after +> was made to handle large ints
15:48 NeuralAnomaly Zoffix, http://perl6.fail/131247 : )> in regex results in stuff being matched wrongly ( /)> . <(/ )
15:50 Zoffix I marked http://perl6.fail/131306 as a blocker because it breaks Digest and that's used by a bunch of modules. If there's still no fix by release, I'm gonna revert 6409ee582ee58 and ef29bb9f41aa, re-adding a bug with +> giving wrong results for +32 shifts
15:50 Zoffix m: sub rotr(uint32 $n, uint32 $b) { $n +> $b +| $n +< (32 - $b) }; say rotr 1652322944, 18; my $x; for ^1000 { $x = rotr 1652322944, 18 }; say $x
15:50 camelia rakudo-moar 541597: OUTPUT: «27071659120799␤229376␤»
15:51 Zoffix the bug is that ^ somewhere "spesh" gets things wrong. MVM_SPESH_DISABLE makes the bug disappear
15:51 * Zoffix tests to see whether reverting those two commits actually hides the bug
15:52 Zoffix and the other ticket, well, I marked it as a blocker 'cause I wanted to write more tests for captures, but haven't got the chance yet. Gonna do tomorrow, to see if any serious issue exists.
15:53 * Zoffix can't wait to finish the IO grant and be free again
15:54 Zoffix yup, reverting both fixes the spesh issue
15:54 Zoffix (but adds the shift issue...)
15:55 Zoffix NeuralAnomaly: status
15:55 NeuralAnomaly Zoffix, [✘] Next release will be in 1 day and 12 hours. Since last release, there are 38 new still-open tickets (13 unreviewed and 2 blockers) and 307 unreviewed commits. See http://perl6.fail/release/stats for details
16:42 lizmat joined #perl6-dev
16:54 Zoffix m: use MONKEY-TYPING; augment class Promise { my @ps; END { say "ending" }; method sink { $ = @ps.push: self; 42 } }; start { sleep 2; say "hi" }; say 42
16:54 camelia rakudo-moar 541597: OUTPUT: «42␤ending␤»
16:54 Zoffix m: use MONKEY-TYPING; augment class Promise { my @ps; END { $ = await @ps }; method sink { $ = @ps.push: self; 42 } }; start { sleep 2; say "hi" }; say 42
16:54 camelia rakudo-moar 541597: OUTPUT: «42␤hi␤»
16:55 Zoffix oh, nevermind
17:00 Zoffix This `Promise.new` line and other similar instances should probably use `self.new`, eh? https://github.com/rakudo/rakudo/blob/541597b/src/core/Promise.pm#L212
17:00 Zoffix m: class Promise::AutoAwait is Promise { my @ps; END { $ = await @ps }; method sink { @ps.push: self } }; dd WHAT Promise::AutoAwait.start: { sleep 2; say "hi" }; say 42
17:00 camelia rakudo-moar 541597: OUTPUT: «Promise␤42␤»
17:01 Zoffix ^ cause it makes the wrong object when you use subclasses
17:45 robertle joined #perl6-dev
17:57 Ven joined #perl6-dev
18:16 Ven_ joined #perl6-dev
18:32 Ven_ joined #perl6-dev
18:58 Ven joined #perl6-dev
19:04 AlexDaniel joined #perl6-dev
19:05 Ven_ joined #perl6-dev
19:11 dogbert17 m: Lock.^methods(:local)
19:11 camelia rakudo-moar 541597: ( no output )
19:11 dogbert17 m: say Lock.^methods(:local)
19:11 camelia rakudo-moar 541597: OUTPUT: «(lock unlock protect condition)␤»
19:11 dogbert17 m: say Match.^methods(:local)
19:11 camelia rakudo-moar 541597: OUTPUT: «No such method 'gist' for invocant of type 'NQPRoutine'␤  in block <unit> at <tmp> line 1␤␤»
19:15 dogbert17 is this in fact a bug?
19:15 dogbert17 commit: 2016.12 say Match.^methods(:local)
19:15 committable6 dogbert17, ¦2016.12: «(new ast prematch postmatch caps chunks make WHICH Str Numeric Bool ACCEPTS perl gist orig from to CURSOR made)»
19:16 dogbert17 commit: HEAD say Match.^methods(:local)
19:16 committable6 dogbert17, ¦HEAD(f3f99b3): «No such method 'gist' for invocant of type 'NQPRoutine'␤  in block <unit> at /tmp/pFcejqDaJb line 1␤ «exit code = 1»»
19:19 lizmat joined #perl6-dev
19:19 * Zoffix didn't think so the first time after seeing that
19:20 dogbert17 and why is that?
19:20 Zoffix That came in as part of uncurse IIRC. Match is pretty low-level so some of the methods aren't Perl 6 routines, but NQP ones
19:20 Zoffix c: 2017.04~50 say Match.^methods(:local)
19:20 committable6 Zoffix, ¦2017.04~50: «Cannot test this commit (Commit exists, but a perl6 executable could not be built for it)»
19:20 Zoffix c: 2017.04~100 say Match.^methods(:local)
19:20 committable6 Zoffix, ¦2017.04~100: «(new ast prematch postmatch caps chunks make WHICH Str Numeric Bool ACCEPTS perl gist orig from to CURSOR made)»
19:20 Zoffix yeah
19:21 Zoffix And now Match and Cursor got merged
19:21 dogbert17 so they were rewritten as part of uncurse then?
19:21 Zoffix And recalling my work on Perl 6 Routine Map this is not the only object that has this caveat
19:22 dogbert17 commit: HEAD say Map.^methods(:local)
19:22 committable6 dogbert17, https://gist.github.com/b5c640a37cc9b946be0b58e21a3448ff
19:23 dogbert17 zofbot: is Zoffix right?
19:23 Zoffix m: say Match.^methods(:local).map({(try .gist) ?? $_ !! .^name })
19:23 camelia rakudo-moar 541597: OUTPUT: «(STR MATCH CURSOR_NEXT CURSOR_OVERLAP CURSOR_MORE INTERPOLATE CALL_SUBRULE DYNQUANT_LIMITS OTHERGRAMMAR INDMETHOD INDRULE RECURSE BUILD clone Bool prematch postmatch caps chunks NQPRoutine NQPRoutine NQPRoutine NQPRoutine NQPRoutine NQPRoutine NQPRoutine…»
19:23 dogbert17 cool
19:28 pmurias joined #perl6-dev
19:28 Geth ¦ nqp/master: 7 commits pushed by pmurias++
19:28 Geth ¦ nqp/master: 60dd4ca4b8 | [js] Serialize stdin, stderr and stdout as nulls
19:28 Geth ¦ nqp/master: 58d71de046 | [js] Stringify the array of arguments passed to nqp::spawn
19:28 Geth ¦ nqp/master: 69085fbda2 | Test serialization of stdion/stdout/stderr as nulls
19:28 Geth ¦ nqp/master: c67f62df03 | [js] Implement nqp::lockfh/nqp::unlockfh
19:28 Geth ¦ nqp/master: 5995a00a31 | [js] Move some io stuff into methods on the file object
19:28 Geth ¦ nqp/master: bc22931cbd | [js] Stringify the env values passed to nqp::shell and nqp::spawn
19:28 Geth ¦ nqp/master: f1e1bf21ae | [js] Implement nqp::closedir, nqp::opendir, nqp::nextfiledir
19:28 Geth ¦ nqp/master: review: https://github.com/perl6/nqp/compare/0a67b5ce3e...f1e1bf21ae
19:43 Ven_ joined #perl6-dev
20:31 Ven joined #perl6-dev
20:38 Ven_ joined #perl6-dev
20:45 Ven_ joined #perl6-dev
20:51 Ven_ joined #perl6-dev
21:37 dct joined #perl6-dev
22:04 lizmat joined #perl6-dev
22:05 Zoffix ZofBot: I've got some chocolate coints, would you like some?
22:05 ZofBot Zoffix, Str
22:05 Zoffix OK then
22:05 timotimo the bot wants a whole string of 'em
22:05 * jnthn wonders if that's a typo, or really the dual of an int...
22:06 jnthn Oh dear, I mentioned category theory. It's probably bed time. :)
22:06 dct joined #perl6-dev
22:08 Zoffix oh, no, I got coins :) hah
22:09 timotimo aaah, a co-int
22:11 geekosaur :)
22:25 robertle wouldn't it be cool if Buf had index/rindex? obviously with needle being a Buf as well...
22:26 timotimo i'd like that
22:28 Zoffix would it be "cool" or would it be "useful"? :)
22:29 robertle useful. why are you ever using a Buf? because it is raw data from a file or a socket or so
22:30 Zoffix robertle: and why do you need an index?
22:30 robertle you will need to do something with it before you can relly use it. pack/unpack if you know the structure, decode, or ... chop into pieces at delimiters
22:30 Zoffix m: my $b1 = Blob.new: 'foobar'.encode; my $b2 = Blob.new: 'bar'.encode; dd $b1.decode('latin1').index: $b2.decode('latin1')
22:30 camelia rakudo-moar 541597: OUTPUT: «3␤»
22:31 robertle so having index/rindex would allow you to do one of the three things you typically want to do more easily. currently you have to kinda resort to []
22:31 robertle plus it should be really easy to implement if the "needle" is a compatible buffer: strstr() will do
22:31 Zoffix robertle: IMO a feature should be added to core when there's a clear case many users will benefit from it. The "wouldn't it be cool" ideas are best first implemented as modules IMO
22:32 Zoffix Like the Die module
22:32 robertle agreed in principle. what I am arguing is that this is a typical use case for a Buf...
22:32 Zoffix buggable: eco Die
22:32 buggable Zoffix, Die 'Perl 5 like die routine for note + exit': https://github.com/zoffixznet/perl6-Die
22:32 Zoffix Wouldn't it be cool if &note had an :exit argument that made it exit with the specified exit code?
22:33 robertle I get your point about "cute" functionality that should not be in core
22:34 robertle but let's look at a few cases: if you want to read data from a HTTP socket, you don't know the necoding until you have read the header. so you need to read octets for a while, and you need to find the end of the header in these
22:34 robertle same if you read an XML file
22:35 robertle well, not quite due to that weird stuff at the beginning that marks 16bit encodings
22:35 Zoffix More exactly my point is that if you make a module and feature sucks you can change it any way you want. If we add it to core, we're stuck with it for basically forever. And having the feature available as a module instead of a core is not a big burden on the users.
22:35 robertle right, unless there is a significant performance overhead
22:35 robertle not sure that is the case here though :)
22:36 robertle especially not for the HTTP case as the needle is really short and silly, so knuth-morris or whatever doesn't reeally save much
22:37 robertle over iterating and [] access
22:37 robertle so point taked
22:37 robertle taken
22:41 timotimo there's modules out there that want to split an http header section from the body section and they want to find a \r\n\r\n
22:42 robertle yeah, that was one use case I was thinking of
22:44 robertle you can do some weird search by hand by only checking every 4th octet and then backtracking as appropriately ;)
22:44 robertle but I guess iteration + [] access is still way slower than strstr()
22:44 robertle and also less clear
22:48 robertle I was also wondering if Buf should have a concatenate, but it turns out that ~ does the trick. but the docs say otherwise: "Coerces both arguments to Str and concatenates them."
22:55 timotimo m: say Buf.new(1, 2, 3).Stringy.perl
22:55 camelia rakudo-moar 541597: OUTPUT: «Cannot use a Buf as a string, but you called the Stringy method on it␤  in block <unit> at <tmp> line 1␤␤»
22:55 timotimo sounds like a doc bug
22:57 robertle m: buf8.new([1]) ~ buf8.new([2])
22:57 camelia rakudo-moar 541597: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "~" in expression ".new([1]) ~ buf8.new([2])" in sink context (line 1)␤»
22:57 nebuchadnezzar joined #perl6-dev
22:57 robertle m: say buf8.new([1]) ~ buf8.new([2])
22:57 camelia rakudo-moar 541597: OUTPUT: «Buf[uint8]:0x<01 02>␤»
22:57 robertle https://github.com/perl6/doc/issues/1314
22:57 Zoffix Buf *is* Stringy, so I'd expect .Stringy on it to just return self
22:57 Zoffix m: Buf.^roles.say
22:57 camelia rakudo-moar 541597: OUTPUT: «((Blob[T]) (Positional[T]) (Stringy))␤»
22:57 Zoffix Is that how it's meant to work?
22:58 timotimo i haven't the slightest >_<
22:58 Zoffix s: Blob.new, 'Stringy', \()
22:58 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/541597b/src/core/Buf.pm#L115
22:59 timotimo heh.
22:59 timotimo that's just fantastic
22:59 Zoffix https://github.com/rakudo/rakudo/commit/2121b16c038584481d3db6306ee38d45a748d9e8
23:00 timotimo This is meant to fix RT #122600 and RT #122827.
23:00 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=122600
23:00 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=122827
23:00 Zoffix Oh, well, I see utf8 ones convert to Str, so I guess it makes sense for it to die
23:01 Zoffix Ah ok, s/I\'d expect.+//
23:03 Zoffix robertle: dude, why did you make that an issue instead of a proper commit :D
23:04 Zoffix robertle: I've sent you an invite to perl6 github org, so you should be able to commit directly to most Perl 6 repos
23:04 timotimo somehow the end of the sentence about both arguments being Buf is gone
23:04 timotimo unless the whole sentence is supposed to be "If both arguments are L<Buf>, a combined buffer"
23:05 robertle I am totally not qualified for that! and I don't quite know how this stuff is meant to work on github: fork+PR seems rather heavy for small changes...
23:06 timotimo once you're in the perl6 org, you can just hit the little pen icon at the top right of any file and do your change right there in the browser
23:06 timotimo no fork, no pr (unless you want to make one, which the tool also offers)
23:08 Zoffix .ask jnthn should Blob.Stringy be dying (as it does right now)? We don't have any cases of .Numeric dying. .Stringy on `utf*` types coerces them to Str, which also feels wrongish. If we follow the Stringy for stringy is like Numeric for numerics, then .Stringy on all Blobs should just return `self`
23:08 yoleaux Zoffix: I'll pass your message to jnthn.
23:12 Zoffix robertle: don't worry about being qualified. If you mess something up, we can easily revert it. And yeah, you can just find the right file in the repo, click the pencil ( http://i.imgur.com/IQQNUtt.png ) make the change and click submit.
23:13 Zoffix \o/
23:17 Zoffix tho then we'd have an ambiguity with `Blob ~ Str` which isn't present in Numerics
23:17 Zoffix m: dd 'foo' ~ Buf.new(1, 2, 3)
23:17 camelia rakudo-moar 541597: OUTPUT: «Cannot use a Buf as a string, but you called the Stringy method on it␤  in block <unit> at <tmp> line 1␤␤»

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