»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
psch timotimo: which loop? and, "Did you mean energy(@bodies)"? 00:00
timotimo yes 00:01
the main loop at the end
running it for 500_000 iterations takes 1:40m on my machine; compared to the other languages in the benchmark game, that's still a gigantic way away 00:02
since it's missing two zeroes
psch well, first there is probably native types for the Body attributes that can use them 00:03
+step
timotimo oh, the body attributes! i haven't checked there
psch has to build r-m before looking closer
well, i mean i can look, but... :) 00:04
timotimo and also energies is completely un-optimized
but it only runs 2 times, not 500_000 times 00:05
(or 50_000_000 times as the final requirements would be)
00:05 jamesnek1 joined
timotimo cool, it's -8 seconds faster ... well, slower :\ 00:06
timotimo flips table slightly
psch offset_momentum still promotes
the $i in there is also not native
...actually, i don't see any $i that's native 00:07
oh, no, in advance it is
00:07 jamesneko left
timotimo not important, though 00:07
i mean offset_momentum
it runs even less often than energies does
psch true 00:08
my thinking was that it promotes the int attrs of Body to Int
but that probably doesn't happen, as the attr itself is typed..
well, assuming you adjusted that :)
also, against intention, it doesn't run without an arg on the cli 00:09
timotimo only hack and jruby use more ram than rakudo-m does in this :(
ah
psch real 0m2.526s
is what i get here..?
timotimo there is no int attribute in Body
psch changed line 138 to
my int $n = @*ARGS[0] // 10_000;
00:10 grondilu joined
timotimo oh, because of IntStr that'll actually work, right? 00:10
psch oh, right, they probably want to be num?
timotimo uh, no
yes, they do
gimme a sec, i'll give you my code
japhb .ask lizmat I see a few of your recent commits have had a laundry list of micro-optimization types applied during that commit. Do you have a master list somewhere of micro-optimizations that you've found generally work well? If so, where? If not, can we pretty please have one? :-) 00:11
yoleaux japhb: I'll pass your message to lizmat.
timotimo there we go, pull again
oh hey japhb
japhb oh hey timotimo
psch real 0m2.628s
00:12 skids joined
psch timotimo: ^^^ that's running it argless, i.e. "./perl6-m nbody.pl6" 00:12
00:12 BenGoldberg joined
timotimo yeah, well, i run either 50_000 or 500_000 :) 00:12
psch timotimo: maybe 50_000 would be a better default then? ;)
10m takes longer than i'm willing to wait for right now, fwiw 00:13
timotimo if only i knew what god-damn piece of crap calls find_best_dispatchee 250064 times
:)
psch obviously you should throw a closure that calls callframe into find_best_dispatchee vOv
well, and print the result of course, and break out the Big Data tools too :) 00:14
timotimo infix:<-> and infix:<,>(????) are all non-jitted
oh, that's the my (foo, bar, baz) stuff
pushed 00:16
OK, 500_000 now only takes 1:16m 00:18
00:18 ufobat left
timotimo though i bet there's some thermal throttling or something going on in there at some point 00:19
because both my sensors measure just above 72 degrees C
00:20 BenGoldberg left 00:21 BenGoldberg joined
timotimo i can build a version that uses nqp:: ops for all arithmetics. that'll likely give ridiculously improved timings 00:22
like it did with my particle system toy
psch well, it probably works, but i don't think it quite in the spirit of the competion... :) 00:25
like, if you're going that far just submit an nqp solution
timotimo of course it isn't
i just want to know how good rakudo could be if we had a few problems solved in this space :)
suddenly only 1 minute
and i've only just started
ShimmerFairy timotimo: hey, rakudo's gotta go fast, so examples of rakudo failing at that are always good :P 00:27
timotimo yes, very
it's just annoying to see such simple code even with "num" sprinkled all over is still so object-allocation-heavy 00:28
and the simple infix ops not getting inlined properly, or even jitted in this case
56s
00:28 pierre_ joined
ShimmerFairy timotimo: I get the feeling that's just a case of native support still not 100%. Incidentally, does 'num' choose the smallest float type, or the "most efficient"? 00:28
timotimo no, it'll choose 64bit nums every time 00:29
but there's num32, too
Num is 32bit, however
ShimmerFairy oh, I didn't know num had numbered version like int 00:30
00:30 geraud left
ShimmerFairy but yeah, I was just curious if rakudo chooses unqualified native 'num' to be the most efficient or something, and how that might affect timing. 00:30
sortiz timotimo, wondering if moving some calculations to methods in Body, can avoid the accessors overhead. 00:31
psch huh
timotimo ah, 30s
00:32 molaf joined
psch well, my one opt idea brought me from 1m10s to 2m30s :P 00:32
timotimo sortiz: the accessors take practically 0 time
psch clearly i'm bad at optimization :)
ShimmerFairy timotimo: write in C and use NativeCall, that'll show 'em! :P
timotimo there is now a "use_nqp" branch
ShimmerFairy as in, 'use' NQP modules? 00:34
timotimo no, just "use nqp"
and then a bunch of nqp:: ops
incidentally, 57s without nqp:: ops 00:35
pushed
00:37 profan joined
ShimmerFairy I thought 'use nqp' was a thing for a while already 00:37
timotimo yeah, it's a thing 00:38
we also have use :from<nqp>
ShimmerFairy yeah, I'm just confused by a "use_nqp" branch if it's been around for a while in nom 00:39
timotimo oh 00:40
sorry, that's a branch in the gist :)
gist.github.com/timo/7babb36055768fe04eeb
when you clone that
ShimmerFairy ah, I had a feeling it maybe wasn't a rakudo branch :P
timotimo :) 00:41
00:41 BenGoldberg left 00:45 cbk joined
skink m: my $fh = open('/dev/null'); for ^1000 { $fh.read(1); }; $fh.close; say now - INIT now; 00:46
camelia rakudo-moar bffc3a: OUTPUT«open is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub open at src/RESTRICTED.setting line 9␤ in block <unit> at /tmp/300HD3Bm3Q line 1␤␤»
00:46 timotimo left 00:47 BenGoldberg joined
skink Well, I suppose that makes sense 00:47
00:47 timotimo joined
timotimo huh, postcircumfix:<[ ]> is using 10.81% of the whole time with the use_nqp branch 00:47
skink > my $fh = open('/dev/urandom'); for (^50_000).race { die if $fh.read(1).elems != 1; }; $fh.close; 00:51
Died
What's the thread-safe way of doing this that isn't super slow? 00:52
i.e. not having an open/close per call
psch skink: push into Channel from a lot of promises... oh
yeah, no, that should work
...no, probably not. i think the .read is what gets this is in a tangle 00:53
timotimo i think it's trying to read from a different thread than the open comes from
skink First time I tested this was with 10,000 iterations, and 9974 reads succeeded 00:54
timotimo hm. did it actually fan out multiple threads?
skink And then ofc, it became unreproducible for anything less than 50,000 iterations
I can make an unlimited number of calls without .race 00:55
BenGoldberg Does it act the same if you use /dev/zero instead of /dev/urandom?
psch yeah, .race being somewhat flaky currently maked me think that you could do that with start { } instead 00:56
timotimo how about having one file handle per worker and read stuff from there?
psch .oO( "maked" makes me think i should go to bed )
skids does the 50000 number change if there is something else in there to slow it down?
timotimo i should also go to bed 00:57
psch i think i'll do that, ta o/
timotimo gnite psch
00:58 wbill joined
skink > my $fh = open('/dev/zero'); for ^25_000 { die if ($fh.read(1).elems != 1 ); }; $fh.close; say now - INIT now; 00:59
0.297447
> my $fh = open('/dev/zero'); for (^25_000).race { die if ($fh.read(1).elems != 1 ); }; $fh.close; say now - INIT now;
Died ... 1.39391199
BenGoldberg, ^
BenGoldberg timotimo, find_best_dispatchee is called from Perl6::Metamodel::ParametricRoleGroupHOW.specialize, and from Perl6::Metamodel::MultiDispatcher.vivify_for 01:00
ugexe skink: if you want to see something odd, try installing OpenSSL and *then* IO::Socket::SSL on windows. For some reason this will fail, but if you install IO::Socket::SSL which pulls in OpenSSL as a dependency it works
timotimo BenGoldberg: i know, but that's not what calls it in this case, i don't think.
the thing is, for some reason it doesn't show up properly in the profiler's call graph 01:01
ugexe i wonder if it has something to do with it getting tested with the original names (ssleay.dll) and then once installed the file names are changed to their sha1
skink > for ^25_000 { my $fh = open('/dev/null'); $fh.read(1); $fh.close; }; say now - INIT now;
65.5502376
Repeated open/close has a surprising amount of overhead
timotimo no doubt 01:02
ugexe it'll say NativeCall fails to open $path-to-sha1-dll-that-does-exists because it doesnt exist
skink In my original tests it was two orders of magnitude slower for 10,000 iterations
ugexe, ... What. 01:03
BenGoldberg considers suggesting replacing the default find_best_dispatchee with one that has an Int state variable, and works normally the first few thousand times, and then throws an exception.
ugexe skink: i dunno, i hoped you knew. i checked before your commits and it still happened then
skink ugexe, Oh, another oddity I noticed as well
OpenSSL::Socket and IO::SockeT::SSL do not work in a repl 01:04
Only as files
ugexe all i can think of is precomp 01:05
skink In a repl I tried connecting to a good-ssl site and a bad-ssl site, got -1 for both $ssl.connect's
As a script, the former got pos 1, and the latter threw my exception
ugexe deleting precomps doesnt help, but it complains about a file not existing that does in fact exist. but what you describe (needing the file) seems to corraborate that
01:07 MasterDuke joined
ugexe i wonder if %?RESOURCES should be providing a mechanism to say "dont rename these files" 01:10
01:12 mr-foobar left
MasterDuke a day or two ago i was asking about how to profile the rakudo build 01:12
and i successfully did so, after several attempts and a fight with the oom killer
the build took about 4 times as long, and then writing out the profile took ~1.5h 01:13
01:14 mr-foobar joined
MasterDuke and produced a 900mb profile 01:14
skink m: my uint64 $x; say $x;
camelia rakudo-moar bffc3a: OUTPUT«0␤»
MasterDuke however, even the QT-based profile viewer can't read that, QJsonDocument has a 135mb limit
skink Odd. Hey sortiz: 01:15
> my uint64 $x;
0
> $x
Unknown lexical type encountered while building context iterator
01:15 dogbert17 left
MasterDuke i don't know the profile format well, if i just lop off the first ~100mb of the 900mb file (and fix the json), would i get any useful information? 01:16
timotimo i should be going to bed 01:21
MasterDuke: yeah, it's super annoying. someone would have to rewrite the code to use a less broken json library
MasterDuke ugh, i hate C/C++, but i want to see my profile 01:24
01:28 huggable left, huggable joined 01:29 BenGoldberg left 01:30 aries_liuxueyang left, BenGoldberg joined 01:31 aries_liuxueyang joined 01:32 geraud joined
sortiz skink, hi! 01:34
skink You ever seen that issue before? 01:36
the lexical type thing
sortiz skink, Yep, that is a know problem in REPL.
skink Ah, alright 01:37
timotimo MasterDuke: the biggest contributor to the json format is call graph complexity; maybe you can chop your program into two distinct pieces, a "first" one and a "second" one? 01:38
01:39 vendethiel left, vendethiel joined
timotimo the "use_nqp" version takes 11:24m for 10_000_000 iterations on my desktop 01:40
:\
skids timotimo: I think MasterDuke 01:41
's "program" is "the rakudo build"
01:41 pierre_ left
timotimo oh, wow, that's ambitious 01:42
did you try --optimize=off to chop the optimize part off?
you can even --target=parse, that'll not do code gen
01:44 pierre_ joined 01:45 pierre_ left 01:47 pierre_ joined
MasterDuke ahh, i didn't do any of those things, i'll give them a try and see if that changes anything for the better/easier 01:49
timotimo also, at some point we want to have an alternative setting that does away with a few classes. for example, all Set/Mix/Bag/..., all concurrency stuff, stuff like that 01:51
to have a better idea of how adding/removing classes/code impacts the size of the setting, and ram usage and all that 01:53
and that's good information for our future optimizations
01:55 ssotka left, molaf left 01:56 zakharyas joined
BenGoldberg Maybe we should find a way to lazily load them? 01:57
timotimo we already lazily load stuff from the core setting 01:58
"lazy deserialization" is the keyword here 01:59
that applies for all our classes 02:00
and we also lazily decode strings from the string heap
02:06 avalenn left 02:07 avalenn joined
BenGoldberg So if Set/etc doesn't get loaded/deserialized until it's used, then what would be the benefit of having a setting without it? 02:08
MasterDuke now i also want to profile the profiler, the build finished in 165s, but writing the profile is taking forever
02:08 molaf joined 02:09 noganex_ joined 02:10 pierre_ left
timotimo MasterDuke: you can find that in the nqp repo, i believe. under src/vm/moar/HLL/Compiler.nqp 02:11
MasterDuke thanks, i'll take a look 02:12
02:12 BenGoldberg left 02:13 noganex left, molaf left
AlexDaniel MasterDuke: I'd say that it will be easier if you do it yourself :) 02:14
timotimo .tell BenGoldberg we'd find out if our lazy deserialization is good enough if removing classes from the setting doesn't change the resident set size beyond the .moarvm file shrinking
yoleaux timotimo: I'll pass your message to BenGoldberg.
02:15 pierre_ joined, zhmylove_ left 02:16 wbill left 02:17 hotel joined
hotel good evening #perl6 02:18
timotimo hey hotel
02:18 pierre_ left 02:20 jack_rabbit left
ZoffixWin \o 02:25
02:26 BenGoldberg joined
MasterDuke AlexDaniel: you may have been wrong about that... 02:28
AlexDaniel MasterDuke: O_O 02:29
timotimo wrong about what?
the what now?
AlexDaniel MasterDuke: how did you even do that 02:30
02:30 kid51 left
MasterDuke AlexDaniel: if i knew i probably wouldn't have 02:35
02:36 mr-foobar left
MasterDuke AlexDaniel: git complained that i needed to pull when i pushed the fix 02:36
AlexDaniel MasterDuke: well, there's no problem, you can have as much fun as you'd like, as long as it is in your own branch :)
02:37 grassass joined
MasterDuke AlexDaniel: maybe i didn't --rebase or something like that 02:37
AlexDaniel: i'll have a go at cleaning that up 02:38
02:38 mr-foobar joined
AlexDaniel MasterDuke: just don't lose your commits please 02:38
02:39 pierre_ joined
timotimo t.h8.lv/nqp_loop_graph.svg - if anybody wants to have a look at internals, bytecode, optimization opportunities ... :P 02:40
MasterDuke timotimo: i *may* have made a PR to p6doc look a lot uglier than it should have, but i take no personal responsibility
timotimo oh 02:41
02:43 grassass left, pierre_ left
hotel timotimo, not sure if it's just my internet connection, but that svg didn't seem to load 02:44
02:44 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
timotimo hotel: it's white on the top left 02:44
it's also gigantic
hotel ah, had to zoom out a lot 02:45
too complicated for me kek
02:45 |2701 left
timotimo i'm surprised, this code could actually work well with attrref optimization 02:46
02:47 sufrostico left
timotimo i was pessimistic enough to think that wouldn't actually end up being inlined 02:48
it's also fantastic how there's a box_n, it goes through a few "set" ops and through a few BBs, and then it lands in an unbox_n >_> 02:49
but yeah, there's stuff i've been intending to teach spesh. now i have a good benchmark to run these optimizations against 02:50
hotel it's all greek to me 02:52
timotimo hehe, fair enough 02:53
02:53 grassass joined
AlexDaniel timotimo: these graphs deserve a blog post 02:53
hotel one day I'll take a class in compilers or whatever
BenGoldberg , o O (the dragon book)
yoleaux 22:14 EDT <timotimo> BenGoldberg: we'd find out if our lazy deserialization is good enough if removing classes from the setting doesn't change the resident set size beyond the .moarvm file shrinking
02:54 zhmylove joined
timotimo huh, we don't even seem to optimize guards when we could 02:57
02:57 Actualeyes left 03:03 mr-foobar left 03:04 mr-foobar joined 03:05 cpage_ left 03:18 skink left 03:19 mr-foobar left 03:20 mr-foobar joined 03:23 Actualeyes joined
skids
.oO(one could just add a bunch of renamed copies of existing classes to a test setting and check if .moarvm grew)
03:24
timotimo that's not all there is to it :)
classes are referenced from signatures and stuff, for example
so that can in theory trigger lazy deserialization purely by being mentioned
03:25 yqt left
MasterDuke timotimo: --optimize=off and --target=parse resulted in a profile ~210mb less (700mb). which is nice, but i've still got a ways to go 03:28
timotimo if yuo have --target=parse, you don't need --optimize=off 03:29
MasterDuke right, that would make sense 03:30
AlexDaniel MadcapJake: it still looks like you want to merge 16 commits 03:40
oops
MasterDuke: ↑
MasterDuke AlexDaniel: my bad, i see that now. i'm off to bed, but i'll fix that tomorrow evening 03:45
AlexDaniel sure
MasterDuke when i look at the PR i only see my nine, but i guess the one that's a merge pulls in those others 03:47
i should be able to get rid of it 03:48
03:50 MasterDuke left 03:54 wamba joined 03:59 pierre_ joined
BenGoldberg If we had some sort of deserialization phazer, then it would be possible to detect if classes are being loaded just by being mentioned in a signature. 04:03
04:05 prevost joined 04:06 Xliff_ left, prevost left, prevost joined 04:08 BenGoldberg left 04:29 Celelibi left 04:31 _28_ria left 04:32 _28_ria joined 04:35 Celelibi joined 04:38 khw left 04:39 itaipu joined 04:44 skids left 04:45 wbill joined 04:46 sno left 04:48 CIAvash joined 04:53 Cabanossi left 04:55 Cabanossi joined, pierre_ left 04:56 ssotka joined 04:57 Xliff joined 05:00 itaipu left 05:04 prevost left 05:13 AlexDaniel left, sortiz left 05:20 mohae left 05:28 huggable left, huggable joined 05:30 ufobat joined 05:44 sno joined 05:51 mr-foobar left 05:52 jack_rabbit joined, mr-foobar joined 05:54 MadcapJake left 05:55 pierre_ joined 05:56 domidumont joined, wbill_ joined 05:58 vendethiel- joined, vendethiel left 05:59 wbill left, pierre_ left 06:00 domidumont left, domidumont joined 06:04 xinming joined 06:08 xinming_ left 06:11 grondilu left 06:16 llfourn left, llfourn joined 06:18 pierre_ joined 06:24 pRiVi left 06:25 domidumont left 06:27 firstdayonthejob joined 06:29 pRiVi joined 06:37 firstdayonthejob left, mr-foobar left 06:39 mr-foobar joined 06:41 pierrot left 06:43 pyrimidine joined 06:44 sQuEE` joined 06:46 avenj left 06:50 mspo left 06:52 domidumont joined 06:54 _mg_ joined 06:56 darutoko joined 06:57 mspo joined 06:59 hjst left 07:00 wamba left, sQuEE` left, zacts left, wamba joined, remmie left 07:02 araujo_ joined, zacts joined, mspo left 07:03 sQuEE joined 07:04 mspo joined
nine hotel: you can skip that compiler class. Compilers are actually not that difficult. You just have to know "compilers are all about trees". You parse source into a tree, transform the tree as much as you need and serialize it again in the end. Just learn some assembly language (any) to know what the output would be like and think it through :) 07:04
07:06 RabidGravy joined, araujo left, remmie joined, DrForr joined
dalek Heuristic branch merge: pushed 17 commits to doc by jonathanstowe 07:08
07:09 hjst joined
masak morning, #perl6 07:14
moritz \o masak, nine, dalek, *
07:14 pierrot joined
RabidGravy marnin 07:15
masak nine: when you say "you can skip that compiler class" -- did you take one? was it really bad?
moritz compilers seem to have a stigma of being complicated and hard to get into 07:16
nine masak: no I didn't :) And it would probably be interesting. I just don't think it's necessary for working on compilers.
masak that much I agree with, I think 07:17
I mean, I hope you're right ;) 07:18
07:20 au_ is now known as au 07:22 ssotka left
DrForr Yeah, it had the same stigma at my college. (The compiler class) 07:24
07:24 Actualeyes left
ShimmerFairy it's kinda weird how I've never needed college to learn programming :P 07:27
DrForr I didn't either, I was programming well before college.
ShimmerFairy me too, since about 10 years old IIRC (first using *shudder* VB) 07:29
moritz used University to learn about formal languages, automaton theory, complexity, computability and all that good stuff
and physics, as it happens :-)
ShimmerFairy Whenever I imagine learning computer science stuff at a college, I can't help but think "but why?"; I think I'm too used to be able to learn on my own at this point :) 07:30
nine ShimmerFairy: I have a suspicion on why rakudo is trying to write to the site repository. If I'm right, it's gonna be fixed by the precomp-store-redesign branch that's soon to land. 07:31
masak ShimmerFairy: I also did VB in my early, formative years :> 07:32
ShimmerFairy nine: cool :) . Is that part of the toolchain thing I've heard about? I for some reason feel a sudden slight interest in the world of package managing (cf. looking at the gentoo devmanual yesterday)
masak: I remember using a VB6 for dummies book and a copy of VB3 on the computer :P . I kinda liked VB3 better since it let me use MS-paint drawings of buttons as their own buttons, which VB6 couldn't do. 07:33
masak haha
yeah, I was on VB3 too 07:34
lost track of it somewhere around VB5
ShimmerFairy masak: also, I stopped using it when VB.NET came out, and five minutes of trying old COM code and it obviously not working :P
masak yeah, I also haven't been paying attention to the VB.NET bits 07:35
jast around that time I think I was using Borland's Delphi 3 07:36
RabidGravy I did a fair amount of VB6 about ten years ago for a while, the vague OO thing was somewhat of an improvement but it still had the things that annoyed me 07:38
masak o rly
07:42 brrt joined
RabidGravy but I did have a moment of revelation about the Make Noise Maths yesterday, I've had the module for a couple of years and never quite got it until then 07:45
07:47 mr-foobar left
nine ShimmerFairy: the main goal of the branch was getting module load times down in the common case of repositories not having changed since the last time. But I ended up redesigning concurrency handling so we don't need a lock for reading precomp files anymore. 07:48
ShimmerFairy: this lock that we will no longer use is probably why it wants to write to the precomp directory. 07:49
ShimmerFairy oh, that's interesting. Without knowing much, I think it'd be cool if something that would normally require a lockfile doesn't :)
nine I've always hated having to lock the precomp store just for reading. But it took quite a bit of work to create a lockless solution that works cross plattform 07:51
ShimmerFairy for some reason I'm reminded of how having atime enabled in your linux effectively requires a write for every read (to write the access time, of course). 07:52
07:54 pierre_ left
moritz ... or people writing their web application's access log into the normal working database :-) 07:56
masak RabidGravy: "'ve had the module" -- you mean you deliver that module to students? now I'm interested. 07:57
07:57 rindolf joined
masak RabidGravy: what was the revelation? 07:57
07:58 espadrine_ joined 07:59 grondilu joined
RabidGravy haha, no no it's an analogue function generator for modular synthesis ;-) I just had the light bulb moment 07:59
masak aha, www.makenoisemusic.com/modules/maths 08:01
RabidGravy yeah that's the puppy
masak now I'm slightly disappointed there's not actually such a class somewhere
08:01 g4 joined
RabidGravy There should be more analogue computers 08:02
masak now I want one of those 08:04
08:06 pierre_ joined
DrForr There's now a synthesizer that fits in a MIDI jack, can't find it on the site I thought it was on. 08:07
RabidGravy mitxela.com/projects/smallest_midi_synth 08:11
there
DrForr Yep, that's the one. 08:12
RabidGravy I've actually got all the parts to make that within a few feet 08:13
the attiny parts are great but I could go one with way more memory 08:16
08:17 wbill joined 08:20 TEttinger left, wbill_ left 08:21 aries_liuxueyang left 08:22 aries_liuxueyang joined 08:24 wbill left
ufobat morning :) 08:28
RabidGravy marnin
masak good mo'hn, ufobat 08:29
08:31 [particle] left, [particle] joined 08:32 aindilis` joined 08:33 espadrine_ left 08:36 aindilis left 08:41 avenj joined
Ulti something between yesterday morning and today has increased my test runs from 2.04s to 2.64s 08:48
08:48 cpage left
Ulti this is after running a few times and warming up the OS caching 08:48
the two recent commits around speeding up kv and hash push append are likely since the tests mostly create and destroy hashes over and over 08:50
08:51 cpage joined
Ulti mattoates.co.uk/files/perl6/bioinfo...05-12.html there is also mattoates.co.uk/files/perl6/bioinfo...05-04.html for some comparisson 08:53
08:59 pmurias_ left 09:02 brrt left
nine lizmat: may interest you ^^^ 09:17
09:27 espadrine_ joined 09:28 huggable left, huggable joined 09:30 araujo_ left 09:32 espadrine joined
RabidGravy off to the seaside to escape pollen! 09:33
09:36 espadrine_ left 09:40 zakharyas left 10:21 mscha joined
mscha p6: my @ll = (1,2; 3,4); say @ll.map(*.Slip); say @ll».Slip; 10:21
camelia rakudo-moar 1e5df4: OUTPUT«(1 2 3 4)␤((1 2) (3 4))␤»
mscha Is this a bug?
timotimo hyper operators are specifically engineered to retain structure, if i'm not mistaken 10:22
at least the unary ones and the method call ones surely are
well, as surely as in "if i recall correctly"
i've stumbled over this at least once before 10:23
10:32 darutoko- joined 10:33 itaipu joined 10:34 kid51 joined, darutoko left 10:37 brrt joined
lizmat Ulti: could you golf this down to a benchmark that I could test ? 10:38
yoleaux 00:11Z <japhb> lizmat: I see a few of your recent commits have had a laundry list of micro-optimization types applied during that commit. Do you have a master list somewhere of micro-optimizations that you've found generally work well? If so, where? If not, can we pretty please have one? :-)
Ulti lizmat not easily 10:39
lizmat ok, I'll see what I can gather from the profiles
Ulti yeah really me golfing it would be doing the profiling slowly and badly... if there is nothing in the profiles that looks relevant it could be something to do with my local environment changing or something 10:40
though I have been thinking about have a suite of benchmark tests where you know if something is a perf regression from a previous release
the issue is what takes 1s for me will be different for you 10:41
so they perhaps all need to be relative to the time taken for some simple operation
nine We do have a benchmark suite 10:42
Ulti sure but the benchmarks aren't written as tests
lizmat Ulti: what strikes me is that the top routines exclusive time is significantly more, but percentage wise the same 10:43
more or less
Ulti then perhaps its all GC time? 10:44
but that hasnt changed in this time frame
I have plenty of RAM free atm too
lizmat GC time has increase by the same amount, and is roughly the same percentage
the number of GC runs is the same, but the nursery collection time is like 1.5x more 10:45
number of jit compiled frames is actually more in the slower version 10:46
number of de-opts is the same 10:47
Ulti which is also surprising given there haven't been massive changes there either in the last week and its literally the same code running, in fact moar hasn't been bumped so its probably the same jit code? 10:48
lizmat hmmm... fewer frames got inlined
looking at the methods called, I don't think I've changed any of them in the past days 10:51
ok, on 5 May I changed the default push-exactly to use prefix ++ 10:53
and that's after your old profile
Ulti: could it be that the slowdown happened earlier? or more gradual? 10:57
perhaps the prefix ++i is as fast as i = i + 1 meme is not universally applicable yet 10:58
11:00 dvinciguerra joined 11:11 pierre_ left 11:13 pierre_ joined 11:27 pierre_ left 11:29 mscha left 11:31 pmurias joined, kid51 left
pmurias captures are immutable in nqp? 11:31
jnthn Captures are immutable in general, no? 11:33
masak .oO( captures are immutable on a plane, captures are immutable on a train... ) 11:36
pmurias at least in the nqp backend there is a savedCC that gets reused and modified 11:37
jnthn 'win 33
oops
pmurias I don't do that so I was wondering if there are other reasons not to just return the same one on clone
lizmat pmurias jnthn: there's some cheating with Captures in Junction 11:38
jnthn lizmat: Ah, with Perl 6 level ones, though, I think?
lizmat yes 11:39
jnthn Not VM-level ones you get from usecapture/savecapture
lizmat nope
jnthn I think pmurias is probably talking about the VM-level ones, and I don't think there's a way to mutate them 11:40
pmurias jnthn: yes, I'm asking about VM-level ones 11:41
teatime waves.
pmurias waves back 11:42
11:44 nicqbot joined
nicqbot hello 11:45
masak hi, nicqbot
lizmat afk& 11:46
11:48 araujo joined, araujo left, araujo joined 11:53 itaipu left
Ulti lizmat not sure, but in general recently things have been getting slower rather than faster 11:55
its been hovering at or near 2s but went from where it is today to a lot nearer exactly 2s during the end of April
this is all on OSX 11:56
11:56 zzzzzzzzz joined
nine Ulti: does it load modules? 11:58
11:58 wamba left 12:01 Xliff left 12:19 MadcapJake joined 12:24 pierre_ joined 12:27 |2701 joined 12:31 brrt left
Ulti yup 12:35
it does essentially everything
which is why I run it all the time 12:36
hmm has next LABEL had some changes? 12:40
masak how do you mean?
Ulti im getting errors on this primes benchmark I havent run in a while "labeled next without loop construct"
masak m: NUMBER: for ^10 { next NUMBER if 4 ff 7; .say } 12:41
camelia rakudo-moar 1e5df4: OUTPUT«0␤1␤2␤3␤8␤9␤»
masak Ulti: care to golf that code and show it here?
12:43 pierre_ left
Ulti m: my $int = 0; NUMBER: loop { ++$int; next NUMBER if $int == 4 ff 7; $int.say; } 12:43
camelia rakudo-moar 1e5df4: OUTPUT«(timeout)Use of uninitialized value of type Any in numeric context in block at /tmp/R01JHaT8my line 1␤1␤Use of uninitialized value of type Any in numeric context in block at /tmp/R01JHaT8my line 1␤2␤Use of uninitialized value of type Any in num…»
Ulti wah
*shrug* either way its a loop rather than a for
oh wait loop is the one more like the C for durr 12:45
12:50 brrt joined 12:52 wamba joined
MadcapJake I'm trying to solve DP266-intermediate and I think my implementation is O(n!) or something :P 12:53
gist.github.com/MadcapJake/efbcb24...13a263c7c7
12:54 Sgeo left 12:55 pierre_ joined
masak m: enum Color <red green blue>; say green; for Color.enums -> $c { say $c.key.perl } 12:57
camelia rakudo-moar 1e5df4: OUTPUT«green␤"red"␤"green"␤"blue"␤»
masak I can't quite put my finger on it, but... Perl 6 enums currently feel like they half want to be string-based, and half object-based 12:58
above, there's the nice rich `green` enum object
but when I loop over all my Color.enums, I only get Str values back
12:58 CIAvash left
masak to recover the nice rich objects, I have to do something like `Color::{$c.key}` 12:59
jnthn m: enum Color <red green blue>; say green; for Color.enums -> $c { say $c.value.perl }
camelia rakudo-moar 1e5df4: OUTPUT«green␤0␤1␤2␤»
masak m: enum Color <red green blue>; for Color.enums -> $c { say Color::{$c.key} }
camelia rakudo-moar 1e5df4: OUTPUT«red␤green␤blue␤»
13:00 hotel_california joined
masak I opened an RT ticket a while ago where I argued that .enums want to return Enum => value pairs, not Str => value pairs -- that it'd be better in every way imaginable 13:00
nothing much has happened since :) TimToady said he was mulling about it
MadcapJake what's the usefulness of the value anyways? 13:01
masak MadcapJake: you mean the 0 1 2 above?
MadcapJake yeah
jnthn m: enum Color <red green blue>; say green; for Color.^enum_value_list -> $c { say $c.perl }
camelia rakudo-moar 1e5df4: OUTPUT«green␤Color::red␤Color::green␤Color::blue␤»
masak I dunno. named constants? ordering?
jnthn There's one workaround :)
13:01 hotel left
jnthn m: enum Color <red green blue>; say green; for Color.pick(*) -> $c { say $c.perl } 13:02
camelia rakudo-moar 1e5df4: OUTPUT«green␤Color::green␤Color::blue␤Color::red␤»
masak jnthn: ooh, didn't know about that one :)
jnthn There's another :)
masak jnthn: but I actually had a use case where I needed both the keys (enum objects) *and* the values
so those workarounds are nice but don't work for me
MadcapJake m: <red green blue>.antipairs.perl.say
camelia rakudo-moar 1e5df4: OUTPUT«(:red(0), :green(1), :blue(2)).Seq␤»
masak fwiw, I wanted to produce the inverse mapping from my enumeration
from values to enums
MadcapJake: if your point is that there's more than one way... well, yeah ;) 13:03
MadcapJake masak: ^^ you can get the numbers easily, it just seems weird that something named enums returns antipairs
masak if you ask me, it feels weird to name anything "antipairs" :P 13:04
unless your programming language runs on a quantum computer
MadcapJake well debatable :P but still "enums" returns a Seq of pairs where the key is a string and the value is a positional index?! o_O 13:05
just seems a bizarre thing to return for that particular method name.
MadcapJake .oO( Not to mention how weird it is that an Enum has a method "enums" ) 13:06
llfourn m: enum Color <red green blue>; say Color::{"green"}.Int # you can do this but dunno if that's what you mean
camelia rakudo-moar 1e5df4: OUTPUT«1␤»
masak in Perl 6 terminology, the big declaration-y thing is an "enumeration"
and the little member thingies are called "enums" 13:07
MadcapJake huh, well that clears up my thought bubble :P
13:08 dogbert17 joined
perlpilot checks S99 to see if it talks about a "big declaration-y thing" anywhere 13:09
13:09 kaare_ joined
masak in `enum A <foo bar>`, "A" is the enumeration, and "foo" is an enum 13:10
notice that the *enumeration* is declared with the keyword `enum`
(a bit like sub*types* are declared with the keyword `subset`, and *switch statements* are spelled `given`)
MadcapJake ok makes some sense :) but I agree with you masak that at the very least it should return the enum values rather than a string (and I would argue that why not just return a list of enums rather than pairs of enum => pos) 13:14
masak the last I think because we got .enums partly so that we could .invert things 13:15
13:17 skids joined
MadcapJake m: <red green blue>.pairs.say # masak, but why invert when you could just do pairs 13:18
camelia rakudo-moar 1e5df4: OUTPUT«(0 => red 1 => green 2 => blue)␤»
MadcapJake my point is, there's already list methods that perform everything that enums/invert does specially, why not converge for clarity?
masak hmmm 13:19
I'll need to try that out in code
but you may have a point
I think I might miss my enums, adopting string literals instead 13:20
13:21 hotel joined
masak and I still think I might have a point on principle, that enums ought to be able to handle this. they sort of almost do. 13:22
13:22 hotel_california left
MadcapJake I just realized why the value is there, it's not positional it's the actual value of that enum xD 13:26
jnthn I think the method enums may be a relic, name wise, of when we had an immutable Hash being called EnumMap instead of just Map like today, and the immutable Pair was called an Enum.
13:26 g4 left
masak in my code, the values are Str, not the default Int 13:26
MadcapJake ahhh interesting!
masak I'm looking to idiomatically generate the inverse mapping, from those Str values to the enums 13:27
MadcapJake the docs example (pretty much the only thing about enums in there...) doc.perl6.org/routine/enums shows a Mass enum
masak shortest way to do what I want at present is `(my %color-of-symbol){.values} = Stone::{.keys} given Stone.enums;`
13:28 huggable left
masak I'd like to be able to write something more like `my %color-of-symbol = Stone.invert;` :) 13:28
jnthn: I think S12 still think of little enumeration members as "enums" 13:29
thinks*
13:30 cdg joined 13:33 finanalyst joined
dogbert17 afternoon #perl6 13:37
llfourn there is .reverse 13:39
13:39 prammer joined
llfourn m: enum Color <red green blue>; say Color.enums.kv.reverse.Hash; 13:39
camelia rakudo-moar 1e5df4: OUTPUT«{0 => red, 1 => green, 2 => blue}␤»
dogbert17 there are a few Exceptions that does not seem to be documented, e.g. X::IO::Symlink. Should I write some pod docs for them?
llfourn oh .invert is a thing. Cool. #nvm 13:40
masak yes, .invert is a little bit hash-friendly 13:46
m: say { :foo(1), :bar(1), :baz(42) }.invert.perl
camelia rakudo-moar 1e5df4: OUTPUT«(1 => "bar", 42 => "baz", 1 => "foo").Seq␤»
masak m: say { :foo(1), :bar(1), :baz(42) }.invert.hash.perl
camelia rakudo-moar 1e5df4: OUTPUT«{"1" => "foo", "42" => "baz"}␤»
masak hmm
m: say (my %).push({ :foo(1), :bar(1), :baz(42) }.invert).perl 13:47
camelia rakudo-moar 1e5df4: OUTPUT«{"1" => $["bar", "foo"], "42" => "baz"}␤»
13:47 dalek left
masak there you go. 13:47
13:47 dalek joined, ChanServ sets mode: +v dalek
llfourn that's pretty cool 13:47
masak ...it's OK, I guess
:P 13:48
llfourn better than doing it myself!
MadcapJake m: say (my %).push: {:1foo, :1bar, :3baz}.antipairs
camelia rakudo-moar 1e5df4: OUTPUT«{1 => [bar foo], 3 => baz}␤»
MadcapJake m: say ((my %).push: {:1foo, :1bar, :3baz}.antipairs).perl 13:49
camelia rakudo-moar 1e5df4: OUTPUT«{"1" => $["bar", "foo"], "3" => "baz"}␤»
masak I'm not sure what .antipairs brings exactly over .invert :/ 13:50
llfourn is that $[ ] vs [ ] meaningful?
MadcapJake llfourn: I think $[ ] might flatten differently (if it all) 13:51
llfourn oh just .gist vs .perl?
masak if I ever write up a critique over the "community's rewrite of the community" way of developing a language, it's that there's no real counterforce against sprawl/feature bloat
llfourn m: my %h = :foo([<bar baz>]); say %h.perl,%h.gist; 13:52
camelia rakudo-moar 1e5df4: OUTPUT«{:foo($["bar", "baz"])}{foo => [bar baz]}␤»
masak s/it's that there's no/it'll be about the lack of a/
llfourn you don't like feature bloat? 13:53
masak oh, I'm all for feature bloat! bring it on.
just not in Perl 6 core :/
llfourn oh ok great me too!
oh. 13:54
:P
13:54 vendethiel joined
llfourn goes back to antipairing things 13:54
masak part of this is me looking at Python 3 and seeing that they manage better with keeping the core small and consistent
sometimes pathologically so, but still. there are advantages to that style.
13:55 vendethiel- left
MadcapJake masak: I think this is kind of what a Linus figure is for in a community, hard-as-nails, can turn people away, but they keep the project from bloating 13:56
13:56 _mg_ left
masak I'm sorry, I don't think the "can turn people away" is a strength of Linus 13:57
I think it's toxic, and needs changing
MadcapJake masak: definitely not saying it's a strength, but I'm saying that often the job of saying "no" is not very well liked
perhaps a bad example :P 13:58
gfldex it's actually quite a good example because there is a story behind Linus' behaviour
llfourn turn features away not people :)
masak what makes the "community's rewrite of the language" approach unique is that the community can override $Larry and @Larry when it comes to language design, just as $Larry and @Larry can override the community
gfldex quite some years ago a young fellow wanted to get some stuff into the mainline and Linus didn't say clearly "no" 13:59
masak or, put differently, there are two "root" components in the design process: $Larry/@Larry, and the community
13:59 _mg_ joined
gfldex he provided feedback why he didn't like the patches instead 13:59
masak if either component is shown to misbehave or stall in some way, the other component can go in and tiebreak
MadcapJake masak: sounds kind of like a republic :)
13:59 brrt left
pmurias can I run nqp with perl6 ops registered? 14:00
masak MadcapJake: yes, there are certainly similarities
gfldex two years later the same young fellow showed up the with same idea, but with the fixes to the stuff Linus didn't like. Linus still rejected to feature. Another two days laters a common friend of the two told him that the young fellow came close to end his life. 14:01
being told that an idea is shit can be healthy
14:01 Sgeo joined, Actualeyes joined
masak that's a non sequitur if I ever saw one 14:02
"[he] came close to end his life" => "[abrasive feedback] can be healthy"
gfldex if you want to simplify it like that. I prefere not to when it comes to the human (quite fragile) mind. 14:03
MadcapJake masak: I think part of it is that Linus' personality is certainly grating but another part that often gets masked by his personality is that it *is* important to have a filter into a project and often times (especially in larger projects) this is tough as the voice of many is even harder to say "no" to than one person. 14:04
profan gfldex: that's quite possibly the worst example you could have used
masak gfldex: ok, let me put it like this: I have no idea what you want to say
jast it's not a non-sequitur, just tricky logic, at least that's what I think this is about: the idea being that it's better to brusquely reject something than to let someone spend two years of their lives implementing it if you didn't want to accept it in the first place
of course there's no reason to not just reject it politely the first time
gfldex a young man wasted 2 years of his life, working on some kernel patches, because Linus was nice. If he would have been clear about the shitty idea, a lot of problems could have been prevented. 14:05
jast being nice is orthogonal to fundamentally rejecting an idea
masak I don't think there's any rational or compassionate defense of Linus's being a jerk to people online
pmurias masak: isn't a lot of the abrasiveness of Linus directed at people who he is close at when they are trying to do horrible things (i.e. break everything)
profan this has nothing to do with being nice or not, it's about being clear
masak worse, I think Linus is setting a bad example as a leader
profan Linux when he rejects things is just a plain butt most of the time
uh, linus* 14:06
14:06 sufrostico joined
gfldex that's a rather big "if", i grant you, but I like to know where ppl stand. And when you are polite, you are also easy to be misunderstood because humans hear mostly what they want to hear. 14:06
jast btw from what I can tell, in *most* cases Linus only does that to people who have been around for a while and are familar with him
masak you can be clear and reject patches without being an abrasive alpha male jerk
MadcapJake Geez I feel like the purveyor of hot button issues :P (transpiler the other day, linus today) 14:07
masak oh, I missed the transpiler hot button discussion :)
jast gfldex: "the consequences of X, Y and Z in your proposal need to be thought out more clearly before I will ever consider merging this." very clear, hard to misunderstand, not aggressive
masak a lot of communities manage to set things up so that feedback is polite, clear, and actionable
MadcapJake jast: I think this is true, I've read some of his responses/rejections and they don't all involve over-the-top insults
profan like, this one for example, i've rarely seen a discussion turn rude just because something was rejected 14:08
14:08 hotel_california joined
profan and people still understand 14:08
jast I totally prefer Linus's style over some other big folks' who shall remain unnamed, who are very brusque and offer precisely nothing in reasons why they reject proposals 14:09
14:10 itaipu joined
jast favourite quote: "Stop reopening the bug. If you want explanations pay somebody." 14:10
14:10 nicqbot left
[Coke] m: say "abcde" ~~ / | @(<a b bc cde>)+»/ 14:11
camelia rakudo-moar 1e5df4: OUTPUT«「cde」␤»
14:11 hotel left
MadcapJake I think that, (thinking of the republic comparison) just like governments, maintaining projects is hard and there are pro's and con's to each method. Linus's method while brash and heartless, has built a world-spanning project. Some choose to give equal say to all contributors, some have benevolent dictators, others use voting systems. It's quite 14:15
fascinating how political and human-influenced programming can be.
RabidGravy seeing that it involves people not that surprising though 14:16
dalek c: e982126 | (Jan-Olof Hendig)++ | doc/Type/X/IO/Symlink.pod:
Wrote some docs for X::IO::Symlink
14:17
MadcapJake Code exists in three worlds at once: machine instructions, human interpretations, *and* group relations
pyrimidine MadcapJake: reminds me of that ol' esr essay "The Cathedral and the Bazaar". Though esr isn't w/o controversy either 14:18
14:18 _mg_ left
MadcapJake how does the code instruct the computer? how does the programmer relay those instructions, how does the team administer those relations? 14:19
14:19 lrep5 joined
perlpilot "effectively", "badly", "tenuously" 14:20
MadcapJake too true :) 14:21
pyrimidine: never read it but seems interesting! 14:22
14:24 m0ltar left 14:28 m0ltar joined
tony-o jast: who said that? 14:29
“Stop reopening the bug. If you want explanations pay somebody.” 14:30
14:31 sortiz joined
sortiz \o #perl6 14:37
gfldex tony-o: sourceware.org/bugzilla/show_bug.c...d=4980#c10 14:41
14:42 sno left 14:43 buharin joined
buharin hello my friends 14:43
jast tony-o: as I said, I shall not name anyone... but Google knows :) 14:44
tony-o oh dear 14:45
mspo people continue to accept abuse by gnu projects and just eat it up
14:48 sufrostico left
gfldex mspo: maybe because of: "He that is without sin among you, let him first cast a stone at her." 14:51
pmurias ok, figured out how to run nqp::p6invokeunder from nqp code
gfldex m: say IO::FileChanged; 14:54
camelia rakudo-moar 1e5df4: OUTPUT«Could not find symbol '&FileChanged'␤ in block <unit> at /tmp/emwt8LFG13 line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/emwt8LFG13 line 1␤␤»
gfldex m: say IO::Notification::FileChanged;
camelia rakudo-moar 1e5df4: OUTPUT«Could not find symbol '&FileChanged'␤ in block <unit> at /tmp/qMK_YNk2oE line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/qMK_YNk2oE line 1␤␤»
gfldex how do i get hold of the enum defined in: github.com/rakudo/rakudo/blob/nom/...ication.pm ? 14:55
tony-o m: FileChangeEvent::FileChanged.value.say; 14:56
camelia rakudo-moar 1e5df4: OUTPUT«1␤»
tony-o m: FileChangeEvent::FileRenamed.value.say; 14:57
camelia rakudo-moar 1e5df4: OUTPUT«2␤»
tony-o m: say "renamed" if 2 ~~ FileChangeEvent::FileRenamed;
camelia rakudo-moar 1e5df4: OUTPUT«renamed␤»
sortiz m: FileChangeEvent::.values.say; 14:58
camelia rakudo-moar 1e5df4: OUTPUT«(FileChanged FileRenamed)␤»
tony-o gfldex: in conclusion; just use FileChangeEvent :-)
not use in a perl way, it's just available
sortiz m: .say for +FileChanged, ~FileChanged; 14:59
camelia rakudo-moar 1e5df4: OUTPUT«1␤FileChanged␤»
gfldex i don't want to use it, I want to doc it.
tony-o what do you mean by "Get hold of", then?
gfldex get the type object
tony-o ok 15:00
gfldex besides, it feels inconsistent not to be called IO::FileChangeEvent.
tony-o m: FileChangeEvent.WHAT.say; 15:01
camelia rakudo-moar 1e5df4: OUTPUT«(FileChangeEvent)␤»
15:05 khw joined 15:20 aries_liuxueyang left
dalek c: 8266af9 | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO/Notification.pod:
get IO::Notification::Change into the index
15:22
c: b0964d6 | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO/Notification.pod:
add useage of enum FileChangeEvent to the example
15:26 pierre_ left 15:27 aries_liuxueyang joined
dalek c: 6222b5f | (Jan-Olof Hendig)++ | doc/Type/X/IO/Move.pod:
Added some docs for X::IO::Move
15:29
pmurias jnthn: what does p6invokeunder do? 15:31
15:32 prammer left 15:34 mohae joined 15:36 pecastro left
jnthn pmurias: Ummm...I *think* it's used to make sure things like where blocks get the correct scope even when invoked by the signature binder 15:37
sortiz m: enum Foo <a b>; Foo.enums.WHAT.say; # Why Hash and not Map?
camelia rakudo-moar 1e5df4: OUTPUT«(Hash)␤»
gfldex m: enum Foo <a b>; Foo.enums<c> = 2; dd Foo.enums; 15:39
camelia rakudo-moar 1e5df4: OUTPUT«{:a(0), :b(1), :c(2)}␤»
pmurias jnthn: I try to compile it to a normal call and see what breaks
jnthn :)
15:39 domidumont left
gfldex m: enum Foo <a b>; Foo.enums<c> = 2; dd Foo.enums; say Foo::a; say Foo::c; 15:40
camelia rakudo-moar 1e5df4: OUTPUT«{:a(0), :b(1), :c(2)}␤a␤Could not find symbol '&c'␤ in block <unit> at /tmp/l6HF74YgT0 line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/l6HF74YgT0 line 1␤␤»
gfldex m: enum Foo <a b>; Foo.enums<c> = 2; dd Foo.enums; say Foo::a;
camelia rakudo-moar 1e5df4: OUTPUT«{:a(0), :b(1), :c(2)}␤a␤»
gfldex sortiz: because of a lack of rakudobug it seams
sortiz jnthn, Do you agree that Map is a better option? 15:41
jnthn sortiz: I'd say so... 15:47
15:48 pecastro joined 15:58 abraxxa left, pecastro left 16:03 itaipu left 16:04 buharin left 16:06 buharin joined 16:11 ssotka joined
pmurias jnthn: p6invokeunder seems to be used to get a context from a not invoke sub that's used as a throw away "scratchpad" so that we can check if a signature binds 16:13
16:14 tinita left
jnthn pmurias: Ah...that'd also make sense. :) 16:14
jnthn really can't remember :)
I know it does terrible evil :)
16:19 sno joined 16:20 grondilu left 16:28 tinita joined 16:30 RabidGravy left
dogbert17 there is something fishy with the link method or the handling of X::IO::Link 16:30
according to the docs the following syntax is correct, i.e. link('mynewlink', 'existingfile); 16:31
if run this and 'existingfile' does no exist :) I get the following error message 16:32
geekosaur dogbert17, sounds like someone got that backwards
the syscall is link(existingfile, newname)
(likewise for symlinks)
dogbert17 aha
geekosaur ...swapping those is rather common, I'm afraid 16:33
dogbert17 the error message is backwards
Failed to create link called 'existingfile' on target '/home/dogbert/pwdlink': Failed to link file: no such file or directory
geekosaur (I'm not sure why; to me it makes sense as "just like copy or move")
16:33 pecastro joined
geekosaur going into standup... 16:34
dogbert17 according to 5to6-perlfunc we have
"In Perl 6, part of the IO::Path class. The only difference between Perl 5 and Perl 6 is that the argument order has changed. It's now link($original, $linked_file)."
16:35 Actualeyes left
geekosaur link OLDFILE,NEWFILE 16:35
from perldoc -f link
which is same as the syscall
dogbert17 so, we should change the doc for link then?
diakopter $linked_file is confusing anyway 16:36
16:36 domidumont joined
ilmari src/core/io_operators.pm: sub link($target, $name, …) 16:37
mst naming around symlinks is almost always confusing
mst was about to say 'soft links' due to falling into the everything2 vortex briefly yesterday
dogbert17 this works on my machine: say link("newlink", "existingfile"); # True 16:40
if I try the same on a nonexisting file I get: Failed to create link called 'nonexistingfile' on target '/home/dogbert/newlink2': Failed to link file: no such file or directory 16:43
there must be a bug lurking somewhere 16:44
ilmari perl6 is backwards of C and perl5, but why? 16:47
16:48 orafu joined
geekosaur probably for the reason I said already: people always think it's the other way around 16:49
so in p6 it is
teatime hrm... jnthn has a perl6 course?? this is on the internet, I hope… 16:52
TimToady I don't recall that any explicit decision was made on link; maybe it was an accident 16:54
mst maybe because it means you can end up doing path_object.link($to) ? 16:56
16:57 kjk joined, tinita left, molaf joined
diakopter mst: I think you mean $from 16:58
mst I don't, because you're making the path a link -to- the other path
(this is why it's so frelling confusing, of course)
16:59 orafu left
diakopter yeah but then you can't do the 2nd-arg optional thing where it uses the same filename for the current directory if it's linking to something in another directory 16:59
I've used that at least once 17:00
17:00 pmurias left
mst I would do that in shell but not in code, I don't think 17:01
matter of taste of course
kjk I see that when I 'use' a module, things that are 'is export' are made available to me, but I'm worry about 'use'-ing multiple modules that might, for example, export subs with the same name, is this a problem? 17:02
17:02 lrep5 left 17:03 prammer joined 17:04 tinita joined
kjk is there a way for a module user to explicitly specify what to import from a module? say, i know module A exports sub1 sub2, but I only want sub1 17:07
mst kjk: use ModuleA qw(sub1);
kjk: use ModuleA; # means give me the defaults
kjk: use ModuleA qw(one two); # give me only one and two
17:07 pmurias joined
mst kjk: use ModuleA (); # don't import anything 17:07
17:07 cpage_ joined, RabidGravy joined
mst kjk: see p3rl.org/use 17:07
huf isnt that for perl5?
kjk mst: awesome, thanks. I didn't even know perl5 17:08
mst AUGH AUGH AUGH WRONG CHANNEL I SUCK
mst facepalms
huf :D
mst kjk: ignore me
MadcapJake lol
huf no no, it was excellent advice, just for the other foot
mst though the perl6 version is presumably similar ... 'use ModuleA <sub1>' or something?
MadcapJake kjk: if you use a module that has a sub declared in a previously imported module it will fail, iirc 17:09
teatime .tell jnthn I saw in my logs someone mention your 'perl6 course' (or maybe it was 'introductory class' or something)... is that online?? sounds like it would be awesome.
yoleaux teatime: I'll pass your message to jnthn.
mst sorry, that's such a common #perl question ... :/
MadcapJake but you can do `require MyModule <&foo>` to only get the sub you want 17:10
kjk: ^^
here's the Perl 6 version of module docs: doc.perl6.org/language/modules
mst kjk: just listen to everybody who isn't me :D 17:11
teatime mst: it's pretty much the same. perl6 has a :MANDATORY tag, which I think will get exported even when the user says ``use MyModule ()`` 17:12
kjk lol np, thanks a lot guys, I'll give it a try @madcapjake, though it didin't fail when I 'use' another module that exports a sub with the same name..., it seems to replace the earlier sub
MadcapJake can you really provide a list to `use`? 17:13
hmm, didn't think it replaced
m: sub ok($foo) { $foo.say }; use Test; ok('hello!') 17:14
camelia rakudo-moar 1e5df4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LeNHjPxkos␤Cannot import symbol &ok from Test, because it already exists in this lexical scope␤at /tmp/LeNHjPxkos:1␤------> 3sub ok($foo) { $foo.say }; use Test7⏏5; ok('hello!')␤»
teatime well... you can definitely specify multiple tags with use, but that's not what you're asking :) 17:15
MadcapJake kjk: ^^ there's the error
m: module foo { package BAR { sub baz { 'quux'.say } } } use foo :BAR; baz() 17:16
camelia rakudo-moar 1e5df4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/yLp77GACgP␤Strange text after block (missing semicolon or comma?)␤at /tmp/yLp77GACgP:1␤------> 3package BAR { sub baz { 'quux'.say } } }7⏏5 use foo :BAR; baz()␤ expecting any of:␤ infi…»
MadcapJake m: module foo { package BAR { sub baz { 'quux'.say } } }; use foo :BAR; baz()
camelia rakudo-moar 1e5df4: OUTPUT«===SORRY!===␤Could not find foo at line 1 in:␤ /home/camelia/.perl6␤ /home/camelia/rakudo-m-inst-2/share/perl6/site␤ /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤ /home/camelia/rakudo-m-inst-2/share/perl6␤ CompUnit::Repositor…»
MadcapJake huh, I thought you could do that in a one-liner 17:17
teatime so. What does a union type look like in Perl6?
geekosaur it's already in scope, don't you want import?
s/in scope/loaded/ I guess
MadcapJake geekosaur: oops! yep that's it! 17:18
still doesn't work though :\ and still besides the point cus I was trying to see if `use` could take lists 17:19
kjk MadcapJake: I have two files(one.pm6 and another.pm6) both contain a sub named 'xxx', then from the REPL, I do: use one; use another;
MadcapJake teatime: I thought that use only accepted package pairs
kjk and it didn't give me an error.
MadcapJake what happens when you call the sub? 17:20
kjk it calls the sub that's imported later
MadcapJake weird, maybe it replaces when they are both in modules whereas fails when one of the subs is in the current scope 17:21
kjk actually, i take that back..., it always calls the same sub, hmm...
teatime MadcapJake: you mean like: use MyModule (:group1 :group2 :DEFAULT) ?
MadcapJake teatime: no I thought you *couldn't* do `use MyModule <&baz>` 17:22
17:22 iH2O joined
MadcapJake m: use Test <&ok>; ok(1 == +'1') 17:22
camelia rakudo-moar 1e5df4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9q5BV4SMqT␤Error while importing from 'Test':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at /tmp/9q5BV4SMqT:1␤------> 3use Test <&ok>7⏏5; ok(1 == +'1')␤»
kjk ok forget what i just said... :( i forgot to make 'is export' one of the sub...., ignore me
teatime there must be a pastebin or something I missed 17:23
MadcapJake kjk: ahh! well glad you figured it out, better than strange module import behavior :)
kjk yeah... sorry about that lol
MadcapJake kjk: no problem! Keep the questions coming!
iH2O lets all /ignore kjk
MadcapJake lol wow harsh O_o 17:24
kjk no~~~ i've got more questions! :)
mst kjk: sometimes making a fool of yourself on IRC is the fastest way to find your mistake :D
iH2O :)
mst we've all done it
kjk indeed..
MadcapJake and mst's advice works for both #perl and #perl6 :P
teatime so.. union type.. inspiration? anyone? trying to figure out how a class should be structured that 'has' either an X or a Y but never both. 17:25
mst MadcapJake: this time :D
MadcapJake lol 17:26
teatime: X|Y ?
or you mean xor
17:26 iH2O left
teatime maybe. I was thinking maybe 'where' + junction? 17:26
MadcapJake: so, let me think of an example... at least one less esoteric than my actual one... 17:27
sortiz kjk, in the REPL you can import multiple lexical symbols with the same name because every line use a new lexical nested scope.
17:28 huggable joined
moritz class A { has ($.x, $.y); submethod BUILD(:$!x, :$!y) { unlexx $!x xor $!y { die "Can only set x XOR y" } }; 17:28
would be my approach to a union type
MadcapJake unlexx?
moritz unless
teatime MadcapJake: synonym for Grammar.parse.inverse() 17:29
kjk so, is there a way to "explore" what's available in my current namespace after I 'use' a module? or maybe to see what symbols are 'is export' in the module?
MadcapJake moritz: oh duh! :P seemed like something else at first glance
geekosaur heh
sortiz m: use Test; MY::.keys.say; # kjk 17:30
camelia rakudo-moar 1e5df4: OUTPUT«(&isnt $=pod &does-ok &flunk &cmp-ok &pass &plan !UNIT_MARKER &unlike &subtest EXPORT $_ $! &use-ok &like &throws-like &is-deeply &eval-dies-ok &skip-rest &todo ::?PACKAGE GLOBALish $¢ &done-testing &diag &is &ok $=finish &eval-lives-ok &lives-ok &dies-ok…»
teatime MadcapJake: I guess this is a (kindof bad) example: class Circle has EITHER (Point $center, Length $radius) OR (Point $circum-point-1, Point $circum-point-2) OR (Line $tan-1, Line $tan-2, Length $radius). 17:31
MadcapJake sortiz: how do you get the subs that Test imports?
teatime bah that's a terrible example that will just invite non-union solutions, heh
sortiz m: need Test; Test::EXPORT::ALL::.keys.say; # without import 17:32
camelia rakudo-moar 1e5df4: OUTPUT«(&isnt &plan &pass &cmp-ok &flunk &does-ok &subtest &unlike &like &use-ok &todo &skip-rest &eval-dies-ok &is-deeply &throws-like &ok &is &diag &done-testing &is-approx &skip &dies-ok &lives-ok &eval-lives-ok &MONKEY-SEE-NO-EVAL &nok &is_approx &isa-ok &can…»
MadcapJake ahh there we go, I was trying Test::Export::DEFAULT::.keys and nothing was coming up
kjk nice, thanks sortiz
MadcapJake teatime: yeah that I would solve via two different `new` methods 17:33
(or three)
sortiz m: need Test; Test::EXPORT::DEFAULT::.keys.say; # DEFAULT works too.
camelia rakudo-moar 1e5df4: OUTPUT«(&isnt &plan &pass &cmp-ok &flunk &does-ok &subtest &unlike &like &use-ok &todo &skip-rest &eval-dies-ok &is-deeply &throws-like &ok &is &diag &done-testing &is-approx &skip &dies-ok &lives-ok &eval-lives-ok &MONKEY-SEE-NO-EVAL &nok &is_approx &isa-ok &can…»
MadcapJake sortiz: huh, maybe it was a case of the REPL thing you stated earlier
sortiz MadcapJake, Yep, can be. 17:34
MadcapJake yep, now that I do it in one line, it works
sortiz :)
MadcapJake sortiz++ # so many helpful tips!
sortiz kjk, yw 17:35
17:36 iH2O joined
MadcapJake should really move his lunch away from the keyboard or risk needing yet another one 17:36
sortiz Another lunch? :-)
MadcapJake lol! 17:37
mst given the LotR themes of TimToady's recent talks ... presumably second lunch, to go with second breakfast
MadcapJake I'm a strong believer in second breakfast :) favorite meal of the day! 17:38
17:41 itaipu joined
sortiz MadcapJake, And yes, 'use Foo ...' take a list, but only named args are handled automatically, as tags mapped to subpackages of EXPORT::, but other args need an EXPORT sub in the exporter unit. 17:42
MadcapJake ok so `use Test <&ok>` won't work, right? 17:43
sortiz Unless Test declares a 'sub EXPORT() { ... }' to handle that. 17:45
MadcapJake i see, could you do `use Test DEFAULT<&ok>`? 17:46
oops forgot the colon
teatime MadcapJake: lol, I still can't think of a good example. that's perhaps telling in itself. and moritz provides one perfectly workable solution. the more I think about it, it seems like unions might be kindof a feature to address short-comings of earlier and forcibly-statically-typed languages, and mostly irrelevant in the world of Perl6. afterall, a variable can hold any type, and you can query it to see
what kind of thing it is. (or have a separate enum param to indicate, if your different types aren't actually different types.)
MadcapJake m: use Test :DEFAULT<&ok>; ok(1 == +'1')
camelia rakudo-moar 1e5df4: OUTPUT«ok 1 - ␤»
teatime so maybe I was just overthinking it.
17:46 iH2O left
MadcapJake teatime: I would agree, there are things on the fringes of dynamic/static languages that don't transfer well 17:48
I think junctions, subsets, where constraints, should let you accomplish what you need
sortiz lunch time& 17:49
teatime oh, and I forgot to mention also, you could also do it as an inheritence hierarchy, à la Cool 17:53
MadcapJake yeah there ya go! That's a great idea.
Can I ask what your specific situation is that makes you want to reach for union types? 17:54
17:54 iH2O joined
iH2O activity folks! 17:56
z.... 17:57
teatime MadcapJake: strong typing makes me feel warm and fuzzy inside. I feel safer if I explicitly specify the types of arguments, return values, and attributes.
nine +1 17:58
iH2O +9
17:59 cdg left
teatime oh hey.. this was easy: sub foo($x where Int|Str) { say $x }; foo 10; foo "bar"; foo 3.42; 18:02
can also do: sub foo ($x where Int:D|Str:D) 18:03
MadcapJake yeah that's what I was trying to tell you :P
I should'a given an example, I s'pose
teatime yeah I realized it early on but I didn't realize the syntax could be that clean.
then I re-read about smartmatching 18:04
nine Public service announcement: I'm gonna merge the precomp-store-redesign branch soon
iH2O good to know
MadcapJake i'll rebase my custom CUR work after that and try and find some time this weekend to finish it! My son's birthday is this weekend so I might be too busy 18:05
iH2O is it fathers day already this weekend?
MadcapJake notices that his fork is already way out of date
18:05 |2701 left
nine MadcapJake: rebase regularily. Makes it much easier :) 18:05
MadcapJake nine: thanks good tip, I thought I should just wait it works xD 18:06
s/it/till it/
teatime and naturally, this also works: class A { has $.x where Str|Int }; <-- moritz, how do you feel about this compared to manually checking in e.g. BUILD 18:07
or anyone, of course.
nine teatime: whatever you can do declaratively, do it 18:08
iH2O why?
perl6 isnt prolog
18:08 kjk left
iH2O :-? 18:09
perlpilot prolog is perl6 though (a slang anyway ;)
iH2O :-P
teatime :)
mst iH2O: declarative > functional > mutable 18:10
in terms of not wanting to kill yourself while debugging
iH2O i stand corrected
teatime nine: that is my feeling as well, at least whenever it's clearer. which it usually is, which is why I lean that way to begin with.
mst iH2O: then again, I also like prolog so :)
iH2O once the japanese had an ambitious AI project based on PROLOG 18:11
20 years ago
dunno what happened with it
no one talks about it anymore :(
people seems to have given up figuring the "hard problem of AI" 18:12
seem
mst not everybody gave up
iH2O never give up!
mst if you don't believe me, idle in ##prolog for a bit
tony-o MadcapJake: the dates on modules are being fixed now too - submitted = first commit to repo and updated = date of latest commit to repo
MadcapJake or maybe it's so powerful that it has become indistinguishable from people... O_O
tony-o: sweet! that's awesome! 18:13
tony-o++ # modules.zef.pm
MadcapJake is off to the laundromat & 18:14
iH2O beware bedbugs crawling around
18:17 simcop2387 left 18:20 simcop2387 joined, espadrine left, brrt joined 18:23 sufrostico joined
iH2O i like perl6 for its awesome regex. but since theyre still a bit slow i usually do some grep/sed front-end preprocessing 18:27
that speeds things up quite a bit like 5x
timotimo yeah, speed improvements are on the menu for this year 18:28
all the speed improvements
buharin hi 18:31
:) 18:32
iH2O hi perl6er
buharin I want to speak with Perl Guru
iH2O perl guru or perl6 guru?
both?
buharin both
iH2O im sorry its not me 18:33
[Coke] If you have a perl 6 question, you can ask it here.
tadzik fire it up, we'll see if we can find someone who's guru enough :)
[Coke] perl 5, you probably want #perl on irc.perl.org 18:34
mst no!
[Coke]: don't send him to a SOCIAL channel!
iH2O tsk tsk
mst for perl5, you want #perl on *freenode* or #perl-help on irc.perl.org
iH2O :)
[Coke] mst++
mst remember that #perl was a social channel years before magnet was irc.perl.org 18:35
iH2O perl5 predates IRC
mst (this would all have been simpler if the people running perl.org DNS had actually bothered asking anybody before they pointed the CNAME at us :)
[Coke] mst: can't remember what I don't know. thanks for clearing up the confusion, though. 18:36
buharin I want to speak only with guru 18:37
gentle conversation
mst buharin: if you want free help, you will go the places I have suggested and ask nicely.
iH2O [Coke] is a guru
mst [Coke]: if you don't know, don't send people to random channels on other people's networks then :P 18:38
buharin [Coke], are you guru?
mst buharin: please if you have a perl6 question, ask it in this channel. 18:39
buharin: if you have a perl5 question, join #perl and ask it there
the 'guru' thing is silly and will not get you help
buharin okay 18:40
so
18:40 ZoffixW joined
buharin I want to ask Perl Guru 18:40
iH2O troll alert!
mst stop with the guru rubbish. ask the question.
iH2O rush to the bunkers!
ZoffixW buharin, ask away.
buharin, I'm a guru in everything.
buharin why there not something like perlgame equivalent to pygame
ZoffixW buharin, no one was interested enough in writing it. 18:41
mst buharin: sdl.perl.org/ 18:42
ZoffixW buharin, we do have SDL bindings in P6 and I'm sure there's a bunch of stuff in Perl 5 too. So there's some stuff, it's just not a "collection of game writing modules"
buharin ya I know
timotimo 2011, fantastic :D
buharin but Python is more friendly anyway
however Perl is magic
timotimo the SDL2 bindings could seriously benefit from people telling me what they are missing, or showing off stuff they are doing with it
ZoffixW timotimo, that'll come soon. I'm planning on writing Tetris (as a learning exercise) 18:43
timotimo great!
buharin timotimo, I send pull request to sdl2 perl6
and it was ignored
:(
ZoffixW buharin, yes, that's why we have so many languages. Different people like different things.
iH2O poor buharin 18:44
iH2O hugs buharin
timotimo oh, are you Freezerburn?
buharin yep
timotimo damn, sorry about that
i remember that
it doesn't apply cleanly any more. i'll have to re-do it myself in order to get it in 18:45
for now i have to be AFK, sorry
18:45 AlexDaniel joined
ZoffixW buharin, oh, actually I see there *is* a PerlGameDev group. Though judging by the dates on those repos, it's full of bitrot: PerlGameDevgithub.com/PerlGameDev 18:45
github.com/PerlGameDev
buharin ZoffixW thank you my friend 18:46
ZoffixW No, problem. Glad to be the guru for guruing needs!
iH2O lol
ufobat lol
[Coke] feels like he and mst are on the same side, and still feels like mst is grumpy. 18:47
[Coke] hugs mst.
18:47 mohae_ joined
ZoffixW huggable, hug mst 18:48
huggable hugs mst
moritz huggable: hug yourself 18:49
huggable hugs yourself
moritz huggable: hug huggable
huggable hugs huggable
huf grammar...
18:49 dalek left 18:50 dalek joined, ChanServ sets mode: +v dalek, mohae left
ZoffixW huf, patches welcome: github.com/zoffixznet/huggable/blo...Hug.pm6#L9 18:50
AlexDaniel RabidGravy: ouch, you merged it! 18:53
RabidGravy what? 18:54
mst huggable hugs huggably huggably on the sea shore
AlexDaniel RabidGravy: not a big actually, but just so that you know
RabidGravy: there was a little problem with github.com/perl6/doc/pull/489
RabidGravy: mainly if you look at the list of commits, every commit is doubled 18:55
not a big issue*
RabidGravy: :) irclog.perlgeek.de/perl6/2016-05-12#i_12467443 18:56
RabidGravy well I was well asleep by then :) 18:57
AlexDaniel huggable: hug hugs
huggable hugs hugs
MadcapJake await start { Laundry.new(:3loads) }; self.rejoice; 18:58
18:58 wamba left
MadcapJake More like: self.fold(:all) 18:58
moritz but is it a left fold or a right fold? :-) 18:59
MadcapJake Lol, is there a middle fold?
jast it's called centerfold 19:01
psch i heard the center cannot fold..? 19:02
moritz if the center folds, the whole front is lost!
moritz wonders if centipedes centerfold 19:03
jast no, they centifold
moritz and "fold" stands for "f-ing old", right? 19:04
huf so if centipedes have 100 legs, do kilopedes have 0.001 legs?
jast what? no!
kilopedes have 1000000 legs 19:05
moritz that would have been my intuition as well
AlexDaniel but then centipedes should have 10 legs, no?
jast the beast with a million legs
moritz one zero off
jast whoops
feel free to sue me
huf i think it's flipped for pedes 19:06
AlexDaniel right, no…
huf because centimeter is 1/100th a meter
but it's supposed to be a hundred legs? so this scale is clearly 1/
moritz the centpede has 100 legs, so a pede has 10_000 legs
huf oh that's silly.
a monopede has one leg. a biped has half a leg
moritz and the kilopede has 10M, the millipede 10 19:07
huf though arguably half a leg is the same thing as one leg
jast you brought up kilo and thus we assumed SI, not greek
AlexDaniel huggable: dunno
huggable AlexDaniel, ¯\_(ツ)_/¯
moritz
.oO( SI is all greek to me )
19:08 JustinHitla joined
huf i thought it was some kind of norwegian thing 19:08
JustinHitla myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' }
moritz I'm glad the French have the habit of switching the order of words in their sentences or names, otherwise we'd be stuck with IS
JustinHitla how to make it into oneliner ?
so I can run it from console without creating file.pl
moritz JustinHitla: I believe you are in the wrong channel
JustinHitla no its perl 19:09
jast why wouldn't you be able to run this from console?
19:09 filippos_ joined
mst JustinHitla: that is a bash function 19:09
AlexDaniel JustinHitla: what part of that is Perl 6?
JustinHitla moritz: so because of little bit of awk its not worth asking here ?
moritz JustinHitla: it looks more like shell programming to me, and certainly not Perl 6
AlexDaniel or even just perl…
mst JustinHitla: that is a bash function
JustinHitla: it is not perl at all
JustinHitla: it is bash
iH2O the French puts the adjective after the noun which is more natural in that you dont have to store the adjective before applying it to the noun
jast it happens to be using a tool written in Perl
AlexDaniel mst: calm down :)) 19:10
jast still I don't really understand the problem
mst AlexDaniel: dude, please don't ever say that to me.
19:10 mr-foobar joined
moritz JustinHitla: we tolerate a bit (or a lot) of off-topic questions from regulars, but are a bit off-put when people join and start with off-topic questions 19:10
jast mst: don't calm down! :}
moritz pump up!
mst jast: I WILL CALM DOWN IF I WANT TO YOU'RE NOT MY MOM
iH2O tsk tsk
jast how do you know?
AlexDaniel huggable: hug mst 19:11
huggable hugs mst
mst jast: I gave the eulogy at her funeral. The corpse was a clue.
jast oh, well that makes sense...
huf i wish calm down were closer to "rest in peace" like it is in a grown up language :)
MadcapJake huggable: hug no one and cries softly
huggable hugs no one and cries softly
filippos_ lovely to see this kind of conversations :)
ufobat while running my bailador tests i just had a "zeroed target thread ID in work pass", which is not reproducible 19:12
19:12 filippos_ left
moritz has written a ~6k chars blog post, and now for the live of him can't think of a conclusion or outro ro something like that 19:13
ufobat: iirc moarvm has some instrumentation that allows you detect cross-thread writes; maybe try to turn that on for the test suite? 19:14
jast let's have a look. for seven fantasy dollars I'll make one up for you!
moritz sorry, my memory is very vague on this one; hopefully somebody else here or in #MoarVM can provide details
ufobat okay... 19:15
diakopter ufobat: that's an internal GC error
moritz JustinHitla: gist.github.com/moritz/62a3b69164e...28499bec60
19:16 yqt joined
diakopter (doesn't mean there's a GC bug; it usually means something wasn't rooted properly) 19:16
moritz sorry, meant jast
19:16 domidumont left
moritz j<tab> simply isn't discriminatory enough 19:16
jast I get that a lot
ufobat what does "wasn't rooted properly" mean?
19:16 spider-mario joined 19:17 ZoffixW left
diakopter oh, not your fault; it's a bug in the VM's C code 19:17
JustinHitla moritz: what is it ?
jast moritz: right, I can see how that's a bit tricky
moritz JustinHitla: sorry, it was meant for JustinHitla
JustinHitla: argl, pleaes ignore me 19:18
JustinHitla: it was meant for jast
geekosaur ufobat, rooting has to do with registering memory allocations with the garbage collector so that when gc moves something around, things that point to or within that thing get updated
moritz should clearly just go to sleep, and try again tomorrow
jast if you add an intro you can double back to it as the conclusion
diakopter ufobat: if you can't reproduce it after a bunch of tries, best to just wait until next version of MoarVM is released (with next Rakudo) since there are some fixes which might fix what you see
jast e.g. tell a story about that time you saved the world using the approach you're describing
ufobat allright :)
thats easy
thanks
jast and then the conclusion is you becoming filthy rich and ruling the world, "and the same could happen to you if you do this stuff" or something 19:19
moritz jast: story telling is a good idea. I usually don't even consider it when talking about technical topics 19:20
jast checks all the boxes for marketing, too. bring up a dilemma the audience can identify with. make them empathize with you. introduce your magic potion. conclude with all the benefits and call the reader to action (do this yourself now). tada!
timotimo oh, and: only fools point out the potential drawbacks of their praised-of-the-day 19:22
19:22 brrt left
jast only point out the *challenges* in such a way that the reader is subtly encouraged to buy your consulting services, too 19:22
moritz jast: heh, when I'm done with my stuff, I should nudge you go over my website and sales pitch :-)
jast: oh, I don't actually want to sell consulting services, just a book 19:23
jast same difference
moritz right :-)
jast now, about those seven fantasy dollars...
I want them in blue coins! 19:24
moritz m: say 'jast +7'
camelia rakudo-moar 1e5df4: OUTPUT«jast +7␤»
jast I guess that will work
moritz m: my $jast; ++$jast for ^7; say $jast
camelia rakudo-moar 1e5df4: OUTPUT«7␤»
moritz there, I even paid you twice! 19:25
jast what? nooo! you don't own me!
iH2O jast is incorruptible 19:26
jast for President!
jast now, let's not be hasty
I may not be... completely incorruptible
if you get my meaning
moritz right, the first step is jast for presidential candidate!
MadcapJake Anyone want to take a look at my poor man's dykstra algorithm? I can't seem to get it to stop running xD gist.github.com/MadcapJake/efbcb24...13a263c7c7 19:32
19:34 dalek left
MadcapJake I should probably assemble all possible paths and then save them to reduce calculations, but I need a working algorithm first 😵 19:35
19:35 dalek joined, ChanServ sets mode: +v dalek
jast repr is a connection matrix, right? 19:36
adjacency matrix, technically speaking
MadcapJake Yeah
jast yeah, I think a dynamic programming type approach is both easier to implement and loads more efficient 19:38
MadcapJake Any good resource you know of for learning that?
jast I can try and describe what I'd be doing here 19:39
MadcapJake Sure!
jast the main thing is you're doing the same things over and over again by iterating in ecc 19:40
a bottom-up approach might work like this:
mst 0 19:41
jast let's say we have N nodes. create an array[N] and initialize with magic/empty value (not 0)
maintain a set of nodes you've looked at (empty initially) and a set of nodes you haven't looked at (all minus your input $v, initially)
actually let's simplify a bit further. put *all* nodes in the set of unvisited (not looked at), but put $v first 19:43
basically you sort the set of unvisited nodes by its value in the array I mentioned. this array is the cost array where you're determining the minimum cost to reach that node from $v. 19:44
the cost value for $v itself is 0, of course, so the $v node comes first in the unvisited set 19:45
MadcapJake I read something like that last night, but how do I establish cost when each node is equidistant?
19:46 khw left
jast if you don't have weights, the cost of every edge is 1 19:46
if you never have specific weights we can simplify a little
the loop goes like this: shift value from unvisited set. let's call that node $x. get $x's successors in the graph. for each successor $y, update its cost: cost[$y] := min($cost[y], $cost[x] + 1) 19:48
I'm gathering you want to know the actual path to take to each destination node, so we can extend this step a little 19:49
define an array of paths initially, with the path to each node initialized to empty
now, when updating the cost for $y, if $cost[x] + 1 is smaller than the previous tentative cost, we've found a new shorter path to $y
MadcapJake How do I get the successors?
timotimo you store them 19:50
jast from your adjacency matrix
you're already doing that
MadcapJake OK got it
jast so now you can update the tentative path to $y: it's path[$x] (concat) $y
19:51 wamba joined
jast once you're done for all $y, you add $x to the visited set (and you skip over all nodes already visited), and that concludes the loop 19:51
in the end you have the real cost/distance to each node, and the shortest path to each node
questions? :) 19:52
(if you do all this for just one destination node, you can terminate the loop the moment you're moving that node to the visited set)
teatime .u U+2216 19:53
yoleaux U+2216 SET MINUS [Sm] (∖)
jast if, at any time after the first go through the loop, all the cost values for the nodes in the unvisited set are magic/empty, you can terminate, too, because you've found that the remaining nodes are not reachable at all 19:54
teatime hypothetical: If you could not use that ^^ one, which Unicode character would you use to indicate Set Subtraction / Set Remove ?
jast backslash 19:55
teatime ok, what unicode character with codepoint > 127, then.
MadcapJake OK let me (try to) take this all in 🤔 19:57
timotimo i wrote a nice dijkstra for the masakism workshop, but i can't find it right now
19:57 cdg joined
timotimo it even draws a grid on the terminal when you ask it to build grid-like graphs 19:57
teatime MadcapJake: {A B C D} ∖ {A C} → {B D} if that helps. and >127 just means non-ASCII. 19:58
jast .u U+2572
yoleaux U+2572 BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT [So] (╲)
jast maybe
it's a bit big but the idea is there
19:59 iH2O left
ugexe .u U+2296 ? 20:00
yoleaux U+0020 SPACE [Zs] ( )
U+002B PLUS SIGN [Sm] (+)
U+0032 DIGIT TWO [Nd] (2)
jast I guess people would understand that, too 20:02
in the context of sets there's only so much it could possibly mean :)
ugexe m: say set(<a b c d>) (^) set(<a c>); # (^) is the texas variant of existing set operator U+2296
camelia rakudo-moar 366ddf: OUTPUT«set(b, d)␤»
psch m: say set(<a b c d>) (-) set(<a c>); # we have two of that? 20:03
camelia rakudo-moar 366ddf: OUTPUT«set(b, d)␤»
psch or am i confused 'cause U+2296 doesn't render here? :) 20:04
MadcapJake jast: thanks I think I follow, still doing laundry but I'll give it a try later tonight!
ugexe ah (^) is symetric difference
jast MadcapJake: good luck with both :) 20:05
I believe laundry is one of the great evils of old
masak yes, it's set difference versus symmetric difference
I kind of enjoy doing laundry, actually
teatime aka relative complement, aka set-theoretic difference 20:06
masak it feels like a very well-delimited, ritualized act
laundry, that is. not set difference
teatime is also doing laundry. *lots* of laundry :≀
er, U+2216 is aka ^^, not U+2296, which, yes is already a different Perl6 set operator :) 20:09
jast yeah, I'm kidding. I don't mind laundry. ironing is the real great evil.
masak oh the ironing 20:12
20:13 firstdayonthejob joined 20:17 molaf left 20:20 darutoko- left 20:24 buharin left 20:25 perlpilot left 20:26 cpage left 20:27 perlpilot joined 20:28 cpage_ left
MadcapJake Lol laundry isn't so bad if you have laundry machines, I really hate going to laundromats... 20:29
20:29 _dolmen_ joined
jast I do have one 20:29
never used a laundromat 20:30
mst I have never owned an iron.
20:33 wamba left 20:34 ufobat left
masak m: for ^5 -> $n { sub foo { next if $n == 3 }; foo(); say $n } 20:41
camelia rakudo-moar 366ddf: OUTPUT«0␤1␤2␤4␤»
masak TIL the corresponding code is outlawed in Python
mst perl5 would warn() unless you specifically tell it not to, I think 20:42
masak "SyntaxError: 'continue' not properly in loop" -- meh :)
in Perl 6 it's just naturally fine
mst I think perl5 warns because 'next' is dynamic and you often didn't mean to exit a subroutine that way 20:45
certainly I don't find occasionally disabling that warning onerous, and it's found bugs for me before
OTOH I suspect perl6 would correctly complain about the equivalent bug as well 20:46
masak m: my $g; for ^3 { $g = { next } }; $g() 20:50
camelia rakudo-moar 366ddf: OUTPUT«next without loop construct␤ in block <unit> at /tmp/uUn3San2uX line 1␤␤»
masak mst: ^^ that one?
mst I was thinking of declaring 'sub foo' outside the loop 20:51
AlexDaniel m: sub foo { next if $^n == 3 }; for ^5 -> $n { foo($n); say $n } 20:53
camelia rakudo-moar 366ddf: OUTPUT«0␤1␤2␤4␤»
masak m: sub foo { next }; for ^3 { foo() if $_ == 1; .say }
camelia rakudo-moar 366ddf: OUTPUT«0␤2␤»
masak works fine in Perl 6. no warning.
Python would shoot soda out its nose at that one. 20:54
mst it works the same in perl5, but the warning has saved me pain before now
20:54 dvinciguerra left
AlexDaniel m: sub foo { LAST { say ‘hi’ } }; for ^5 -> $n { foo; say $n } 20:55
camelia rakudo-moar 366ddf: OUTPUT«0␤1␤2␤3␤4␤»
AlexDaniel m: sub foo { FIRST { say ‘hi’ } }; for ^5 -> $n { foo; say $n }
camelia rakudo-moar 366ddf: OUTPUT«0␤1␤2␤3␤4␤»
20:56 kaare_ left
AlexDaniel what do you guys think about these ones ↑ ? 20:57
should it throw a warning?
masak yeah; not surprised those two don't find the loop
probably
maybe even an error
AlexDaniel m: LAST { say ‘hi’ }
camelia ( no output )
jnthn m: sub foo { FIRST { say 'hi' } }; (1,2,3).map(&foo) 20:58
yoleaux 17:09Z <teatime> jnthn: I saw in my logs someone mention your 'perl6 course' (or maybe it was 'introductory class' or something)... is that online?? sounds like it would be awesome.
camelia rakudo-moar 366ddf: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub foo at /tmp/UCPZxtWpcO line 1␤ in block <unit> at /tmp/UCPZxtWpcO line 1␤␤»
jnthn m: sub foo($) { FIRST { say 'hi' } }; (1,2,3).map(&foo)
camelia rakudo-moar 366ddf: OUTPUT«hi␤»
jnthn A sub with a FIRST is not automatically wrong, 'cus you could be passing it to map or some other higher-order looper
The LAST in the mainline is detectable, as it would be in any other immediate block. 20:59
20:59 Skarsnik joined
jnthn teatime: It's the Perl 6 course linked from jnthn.net/articles.shtml 21:00
masak waitwait, FIRST works with .map, but LAST doesn't?
jnthn m: sub foo($) { LAST { say 'hi' } }; (1,2,3).map(&foo)
camelia rakudo-moar 366ddf: OUTPUT«hi␤»
jnthn Looks working to me
m: sub foo($_) { .say; LAST { say 'hi' } }; (1,2,3).map(&foo) 21:01
camelia rakudo-moar 366ddf: OUTPUT«1␤2␤3␤hi␤»
21:02 pmurias_ joined 21:03 skids left 21:06 pmurias left
ZoffixWin whoa! 21:09
jnthn, it's like a treasure chest of goodies!
masak jnthn: ah. I misunderstood what you were saying. 21:10
in a sub, either FIRST or LAST are OK, because its caller is potentially late-bound and *could* be a loop (or a .map, or similar) 21:11
21:12 TEttinger joined
teatime jnthn++ 21:14
jnthn masak: Yeah, a sub or a block. The "immediate block" bit was "a block that's executed immediately rather than a closure" :)
masak: So in the block of an `if` statement it'd not make sense, for example.
BTW, this is nice in so far as it lets you call those phasers if you make your own looping constructs too. 21:15
Thus why whenever loops could also easily use them. :)
masak that is nice :) 21:19
though creating something like a `whenever` block is still an extralingual activity 21:20
21:20 vendethiel left
masak someone should put in place, I dunno, a kind of system for extending the syntax and semantics of the language from within Perl 6 itself 21:20
:P
21:21 rindolf left
teatime Survey... can you see this character, or not? (i.e., is it in your configured IRC font(s)) 21:22
.u U+27CD
yoleaux U+27CD MATHEMATICAL FALLING DIAGONAL [Sm] (⟍)
sortiz can see. 21:23
ZoffixWin No, I see a box with numbers in it
jnthn masak: Well yeah, it's interesting to note that both for and whenever desugar to function/method calls :)
jnthn quickly dodges the falling diagonal
teatime it was added in Unicode 6.1, so it's relatively a baby still. 21:24
zostay sees
jnthn doesn't see it, fwiw 21:27
21:28 huggable left
jnthn Hm, I can't see it in Chrome either. 21:28
teatime it surprises me how many Unicode 1.1–3.2 characters are not in my preferred font(s), which do actually have and aim for pretty good coverage (of the math/arrows/etc. stuff that I care about, not various scripts)... I need to tweak my terminal fontstack a bit, for sure.
21:28 _28_ria left 21:30 _28_ria joined 21:32 ZoffixWin left 21:33 prammer left
AlexDaniel teatime: I can see it without any problems 21:34
teatime: in fact, it's not even unifont that renders it on my machine 21:35
21:35 cognominal joined 21:36 cpage_ joined 21:37 Mona joined
teatime it's definitely in STIX on my machine, so it shows up in-general. STIX isn't in my current list of fonts to use in the terminal, though. and, I haven't yet found a good way (or really, any way) to ask my system, "Which of my installed fonts cover $codepoint / @codepoints" nor "What codepoints does this font cover?" 21:37
the latter is probably fairly easy, though.
21:38 Mona left 21:47 cpage_ left
teatime for anyone curious about my earlier set-difference question, I am currently thinking about these: U+244A "OCR DOUBLE BACKSLASH" «⑊» (appeared in Unicode ver. 1.1 / 1993), U+27C8 "REVERSE SOLIDUS PRECEDING SUBSET" «⟈» (5.0 / 2006), U+FE68 "SMALL REVERSE SOLIDUS" «﹨» (1.1 / 1993), U+FF3C "FULLWIDTH REVERSE SOLIDUS" «\» (1.1 / 1993) 21:50
I figure U+27C8 has a different established meaning in math. but maybe I am about to get lucky!
21:51 cognominal left
masak 'night, #perl6 21:58
22:00 _28_ria left
sortiz masak o/ 22:01
22:02 _28_ria joined
diakopter falling diagonal is so LTR-centric 22:09
bias alert
22:10 ZoffixWin joined 22:14 _dolmen_ left 22:21 pmurias_ left 22:27 mr-foobar left 22:28 mr-foobar joined 22:35 ZoffixWin left
teatime hmm... and a 2nd good cantidate emerges: ⧷ U+29F7 REVERSE SOLIDUS WITH HORIZONTAL STROKE (3.2 / 2002) ... it's both a backslash, and a minus sign, but can't be confused with either :) 22:45
22:48 JustinHitla left, Skarsnik left 22:51 hotel joined 22:52 hotel_california left 22:56 ZoffixWin joined, ZoffixWin left, ZoffixWin joined 22:57 firstdayonthejob left
dalek c: acbd6ec | (Tom Browder)++ | doc/Language/about.pod:
correct description
23:02
c: 9984701 | (Zoffix Znet)++ | doc/Language/about.pod:
Merge pull request #511 from tbrowder/misc-doc-fixes

correct description of N in =headN
23:05 kid51 joined 23:16 bitmap left 23:17 bitmap joined 23:19 RabidGravy left 23:21 itcharlie joined 23:22 brabo left, brabo joined 23:24 petercommand left, sunnavy_ left 23:25 cpage_ joined, sunnavy joined 23:26 petercommand joined, spider-mario left 23:31 pierre_ joined 23:34 grondilu joined
TEttinger teatime: for coverage of codepoints I use cmaptofile, which is a tricky to find utility 23:39
it might be good to find the source so it could be made more cross-platform... 23:40
23:41 itaipu left 23:49 pierre_ left 23:51 BenGoldberg joined 23:59 finanalyst left