🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
teteet uhhh 02:54
uhh
hi?
uhh
help?
teteet f 02:55
moon-child hello
what seems to be the problem?
teteet hello? 02:56
help ?
moon-child what do you need help with?
teteet so....
raku
helpoPP?
X) 02:57
Uploaded file: uploads.kiwiirc.com/files/2618839a...242135.jpg
neshpion uh ok 03:02
frost X) 08:43
Geth problem-solving/clarify-readme: fe9d5ca876 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | README.md
Address some comments.
14:16
[Coke] is there a browser preference when working with the generated HTML profiles? (Chrome is taking a very long tiem to process this one...) 16:02
... d'oh. that was edge. 16:03
(Chrome not doing any better so far) 16:04
lizmat they all have trouble processing the sometimes massive profiles 16:07
in my experience
[Coke] do we need to switch to a sampling instead to reduce the size of the data? 16:09
I have some slow running code at $DAYJOB, can't speed it up if I can't figure out where it's slow. :| 16:10
lizmat I think timo has basically shifted to using the SQL version for any sizeable profile
[Coke] digs through the profile page on docs, thanks for the hint. 16:14
[Coke] wonders if moarperf will work on windows. 16:15
[Coke] gets a response from a stripped down run, and is spending 20% of his time in IO.Str?? 16:17
er, IO::Path.Str 16:18
lizmat that feels... meh?
but yeah, that's an expensive one, if I recall correctly
reminds me of my attempts to simplify IO, and I start to shudder :-(
timo whoof, yeah 16:22
[Coke]: moarperf should work on windows, if it doesn't please ping me again
rassoc do we have a more elegant way to extract the same chars of two strings? 16:23
m: zip("abc".comb, "axc".comb).map({ .head if .head eq .tail }).join.say
camelia ac
rassoc keeping the order
[Coke] also 368976 seems like a LOT of BOOTHash allocations for the work I'm doing. 16:24
timo: can't install deps.
Digest::SHA1::Native:ver<0.04> fails.
lizmat [Coke]: that's probably a lot of method calls and allocations for %_ ?
[Coke] I'm on a repo build from 2020.11 era. 16:25
doing a fresh build of rakudo 16:28
timo hm, does Digest::SHA1::Native have a "download pre-built dll from the internets" thing or does it try to compile from source? 16:51
CIAvash m: say "abc".comb.grep(* eq 'axc'.comb[$++]).join 17:15
camelia ac
CIAvash rassoc: another solution ↑ 17:16
timo m: say ("abc".comb X "axc".comb).grep({ .[0] eq .[1] }).join 17:23
camelia a ac c
timo m: say ("abc".comb Z "axc".comb).grep({ .[0] eq .[1] }).join
camelia a ac c
timo hm, no, not quite .. at all 17:24
rassoc CIAvash: newbie perspective: shorter, but less straightforward 17:25
is $ reset upon scope enter? 17:26
seems so
timo m: say ("abc".comb Z "axc".comb).grep({ .[0] eq .[1] }).map(*.[0]).join
camelia ac
timo $ is syntax for getting an anonymous state variable
rassoc yeah, but i need compare multiple words in a row; was worried about that state being retained 17:27
timo so it "survives" leaving its scope and re-entering it, but entering the scope one outer from that will create a new closure clone and that means the state var gets "reborn"
rassoc m: say ("abc".comb Z "axc".comb).map({ .[0] if .[0] eq .[1] }).join
camelia ac
timo ah, not bad 17:28
rassoc hm, like .head and .tail a bit better
getting the docs for some magical » syntax. maybe there's something short 17:29
checking*
rassoc guess the above is as good as it gets for now. alright, thanks everyone! 17:33
[Coke] walked away from the rakudo build, comes back... nothing, it hung on "building nqp ..." 17:36
killed it and restarted... it's fine. wtf
killed it and restarted... it's fine. wtf 17:37
build failed with the "include file 'uv.h' error. 17:45
Xliff \o 17:45
vrurg: My apologies. I've updated the replication steps for #4440. Please update your p6-GtkPlus directory and try again. 17:46
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/07/06/th...ast-thing/ 18:06
rassoc how does `sub prefix:<♥> { c }` work? the c part specifically. where is this coming from? 18:29
missing param?
gfldex yes, wordpress eating stuff again :-/
rassoc but yeah, that's really irking me about raku. you can never quite tell what's going to be fast. even more pronounced with nested loops. `for (@x X @y) -> ($a, $b)` is sooo much slower than nested loops the last time i tried 18:32
but yeah, that's really irking me about raku. you can never quite tell what's going to be fast. intuition from other langs doesn't carry over. even more pronounced with nested loops in this case. `for (@x X @y) -> ($a, $b)` is sooo much slower than nested loops the last time i tried 18:33
crap, sorry
El_Che you put it in a loop?
:)
rassoc had trouble with my connection the last few days, wondering why the goddamn msg wasn't going through. bottom part just scrolled off screen -.- 18:35
goddamn window manager
[Coke] Anyone else having trouble with the 'uv.h' missing file bug? 19:30
[Coke] (workaround: re-try the build?) 19:35
timo that seems to be very new 19:37
you can try an older moarvm commit
MasterDuke [Coke]: try removing msinttypes.h from your <install>/include directory 19:47
See github.com/MoarVM/MoarVM/commit/42...cb6ab9cdbd 19:48
lizmat [Coke]: I had the same... I rebuilt all the intermediate commits, and it seemed to fix itself 20:13
also, I dud a "git submodule update" somewhere along the way, but I doubt that had anything to do with it 20:14
timo gfldex: can you try changing in what order the lines in your latest blogpost are run to see if that changes the timing any? 21:01
m6locks what should I pass as a null value if I have a method that expects an instance of a class but there's a certain case where a null would need to be passed? 21:59
getting an error expecting xxx but got Nil
timo you'd want to pass the type object
this is how NativeCall handles null in any case
m6locks what would I check within the method? 22:00
if (...)
m6locks I can't check if it's Nil, and the type object is clearly an object right? 22:01
timo check for whether it's defined, using the "with" or "without" keywords
m6locks ah ok, thanks
can I combine it with an if? sort of like without $var or if ($obj.method() == 0) 22:06
comma says that subroutine if is not declared
japhb m6locks: `unless $var.defined && $obj.method {` 22:08
timo are you writing stuff like "if($a, $b)"?
m6locks yea
timo er, not with a comma
m6locks japhb: thanks
timo well, that's a subroutine call, you don't put () with if and friends in raku
gfldex timo: the order does change the execution time a good bit. Do you suspect the GC to successfully fooly me? 22:25
rassoc m6locks: you can always do `if !$var.defined || $obj.method() == 0 { ... }` in case you absolutely want to keep them together 22:30
timo not GC, i'd suspect dynamic optimization 22:31
gfldex m: my $s1 = Str; my $s2 = "42"; sub s(|c) { when c ~~ :(Str:D $) { say 'defined' }; when c ~~ :(Str:U $) { say 'undefined' }; }; ($s1, $s2)».&s; 22:33
camelia undefined
defined
gfldex m6locks: if you like functional you can use the power of Signature. ^^^ (also see: gfldex.wordpress.com/2021/04/21/re...-a-wheel/)
timo the different pieces of code surely have a few methods in common, so during the first piece's run time, those would be warmed up and optimized, which the following pieces would be able to take advantage of from the very start 22:34
you can run every code once up front so that the optimizer has had a chance to see everything already when you're doing the actual timing, or you do everything in isolation with a whole new process, which makes each timing individually slower, since they all start out cold, but it'll be "fairer" 22:39
but a fully warmed-up process may be more representative of "real world" use cases, if you're considering long-running processes more likely than one-off scripts
rassoc why not just pick one of the benchmark modules for that? 22:42
timo also possible, yeah
gfldex m: my $s = Str; given $s { when Str:U { say 'undefined' }; when Str:D { say 'defined' }; } 22:45
camelia undefined
gfldex m6locks: type smilies work with given/when too
rassoc: I try to keep external deps out of my blog posts. That way I don't rely on the reader to know to module, nor do I have to explain what they do. 22:46
I don't think I could explain what my readers do. :) 22:47
gfldex .oO( English is odd )
rassoc but benchmarking is hard, and these modules at least get you a tiny bit closer to the truth ;) 22:48
timo gfldex: ping me when/if you update the blog post based on the "new" timings? 22:50
gfldex will do 22:51