🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:02 reportable6 left 00:14 pierrot left, pierrot_ joined 00:29 bdju left 00:54 jjido left 01:05 reportable6 joined 01:48 bdju joined 02:24 frost joined 02:38 unixcat647 left 02:40 hyperreal joined 03:03 frost left 03:28 Xliff left 04:28 evalable6 left, linkable6 left 05:19 xinming left 05:20 xinming joined 05:24 Eddward left 05:29 linkable6 joined 05:30 evalable6 joined 05:33 dwarring left 06:02 reportable6 left 06:04 reportable6 joined 06:10 abraxxa joined 06:15 abraxxa left, abraxxa joined 07:15 nativecallable6 left, benchable6 left, linkable6 left, reportable6 left, sourceable6 left, evalable6 left, squashable6 left, releasable6 left, bisectable6 left, notable6 left, bloatable6 left, unicodable6 left, committable6 left, greppable6 left, shareable6 left, quotable6 left, tellable6 left, coverable6 left, statisfiable6 left 07:16 quotable6 joined, bisectable6 joined, coverable6 joined, linkable6 joined, evalable6 joined, releasable6 joined 07:17 tellable6 joined, nativecallable6 joined 07:18 unicodable6 joined, bloatable6 joined, reportable6 joined 07:56 Sgeo left 08:14 dakkar joined 08:16 statisfiable6 joined 08:17 greppable6 joined, squashable6 joined 08:22 CIAvash left, AlexDaniel left, demostanis[m] left, juanfra left, cnx left, happy-dude left 08:26 juanfra joined 08:37 gordonfish left 08:43 gordonfish joined 08:47 AlexDaniel joined, cnx joined, happy-dude joined, demostanis[m] joined 08:48 CIAvash joined 08:49 gordonfish- joined 08:50 gordonfish left 08:53 gordonfish- left 09:16 sourceable6 joined 09:18 committable6 joined 09:22 silug left, silug7 joined 09:26 silug7 left 09:28 silug joined 09:32 silug left 09:33 silug joined 09:37 silug left, silug joined 09:44 wz joined 09:48 wz left 09:50 wz joined, wz left 10:17 jjido joined, notable6 joined 10:27 Altai-man joined 10:31 jjido left 11:17 benchable6 joined 11:18 shareable6 joined 11:32 squashable6 left 11:34 squashable6 joined 11:54 whatnext joined
whatnext hello everybody :) today's question: any idea what would cause this error: "Error while compiling... Cannot find method 'EXISTS-KEY' on 'BOOTHash': no method cache and no .^find_method" ? 11:55
I have a module that is identical apart from name (boilerplate classes which don't yet have anything much in them) which seems to compile just fine 11:56
? 11:57
12:01 Xliff joined
[Coke] No idea, but is your program small enough to show a gist of it? 12:02
12:02 reportable6 left
whatnext actually not really - but hang on I am concocting a snippet 12:07
[Coke] m: 'something small enough to show here?'.say 12:09
camelia something small enough to show here?
whatnext gist.github.com/whatnext/87c22a266...2b01b610d3 12:14
[Coke] there are multiple 'unit class' in that file? 12:16
there are multiple 'unit class' in that file? 12:17
(or is that a concat of multiple files?)
lizmat whatnext: can you run with --ll-exception and gist the backtrace ? 12:18
whatnext they are in separate files - I just put them inline for the gist
lizmat I commented the backtrace on the gist 12:22
[Coke] if you use --ll-exception you'll get a bigger trace. 12:23
you *should*, I mean.
lizmat feels like an issue in Inline::Python ?
whatnext bigger than the one I posted? 12:24
12:25 wz joined
[Coke] Try it and see. 12:25
(but yes)
it reports on things that are "internal"
whatnext I did use --ll-exception - that's the output I got from doing that 12:26
lizmat I would be happy to believe it was Inline::Python - but it doesn't seem to throw an error the first time around 12:27
lizmat hmmm
must admit I'm too distracted atm to look at it deeper :-( 12:28
whatnext no worries
was just asking in case anyone had seen it before
will post a solution if I find one :) 12:37
lizmat m: use nqp; nqp::hash.EXISTS-KEY("a") # the ultimate golf 12:39
camelia Cannot find method 'EXISTS-KEY' on 'BOOTHash': no method cache and no .^find_method
in block <unit> at <tmp> line 1
lizmat now, the error is legit: an nqp::hash does not have an EXISTS-KEY method
so somewhere an nqp::hash is not being hllized to a Raku Hash object
12:42 clarkema joined 12:46 Eddward joined
wz We are conducting a research on image label generation on the docker hub platform. We apply natural language processing technology and text mining technology to implement our method. 12:53
In order to be able to give a reasonable evaluation to the tags generated by our method, we sincerely hope that you, as the developers of rakudo-star, can make an evaluation. Your evaluation is very important to us.
The tags for rakudo-star are as follows:
compiler, apline, rakudo, perl, development tools, small, virtual machine, linux
If the tags are reasonable or not, please reply in form of, "Good tags: ***, ***; Bad tags: ***, ***"
If the tags are reasonable or not, please reply in form of, "Good tags: ***, ***; Bad tags: ***, ***" 12:54
It will be a great help if you can give us a feedback
Thank you so much for you precious time.
lizmat Bad tags: perl, small 12:57
wz thank you so much
lizmat wtf is apline ?
whatnext so lizmat... I'm just trying to understand what that means
so lizmat... I'm just trying to understand what that means 12:58
not really being familiar with what's going on under the hood
wz Damn algorithm generated
lizmat Good tags: raku, programming language, ecosystem 12:59
whatnext: something is being naughty using nqp, and has been caught :-) 13:00
afk for a few hours&
whatnext yeah i understood that much
wz Ha ha
whatnext but nqp is part of the compiler correct - so just means something went wrong somewhere in the compiler? 13:01
wz maybe 13:02
13:03 wz left 13:09 jjido joined 13:10 cnx left 13:11 whatnext left 13:12 jjido left 13:22 patrickb joined 13:23 whatnext joined
[Coke] I'm guessing a 3rd party module you're using is using nqp internals that it should not be. 13:27
m: use nqp; nqp::say(3); 13:28
camelia This type cannot unbox to a native string: P6opaque, Int
in block <unit> at <tmp> line 1
[Coke] as an example of something you can do from rakudo, using NQP directly, that someone might expect to work but doesn't.
13:39 whatnext left 14:02 Sgeo joined 14:24 gordonfish joined 14:54 xinming left 14:56 xinming left, xinming joined 15:05 reportable6 joined 15:08 discord-raku-bot left 15:10 discord-raku-bot joined 15:16 patrickb left
ugexe im guessing its more that they seen to be using `use lib ...` along with dynamically loading modules 15:18
not that you shouldnt (of course i never `use lib ...`), just that that combination + the stack trace makes it seem like it
avuserow lizmat: apline is presumably a typo for alpine, a linux distro that's popular in making minimal docker images 15:25
15:27 zacts joined 15:57 ufobat joined, ufobat left
[Coke] anyone building from master, new-disp just dropped. 16:23
16:42 gordonfish left 16:44 gordonfish joined 16:49 nige joined, nige left, nige joined 16:54 dakkar left 17:01 nige left, nige joined 17:06 nige left, nige joined
tonyo new disp? 17:08
Altai-man new disp! 17:09
[Coke] 6guts.wordpress.com/2021/09/29/the...m-is-here/ 17:11
lizmat weekly: 6guts.wordpress.com/2021/09/29/the...m-is-here/ 17:14
notable6 lizmat, Noted! (weekly)
Juerd So I checked out blead hoping to see some improvements in the regex heavy benchmark that I've been doing 17:49
But it's really really slow :(
7 seconds with 2021.04 that I had, 43 seconds with current :( 17:50
Code: github.com/Juerd/p6-mqtt/blob/master/t/regex.t 17:51
17:58 Altai-man left 18:02 reportable6 left 18:05 reportable6 joined
lizmat Juerd: that's... disappointing 18:11
ah... EVAL $_ ??? 18:12
Juerd It's slow all over, not just line 146 18:13
lizmat well... indeed...
but what I would do, is set up a list of Captures and pass that to pattern_test ? 18:14
Juerd Oh, there are a gazillion ways to improve the code to make it faster I'm sure
But this is a near literal port of Perl code, which makes it suitable for comparisons 18:15
lizmat well... that's debatable... :-) 18:16
Juerd I'm not saying the Perl original or this port is good code, but it has been my go-to thing to check whether Raku is "ready" yet, for years
Because I write many one-offs that do make use of generated regexes, eval, etc, to then process lots of data. That's something I can't do with raku yet :| 18:17
Well I could perhaps, but I'd have to do everything completely differently
In any case, if the regression by itself is not interesting, feel free to ignore it :)
This code is basically frozen anyway, I'm probably not going to improve anything ever, since leont's Protocol::MQTT does everything this does, and much more. 18:19
I haven't tested whether his port of the same tests has improved with new dist - github.com/Leont/raku-protocol-mqt...r.rakutest
18:31 nige left, nige joined
lizmat Juerd: looking at filter-as-regex code: that's basically screaming RakuAST to me :-) 18:35
18:36 nige left, nige joined
Juerd Yes, it does 18:37
But I'm not really interested in fixing this code, no matter how hard it screams
For me, it serves a good purpose of being a benchmark, and it's showing a regression 18:38
18:39 nige left
lizmat indeed it does :-) 18:40
Juerd: are you aware of the Str.subst method ?
Juerd I know it exists 18:41
lizmat $str ~~ s:g[\W+] = "'$/'"; 18:42
return $str;
could be rewritten as: return $str.subst(/\W+/, { "'$/'" }, :global)
Juerd Look, I'm into timtowtdi, not really into the "there are 15 ways to do this, but only one performs well so I guess you'll have to use that one" :)
That's kinda why I'm not using Raku for anything real yet. 18:43
lizmat well, true. It's just that a lot of worn in Perl habits are counter intuitive wrt performance in Raku 18:45
like using hashes instead of proper classes
Juerd I'm hoping it will get there at some point, but I note that whether on irc or reddit or stackoverflow, if someone complains that naively written code performs worse than similar code on another platform, people jump to providing help to improve the code. That's nice, and community wise really cool, but it won't ever scale to anything that can be used in production. No programming language's community
can ever scale to fixing everyone's code.
lizmat that is true... 18:46
we're all trying to learn to go with the flow of Raku, rather than trying to go upstream with it because of old habits :-) 18:47
Juerd Dumb code has to perform reasonably well too
If I have to write int instead of Int to come close to what Perl or Python does, I'm not saving much time by using the fancy new thing, and I can just as well keep using the old tools. I know Raku's improving all the time, which is why I keep trying from time to time. 18:48
lizmat indeed... but e.g. using a Real type in a recent floating point benchmark, rather than just a num, is like... well....
I mean, it's a "floating point" benchmark... 18:49
why would you want to use Reals ?
Juerd I saw that one and was amused too
But tbh, it speaks to an issue with naming that exists in Raku 18:50
lizmat yeah, num should probably have been called "float" I have no idea why num was chosen
Juerd I've ranted about the names of numeric types before so I won't repeat that, as it's set in stone anyway :)
lizmat in any case, looks like the MQTT::Client code is triggering some megamorphic callsite mitigation code 18:51
in the new dispatcher logic
Juerd If only I had some clue what megamorphic meant :)
lizmat the test will be a good case for improving that
Juerd: www.google.com/search?rls=en&q...+call+site 18:53
:-)
19:02 jjido joined 19:10 jjido left 19:16 jjatria left, jjatria joined 19:17 Scotteh left, Scotteh joined
codesections Juerd this is totally speculative, but I'm (cautiously) *very* optimistic about RakuAST helping with the performance cliff between the 15 different ways of saying the same thing. 19:28
(in the medium/long term, I mean, not on the day it's merged)
Juerd That would be nice
codesections If two (or 15) statements have exactly the same semantics, then in theory out static optimizer ought to be able to pick the best-performing one. Theory isn't practice, and that sort of transform can be hard, especially Raku's dynamism 19:30
But rAST will make it easier. Personally, I'm hopping we can at least optimize things like $some-string ~~ /^foo/ to have the same performance as $some-string.starts-with('foo') 19:33
19:59 jjido joined, spacekookie left 20:00 spacekookie joined
tbrowder ref num, etc., names: can't we add aliases for better names? 20:39
(e.g., "float" as the "real" name and "num" as its aliad) 20:41
s/aliad/alias/ 20:42
20:42 squashable6 left
lizmat m: my constant float = num; dd my float $a = 42e0 # alias done 20:43
camelia 42e0
lizmat now the documentation :-)
leont lizmat: yeah, it is screaming RakuAST :-) 20:46
tonyo m: my \float = num; dd my float $a = 42e0; 20:52
camelia ===SORRY!===
No compile-time value for float
tonyo m: my \float := num; dd my float $a = 42e0;
camelia ===SORRY!===
No compile-time value for float
lizmat tonyo: needs to be compile time, hence the constant 20:53
m: BEGIN my float := num; dd my float $a = 42e0
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed my (did you mean to declare a sigilless \float or $float?)
at <tmp>:1
------> 3BEGIN my float7⏏5 := num; dd my float $a = 42e0
lizmat m: BEGIN my float := num; my float $a = 42e0; dd $a 20:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed my (did you mean to declare a sigilless \float or $float?)
at <tmp>:1
------> 3BEGIN my float7⏏5 := num; my float $a = 42e0; dd $a
lizmat m: BEGIN my \float = num; dd my float $a = 42e0
camelia ===SORRY!===
No compile-time value for float
lizmat he
leont Juerd, lizmat: that code is slow because it does a string-to-regex conversion every time you use the regex. If it got slower, it's probably because that conversion got slower 20:59
tonyo m: use experimental :macros; macro float() { quasi {"float"}; }; dd my float() $a = 42e0; 21:00
camelia 5===SORRY!5===
Type 'float' is not declared. Did you mean any of these: 'Num', 'num'?
at <tmp>:1
------> 3loat() { quasi {"float"}; }; dd my float7⏏5() $a = 42e0;
Malformed my
at <tmp>:1
------> 3acro float() { quasi {"float"};…
lizmat leont: yeah, the reason for the slowdown appears clear: lost of types created and not being properly cached in an attempt to handle megamorphic call sites
21:00 t3nj1n left
lizmat *lots 21:08
21:44 jjido left 21:59 tejr left 22:00 tejr joined
codesections Is there a way for my module to tell that it's being `use`ed from a REPL session? I thought the REPL would set an env var/ $*dyn-var or something, but I'm not seeing one right off 22:00
japhb codesections: That sounds a bit like an XY question. What is your actual use case? 22:03
codesections japhb not much of one at the moment. I use'ed a module that I'm working on to test it out interactively, and it didn't behave itself well (i.e., an `await` in WIP code hung the REPL) and I got curious. 22:05
It's something I'd think we'd need if we ever go further down the interactive/REPL-driven development path, but that's probably a long way off (if we even pursue that goal) 22:07
(I'd like to, but I don't know how widely held that view is)
japhb Well, given that a Jupyter kernel was actually a relatively early module 22:10
... I'd say there's definite interest
But if that's what you're looking for, maybe $*PROGRAM or $*PROGRAM-NAME?
m: .say for $*PROGRAM, $*PROGRAM-NAME;
camelia "<tmp>".IO
<tmp>
codesections That does the trick, thanks :) 22:11
japhb np
22:13 melezhik joined
melezhik . 22:13
hi raku people! 22:14
moon-child melezhik: sup
melezhik i am looking for a raku module that would convert int numbers into picture (png/jpeg) 22:15
moon-child I think there were some imagemagick bindings
melezhik i am pretty sure there are some modules that binds to image libraries
imagemagick - i thought about it, will it requite Inline::Perl5 ? 22:16
moon-child modules.raku.org/dist/MagickWand:cpan:AZAWAWI nativecall, not perl5 22:17
melezhik yep, just have found it as well ...
22:28 melezhik left 22:37 Eddward left
tbrowder i find it easier to use Inline::Perl5 with GraphicsMagick's Perl modules 22:48
and GraphicsMagick is the preferred code according to my research 22:50
.tell melezhik try Inline::Perl5 with Perl modules from GraphicsMagick 23:37
tellable6 tbrowder, I'll pass your message to melezhik
23:37 evalable6 left, linkable6 left 23:43 squashable6 joined