Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-30

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:15 evalable6 joined #perl6
00:26 astj joined #perl6
00:28 thou joined #perl6
00:32 P6Bot joined #perl6
00:47 thou Is Cat / cat() (lazy Str interface) gone away?
00:48 thou any replacement I ought to know about?
00:53 Geth_ ¦ synopsebot: deec85bc50 | (Zoffix Znet)++ | 4 files
00:53 Geth_ ¦ synopsebot: First draft
00:53 Geth_ ¦ synopsebot:
00:53 Geth_ ¦ synopsebot: That doesn't seem to work on my local box :/
00:53 Geth_ ¦ synopsebot: Gonna try another one
00:53 Geth_ ¦ synopsebot: review: https://github.com/perl6/synopsebot/commit/deec85bc50
00:56 Cabanossi joined #perl6
00:58 Zoffix joined #perl6
00:58 Zoffix thou: it's yet to be implemented
00:58 thou Zoffix, OK, thanks. For some reason I imagined using it in the past, but probably it was just a dream.
01:01 P6Bot joined #perl6
01:26 Cabanossi joined #perl6
01:29 P6Bot joined #perl6
01:32 thou m: dd "nosuchfile".IO.open;   # Why isn't this X::IO::DoesNotExist error instead of X::AdHoc?
01:32 camelia rakudo-moar b9c985: OUTPUT: «Failure.new(exception => X::AdHoc.new(payload => "Failed to open file /home/camelia/nosuchfile: No such file or directory"), backtrace => Backtrace.new)␤»
01:33 Zoffix thou: it's yet to be implemented
01:33 Zoffix ^_^
01:33 thou :-)
01:33 Zoffix thou: there's actually a stale PR for that: https://github.com/rakudo/rakudo/pull/894
01:34 committable6 joined #perl6
01:34 committable6 joined #perl6
01:35 thou Thank you again
01:36 committable6 joined #perl6
01:37 bisectable6 joined #perl6
01:40 bisectable6 joined #perl6
01:53 ryn1x joined #perl6
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:56 synopsebot joined #perl6
02:04 synopsebot joined #perl6
02:08 unicodable6 joined #perl6
02:13 cdg joined #perl6
02:17 ryn1x joined #perl6
02:25 cdg joined #perl6
02:28 Ven`` joined #perl6
02:31 japhdc joined #perl6
02:34 vendethiel- joined #perl6
02:48 noganex_ joined #perl6
02:55 Cabanossi joined #perl6
02:57 piojo joined #perl6
03:12 evalable6 joined #perl6
03:18 japhdc joined #perl6
03:19 japhdc joined #perl6
03:23 mcmillhj joined #perl6
03:24 Cabanossi joined #perl6
03:38 mcmillhj joined #perl6
03:41 headcase_ joined #perl6
03:48 synopsebot joined #perl6
03:52 synopsebot joined #perl6
03:55 mcmillhj joined #perl6
04:01 aborazmeh joined #perl6
04:01 aborazmeh joined #perl6
04:04 lizmat joined #perl6
04:11 mcmillhj joined #perl6
04:14 Geth joined #perl6
04:19 ryn1x joined #perl6
04:30 mcmillhj joined #perl6
04:38 japhdc joined #perl6
04:40 Geth_ ¦ Inline-Python: 1c3839e1e8 | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json
04:40 Geth_ ¦ Inline-Python: Add missing prereq
04:40 Geth_ ¦ Inline-Python: review: https://github.com/niner/Inline-Python/commit/1c3839e1e8
04:40 Geth_ ¦ Inline-Python: 0df7fe03de | niner++ (committed using GitHub Web editor) | META6.json
04:40 Geth_ ¦ Inline-Python: Merge pull request #25 from zoffixznet/patch-2
04:40 Geth_ ¦ Inline-Python:
04:40 Geth_ ¦ Inline-Python: Add missing prereq
04:40 Geth_ ¦ Inline-Python: review: https://github.com/niner/Inline-Python/commit/0df7fe03de
04:42 japhdc joined #perl6
05:05 AnotherNick joined #perl6
05:08 mcmillhj joined #perl6
05:11 virtualsue joined #perl6
05:18 HoboWithAShotgun joined #perl6
05:24 mcmillhj joined #perl6
05:31 aborazmeh joined #perl6
05:31 aborazmeh joined #perl6
05:35 mcmillhj joined #perl6
05:40 ChoHag joined #perl6
05:48 mcmillhj joined #perl6
06:03 mcmillhj joined #perl6
06:20 mcmillhj joined #perl6
06:21 llfourn joined #perl6
06:22 cdg joined #perl6
06:25 ChoHag joined #perl6
06:26 Todd joined #perl6
06:26 domidumont joined #perl6
06:27 Todd Hi All,  I am having a head scratcher on a loop within a loop test.  http://vpaste.net/lkFkN  Would one of our intrepid heros mind seeing what I screwed up, this time?
06:30 wamba joined #perl6
06:30 domidumont joined #perl6
06:36 mcmillhj joined #perl6
06:38 Todd I changed line 26 to
06:38 Todd say "LineKey = <$LineKey>   key = <$key>  LineValue = <$LineValue>  value = <%x<$key>>";
06:38 evalable6 Todd, rakudo-moar b9c98531c: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/FstvIsfEW1␤Variabl…»
06:38 evalable6 Todd, Full output: https://gist.github.com/783f10fc72bea08614ecac4828fc01f9
06:38 Todd but the last `say %x` still comes out screwy like before
06:39 Todd what is meant by that gist link you sent me?
06:45 headcase joined #perl6
06:48 ryn1x joined #perl6
06:54 Cabanossi joined #perl6
06:54 mcmillhj joined #perl6
06:55 Todd actually, thiws one liner does not work
06:55 Todd perl6 -e ' my %x = ( "a" => "A", "b" => "x", "c" => "C" );my $y="b"; %x<[$y]>="BB"; say %x;'
06:55 Todd {[$y] => BB, a => A, b => x, c => C}
06:56 Todd is added an element to the hash instad of modify %x<b>   I think I do not know the proper syntax to put a variable in place of a key
07:06 AnotherNick left #perl6
07:09 TEttinger Todd: evalable6 is a bot, it sadly cannot explain the gist, only post the link
07:10 TEttinger m: my %x = ( "a" => "A", "b" => "x", "c" => "C" ); my $y="b"; %x<[$y]>="BB"; say %x
07:10 mcmillhj joined #perl6
07:10 camelia rakudo-moar b9c985: OUTPUT: «{[$y] => BB, a => A, b => x, c => C}␤»
07:10 Todd My problem boils down to me not knowing how to access an element in a hash with a variable as the key.  %x<$y> is what is messing me up.
07:10 TEttinger yeah I don't even know perl 6
07:11 TEttinger but it seems a lot of the channel is asleep, though the european crowd should be active soon
07:11 Todd %x<[$y]>="BB"    got added to the hash
07:11 TEttinger m: my %x = ( "a" => "A", "b" => "x", "c" => "C" ); my $y="b"; %x<$y>="BB"; say %x
07:11 camelia rakudo-moar b9c985: OUTPUT: «{$y => BB, a => A, b => x, c => C}␤»
07:11 Todd $y => BB  got added to the hash
07:11 TEttinger yep
07:12 setty1 joined #perl6
07:12 TEttinger so [] is some other syntax that doesn't seem to apply to changing a hash
07:12 TEttinger maybe the learn perl 6 in y minutes can help
07:12 Todd [] is just me trying everything I can think of
07:14 TEttinger m: my %x = ( "a" => "A", "b" => "x", "c" => "C" ); my $y="b"; %x{$y}="BB"; say %x
07:14 camelia rakudo-moar b9c985: OUTPUT: «{a => A, b => BB, c => C}␤»
07:14 TEttinger hooray
07:15 TEttinger m: my %x = "a" => "A", "b" => "x", "c" => "C" ; my $y="b"; %x{$y}="BB"; say %x
07:15 camelia rakudo-moar b9c985: OUTPUT: «{a => A, b => BB, c => C}␤»
07:15 Todd Yippee !!!!
07:15 Todd Thank you!
07:15 TEttinger so {} is used like [] in C for arrays, or in Lua for stuff like this
07:15 TEttinger m: say "abcd"{3}
07:15 camelia rakudo-moar b9c985: OUTPUT: «Type Str does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤»
07:16 TEttinger ha, the tutorial seems to be wrong there
07:17 TEttinger oh they had declared a thing
07:17 TEttinger m: sub postcircumfix:<{ }>(Str $s, Int $idx) { $s.substr($idx, 1); } say "abcd"{3}
07:17 camelia rakudo-moar b9c985: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3tr $s, Int $idx) { $s.substr($idx, 1); }7⏏5 say "abcd"{3}␤    expecting any of:␤        infix␤        infix stoppe…»
07:17 TEttinger m: sub postcircumfix:<{ }>(Str $s, Int $idx) { $s.substr($idx, 1); }; say "abcd"{3}
07:17 camelia rakudo-moar b9c985: OUTPUT: «d␤»
07:18 TEttinger yay
07:18 nadim joined #perl6
07:24 darutoko joined #perl6
07:26 Todd bye bye and than you again for the help!
07:28 andrzejku joined #perl6
07:28 mcmillhj joined #perl6
07:32 jeromelanteri joined #perl6
07:33 headcase joined #perl6
07:38 mcmillhj joined #perl6
07:39 headcase joined #perl6
07:39 Cabanossi joined #perl6
07:41 rindolf joined #perl6
07:42 jeromelanteri joined #perl6
07:51 mcmillhj joined #perl6
07:53 headcase joined #perl6
08:02 headcase joined #perl6
08:03 eliasr joined #perl6
08:07 mcmillhj joined #perl6
08:11 headcase joined #perl6
08:17 espadrine joined #perl6
08:19 hankache joined #perl6
08:22 mcmillhj joined #perl6
08:23 headcase joined #perl6
08:24 Cabanossi joined #perl6
08:34 mcmillhj joined #perl6
08:34 headcase joined #perl6
08:47 mcmillhj joined #perl6
08:50 ufobat joined #perl6
08:50 ufobat hi
08:50 gfldex_work joined #perl6
08:52 ufobat is it zef that causes scripts to be generated such as $HOME/.rakudobrew/moar-2017.09/install/share/perl6/site/bin/bailador? those are wrapper scripts that invoke CompUnit::RepositoryRegistry.run-script("bailador", :dist-name<Bailador>, :$name, :$auth, :$ver)
08:52 ufobat https://github.com/Bailador/Bailador/issues/265
08:52 ufobat is this a zef bug?
08:53 ufobat or what do i need to do that passing parameters to my binary would work?
08:53 lancew joined #perl6
08:58 headcase joined #perl6
09:03 atroxaper joined #perl6
09:04 margeas joined #perl6
09:05 atroxaper joined #perl6
09:06 timotimo "don't use --name" :\
09:07 timotimo it's not great that --name, --auth, and --ver are taken by the CUR system
09:07 atroxaper Hello! I have two questions. Firstly I remember github repo 'coke/perl6-roast-data'. As I understand it is not supported now. Is there some replacement?
09:09 atroxaper And second question. Why?
09:09 atroxaper m: {'3' => 'str', 3.Int => 'int'}.elems
09:09 camelia rakudo-moar 9bbfed: ( no output )
09:09 atroxaper m: say {'3' => 'str', 3.Int => 'int'}.elems
09:09 camelia rakudo-moar 9bbfed: OUTPUT: «1␤»
09:10 leont joined #perl6
09:12 timotimo because it's not an object hash
09:12 timotimo m: say :{'3' => 'str', 3.Int => 'int'}.elems
09:12 camelia rakudo-moar 9bbfed: OUTPUT: «2␤»
09:13 ufobat timotimo, but the other parameters in %* and @_ are passed, are they? because i dont see it being passed
09:13 timotimo they should, but name is already taken, isn't it?
09:16 ufobat right
09:17 Ven`` joined #perl6
09:17 lancew joined #perl6
09:18 ufobat i am just wondering how are all the other parameters passed?
09:18 timotimo potentially @*ARGS
09:18 lancew hi, is anyone here able to do invites for the Bailador slack?
09:19 ufobat me
09:19 lancew :-)
09:23 ryn1x joined #perl6
09:24 Cabanossi joined #perl6
09:27 atroxaper timotimo: wow. Will go and read about it :)
09:27 atroxaper And for first question?
09:39 evalable6 joined #perl6
09:47 timotimo oh, huh, python got a totally new distribution format: wheels
09:47 timotimo "Avoids arbitrary code execution for installation. (Avoids setup.py)", nice.
09:47 timotimo "Installation of a C extension does not require a compiler on Windows or macOS." - i wonder how they do this
09:49 teatime is it new?
09:50 timotimo the PEP for it has been created in 2012 it looks like
10:02 Zoffix atroxaper: that sounds like [Coke] might now about it. I've no idea what was in that repo
10:02 yoleaux 04:18Z <nine> Zoffix: added your user to the camelia VM where geth is running
10:03 Zoffix \o/
10:05 atroxaper Zoffix: there was information about night runs of all Perl 6 implementation on roast. For know which implementation has troubles. Or now all implementation (moar and jvm) pass roast all time?
10:07 Zoffix atroxaper: moar does and it's the only one actively developed, so I'm not surprised that repo's gone. jvm is kinda limping along, but it might be failing some newer tests
10:08 zakharyas joined #perl6
10:08 Zoffix m: say :{'3' => 'str', 3 => 'int', <3> => 'IntStr'}.elems
10:08 camelia rakudo-moar 9bbfed: OUTPUT: «3␤»
10:09 atroxaper Zoffix: even we have 'only' moar, I think, it is useful to know how stable current nom is. Ok.
10:09 leont timotimo: in perl5 we're also considering codeless installation, but ETUITS
10:09 atroxaper Zoffix: Yeah. timotimo++ already tell me about 'object hashes'.
10:10 Zoffix atroxaper: it passes all tests
10:10 atroxaper Zoffix: glad to hear :)
10:12 Zoffix atroxaper: well, the past couple of days it failed a few, but that's a rarity and IMO isn't something that we should be actively be doing as it makes it more difficult for other core devs to figure out if their changes break anything
10:12 Zoffix I think sprintf.t is still failing now
10:14 Zoffix So the docs say "Threads should be considered, for all intents, largely un-managed and their direct use should be avoided in user code"
10:15 Zoffix What's a good contruct for stuffing a value into a set and then a few minutes later removing it via a promise? I wrote this, but it's a bit bulky and still has a race in the lookup: https://github.com/perl6/synopsebot/blob/master/lib/SB/Plugin/RT.pm6#L10-L22
10:15 Zoffix Seems like 2 locks would be much easier to use
10:19 Zoffix .oO( write a module Set::Timed )
10:19 Zoffix meh
10:25 atroxaper Zoffix: I think some times that we want concurrent collection like in Java (I am a Java programmer). In that case is would prefer to wrap all interaction with %recent under Lock.
10:27 Zoffix That brings me to my first point that docs say Locks are low-level and should be avoided.
10:27 evalable6 joined #perl6
10:28 atroxaper Can we have a wrapper under some object to calculate something before and after any of original methods?
10:29 cdg joined #perl6
10:29 kurahaupo joined #perl6
10:30 kurahaupo joined #perl6
10:30 atroxaper Zoffix: yes. I think a Lock is not sooo low-level to avoid it. imo.
10:30 Zoffix You can wrap methods
10:30 Zoffix m: Str.^lookup("say").wrap: -> |c { put "about to say {c.gist}"; callsame; put "done" }; "meow".say
10:30 camelia rakudo-moar 9bbfed: OUTPUT: «about to say \("meow")␤meow␤done␤»
10:30 Zoffix atroxaper: um, do you mean in Java or in this language?
10:30 kurahaupo joined #perl6
10:30 atroxaper In Perl 6.
10:33 atroxaper I imaging some wrapper that can transfigurate any object into Monitor (https://github.com/jnthn/oo-monitors)
10:34 atroxaper And we can use methods of the object safety.
10:35 Zoffix It's probably as simple as `use OO::Monitors; my %recent := monitor :: is SetHash {}.new` and both the Channel and the Locks won't be needed
10:36 atroxaper Is it works now like that?!
10:36 atroxaper Or it would be cool?
10:41 Zoffix I'd've thought it'd work, but doesn't seem to:
10:41 Zoffix $ perl6 -e 'use v6.d.PREVIEW; use OO::Monitors; my %recent := monitor :: is Hash {}.new; await ^1000 .map: { slip (start { sleep rand; %recent.AT-KEY("foo")++ }), start { sleep 1+rand; %recent.AT-KEY("foo")-- }  }; say %recent'
10:42 Zoffix {foo => 7}
10:42 Zoffix Oh right
10:42 Zoffix The ++ itself happens outside the monitor
10:45 MasterDuke maybe the atomic cas op?
10:46 Zoffix it only works with atomic ints doesn't it?
10:46 atroxaper atomic is not what we want :)
10:46 Zoffix it'd work for my current usecase tho
10:49 evalable6 joined #perl6
10:49 Zoffix m: use v6.d.PREVIEW; my %recent := :{:foo(my atomicint $)}; await ^500 .map: { slip (start { sleep rand; %recent<foo>⚛++ }), start { sleep 2+rand; %recent<foo>⚛++ }  }; say %recent
10:49 camelia rakudo-moar 9bbfed: OUTPUT: «Type check failed in binding; expected Associative but got Block (-> ;; $_? is raw { #`...)␤  in block <unit> at <tmp> line 1␤␤»
10:49 MasterDuke is this for keeping count of recently seen RT #s for the new synopsebot?
10:49 Zoffix Block? o'cmon
10:49 Zoffix MasterDuke: yeah
10:49 atroxaper Zoffix: The 'my %recent := monitor :: is Hash {}.new' and solve problem with concurrent autovivification (https://docs.perl6.org/language/concurrency#Safety_Concerns)
10:49 Zoffix m: use v6.d.PREVIEW; my atomicint $foo; my %recent := :{:$foo}; await ^500 .map: { slip (start { sleep rand; %recent<foo>⚛++ }), start { sleep 2+rand; %recent<foo>⚛++ }  }; say %recent
10:50 camelia rakudo-moar 9bbfed: OUTPUT: «MoarVM panic: Could not spawn thread: errorcode -11␤»
10:50 Zoffix heh
10:51 Zoffix Actually it won't work for my usecase, since I don't pre-know the RT number
10:53 Zoffix "Expected a modifiable native int argument for '$target'" but that's what I gave it :/
10:53 Zoffix Oh well
10:53 * Zoffix goes to do @other-things
10:53 Zoffix And yeah, second atomic should be ⚛--
10:58 Zoffix Well, this I'd've thought to work: use v6.d.PREVIEW; use OO::Monitors; my %recent := monitor :: is Hash { method bump ($k) { self{$k}++ }; method debump ($k) { self{$k}-- } }.new; await ^500 .map: { slip (start { sleep rand; %recent.bump: "foo" }), start { sleep 2+rand; %recent.debump: "foo" }  }; say %recent
10:58 Zoffix But dies with ":Invocant of method 'unlock' must be an object instance of type 'Lock', not a type object of type 'Lock'.  Did you forget a '.new'?"
11:01 Zoffix works: use v6.d.PREVIEW; use OO::Monitors; my $recent := monitor { has %!stuff = {}; method d { %!stuff }; method bump ($k) { %!stuff{$k}++ }; method debump ($k) { %!stuff{$k}-- } }.new; await ^500 .map: { slip (start { sleep rand; $recent.bump: "foo" }), start { sleep 2+rand; $recent.debump: "foo" }  }; say $recent.d
11:02 MasterDuke cool
11:05 cdg joined #perl6
11:06 TimToady joined #perl6
11:14 Zoffix "Unsupported use of C++ constructor syntax; in Perl 6 please use method call syntax" are you kidding me >:O
11:14 Zoffix I never used C++ in my life.
11:14 jnthn Apparently you'd be decent at it :P
11:15 Zoffix m: class Foo {}; say new Foo:
11:15 camelia rakudo-moar 9bbfed: OUTPUT: «Foo.new␤»
11:15 Zoffix m: say new class Foo {}:
11:15 camelia rakudo-moar 9bbfed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of C++ constructor syntax; in Perl 6 please use method call syntax␤at <tmp>:1␤------> 3say new class 7⏏5Foo {}:␤»
11:15 Zoffix Oh well
11:17 Zoffix Ended up with this for synbot: https://github.com/perl6/synopsebot/commit/895a6adf03
11:18 Zoffix Cleared up the code nicely too
11:18 jnthn Nice use of OO::Monitors :)
11:18 jnthn And the "send a message to yourself in the future" pattern :)
11:19 Zoffix \o/
11:19 synopsebot joined #perl6
11:20 jnthn not $recently.seen: $^rt # cute :)
11:20 Zoffix :D
11:28 AlexDaniel squashable6: status
11:28 squashable6 AlexDaniel, Next SQUASHathon in 5 days and ≈22 hours (2017-10-07 UTC-12⌁UTC+14)
11:29 leont joined #perl6
11:39 Cabanossi joined #perl6
11:40 lancew joined #perl6
11:55 evalable6 joined #perl6
11:56 ryn1x joined #perl6
11:56 cdg joined #perl6
12:07 BenGoldberg joined #perl6
12:11 Ben_Goldberg joined #perl6
12:22 Zoffix left #perl6
12:25 Rawriful joined #perl6
12:38 HoboWithAShotgun joined #perl6
12:44 ShalokShalom_ joined #perl6
12:50 ChoHag joined #perl6
12:51 leah2 joined #perl6
12:54 Cabanossi joined #perl6
13:00 atroxaper jnthn: Hello. Can you help me with the Monitor? Why I got that exception? https://gist.github.com/atroxaper/0f435d2972fb2aa9472553543f0c550d
13:00 atroxaper I try to implement Java-style ConcurrentHashMap.
13:01 atroxaper I prefer to inherit a hash instead of aggregate for support map, grep and so on.
13:09 evalable6 joined #perl6
13:14 jnthn atroxaper: Probably because Hsah cheats on construction
13:15 jnthn atroxaper: Also, inherited methods won't be protected
13:15 atroxaper :(
13:15 jnthn Even if they were, grep and map return Seq
13:15 jnthn Those are lazy
13:15 jnthn So their working would not be protected anyway
13:15 atroxaper Good point.
13:16 atroxaper Then I have to use lock directly when need.
13:16 jnthn ConcurrentHashMap in Java probably is a lot more sophisticated than a hash that auto-locks
13:17 cdg joined #perl6
13:17 atroxaper Agree.
13:17 jnthn Worse, assignment takes place outside of a hash
13:17 jnthn In the general case
13:17 jnthn So AT-KEY returns a Scalar, and upon assignment to it it is bound into the Hash
13:19 atroxaper Many thanks for describe. I have to change my mind after Java :)
13:21 jnthn I used to teach .Net concurrency stuff, and I spent some time there on the fact that things like Stack/Queue and ConcurentStack/ConcurrentQueue had quite different APIs, because the things that make a convenient non-concurrent API don't usually make a good concurrent one.
13:22 jnthn (For example, you can't check if something is empty, and then pop from it, because it might become empty between the two)
13:23 atroxaper jnthn: One more think. In Java reading volatile variable (or enter/exit synchronized block) clears local case and thread can see changes of another thread. What about Perl 6 vision of another thread's changes? Is there some point in code when I can be sure that I load fresh value. Not 'actual', but fresh at least.
13:24 atroxaper local cache*
13:28 jnthn lock/unlock work out the same as enter/exit synchronized blocks; you can use the atomic fetch/assign operations otherwise to ensure values are published
13:28 jnthn Alternatively, to ensure all changes up to that point are, there's a memory barrier
13:29 jnthn See https://docs.perl6.org/routine/full-barrier and https://docs.perl6.org/type/Scalar#Atomic_Operations_on_Scalar for more info
13:30 jnthn There's also operator forms just below the routines
13:30 jnthn Which I find make the operators stand out nicely, and look alright if you have a font that doesn't decide to render them with a hot pink background :P
13:33 skids joined #perl6
13:34 atroxaper Does atomic fetch/assign clear _all_ local cache or just read/write actual data of the Scalar?
13:36 jnthn Just of that Scalar
13:36 jnthn full-barrier clears all
13:38 jnthn ah, hang on
13:38 * jnthn actually checks
13:39 atroxaper brilliant! Thank you. Gonna implement cache like Guava's CacheLoader (https://github.com/google/guava/wiki/CachesExplained#example)
13:40 abraxxa joined #perl6
13:40 jnthn https://github.com/MoarVM/MoarVM/blob/master/src/moar.h#L241
13:40 jnthn So they are actually doing full barriers
13:40 jnthn I'd misremembered that
13:41 jnthn https://github.com/ivmai/libatomic_ops/blob/master/src/atomic_ops.h#L82 is the relevant bit
13:42 jnthn I guess if there's demand that we can use operator adverbs to provide a way to get the weaker forms in the future
13:42 jnthn s/that/then/
13:44 atroxaper "they are actually doing full barriers" they == scalars' fetch/assign?
13:44 jnthn Yes
13:45 atroxaper As Java volatiles, ok.
13:45 jnthn They use the MVM_store/MVM_fetch that I linked to, and the second link is where the things they are #define'd to are defined with a bunch of explanation
13:46 atroxaper And they use AO_
13:46 atroxaper I see now.
13:50 llfourn joined #perl6
13:57 ab5tract_ o/ #perl6
13:57 yoleaux 15 Oct 2016 03:43Z <japhb> ab5tract_: I've got a pile of changes I'd like to make to Terminal::Print (some cleanup, some speedup, some API extensions, etc.).  How granular would you like PRs?  Or would you rather I just maintained my own fork?
13:57 yoleaux 15 Oct 2016 08:08Z <japhb> ab5tract_: I've sent you a PR with my first 11 commits (they're all very small, just minor cleanups/tuneups/fixes).  After that I'm probably going to have to expand the API for further improvements.
13:57 yoleaux 15 Oct 2016 08:41Z <japhb_> ab5tract_: What exactly is examples/clock.p6 trying to draw?  It looks overcomplicated to be just a circle, and it appears to be halfway through a rewrite.  I'd fix it but I don't know what it's trying to do.
13:57 yoleaux 16 Oct 2016 18:57Z <japhb> ab5tract_: Thank you for the Terminal::Print PR merge.  :-)
13:57 yoleaux 7 Nov 2016 14:56Z <viki> ab5tract_: I had to revert your PR #911 as it broke 6.c-errata. See https://github.com/rakudo/rakudo/pull/911#issuecomment-258854543
13:58 ab5tract_ been a long time since i've had a nick tail, apparently!
13:59 ab5tract_ is it currently possible to disable buffering for stdout ?
13:59 abraxxa joined #perl6
14:09 Cabanossi joined #perl6
14:09 tbrowder \o #perl6
14:10 MasterDuke ab5tract_: can you reopen it with :!buffering?
14:11 tbrowder Is there any way to use Test* modules to give an alternate description string for failures?
14:15 zakharyas joined #perl6
14:16 ab5tract_ hmm, interesting thought. I'll give that a try, MasterDuke
14:18 ab5tract_ though I can't seem to find much about buffering in the docs
14:19 ab5tract_ just this tantalizing bit here: "Using getc to get a single keypress from a terminal will only work properly if you've set the terminal to "unbuffered"."
14:20 lancew joined #perl6
14:20 MasterDuke jnthn: recently made some changes to the default buffering behavior
14:21 ab5tract_ I'm asking because I've made some changes to Terminal::Print that I expected to have a larger impact on FPS
14:21 ab5tract_ removing a lot of introspection and objects along the way
14:23 MasterDuke i think the tldr is that output attached to a tty is now buffered by default
14:23 ab5tract_ but the performance runs about as well as the previous version.
14:25 jnthn MasterDuke: Nope, buffering is explcitly not enabled for TTYs
14:25 jnthn *explicitly
14:25 jnthn It's for non-TTYs only
14:25 jnthn So for output to one of those, there was no change
14:26 MasterDuke whoops, i got it backwards. ab5tract_ ^^^
14:27 ab5tract_ jnthn: interesting.. i guess we've gotten the costs of object instantation and instrospection way down!
14:28 jnthn lizmat++ recently did some changes to speed up instantiation
14:35 broquain1 joined #perl6
14:36 khw joined #perl6
14:51 HoboWithAShotgun joined #perl6
15:02 leah2 joined #perl6
15:03 leont joined #perl6
15:07 cdg joined #perl6
15:20 kaare_ joined #perl6
15:32 synopsebot joined #perl6
15:39 virtualsue joined #perl6
15:47 ab5tract_ jnthn: so if tty is no longer buffered, would that make setting stdout to makeraw via termios redundant?
15:48 jnthn It never was buffered
15:48 jnthn So if you had to before, then you'll still have to
15:49 jnthn I don't know what setting stdout to makeraw does/means, so no idea on that part :)
15:53 ryn1x joined #perl6
15:54 Aaronepower joined #perl6
15:55 timotimo nadim: i wonder why Terminal::Print isn't in the dependencies of Data::Dump::Tree?
15:59 sjn o7
15:59 * sjn is playing around with perl6-docs today o/
16:02 leah2 joined #perl6
16:04 ab5tract_ jnthn: it means that "all output processing is disabled"
16:04 ab5tract_ whatever that means ;)
16:05 ab5tract_ something about carriage returns and baudrates, if I understand the manpage correctly
16:08 cdg joined #perl6
16:09 troys joined #perl6
16:12 domidumont joined #perl6
16:13 ryn1x joined #perl6
16:15 timo joined #perl6
16:28 chakli joined #perl6
16:34 chakli hey, can someone try this and tell me if something is wrong here, in HTTP::UserAgent if i do say $response.content i get just the content but if i do say "$response.content" i get the header too
16:36 ugexe "$response.content" isn't calling .content is it?
16:37 ugexe it'd have to be "$response.content()" or "{$response.content}"
16:37 ugexe otherwise you are getting `my $str = $response.Str ~ ".content"`
16:40 chakli ok, thanks got it
16:46 Rawriful joined #perl6
17:01 evalable6 joined #perl6
17:04 HoboWithAShotgun so i used zef locate to see where a module file is, but after i changed it, i don't see my changes when i run it
17:04 Rawriful joined #perl6
17:04 HoboWithAShotgun is there a precompiled cache or somethng i need to clear?
17:07 timotimo you're not supposed to change files in the compunitrepo
17:07 timotimo they ought to be immutable
17:08 HoboWithAShotgun you're not supposed to call private methodes either :) i just want to check if a variable contains what i think it does
17:10 cdg joined #perl6
17:12 yht joined #perl6
17:12 timotimo the safest way is to grab the source of the distro you're looking at, modify it, and either install it or use -I for it
17:14 Aaronepower joined #perl6
17:19 kaare__ joined #perl6
17:30 timo joined #perl6
17:31 cdg joined #perl6
17:38 kaare_ joined #perl6
17:44 releasable6 joined #perl6
17:47 Geth ¦ whateverable: 62953b6285 | (Aleks-Daniel Jakimenko-Aleksejev)++ | services/whateverable@.service
17:47 Geth ¦ whateverable: Add missing .precomp
17:47 Geth ¦ whateverable:
17:47 Geth ¦ whateverable: Otherwise the bot won't start if Whateverable.pm6 was changed.
17:47 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/62953b6285
17:47 Geth ¦ whateverable: 6b1507476f | (Aleks-Daniel Jakimenko-Aleksejev)++ | services/whateverable@.service
17:47 Geth ¦ whateverable: Be a bit more forgiving about starting new processes
17:47 Geth ¦ whateverable:
17:47 Geth ¦ whateverable: Otherwise IRC::Client module does not seem to work… not that this
17:47 Geth ¦ whateverable: usage is intended, but sometimes it is useful.
17:47 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/6b1507476f
17:47 Geth ¦ whateverable: 45e09f4827 | (Aleks-Daniel Jakimenko-Aleksejev)++ | sandbox/answer
17:47 Geth ¦ whateverable: Add sandbox folder
17:47 Geth ¦ whateverable:
17:47 Geth ¦ whateverable: It will take more work to get stuff chdir-ed there, but this is good
17:47 Geth ¦ whateverable: enough for now.
17:47 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/45e09f4827
17:49 itaipu joined #perl6
17:57 Ben_Goldberg joined #perl6
18:01 quotable6 joined #perl6
18:02 HoboWithAShotgun joined #perl6
18:02 HoboWithAShotgun tx timotimo i will do as told
18:07 kybr joined #perl6
18:09 ken joined #perl6
18:12 mst https://github.com/nikomatsakis/rayon#rayon is interesting
18:25 evalable6 joined #perl6
18:29 telex joined #perl6
18:32 cdg joined #perl6
18:33 chakli joined #perl6
18:34 Zoffix joined #perl6
18:45 atroxaper joined #perl6
18:47 Zoffix joined #perl6
18:48 Zoffix A while back I was asking how to disable part/join notifications in weechat's "hotlist" bar... Finally figured out. /set weechat.look.buffer_notify_default message  https://weechat.org/files/doc/devel/weechat_user.en.html#option_weechat.look.buffer_notify_default
18:49 Zoffix left #perl6
18:49 Zoffix joined #perl6
18:53 Zoffix .ask teatime how's the regex range thing going?
18:53 yoleaux Zoffix: I'll pass your message to teatime.
18:54 Cabanossi joined #perl6
19:04 eroux joined #perl6
19:05 HoboWithAShotgun m: $*SPEC.join("foo/bar").say;
19:05 camelia rakudo-moar 4d0ead: OUTPUT: «Too few positionals passed; expected 4 arguments but got 2␤  in block <unit> at <tmp> line 1␤␤»
19:05 HoboWithAShotgun m: $*SPEC.join("foo", "bar").say;
19:05 camelia rakudo-moar 4d0ead: OUTPUT: «Too few positionals passed; expected 4 arguments but got 3␤  in block <unit> at <tmp> line 1␤␤»
19:05 HoboWithAShotgun m: $*SPEC.join($, "foo", "bar").say;
19:05 camelia rakudo-moar 4d0ead: OUTPUT: «foo/bar␤»
19:05 Zoffix HoboWithAShotgun: don't use $*SPEC
19:05 Zoffix m: say 'foo'.add: 'bar'
19:05 camelia rakudo-moar 4d0ead: OUTPUT: «No such method 'add' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
19:06 Zoffix m: say 'foo'.IO.add: 'bar'
19:06 camelia rakudo-moar 4d0ead: OUTPUT: «"foo/bar".IO␤»
19:06 silug joined #perl6
19:06 Zoffix https://docs.perl6.org/language/io-guide#Leave_$*SPEC_Alone
19:06 HoboWithAShotgun i see
19:18 lichtkind joined #perl6
19:18 Geth ¦ doc: a917d93624 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/io-guide.pod6
19:18 Geth ¦ doc: De-villify $*SPEC a bit
19:18 Geth ¦ doc:
19:18 Geth ¦ doc: Since some methods don't got an alternative in IO::Path
19:18 synopsebot Link: https://doc.perl6.org/language/io-guide
19:18 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a917d93624
19:19 Geth ¦ doc: d152a22fc9 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/io-guide.pod6
19:19 Geth ¦ doc: Link to devnull from all IO::SPECs
19:19 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d152a22fc9
19:19 synopsebot Link: https://doc.perl6.org/language/io-guide
19:33 cdg joined #perl6
19:43 geekosaur joined #perl6
19:53 synopsebot joined #perl6
19:54 kurahaupo joined #perl6
20:08 wamba joined #perl6
20:19 teatime Zoffix: to answer your question: http://i0.kym-cdn.com/photos/images/facebook/000/234/765/b7e.jpg
20:19 yoleaux 18:53Z <Zoffix> teatime: how's the regex range thing going?
20:20 Zoffix teatime: does it mean I am free to fix it or do you still want to fix it? :)
20:21 teatime help yourself.
20:22 teatime I will be interested to see the right answer.
20:22 Zoffix \o/
20:22 TEttinger joined #perl6
20:22 Zoffix Some time tomorrow. I think I'm done coding for today :)
20:23 teatime it would be easy enough to duplicate the logic from elsewhere, but that can't be the right thing
20:24 Cabanossi joined #perl6
20:26 teatime also do note this doesn't error but doesn't actually work either
20:26 teatime m: 'xx' ~~ / 'x' ** 0.9..2 /
20:26 camelia rakudo-moar 4d0ead: ( no output )
20:27 teatime m: say 'xx' ~~ / 'x' ** 0.9..2 /
20:27 camelia rakudo-moar 4d0ead: OUTPUT: «Nil␤»
20:27 gigavinyl joined #perl6
20:29 HoboWithAShotgun joined #perl6
20:30 geekosaur teatime, that one is known/expected, there are parse ambiguities. use braces around the range
20:31 teatime hmm
20:33 epony joined #perl6
20:34 cdg joined #perl6
20:38 Aaronepower joined #perl6
20:52 HoboWithAShotgun is there a method to dump out the interface (methods etc) of $something ?
20:52 geekosaur that lives in the MOP
20:53 geekosaur m: dd Int.^methods
20:53 camelia rakudo-moar 4d0ead: OUTPUT: «(method new (Int $: | is raw) { #`(Method|30631008) ... }, method Int (Int $: *%_) { #`(Method|30631160) ... }, method Num (Int:D $: *%_) { #`(Method|30631312) ... }, method Rat (Int:D $: $?, *%_) { #`(Method|30631464) ... }, method FatRat (Int:D $: $?, …»
20:54 ryn1x joined #perl6
20:54 Zoffix m: dd Int.^methods».name
20:54 camelia rakudo-moar 4d0ead: OUTPUT: «("new", "Int", "Num", "Rat", "FatRat", "abs", "Bridge", "chr", "sqrt", "base", "polymod", "expmod", "is-prime", "floor", "ceiling", "round", "lsb", "msb", "narrow", "Range", "atanh", "sign", "asech", "sin", "tan", "atan2", "acosech", "truncate", "asinh",…»
20:54 Cabanossi joined #perl6
20:54 Zoffix m: dd Int.^methods(:all)».name
20:54 camelia rakudo-moar 4d0ead: OUTPUT: «("new", "Int", "Num", "Rat", "FatRat", "abs", "Bridge", "chr", "sqrt", "base", "polymod", "expmod", "is-prime", "floor", "ceiling", "round", "lsb", "msb", "narrow", "Range", "atanh", "sign", "asech", "sin", "tan", "atan2", "acosech", "truncate", "asinh",…»
20:55 Zoffix (:all includes those from Any and Mu as well)(
20:59 geekosaur joined #perl6
21:12 cpage_ joined #perl6
21:15 HoboWithAShotgun how do i instantiate a class whichs name i have in $classname?
21:16 timotimo you grab the type object from your lexical environment using ::($classname) and call your favourite constructor method on it, for example .new
21:19 Ven`` joined #perl6
21:22 Zoffix m: class Meows { method mew { say "\c[CAT]" } }; my $what = "Meows"; my $do = "mew"; ::($what)."$do"()
21:22 camelia rakudo-moar 4d0ead: OUTPUT: «?␤»
21:31 thou joined #perl6
21:35 cdg joined #perl6
21:42 HoboWithAShotgun ok, this works: https://hastebin.com/uvoqiyufez.pl
21:42 HoboWithAShotgun any red flags?
21:43 nadim joined #perl6
21:44 HoboWithAShotgun with all these flexibility, does it even make sense to speak about idiomatic perl6?
21:44 atroxaper joined #perl6
21:45 gfldex HoboWithAShotgun: The idioms might actually be build in.
21:47 kyan joined #perl6
21:47 gfldex HoboWithAShotgun: you may want to be careful with `.pl`. That will bite you on Windows.
21:48 HoboWithAShotgun that's just the paste site doing that
21:48 HoboWithAShotgun the actual file is called Vision.pm6 :)
21:50 gfldex HoboWithAShotgun: you may want to give gist-paste a try http://manpages.org/gist-paste
21:53 grondilu m: say { a => pi } (+) { a => -pi }
21:53 camelia rakudo-moar 4d0ead: OUTPUT: «Bag(a(3))␤»
21:53 grondilu is that how  (+) is supposed to behave with hashes?
21:53 grondilu m: say { a => pi } (+) { a => "foo" }
21:53 camelia rakudo-moar 4d0ead: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤»
21:54 grondilu m: say { a => 2 } (+) { a => 1 }
21:54 camelia rakudo-moar 4d0ead: OUTPUT: «Bag(a(3))␤»
21:54 nhywyll joined #perl6
21:54 grondilu m: say { a => pi } (+) { a => -1 }
21:54 camelia rakudo-moar 4d0ead: OUTPUT: «Bag(a(3))␤»
21:54 grondilu m: say { a => pi }.Mix (+) { a => -1 }.Mix
21:54 camelia rakudo-moar 4d0ead: OUTPUT: «Mix(a(2.14159265358979))␤»
21:55 grondilu m: say { a => pi }.Mix (+) { a => -pi }.Mix
21:55 camelia rakudo-moar 4d0ead: OUTPUT: «Mix()␤»
22:02 Zoffix grondilu: yup
22:04 Zoffix Bags don't have negative weights, so the -pi one is like zero, and Bags have integer weights, so the pi gets coerced into Int, hence Bag(a(3))
22:04 grondilu but why should Bags prevail other Mixes?
22:04 grondilu I mean shouldn't { a => -pi } be cast into a Mix instead of a Bag?
22:05 Zoffix grondilu: unsure. You should ask lizmat. She hammered down all of these semantics a few months ago
22:07 Mrofnet joined #perl6
22:24 evalable6 joined #perl6
22:24 DerAlex joined #perl6
22:35 cdg joined #perl6
22:36 epony joined #perl6
22:42 ryn1x joined #perl6
22:47 hoffentlichja joined #perl6
22:49 atroxaper joined #perl6
22:52 HoboWithAShotgun can i have lazy attributes? say class f { has $x; has $o = Some::Thing.new($x); } now x might not be known when the object is constructed
22:53 HoboWithAShotgun can i make that lazy so the the S::T.new gets called when o get accessed ?
22:53 HoboWithAShotgun and not when the object is constructed
22:54 Cabanossi joined #perl6
22:55 ryn1x joined #perl6
22:55 grondilu HoboWithAShotgun: do it in the BUILD submethod
22:55 grondilu or rather the TWEAK
22:56 grondilu oh wait, you mean when accessed
22:56 grondilu not constructed, my bad
22:56 hoffentlichja joined #perl6
23:00 samcv how do you get a module's version number from inside the module's code?
23:12 headcase joined #perl6
23:26 Ven`` joined #perl6
23:27 ryn1x joined #perl6
23:36 cdg joined #perl6
23:47 headcase_ joined #perl6
23:55 headcase joined #perl6
23:58 atroxaper joined #perl6

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

Perl 6 | Reference Documentation | Rakudo