Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-10-03

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:06 dalek doc: 1c5f8fb | gfldex++ | util/list-missing-methods.p6:
00:06 dalek doc: handle enums
00:06 dalek doc: review: https://github.com/perl6/doc/commit/1c5f8fb57d
00:15 pierre_ joined #perl6
00:19 mcmillhj joined #perl6
00:21 adamfish joined #perl6
00:24 adamfish left #perl6
00:39 mcmillhj joined #perl6
00:50 mcmillhj joined #perl6
01:02 mcmillhj joined #perl6
01:09 canopus joined #perl6
01:21 mcmillhj joined #perl6
01:24 gfldex lolibloggedagain! https://gfldex.wordpress.com/2016/10/03/being-lazy-on-this-side-of-the-channel/
01:24 pierre_ joined #perl6
01:47 ilbot3 joined #perl6
01:47 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:50 mcmillhj joined #perl6
01:51 Sqirrel joined #perl6
02:00 SmokeMachine____ What is the difference between ..., !!!, ??? ?
02:04 SmokeMachine____ m: role A {method a{...}}; class B does A {}
02:04 camelia rakudo-moar 3a6cd8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'a' must be implemented by B because it is required by a role␤at <tmp>:1␤»
02:04 SmokeMachine____ m: role A {method a{!!!}}; class B does A {}
02:04 camelia rakudo-moar 3a6cd8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'a' must be implemented by B because it is required by a role␤at <tmp>:1␤»
02:04 SmokeMachine____ m: role A {method a{???}}; class B does A {}
02:04 camelia rakudo-moar 3a6cd8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'a' must be implemented by B because it is required by a role␤at <tmp>:1␤»
02:05 geekosaur ... is fail, !!! is die, ??? is warn
02:05 TimToady but they're all officially "stubs"
02:07 pierre_ joined #perl6
02:07 SmokeMachine____ camelia: gave the same error for the all 3...
02:07 geekosaur yes, because you didn't test it
02:08 geekosaur you got the same compile time error for composing the method; these are runtime things when you *call* a, not when you fail to compose it because you never defined it in the class
02:08 SmokeMachine____ geekosaur: but ??? Shouldn't give a warning?
02:09 SmokeMachine____ So on that usage, all 3 are the same?
02:09 geekosaur you didn't use it, it never got invoked
02:09 geekosaur again, these are *runtime* failures. you mis-declared the class and got a *compile* time error
02:09 geekosaur un related
02:10 geekosaur m: role A {method a{;}}; class b does A {}
02:10 camelia rakudo-moar 3a6cd8: ( no output )
02:10 geekosaur er
02:10 geekosaur ok, right, it detects that specially when composing roles, but it still gave you the compile time error instead. which is kinda magic
02:10 geekosaur and unrelated to the runtime behavior
02:10 TimToady in a role, any stub means "must be declared in the class"
02:11 SmokeMachine____ TimToady: ok! Thanks!
02:11 SmokeMachine____ geekosaur: thank you too!
02:12 geekosaur sadly the magic does make it somewhat confusing because ou might expect different behavior at compile time. but it's not clear what a compile time warning, for eample, would accomplish
02:13 SmokeMachine____ geekosaur: yes... in the case that I was trying to use it, I was wanting to ??? Give me a compile time warning...
02:13 geekosaur that could probably be done, but not clear that actually makes sense
02:14 SmokeMachine____ Wouldn't that makes sense?
02:14 SmokeMachine____ *make
02:18 SmokeMachine____ My case is: I have a role that has 2 "load" methods, 1 with the signature (::?CLASS:U: $id) and the other one with the signature: (::?CLASS:D) the first one instanciate a object of ::?CLASS (::?CLASS.new: :$id) and call the second one...
02:19 SmokeMachine____ But I'd like to give some options to the class that will does the role:
02:19 isBEKaml joined #perl6
02:20 SmokeMachine____ I forgot to say: the second one is a stub!
02:20 SmokeMachine____ 1st option, write a "defined" load function
02:21 SmokeMachine____ Or write the "undefined" load function that does not use the defined version...
02:22 SmokeMachine____ But if I do the 2nd option, it gives me a compile time error... because the defined version is a stub...
02:23 SmokeMachine____ But it will not be used... so if it were a warning that would be ok...
02:23 SmokeMachine____ This is the role that I'm writing (not done yet): https://github.com/FCO/JSON-API/blob/master/lib/JSON/API/Resource.pm6
02:25 SmokeMachine____ Any idea to do what I want?
02:26 kaare_ joined #perl6
02:37 zakharyas joined #perl6
02:39 seatek The more I dig, after I get past my next frustrated thing, the more I like it, and appreciate how it was done.
02:42 mcmillhj joined #perl6
02:46 jdahl joined #perl6
02:52 pierre_ joined #perl6
02:52 mcmillhj joined #perl6
02:54 labster joined #perl6
02:59 noganex joined #perl6
03:05 mcmillhj joined #perl6
03:05 BenGoldberg SmokeMachine____, Out of curiosity, why aren't JSON::API::Attr and JSON::API::Id simply empty roles?
03:06 SmokeMachine____ BenGoldberg: I think it'll do something in the future... (but not sure yet)
03:09 SmokeMachine____ And I think I had read somewhere that's a good practice to create a method with the same name of the positional par when using a trait on a attribute...
03:09 SmokeMachine____ BenGoldberg: ^^
03:10 SmokeMachine____ My memory isn't very good
03:14 stmuk joined #perl6
03:33 mcmillhj joined #perl6
03:34 TimToady seatek++ for persistence
03:36 zacts joined #perl6
03:40 pierre_ joined #perl6
03:50 _slade_ joined #perl6
03:53 shinobicl Hi all... how can i print the current method/class where i am in (for a logging function) ?
03:54 wamba joined #perl6
03:57 shinobicl that is, to define the LOG function in an utility .pm file, and then use it anywhere, and that this LOG funcion shows from where it was called.
04:02 AlexDaniel shinobicl: https://docs.perl6.org/type/CallFrame ?
04:03 cibs joined #perl6
04:05 geekosaur m: class Foo { method bar { say $?CLASS, "::", $?ROUTINE;}}; Foo.new
04:05 camelia rakudo-moar 3a6cd8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$?ROUTINE' is not declared. Did you mean 'Routine'?␤at <tmp>:1␤------> 3s Foo { method bar { say $?CLASS, "::", 7⏏5$?ROUTINE;}}; Foo.new␤»
04:07 geekosaur m: class Foo { method bar { say $?CLASS, "::", &?ROUTINE.name;}}; Foo.new.bar
04:07 camelia rakudo-moar 3a6cd8: OUTPUT«(Foo)::bar␤»
04:08 geekosaur m: class Foo { method bar { say ::?CLASS, "::", &?ROUTINE.name;}}; Foo.new.bar
04:08 camelia rakudo-moar 3a6cd8: OUTPUT«(Foo)::bar␤»
04:08 geekosaur m: class Foo { method bar { say $?CLASS.name, "::", &?ROUTINE.name;}}; Foo.new.bar
04:08 camelia rakudo-moar 3a6cd8: OUTPUT«No such method 'name' for invocant of type 'Foo'␤  in method bar at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
04:08 geekosaur meh
04:09 geekosaur m: class Foo { method bar { say $?CLASS.^name, "::", &?ROUTINE.name;}}; Foo.new.bar
04:09 camelia rakudo-moar 3a6cd8: OUTPUT«Foo::bar␤»
04:09 jdahl joined #perl6
04:19 pierre_ joined #perl6
04:40 stmuk_ joined #perl6
04:42 mcmillhj joined #perl6
04:59 Cabanossi joined #perl6
05:06 dalek perl6.org/add-resources-redirect: 852b5a1 | (perl6.org website)++ | source/.htaccess:
05:06 dalek perl6.org/add-resources-redirect: Include redirect from old /documentation/ to new /resources/
05:06 dalek perl6.org/add-resources-redirect: review: https://github.com/perl6/perl6.org/commit/852b5a13b8
05:08 mcmillhj joined #perl6
05:11 pierre_ joined #perl6
05:23 domidumont joined #perl6
05:26 _slade_ joined #perl6
05:29 domidumont joined #perl6
05:30 mcmillhj joined #perl6
05:35 moritz uhm, isn't all of perl6.org about resources? what's wrong with /documentation/ ?
05:37 moritz is there any discussion about this in an issue tracker that I should read?
05:53 TimToady I guess to millenials "documentation" is something you avoid reading because it's required, while "resources" are there to be consulted when you feel like it.  :)
05:54 TimToady *millennials
05:55 TimToady I guess "millenial" would rhyme with "menial"
06:04 geekosaur not sure if it's that or just maintaining the link to the original (annum)
06:07 domidumont joined #perl6
06:08 domidumont joined #perl6
06:32 ShimmerFairy joined #perl6
06:32 mcmillhj joined #perl6
06:41 pierre_ joined #perl6
06:46 mempko joined #perl6
06:51 bjz joined #perl6
06:54 TEttinger I guess to some people millennials are a monolithic bunch of slackers
06:55 TEttinger have fun in your next hundred years of code I guess
07:04 domidumont joined #perl6
07:07 ecocode joined #perl6
07:12 rindolf joined #perl6
07:12 nadim_ joined #perl6
07:13 ecocode joined #perl6
07:15 wamba joined #perl6
07:21 huf_ it's the yooths that are the problem. they have no respect for their elders, just like the yooths of ancient greece had no respect for their elders.
07:21 huf_ we've been on a constant downward slide since antiquity
07:22 mcmillhj joined #perl6
07:22 bjz joined #perl6
07:31 pierre_ joined #perl6
07:34 pdcawley joined #perl6
07:51 g4 joined #perl6
07:51 g4 joined #perl6
07:53 mcmillhj joined #perl6
07:58 cibs joined #perl6
08:05 dakkar joined #perl6
08:07 labster joined #perl6
08:07 labster joined #perl6
08:08 masak huf_: does anyone seriously doubt that? :P
08:08 masak (hi, #perl6)
08:08 arnsholt o/
08:09 huf_ masak: no, this assumption is in core
08:09 masak "constant downward slide" sounds like a good general summary of the time since antiquity. we've had a weird blip with enlightenment and stuff, but recent developments show that it didn't catch on.
08:10 huf_ yeah i know, our washing machines cant even hold a conversation anymore
08:10 arnsholt Constant downward slide since the golden age of heroes =p
08:10 huf_ not like back in the good old days of slavery in the antique world
08:10 masak huf_: I notice traces of voice in your sarcasm :P
08:10 arnsholt Even ancient Greece was merely the age of iron; not even the silver age
08:11 huf_ masak: oh no, that rather detracts from the point :)
08:11 masak :P
08:12 masak sorry for my bleak cynicism, everybody. I've ingested the coffee, but it hasn't been absorbed yet. :P
08:12 arnsholt Your caffeine stream is recaffeinating, good =)
08:12 huf_ i'm not sure how much of a blip the enlightenment was. have you seen their toilets?
08:12 masak arnsholt: tell me more about that. ancient Greece was a mere shadow of... what?
08:13 DrForr Too much blood in the caffeine stream, eh.
08:13 huf_ a taller ancient greece hovering above greece
08:13 aries_liuxueyang joined #perl6
08:13 arnsholt masak: The golden age of heroes! When heroes and gods walked the Earth and things were awesome^Wterribly exciting
08:13 huf_ ww2?
08:15 arnsholt https://en.wikipedia.org/wiki/Ages_of_Man#Hesiod.27s_Five_Ages
08:15 arnsholt Turns out I'm misremembering somewhat, but the general gist of it is right
08:15 arnsholt "Hesiod finds himself in the Iron Age. During this age humans live an existence of toil and misery. Children dishonor their parents, brother fights with brother and the social contract between guest and host (xenia) is forgotten."
08:16 arnsholt Hesiod being ~750-650 BCE, according to Wikipedia =)
08:16 DrForr Heh. Currently watching (for background noise) "Secrets of Stonehenge' (sadly no /Spinal Tap/ references made yet.)
08:17 Actualeyes joined #perl6
08:26 Dunearhp joined #perl6
08:26 mcmillhj joined #perl6
08:27 masak arnsholt: could simply be that amnesiac nostalgia is a very old thing. :P
08:29 DrForr Nostalgia ain't what it used to be.
08:29 masak even meta-nostalgia is beginning to feel a bit jaded.
08:30 huf_ back in the day, old people used to complain better about the youth
08:31 huf_ but now that they're made up of said former useless youth grown old, they're shit at even that
08:31 masak they can't even nostalgia right
08:31 * masak .oO( "you had one job" )
08:32 aries_liuxueyang joined #perl6
08:39 mcmillhj joined #perl6
08:39 arnsholt masak: Or that the youth of today are simply terrible. I know which one I'm betting on =p
08:42 DrForr "Kids today."
08:44 masak arnsholt: yes. people have saying it for ages, but this generation of old people happens to be right about it for the first time in history. it makes sense.
08:52 arnsholt I know, right!
08:52 arnsholt Stopped clocks, and all that
08:52 MARTIMM joined #perl6
08:57 masak I believe "The time is out of joint" was uttered very recently.
08:57 mcmillhj joined #perl6
08:58 masak we live in exceptional times.
09:00 * masak stops sarcasm-trolling and drinks more coffee
09:05 domidumont joined #perl6
09:22 ecocode` joined #perl6
09:23 user9 joined #perl6
09:30 mcmillhj joined #perl6
09:33 pierre_ joined #perl6
09:37 aries_liuxueyang joined #perl6
09:40 zakharyas joined #perl6
09:47 bjz joined #perl6
09:49 tbrowder .tell timotimo I've experimented all I can with the travis build for my use case and can't come up with a better solution than my original one (I'll tweak the gist a bit later, though).  I thought using environment vars would help but it just complicated the build by littering it with sub-builds, one for every env var in the .travis.yml file!
09:53 bjz joined #perl6
10:03 lizmat gfldex: thanks for the overview  :-)
10:03 gfldex yw
10:03 FROGGS joined #perl6
10:05 FROGGS o/
10:07 ocbtec joined #perl6
10:09 gregf_ joined #perl6
10:26 bjz joined #perl6
10:29 bjz joined #perl6
10:31 zakharyas joined #perl6
10:37 dalek perl6.org: 0b79607 | (Josiah Dahl)++ | / (3 files):
10:37 dalek perl6.org: Fixed 'Resources' and 'Documentation' highlighting in the navbar. Renamed the folder 'documentation' to 'resources'
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/0b796075b0
10:37 dalek perl6.org: e885101 | (Josiah Dahl)++ | / (3 files):
10:37 dalek perl6.org: Merge branch 'issue_57'
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/e88510164e
10:37 dalek perl6.org: 2dbc228 | (Josiah Dahl)++ | / (2 files):
10:37 dalek perl6.org: Changed 'Documentation' link in footer to 'References'
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/2dbc2287dd
10:37 dalek perl6.org: 2535f08 | (Josiah Dahl)++ | / (2 files):
10:37 dalek perl6.org: Accidentally wrote references instead of resources/
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/2535f0802b
10:37 dalek perl6.org: 5a73999 | (Josiah Dahl)++ | includes/footer:
10:37 dalek perl6.org: fixed link to resources in footer
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/5a739993f4
10:37 dalek perl6.org: 47e7383 | (Zoffix Znet)++ | / (5 files):
10:37 dalek perl6.org: Merge pull request #59 from josiahdahl/master
10:37 dalek perl6.org:
10:37 dalek perl6.org: Issue #57 - Resources Tab Nav Issues
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/47e738356e
10:37 dalek perl6.org: 852b5a1 | (perl6.org website)++ | source/.htaccess:
10:37 dalek perl6.org: Include redirect from old /documentation/ to new /resources/
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/852b5a13b8
10:37 dalek perl6.org: 52bbb14 | (Zoffix Znet)++ | source/.htaccess:
10:37 dalek perl6.org: Merge pull request #60 from perl6/add-resources-redirect
10:37 dalek perl6.org:
10:37 dalek perl6.org: Include redirect from old /documentation/ to new /resources/
10:37 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/52bbb146e5
10:39 * hackedNODE giggles at (perl6.org website)++
10:39 hackedNODE The thing got sentient! :P
10:42 masak that was always a risk
10:45 DrForr Skynet, now powered by Perl 6.
10:48 dalek perl6.org: 062c3f2 | (Zoffix Znet)++ | source/resources/index.html:
10:48 dalek perl6.org: s/Documentation/Resources/
10:48 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/062c3f201b
10:50 gfldex does `zef test .` have a look at META*.json?
10:51 bjz joined #perl6
10:52 bjz joined #perl6
11:13 aries_liuxueyang joined #perl6
11:16 pierre_ joined #perl6
11:28 pmurias joined #perl6
11:28 bjz joined #perl6
11:35 Actualeyes joined #perl6
11:52 itaipu joined #perl6
11:53 rindolf joined #perl6
12:04 Actualeyes joined #perl6
12:05 domidumont joined #perl6
12:27 moritz so, any takes on why "documentation" is now "resources"?
12:27 hackedNODE moritz: because documentation link was changed to point to docs.perl6.org
12:27 moritz ah
12:28 moritz the weird thing about "resources" is just that whole of perl6.org is pointers to resources
12:28 moritz maybe I should try to come up with a better name myself
12:29 hackedNODE Go for it :)
12:29 dalek doc: c0ca8fa | gfldex++ | doc/Language/list.pod6:
12:29 dalek doc: link to /type/Slip
12:29 dalek doc: review: https://github.com/perl6/doc/commit/c0ca8fa97b
12:29 dalek doc: 1b8bdce | gfldex++ | doc/Type/Slip.pod6:
12:29 dalek doc: fix typo
12:29 dalek doc: review: https://github.com/perl6/doc/commit/1b8bdce409
12:29 dalek doc: 08a77b9 | gfldex++ | doc/Type/Slip.pod6:
12:29 dalek doc: show the difference between |(1,2,3) and (1,2,3).Slip
12:29 dalek doc: review: https://github.com/perl6/doc/commit/08a77b9e6a
12:30 moritz http://tromey.com/blog/?p=911 "Since the gcj days I’ve been searching for basically the same combination that kept me hacking on gcj all those years: cool technology, great social environment, and a worthwhile mission."
12:32 moritz couldn't help but think of Perl 6 :-)
12:32 hackedNODE :)
12:33 vcv after finally attending my first YAPC in June, I concur whole heartedly
12:36 tbrowder ref new docs site (ab
12:36 tbrowder reboot...
12:36 * [Coke] yawns.
12:38 tbrowder ref new docs site (and other p6 sites): i've always thought it would be handy to make the upper-left Camelia always return to the main site.
12:39 tbrowder make it a link, that is
12:44 tbrowder break, break: i need help with a hash idiom.  i want to make a hash of keywords with all the same values (any value) since all i want is to be able to test a key for existence. the best i can come with is:
12:45 crookbond joined #perl6
12:46 hackedNODE use a Set
12:46 tbrowder m: my @k = <a b>; my %k = map { $_ => 1}, @k; say %k.perl
12:46 camelia rakudo-moar 3a6cd8: OUTPUT«{:a(1), :b(1)}␤»
12:46 rgrinberg joined #perl6
12:46 hackedNODE m: my %k = set <a b>; say %k.perl
12:46 camelia rakudo-moar 3a6cd8: OUTPUT«{:a, :b}␤»
12:47 hackedNODE m: my %k = 'The quick brown fox jumped over the lazy dog'.comb; say %k.perl
12:47 camelia rakudo-moar 3a6cd8: OUTPUT«{" " => "d", :T("h"), :b("r"), :e(" "), :f("o"), :i("c"), :j("u"), :k(" "), :l("a"), :m("p"), :n(" "), :o("g"), :q("u"), :r(" "), :t("h"), :v("e"), :x(" "), :z("y")}␤»
12:47 hackedNODE m: my %k = 'The quick brown fox jumped over the lazy dog'.comb.Set; say %k.perl
12:47 camelia rakudo-moar 3a6cd8: OUTPUT«{" " => Bool::True, :T, :a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, :l, :m, :n, :o, :p, :q, :r, :t, :u, :v, :w, :x, :y, :z}␤»
12:48 rgrinberg joined #perl6
12:48 tbrowder hackedNODE: thanks! forgot about that is in p6--used it in C++ all the time...
12:57 pmurias moritz: hopefully Perl 6 ends up more succefull than gcj
13:04 mcmillhj joined #perl6
13:13 canopus joined #perl6
13:18 finanalyst joined #perl6
13:21 finanalyst !Ook David B Coe - [The Case Files of Justis Fearsson 02] - His Father's Eyes (epub).rar
13:21 finanalyst again. ignore#
13:26 skids joined #perl6
13:27 averna joined #perl6
13:32 Averna joined #perl6
13:34 imcsk8 joined #perl6
13:40 itaipu joined #perl6
13:42 grondilu joined #perl6
13:42 grondilu m: sub { .say for @_ }(False || Nil)
13:42 camelia rakudo-moar 3a6cd8: OUTPUT«Nil␤»
13:42 grondilu m: sub { .say for @_ }(Nil)
13:42 camelia rakudo-moar 3a6cd8: OUTPUT«Nil␤»
13:43 grondilu m: sub { .say for @_ }()
13:43 camelia rakudo-moar 3a6cd8: ( no output )
13:43 masak m: say Nil === ()
13:43 camelia rakudo-moar 3a6cd8: OUTPUT«False␤»
13:43 grondilu m: sub { .say for @_ }(())
13:43 camelia rakudo-moar 3a6cd8: ( no output )
13:43 grondilu m: sub { .say for @_ }(False || ())
13:43 camelia rakudo-moar 3a6cd8: ( no output )
13:43 grondilu ok
13:44 masak m: say Nil ~~ List
13:44 camelia rakudo-moar 3a6cd8: OUTPUT«False␤»
13:45 grondilu m: sub { .say for @_ }(False || (), "foo")
13:45 camelia rakudo-moar 3a6cd8: OUTPUT«foo␤»
13:46 grondilu (just a last tiny check, I'm good now)
13:47 masak no no, it's interesting
13:48 grondilu not quite related:  a Pair is always True unless it is undefined, isn't it?
13:48 grondilu m: my $var; say ?:$var;
13:48 camelia rakudo-moar 3a6cd8: OUTPUT«True␤»
13:49 mcmillhj joined #perl6
13:49 grondilu because I wanted to pass a named argument to a sub, unless it is not defined. Ended up having to use a binary.
13:49 hackedNODE You ninja it in
13:50 hackedNODE foo |(:$arg if $arg)
13:50 grondilu oh I never use that, I shoudl.
13:50 masak grondilu: yes, I think it's always true. seems you're hitting Mu.Bool, which returns `self.defined`
13:51 * grondilu sadly only now remembers he had this conversation before
14:02 tbrowder m: my %k = <a b>; say %.perl
14:02 camelia rakudo-moar 3a6cd8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable %.perl used where no 'self' is available␤at <tmp>:1␤------> 3my %k = <a b>; say %.perl7⏏5<EOL>␤    expecting any of:␤        argument list␤        term␤»
14:03 masak m: my %k = <a b>; say %k.perl
14:03 camelia rakudo-moar 3a6cd8: OUTPUT«{:a("b")}␤»
14:03 tbrowder wow, camelia ca read my mind
14:06 masak the AI function is at early stages, but it's there.
14:06 lizmat .oO( feels a bit ad interim )
14:07 * masak .oO( ad homonunculus attack )
14:07 masak homunculus*
14:08 * masak .oO( don't you dare bring my uncle into this! )
14:09 spebern joined #perl6
14:14 grondilu can anyone remind the correct use of the words "argument" vs "parameter"?
14:14 grondilu sub ($parameter) {}($argument), right?
14:14 hackedNODE grondilu: parameters is what you receive in routines; arguments is what you give to routines
14:14 * nine has never managed to get those two right either
14:14 hackedNODE grondilu: right
14:15 hackedNODE .oO( you argue with a sub by giving it arguments... )
14:16 grondilu hackedNODE++ neat mnemotechnic
14:16 mcmillhj joined #perl6
14:17 masak also worth noting that the "argument"/"parameter" subdivision is fairly Perl-centric
14:17 masak I seldom see it exactly that way in other communities
14:17 masak more CS-y communities seem to call them "parameter"/"formal parameter", for example
14:18 masak I don't have a mnemonic, I've just practiced and practiced getting it right ;)
14:18 masak but it helps to realize that a parameter is a kind of variable, whereas an argument is a kind of expression
14:18 masak (IMHO)
14:19 mst through my perl5 goggles it's "the argument list" in both places, the only place I regularly see us use 'parameter' is, well, Function::Parameters' package name
14:19 gfldex a routine will argue with you about it's arguments when you stick the wrong parameters in
14:19 masak mst: what about the new signature syntax? are those parameters?
14:20 masak gfldex: you stick arguments in. they emerge on the inside of the routine as parameters.
14:20 itaipu joined #perl6
14:21 mst masak: I dunno how it's documented-as, but that doesn't seem to've affected the language-as-used
14:21 mst then again, I could be wrong about the language-as-used and only actually describing -my- language-as-used
14:21 mst (also I'm on my first coffee here ;)
14:22 huf_ i bet the distinction exists in mauke's bavarian :)
14:22 huf_ hence the name of F::P
14:23 * masak .oO( the Bavarian Naming Maneuver )
14:24 timotimo .
14:24 hackedNODE :
14:24 seatek joined #perl6
14:25 masak
14:31 perlawhirl joined #perl6
14:39 Averna joined #perl6
14:41 stevieb joined #perl6
14:43 ptolemarch joined #perl6
14:47 AlexDaniel joined #perl6
14:53 vytas joined #perl6
14:57 khw joined #perl6
15:03 Averna joined #perl6
15:09 dalek doc: 49217b9 | (Zoffix Znet)++ | doc/Type/Dateish.pod6:
15:09 dalek doc: Correct docs for Dateish.[days-in-month|is-leap-year]
15:09 dalek doc:
15:09 dalek doc: The argument-taking candidates of the two methods were never part of
15:09 dalek doc: the Perl 6 specification and have now been removed[^1] from Rakudo.
15:09 dalek doc:
15:09 dalek doc: [1] https://github.com/rakudo/rakudo/commit/6aab64103f1c6ce509be79783d2fd10a989b6edd
15:09 dalek doc: review: https://github.com/perl6/doc/commit/49217b9a52
15:10 user9 joined #perl6
15:14 ponbiki joined #perl6
15:19 dalek doc: 5ec3597 | (Zoffix Znet)++ | doc/Type/Dateish.pod6:
15:19 dalek doc: Document Dateish.IO
15:19 dalek doc: review: https://github.com/perl6/doc/commit/5ec3597f31
15:33 mempko joined #perl6
15:36 MARTIMM joined #perl6
15:36 dalek doc: 261e163 | gfldex++ | doc/Language/faq.pod6:
15:36 dalek doc: link to Signature
15:36 dalek doc: review: https://github.com/perl6/doc/commit/261e163bc0
15:36 pierrot joined #perl6
15:37 harmil_wk hackedNODE: Re: the https://irclog.perlgeek.de/perl6/2016-09-29#i_13310847 discussion, I was really only talking about the text of the exception. The type is, I think, fine. But some clearer hint could be placed in the warning text.
15:38 vytas joined #perl6
15:39 hackedNODE m: multi foo ($x is rw) { }; foo(42)
15:39 camelia rakudo-moar 6c0732: OUTPUT«Cannot resolve caller foo(Int); none of these signatures match:␤    ($x is rw)␤  in block <unit> at <tmp> line 1␤␤»
15:40 hackedNODE maybe there's a way to make the exception figure out that there is a match for non-rw candidate and suggest that maybe that's what the user meant
15:40 timotimo yes, there is
15:41 hackedNODE sweet
15:41 timotimo it can go as far "out" as Exception.pm in the message method
15:41 tailgate how does is rw change the function call? does the argument also have to be rw?
15:41 timotimo yes
15:41 timotimo if you don't give it something that can be written to, it won't be called
15:57 hackedNODE m: multi foo ($x is rw) { }; X::Multi::NoMatch.new(:dispatcher(&foo.dispatcher), :capture(\(42))).throw;
15:57 camelia rakudo-moar 6c0732: OUTPUT«X::Multi::NoMatch exception produced no message␤  in block <unit> at <tmp> line 1␤␤»
15:57 hackedNODE Why no message? :/
15:57 timotimo it might have exceptioned
15:59 hackedNODE Oh. It would help if I got the args right.
15:59 hackedNODE m: multi foo ($x is rw) { }; X::Multi::NoMatch.new(&foo.dispatcher,\(42)).throw;
15:59 camelia rakudo-moar 6c0732: OUTPUT«Cannot resolve caller new(X::Multi::NoMatch: Mu, Capture); none of these signatures match:␤    (Mu $: *%)␤    (Mu $:, *@, *%_)␤  in block <unit> at <tmp> line 1␤␤»
15:59 hackedNODE Oh, wait, that's the wrong throwage ^_^
16:00 hackedNODE Programming is hard! Let's go shopping.
16:01 timotimo ah, you wanted positionals?
16:01 timotimo oh, no, you don't
16:02 hackedNODE m: multi foo ($x is rw) { }; X::Multi::NoMatch.new(:dispatcher(&foo.dispatcher),:capture(\(42))).message.say;
16:02 camelia rakudo-moar 6c0732: OUTPUT«No such method 'dispatchees' for invocant of type 'Mu'␤  in block <unit> at <tmp> line 1␤␤»
16:02 hackedNODE Getting closer! :)
16:02 hackedNODE Which is weird, 'cause:
16:02 hackedNODE m: multi foo ($x is rw) { };  dd &foo.dispatcher.dispatchees
16:02 camelia rakudo-moar 6c0732: OUTPUT«No such method 'dispatchees' for invocant of type 'Mu'␤  in block <unit> at <tmp> line 1␤␤»
16:02 hackedNODE huh
16:02 hackedNODE Oh, I get it now
16:03 hackedNODE m: multi foo ($x is rw) { }; X::Multi::NoMatch.new(:dispatcher(&foo),:capture(\(42))).message.say;
16:03 camelia rakudo-moar 6c0732: OUTPUT«Cannot resolve caller foo(Int); none of these signatures match:␤    ($x is rw)␤»
16:03 hackedNODE \o/
16:03 timotimo hah, you were meant to just give the sub, eh?
16:03 timotimo fun times
16:03 hackedNODE :)
16:12 pierrot joined #perl6
16:26 itaipu joined #perl6
16:30 cdg joined #perl6
16:34 mempko joined #perl6
16:36 mcmillhj joined #perl6
16:38 wamba joined #perl6
16:39 wamba joined #perl6
16:40 isBEKaml joined #perl6
16:41 hackedNODE m: use nqp; my $sig = :($x); dd nqp::getattr($sig, Signature, '$!params');
16:41 camelia rakudo-moar 6c0732: OUTPUT«P6opaque: no such attribute '$!params' in type Signature when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:41 hackedNODE How come it says no attribute, when it clearly exists: https://github.com/rakudo/rakudo/blob/nom/src/core/Signature.pm#L92
16:41 grondilu how can I store various versions of the same module in separate files?
16:42 grondilu like Foo:<0.1> in Foo-0.1.pm6 and so on?  But that does not seem to work.
16:42 timotimo i think we currently expect the version distinction to be at the distribution level
16:44 grondilu so I suppose something like C<use Foo:<0.1>; unit module Foo:<0.2> is Foo:<0.1>;> could not work, could it?
16:44 grondilu sorry I meant that with classes
16:44 grondilu so I suppose something like C<use Foo:<0.1>; unit class Foo:<0.2> is Foo:<0.1>;> could not work, could it?
16:44 timotimo it could, but it'd have to be in two separate installables
16:45 timotimo we might want to loosen that restriction
16:47 grondilu and if it's done, I could store the source code of Foo:<0.n> in Foo-0.n.pm6, right?
16:48 timotimo i imagine so
16:48 grondilu granted, it would only be accessable if I compile it first, though.
16:48 timotimo Meta.json would have to have some way to tell which file supplies what version
16:48 grondilu oh yeah
16:48 setty1 joined #perl6
16:49 grondilu FYI it's for my miniPerl project.  I was told using SI prefixes is silly and it's kind of true.
16:50 grondilu using versioning would make a lot of sense for this.
16:50 timotimo SI prefixes? i only know SI suffixes :o
16:51 grondilu I don't know what SI suffixes are
16:51 grondilu https://en.wikipedia.org/wiki/Metric_prefix
16:51 cdg joined #perl6
16:52 geekosaur the prefixes are the kilo- mega- etc.
16:52 timotimo oh
16:52 timotimo haha, right
16:52 timotimo somehow i thought "100 kilograms" makes "kilograms" the SI-suffix
16:53 grondilu lol, weird
16:53 timotimo my brain is stupid sometimes
16:55 hackedNODE timotimo: when you said it's possible (for checking `is rw` stuff in NoMatch exception)... did you have an easy plan in mind or was it just a guess? :)
16:55 timotimo just a guess
16:55 timotimo like you could go through the list of incoming arguments, flip one of them into a container and try to match them against all potential signatures
16:55 hackedNODE Ah. I'm kinda stuck on trying to strip `is rw` from a Signature to see if it would ACCEPTS a capture
16:55 timotimo hah
16:55 timotimo do it the other way around
16:55 timotimo it's easier to create a container and put it into the capture
16:56 hackedNODE Ah :) ok, I'm gonna give that a shot
16:56 timotimo good luck!
17:01 BrassLantern joined #perl6
17:08 rgrinberg joined #perl6
17:27 dha joined #perl6
17:29 Zero_Dogg joined #perl6
17:31 Zero_Dogg Hi, is there any way to store a reference to class in a variable, and then instantiate whatever class a variable is referencing? Ie. class A {}; my $ref = A; my $obj = $ref.new();
17:31 timotimo of course
17:31 timotimo exactly like what you just wrote
17:32 psch m: class A {}; my $ref = A; my $obj = $ref.new();
17:32 camelia rakudo-moar 6c0732: ( no output )
17:32 Zero_Dogg really? I guess something else is buggy then
17:32 psch m: class A {}; my $ref = A; my $obj = $ref.new(); say $obj.WHAT
17:32 camelia rakudo-moar 6c0732: OUTPUT«(A)␤»
17:36 Zero_Dogg sigh, I had just been stupid, a conflict between a method and an attribute prevented it from working. Thanks
17:38 dha Removing stupidity from the equation solves many problems! :-)
17:39 hackedNODE m: my @a = <a b c d e f g>; my @b = <c f>; dd keys @a ∖ @b
17:39 camelia rakudo-moar 6c0732: OUTPUT«("a", "g", "b", "e", "d").Seq␤»
17:39 hackedNODE (Perl 6)++
17:43 girafe joined #perl6
17:44 ufobat joined #perl6
17:47 cdg joined #perl6
17:47 grondilu m: use Test; ok True, '\n'
17:47 camelia rakudo-moar 6c0732: OUTPUT«ok 1 - \\n␤»
17:47 * grondilu is slightly annoyed by the double slash here
17:48 hackedNODE m: my @a = <a b c d e f g>; my @b = <c f>; dd (@a ∖ @b){*}:k
17:48 camelia rakudo-moar 6c0732: OUTPUT«("a", "g", "b", "e", "d")␤»
17:48 hackedNODE \o/
17:48 timotimo grondilu: you know that you're giving it a backslash and an n, though, right?
17:48 timotimo m: say '\n'.graphs
17:48 camelia rakudo-moar 6c0732: OUTPUT«No such method 'graphs' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
17:48 psch m: say '\n'
17:48 camelia rakudo-moar 6c0732: OUTPUT«\n␤»
17:48 timotimo m: say '\n'.chars
17:48 camelia rakudo-moar 6c0732: OUTPUT«2␤»
17:49 * psch doesn't see why Test.pm has to escape that \
17:49 psch maybe it's in TAP though?
17:49 hackedNODE grondilu: it's to escape the backslash that might prevent escaping the # that would interfere with TODOs.
17:49 grondilu I have a bunch of strings in my tests that can contain newlines.  I don't want to actually print newlines in the reports.
17:49 hackedNODE grondilu: so it greedily escapes all slashes. You may wish to try to submit a patch, but test performance, if you do.
17:49 psch grondilu: take ␤?
17:49 psch .u ␤
17:49 yoleaux U+2424 SYMBOL FOR NEWLINE [So] (␤)
17:50 grondilu that does not show up on my terminal
17:50 psch update your fonts? :)
17:50 hackedNODE Time for upgrade :)
17:50 timotimo well, nqp::escape exists
17:50 * grondilu is not sure he wants to dive into a font quest righ now
17:50 hackedNODE m: use MONKEY-GUTS; say nqp::escape('\#')
17:50 camelia rakudo-moar 6c0732: OUTPUT«\\#␤»
17:51 hackedNODE neat
17:51 grondilu I'm using putty on Windows 10.  Any font you'd recommend?  (And how to install it?)
17:51 sjoshi joined #perl6
17:52 hackedNODE *shrug* Whatever stock Windows 10 uses works for me in the browser and HexChat
17:53 grondilu unicode characters usually show up but not this one.
17:54 gfldex grondilu: we had this topic before :) https://irclog.perlgeek.de/perl6/2016-08-11#i_13004071
18:02 vcv Consolas should be a standard windows font and is pretty good
18:03 stmuk_ inconsola is a good one too
18:03 isBEKaml vcv: You should try "Deja Vu Sans Mono" or "Source Code Pro" :-)
18:03 vcv i use source code pro too. back and forth between it and consolas
18:03 vcv i think i use the former because it has a bunch of stuff for vim-powerline
18:11 rgrinberg joined #perl6
18:11 domidumont joined #perl6
18:11 grondilu m: say "\u{2424}"
18:11 camelia rakudo-moar 1e6c46: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unrecognized backslash sequence: '\u'␤at <tmp>:1␤------> 3say "\7⏏5u{2424}"␤    expecting any of:␤        argument list␤        double quotes␤        term␤»
18:11 grondilu I can never remember how to do this
18:12 grondilu m: say "U+2424"
18:12 camelia rakudo-moar 1e6c46: OUTPUT«U+2424␤»
18:13 harmil_wk m: say "\x{2424}"
18:13 camelia rakudo-moar 1e6c46: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of curlies around escape argument; in Perl 6 please use square brackets␤at <tmp>:1␤------> 3say "\x{7⏏2424}"␤»
18:13 harmil_wk I guess I can't either :)
18:13 harmil_wk m: say "\x2424"
18:13 camelia rakudo-moar 1e6c46: OUTPUT«␤␤»
18:13 harmil_wk Going to stop "helping" now :)
18:15 hackedNODE m: say "\x[2424]"
18:15 camelia rakudo-moar 1e6c46: OUTPUT«␤␤»
18:15 hackedNODE {} is Perl 5's way
18:15 moritz m: say "\c[2424]"
18:15 camelia rakudo-moar 1e6c46: OUTPUT«ॸ␤»
18:15 hackedNODE Oh, it did tell you to use square brackets! :) You just didn't read the message :D
18:16 hackedNODE m: 42++
18:16 camelia rakudo-moar 1e6c46: OUTPUT«Cannot resolve caller postfix:<++>(Int); arguments that are expected to be␤in writable containers do not have them, for these candidates:␤    (Mu:D $a is rw)␤    (Int:D $a is rw)␤␤These candidates are also available:␤    (Bool:D $a is rw)␤   …»
18:17 hackedNODE harmil_wk: ^
18:31 harmil_wk hackedNODE: that's nice
18:33 hackedNODE \o/
18:34 RabidGravy joined #perl6
18:34 TimToady the verbiage there could use some editing, but nice that it notices now
18:34 hackedNODE TimToady: what would be the better wording?
18:34 * hackedNODE can fix it up while we still remember :)
18:35 wisti joined #perl6
18:36 timotimo "If you had passed a writable argument: "
18:36 timotimo maybe?
18:38 * perlpilot just discovered Perl 6 is very permissive with multis ...
18:38 perlpilot m: multi foo($) { }; multi foo($) { };
18:38 camelia rakudo-moar 1e6c46: ( no output )
18:38 perlpilot m: multi foo($) { }; multi foo($) { }; foo(1);
18:38 camelia rakudo-moar 1e6c46: OUTPUT«Ambiguous call to 'foo'; these signatures all match:␤:($)␤:($)␤  in block <unit> at <tmp> line 1␤␤»
18:38 TimToady the following match the type but require a mutable argument ... the following do not match on type either
18:38 TimToady or something like that
18:39 TimToady "are expected to be" is just too passive aggressive :)
18:40 TimToady and we don't really have to mention containers
18:40 TimToady the argument is either mutable or it isn't
18:41 TimToady the following candidates require a mutable argument: ... the following do not match for other reasons:
18:42 moritz that only works well for the one-argument case though
18:42 * TimToady hasn't looked at the code in questoin
18:42 TimToady *tion
18:43 TimToady just suggesting the language is a bit stilted currently
18:43 hackedNODE The code stuffs all arguments into writable containers and tries to find a candidate that would take it
18:43 TimToady LTA isn't evil, it's just...LTA
18:44 perlpilot moritz: "the following candidates match, but require the $x, $y and $z arguments to be mutable:"?  (little bit of work to get this though)
18:45 TimToady it would be nice if the binder (or some proxy for the binder) could return a reason that each candidate was rejected
18:45 TimToady anyway, when I see progress, I get greedy :)
19:01 hackedNODE perlpilot: what's the permissiveness? That they get checked for ambiguity only at runtime? Some type checks can only be done at runtime
19:01 hackedNODE m: subset FunOne where rand > .5; multi foo (FunOne) {"yey"}; multi foo ($) { "w00t"}; say foo $ for ^5
19:01 camelia rakudo-moar f4bda3: OUTPUT«w00t␤w00t␤w00t␤w00t␤yey␤»
19:01 RabidGravy I tried to write some C# for the first time in ages today,  it was a struggle
19:03 perlpilot hackedNODE: Aye, some can only be checked at runtime, but others can still be checked at compile time.
19:06 hackedNODE ¯\_(ツ)_/¯ it'd be extra work to check them at compile time, just to have to re-check them all again during runtime.
19:07 perlpilot yeah ... I think I sometimes expect Perl to be übermagical  :)
19:08 hackedNODE :)
19:21 setty2 joined #perl6
19:29 ptolemarch joined #perl6
19:33 labster joined #perl6
19:38 iH2O joined #perl6
19:38 iH2O joined #perl6
19:50 grondilu vocabulary question :  given a grammar $G and a class action $actions, how would you name $G.parse($string) as opposed to $G.parse($string, :$actions)  ?
19:51 grondilu both do parsing, but the latter does a bit more, yet it's not quite "compiling", is it?
19:52 iH2O left #perl6
19:55 TimToady Idunno, intrinsically decorated vs extrinsicly decorated?
19:55 TimToady you can still have action blocks embedded in the grammar, so you can decorate there too
19:56 TimToady oh goodness, how'd it get to be almost past lunchtime already?
19:56 grondilu basically adding an action class does not change the nature of what is being done (parsing), right?  It's still parsing, but done more specifically?
19:59 grondilu I'm asking that because I'm considering doing :  grammar MyGrammar { class MyActions {...}; rule TOP {...}; our sub parse($string) { ::?CLASS.parse($string, :actions(MyActions)); } }
20:00 grondilu so that there will by two ways to parse a string for the user:  MyGrammar::parse($string) and MyGrammar.parse($string), and I'm wondering if that can be confusing.
20:01 grondilu meh, I guess I'm making a big deal out of nothing
20:01 psch grondilu: is the Grammar useful without the .made?
20:02 grondilu not sure
20:02 psch grondilu: i'm asking because if not, and people want to use the Match objects .make most of the time anyway i'd just inline the &make calls
20:03 grondilu I tried inlining the make calls but that uglifies things quite a lot
20:04 TEttinger joined #perl6
20:11 eliasr joined #perl6
20:20 khw joined #perl6
20:21 mcmillhj joined #perl6
20:24 mohae_ joined #perl6
20:39 itaipu joined #perl6
20:47 rgrinberg joined #perl6
20:51 ens joined #perl6
20:51 ens hi camelia
20:52 ens & others
20:52 dogbert17 o/ ens
20:53 ens so, i was pondering what the official name of perl6 is?
20:53 ens does one call it perl6 or something else?
20:54 dogbert17 I believe Perl6 is the name to use (will probably be corrected :-)
20:55 ens ok because otherwise i wanted to suggest Perly McPerlface
20:55 El_Che with a space
20:55 dogbert17 dunno if that name was ever considered
20:56 dogbert17 .seen timotimo
20:56 yoleaux I saw timotimo 18:36Z in #perl6: <timotimo> maybe?
20:57 dogbert17 timotimo: is it correct that array accesses haven't been optimized yet?
20:58 [Coke] ens: there's Perl 6, the language specification, there's the Rakudo Perl 6 Compiler, the Rakudo Star Perl 6 Distribution…
20:59 [Coke] the executable is typically ./perl6
21:02 khw joined #perl6
21:05 cyphase joined #perl6
21:06 timotimo dogbert17: multidimensional array accesses haven't been optimized
21:07 dogbert17 timotimo: what about the single dimension case?
21:07 timotimo not sure
21:07 timotimo probably not as much as possible ;)
21:08 ens ah rakudo means 'way of the camel' in japanese
21:08 dogbert17 doodling with a project euler problem, takes 130 sec on my machine, the same in p5 takes seven and it 'feels' like it's the array accesses
21:08 ens that's pretty nice actually
21:09 dogbert17 timotimo: or should we be at that difference at this point in time?
21:09 ens 駱駝道
21:10 timotimo dogbert17: give me the code and i'll have a look maybe
21:11 timotimo did you try --profile yet?
21:11 dogbert17 timotimo: https://gist.github.com/dogbert17/6cdf82145f61495936eeb6c64a2d58a7
21:12 dogbert17 I'll try a profile
21:14 dogbert17 timotimo: original problem here: https://projecteuler.net/problem=14
21:17 timotimo i know this, that's the hailstone sequence
21:17 dogbert17 cool
21:22 timotimo dogbert17: if you use native ints, you'll have about a 3x increase in speed
21:22 dogbert17 timotimo: that sounds very good
21:23 dogbert17 profile still running ...
21:23 timotimo 94816.85ms  ->  29727.32ms
21:23 timotimo m: say 29727.32 / 94816.85
21:23 camelia rakudo-moar 01321c: OUTPUT«0.31352360␤»
21:24 timotimo even faster than 3x
21:24 dogbert17 very good
21:24 labster joined #perl6
21:25 labster joined #perl6
21:25 masak ens: "rakudado" would mean "way of the camel"
21:26 DrForr I'm going to do a more elaborate posting later, but https://github.com/drforr/perl6-Template-Toolkit might be of some interest. The actual working bits are still to be put in place, but there's a rather primitive grammar that covers 80%+ of the original Perl 5 Template Toolkit directives.
21:26 masak ens: "rakudo" is kind of a contraction of that. one of its meanings is "paradise"
21:27 masak (lit. "easy soil")
21:28 masak in retrospect, "easy soil" sounds like a wonderful description of having the setting and much of the compiler stack be written in Perl 6 :D
21:34 dogbert17 timotimo: the profile completed, 60_000_000 Int's allocated
21:35 timotimo yeah
21:35 timotimo the faster one allocates 12_400_570 Int and 22_852_542 IntLexRef
21:35 timotimo and another 2_180_949 IntPosRef
21:36 dogbert17 so an Int will be allocated if I do a ++ on a scalar?
21:36 timotimo Int is immutable
21:36 dogbert17 gah, I'm a moron
21:36 timotimo don't worry about it
21:36 dogbert17 :-)
21:37 timotimo quick-dying objects are cheap
21:37 dogbert17 452 GC's
21:38 timotimo 2.71% (804.82ms)
21:38 timotimo time spent in the GC
21:38 dogbert17 yeah, that's fast
21:38 timotimo fast enough anyway
21:39 bjz joined #perl6
21:39 dogbert17 what does OSR mean?
21:40 timotimo on-stack-replacement is when we replace code with optimized code as it's running
21:40 dogbert17 ah, cool
21:40 timotimo otherwise we could only use optimized code when entering a routine
21:40 timotimo but loops don't "enter" their loop body in that same way
21:41 timotimo that's why OSR had to be put in, so that for and while loops can get properly optimized when they are hot
21:41 timotimo you can disable OSR with an env var i think
21:42 dogbert17 interesting, thanks for the explanation
21:43 timotimo moar --help tells you more about that
21:45 dogbert17 excellent stuff
21:46 dogbert17 so there was nothing goin on with the profile which struck you as 'suspicious'
21:46 timotimo i'm not sure
21:47 timotimo almost all time spent is in the loop that starts in line 6
21:47 timotimo i wonder if replacing ++ with += or completely written out makes it any better, but time spent in ++ is only 6%
21:47 dogbert17 yes, I noticed that, couldn't really get the numbers to add up
21:49 harmil_wk m: class Singleton { multi method new() { state $singleton = self.bless; $singleton } }; my $s1 = Singleton.new; my $s2 = Singleton.new; say $s1 === $s2
21:49 camelia rakudo-moar 01321c: OUTPUT«True␤»
21:49 harmil_wk Is that unreasonable?
21:49 harmil_wk I mean for me to do, not so much for Perl 6 to accept.
21:52 timotimo BBL
21:53 dogbert17 timotimo: thx for the help
21:53 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2016/10/03/2016-40-pull-up-to-the-hacktoberfest/
21:56 dogbert17 lizmat++ weekly
22:04 harmil_wk Weekly's are a really important part of the community. I'm so glad they exist!
22:10 masak lizmat++
22:24 _slade_ joined #perl6
22:41 skids joined #perl6
22:54 mcmillhj joined #perl6
22:54 MasterDuke dogbert17: i got a little speedup in your script by pre-filling @cache (my int @cache = 0 xx 75001) instead of using default(0)
23:04 adu joined #perl6
23:13 timotimo MasterDuke: how big is it?
23:15 MasterDuke well, i reduced the iterations just to make the timing faster, but it went from avg 2.3s to avg 1.9s
23:15 MasterDuke oh, and that had ints where possible
23:17 MasterDuke m: my int @cache = 0 xx 10
23:17 camelia rakudo-moar 01321c: ( no output )
23:17 MasterDuke m: my int @cache is default(0)
23:17 camelia rakudo-moar 01321c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use trait 'is default' on a native array[int].␤at <tmp>:1␤------> 3my int @cache is default(0)7⏏5<EOL>␤    expecting any of:␤        constraint␤»
23:18 MasterDuke ^^^ has that been decided upon, or just NYI
23:19 MasterDuke pre-filling @cache got rid of AT-POS-CONTAINER, which was in third place ordering by exclusive time in my profile
23:22 mcmillhj joined #perl6
23:24 TEttinger joined #perl6
23:26 timotimo i threw "is dfeault" out and made it an int array as the first order of business
23:30 timotimo not only because 0 is already the default of native int arrays
23:33 MasterDuke huh, switching "$num % 2 == 0" to "$num %% 2" doubles runtime
23:34 timotimo doubles? huh
23:34 timotimo i did that switch just for fun and it was part of my "3x faster"
23:34 timotimo so yours ought to be 6x faster?
23:35 MasterDuke well, 2s with "$num % 2 == 0", 4s with "$num %% 2"
23:35 timotimo oh
23:35 timotimo OK
23:35 MasterDuke and only looping up to 100_000
23:37 MasterDuke with %% the 2nd and 3rd entries in my profile are infix:<%> and infix:<%%>, 529587 entries each
23:37 MasterDuke sorted by exclusive time
23:39 timotimo how about +& 2?
23:39 skids $num +| 1 ?
23:39 MasterDuke huh, infix:<%> doesn't even show up at all in a profile with % == 0
23:39 timotimo no, +& 1
23:39 skids right.
23:39 skids :-)
23:39 timotimo skids: it's potentially statically inlined
23:40 skids maybe.  Hopefully.
23:40 MasterDuke wait, which should i try?
23:40 timotimo when we inline stuff dynamically, it ends up in the profile
23:40 timotimo $num +& 2 should be the same as %% 2
23:41 timotimo er, why did i say +& 1? of course it has to be +& 2
23:41 MasterDuke that's even worse
23:41 MasterDuke took an extra second
23:42 timotimo wow
23:42 skids no, +& 1 :-)
23:42 MasterDuke infix:<+&> second place in profile by exclusive time, 1636036 entries
23:42 skids damn backscroll.
23:42 timotimo er, yeah, you're right
23:42 timotimo +& 1 is the correct one. and it's the opposite of %% 2
23:43 tushar joined #perl6
23:44 MasterDuke changed it to !($num +& 1), just about as fast as % == 0
23:44 timotimo i think the ! might actually cost a lot there
23:44 timotimo in this case you can just flip the then and else branches
23:44 MasterDuke 31ms
23:44 MasterDuke prefix:<!> was 13th in profile
23:45 timotimo it could have had ripple effects
23:45 timotimo preventing inlines, causing additional callframes, stuff like that
23:46 MasterDuke about the same
23:46 timotimo OK, good
23:47 avuserow if I remove the size limit of 75000 on the cache, it gets way faster for me
23:47 avuserow ~2x as fast
23:47 avuserow uses about 7MB more memory
23:48 timotimo that's clearly worth it
23:48 timotimo also not having to check the number every time :)
23:48 MasterDuke same time for me making it 200000
23:48 timotimo because we all know checking an int against another int is one of the most expensive operations a processor can do
23:48 MasterDuke my int @cache = 0 xx 200000
23:50 timotimo no need to do that
23:50 timotimo just @cache[20_000_000] = 0
23:53 MasterDuke 6x slower for me doing "my int @cache[200000] = 0" vs "my int @cache = 0 xx 200000"
23:53 MasterDuke eh, maybe close to 4x
23:54 mcmillhj joined #perl6
23:55 MasterDuke wtf? 0 xx 200000 is twice as slow if i just time that alone vs my int @cache[200000] = 0
23:55 matthewsellers joined #perl6
23:56 khw joined #perl6
23:56 timotimo it surprises me that 0 xx * is so fast
23:57 Dunearhp joined #perl6
23:58 skids can we build-depends on native OS packages yet?
23:58 MasterDuke ok, so if i profile with my int @cache[200000] = 0, top of the exclusive list is type_check (gen/moar/m-Metamodel.nqp:1187) with 911922 entries and 3.7s
23:59 timotimo skids: no
23:59 timotimo how many percents is that?
23:59 MasterDuke oh, i think i have a moar built with --debug
23:59 MasterDuke 24%

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

Perl 6 | Reference Documentation | Rakudo