🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:12 Manifest0 left 02:37 Sgeo left 02:40 Sgeo joined 03:06 committable6 left, bisectable6 left, committable6 joined, bisectable6 joined 05:21 Util left 05:34 Util joined 05:57 abraxxa joined
lizmat PSA: the Rakudo Weekly News will either be very late today, or tomorrow 06:24
06:49 melezhik joined
melezhik o/ 06:49
my colleagues asked my on named function parameters
where can I get a formal description on using :foo() VS :foo<> ?
I found this - andrewshitov.com/2018/10/31/named-...rl-6-subs/ , but this example does not describe <> syntax 06:50
07:31 melezhik left
ab5tract_ melezhik: it's just normal colon pair logic. 07:37
tellable6 ab5tract_, I'll pass your message to melezhik
07:39 Manifest0 joined
ab5tract_ :this<stringifies>, :this('passes') 07:39
docs.raku.org/syntax/Colon%20Pair 07:41
07:41 sena_kun joined
ab5tract_ m: dd :a<b c d> # note also that <> keeps its normal semantics 07:42
camelia :a(("b", "c", "d"))
ab5tract_ not-so-strangely consistent :)
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/10/09/sp...elimiting/ 07:54
07:55 Manifest0 left 07:56 Sgeo left, dakkar joined 08:31 derpydoo left
SmokeMachine Would anyone here be interested in this project? github.com/FCO/OTPish 09:29
nemokosch Re Elixir: I don't know if there is some major advantage to it; for some reason, I keep hearing that it "scales much better" or something 09:41
for me it seemed like obfuscated Erlang 09:42
much like the C-derived languages to C, except those languages have more or less the same paradigm, while Elixir poses as an imperative-ish language on top of a functional language 09:43
iirc it even brings assignments back 09:44
other (similar-ish) topic: Github polls about "most loved" and "most dreaded" languages 09:52
09:52 jpn joined
it's just crazy how they managed to misrepresent the actual question. It's weird enough that they kept a separate "most loved" and "most dreaded" part, even though in practice that's just a 100%-X operation; you'd assume that "not loving" is different from downright "dreading" 09:53
but the bigger problem is that the actual question was, "do you intend to continue using this language?" 09:54
what does this have to do with "love"?
this is how you get nonsensical conclusions like "SQL and Bash are more popular among developers than C, C++, Ruby, Perl and whatnot" 09:56
El_Che SmokeMachine: nice. Do you need to be familiar with the Elixir semantics? 10:12
SmokeMachine nemokosch: I've probably miss described the project there... it's more about OTP than about Elixir...
El_Che SmokeMachine: no, I expressed myself poorly. I did get that
SmokeMachine El_Che: not to Elixir, but to OTP...
El_Che I meant the agent thing is new to Raku (and probably other languages people here write) 10:13
SmokeMachine El_Che: yes, that's the OTP thing... the idea is to have processes always running (that a supervisor will be sure it's running (the supervisor is not implemented yet)), and send and receive messages from those processes... 10:15
El_Che I get the message passing metaphore, but have no real life experience. It looks exciting 10:16
SmokeMachine I'm implemented the processes with promises and react/whenever, so, the message is received one each time... so, for example, the OTPish::Hash implemented on example has no race conditions... (I hope)
my next step is implement the supervisor... after that I'm planing making it possible to start processes on different machines... 10:18
El_Che how?
grpc? 10:19
SmokeMachine not only starting processes on different machines, but also send, and receive, messages from processes on different machines...
El_Che: maybe... I was thinking on starting with simple http requests... 10:20
El_Che json is something programmers get and can easily work with it. grpc is a lot of generation magic but it's fast 10:21
luckily my services most of the time are happy with good old rest + jason :)
SmokeMachine I'll try to make it in a way that it will be easy to change the communication... maybe even make it pluggable... 10:23
El_Che a good working system is better that an perfect one that does not work :) 10:26
SmokeMachine El_Che: agreed... 10:27
nemokosch however, an undocumented solution doesn't exist practically 10:31
11:21 lichtkind__ joined 11:39 teatwo left, teatwo joined 11:40 teatwo left, teatwo joined 11:42 teatwo left, teatwo joined 12:19 derpydoo joined
ugexe that doesn't seem like it can actually do "Insert 1000 pairs in parallel" 12:39
anymore than putting a lock inside of the race/map would be working in parallel
like you'd still be bound by the limitations of the underlying data types 12:40
SmokeMachine ugexe: that's sending messages in parallel... the insert is serial... 12:50
I mean, the process that sent the message is free to do another thing... 12:52
(on my example I should be spawn()ing OTPish::Process instead of using race... I'll change that after work...) 12:53
ugexe sure, but "Insert 1000 pairs in parallel" to me looks like its trying to say "i can do this thing regular raku can't do in parallel!"
SmokeMachine ugexe: thanks, I'll fix the comment after work... 12:54
ugexe queue 1000 pairs to be inserted or some such is probably more accurate
SmokeMachine yes, I'll probably use that sentence... 12:55
ugexe: thanks 12:57
12:59 tejr left, tejr joined 13:23 teatwo left, teatwo joined 13:55 jgaz joined 15:36 committable6 left, quotable6 left, sourceable6 left, bisectable6 left, bloatable6 left, linkable6 left, evalable6 left, releasable6 left, coverable6 left, notable6 left, tellable6 left, unicodable6 left, nativecallable6 left, shareable6 left, greppable6 left, benchable6 left, buildable6 left 15:39 shareable6 joined, bisectable6 joined, benchable6 joined, unicodable6 joined, buildable6 joined 15:40 linkable6 joined, sourceable6 joined, coverable6 joined, quotable6 joined, committable6 joined 15:41 nativecallable6 joined, notable6 joined, greppable6 joined, releasable6 joined, evalable6 joined, tellable6 joined, bloatable6 joined 15:43 benchable6 left, benchable6 joined, bisectable6 left 15:44 linkable6 left, linkable6 joined, quotable6 left, quotable6 joined 15:46 xinming left 15:48 xinming joined 15:49 jgaz left 15:51 jgaz joined
[Coke] quotable6: frak 15:58
quotable6 [Coke], and I oop! Backtrace: gist.github.com/b1a4257789dc83f3c3...c45f96d0e5
[Coke] AlexDaniel: ^^ 15:59
AlexDaniel yeah, I have a bunch of e2e tests for the bots, but I haven't tried running them yet. One step at a time :) 16:00
but they should uncover all issues like this
16:01 quotable6 left, quotable6 joined 16:13 unicodable6 left, bloatable6 left, tellable6 left, quotable6 left, coverable6 left, linkable6 left, benchable6 left, sourceable6 left, buildable6 left, releasable6 left, nativecallable6 left, shareable6 left, evalable6 left, notable6 left, committable6 left, greppable6 left 16:15 greppable6 joined, linkable6 joined, evalable6 joined, sourceable6 joined, shareable6 joined 16:16 nativecallable6 joined, unicodable6 joined, bisectable6 joined, releasable6 joined 16:17 committable6 joined, bloatable6 joined, coverable6 joined, tellable6 joined 16:18 notable6 joined, benchable6 joined, quotable6 joined, buildable6 joined 16:20 bisectable6 left, bisectable6 joined 16:22 evalable6 left, evalable6 joined 16:24 linkable6__ joined, linkable6 left 16:26 xinming left 16:28 xinming joined 16:35 jpn left, dakkar left 16:36 jpn joined
AlexDaniel quotable6: frak 16:42
quotable6 AlexDaniel, OK, working on it! This may take up to three minutes (4582161 messages to process)
AlexDaniel, Something went wrong (Commit exists, but an executable could not be built for it)
AlexDaniel well, that's a different error message :)
16:43 bisectable6 left
jdv did you rebuild on buster? 16:43
16:44 bisectable6 joined
AlexDaniel jdv: on bullseye 16:46
jdv: but that brought the minimum required GLIBC version back 16:47
jdv: so if you had issues related to GLIBC, they should be gone now, or so I think
jdv i built my own cause the mothership was broke
i think i had it all fine on bookworm
AlexDaniel mmmm 16:48
jdv in terms of blin
AlexDaniel so how is it today, btw? Who's running Blin? Is it working?
jdv afaik only the rel mgr, me.
AlexDaniel well, let me know if I can do something for you 16:49
while I'm still here :)
jdv what does that mean? cause you werent here in jun, jul, etc... when it was broke. 16:50
AlexDaniel well, I'm still around, just not being active on IRC. I still reply to emails and I follow whateverable's issue tracker 16:51
jdv i thought i emailed. could be wrong. 16:52
anyway, point was why did you rebuild on old? 16:53
AlexDaniel I'm moving everything to a new server. So instead of maintaining the old mess, I dockerized the bots. Due to some rakudo regression, the newest rakudo star I can run is 2023.02. That is based on bullseye 16:54
this did mean that I had two thousand builds that were too new for the bot containers 16:55
so I deleted them and now they're rebuilding :)
17:00 abraxxa left
jdv weird. is the regression understood? 17:00
AlexDaniel no
github.com/Raku/whateverable/issue...1737120686 17:01
jdv weird that blin doesnt hit that 17:02
afaik
AlexDaniel not surprising, it's a real world usage of an IRC client 17:03
kinda hard to test that with unit tests
oops
pastebin::gist in that case, not irc client
still, it's about making actual requests to github
17:21 Xliff joined
Xliff .seen japhb 17:21
tellable6 Xliff, I saw japhb 2023-10-04T14:52:41Z in #raku-dev: <japhb> Huh, didn't know there was a whole community there -- I assumed it was just him. :-)
Xliff \o
.tell japhb Looking for Terminal::Widgets help. How would you write a select list with it?
tellable6 Xliff, I'll pass your message to japhb
17:22 jpn left 17:23 jpn joined 17:59 chmod222 joined
chmod222 Heya, a quick question. I'm trying to translate a simple script from python to Raku (gist.github.com/chmod222/5f12134d3...4afe59816) and find my Raku version running about a factor 10 slower (750ms+/- 30, vs 70ms +/- 3). I tried to help the optimizer where possible but it seems to spend the majority of it's time in the STORE sub for some reason 18:01
Is there any obvious performance pitfall I have fallen in? 18:02
(Rakudo 2023.09) 18:03
[Coke] We've seen a few of these recently where a straightforward translation misses taking advantage of some builtin thing. checking... 18:06
MasterDuke just curious, but have you tried typing the arrays as Str instead of str?
chmod222 I have not, let's try that 18:07
Same performance with Str unfortunately 18:08
MasterDuke if the majority of the time is spent in STORE, then it's probably reading the files into the arrays that's taking the time 18:09
chmod222 I don't think that's the issue here, I can see while it's printing the results that it's taking the time inside the loop 18:10
The issue seems to be the filtering part, because if I take it out, we're fast again 18:11
[Coke] the greps, you mean?
MasterDuke what if you don't create the intermediate `@viable-adjectives` variables and just do `my str $adj = @adjectives.grep(-> str $a { $a.starts-with($pref, :i) }).pick.tc`?
chmod222 200ms if I just use the first item of the list, which taking into consideration the startup time seems fair 18:12
The non-intermediary version was my first attempt, same performance
Xliff m: my $l = 42; my $t = start { $l = 0; sleep 2; }; await $t; print $l 18:13
[Coke] out of curiosity, what if you remove the , :i ?
camelia 0
chmod222 If I use [email@hidden.address] and don't filter with grep, also fast
If I use "@adjactives.pick.tc" and don't filter with grep, also fast
[Coke] I also wonder if there's any substantial difference between that grep syntax and the whatevercode version.
.grep(*.starts-with(...))
Also, how big are these lists? 18:14
chmod222 Whatever-star was also sluggish, I basically removed it with the typed pointy so that the optimizer gets the hint
Without :i it's a bit faster, 500ms
6200, 1000 and 2900 elements 18:15
The profiler graph tells me that about 75% of STORE is spent interpreted and 25% is JITted 18:19
If I managed to interpret it correctly
MasterDuke the starts-with looks like it isn't getting fully jitted either. it has a couple optional arguments, and those are problematic for the jit 18:22
chmod222 I rewrote it to ".grep(*.substr(0, 1) eq $pref)" for funsies, but no dice 18:25
18:26 xinming left 18:28 xinming joined, jpn left 18:29 jpn joined
chmod222 Interesting, if I drop the .grep in favor of "for @... { @...-viable.push($_) if .starts-with($pref, :i); }" it's also faster, with ~480ms instead of 700 18:34
MasterDuke that i'm somewhat surprised by
afk for a while, but if she's around lizmat would be a good person to ping 18:35
lizmat yes, but not tonight: trying to finish the weekly today before zonking out after a busy day with a lot of travel
chmod222 Alrighty, thanks for having a look!
It's alright, I'm just experimenting around a bit 18:36
Ah, I mislead you. The for-loop version runs with the same speed as the grep one, but I didn't run the profiler when running the for-loop version 18:40
tonyo . 18:46
18:49 jpn left 18:51 stevied_test joined, jpn joined 18:52 stevied_test left, stevied_test joined 18:59 jpn left 19:01 jpn joined 19:09 jpn left 19:23 committable6 left 19:24 committable6 joined
lizmat And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/10/09/2023-...-in-three/ 19:53
20:02 committable6 left, committable6 joined 20:05 evalable6 left, evalable6 joined
lizmat afk again& 20:06
20:07 committable6 left, committable6 joined
[Coke] chmod222: do you have a recent rakudo? wondering what RAKUDO_RAKUAST=1 does to your script. 21:08
chmod222 I just built it from the 2023.09 tag basically, same with MoarVM and NQP because I had to manually bump my distribution's package
Running without profiling enabled now, there appears to be no noticable difference between RakuAST and legacy AST with 430 - 500ms 21:10
I'll try the current main branch just for fun 21:15
No difference 21:18
21:24 wheaties joined
wheaties I have a question 21:25
I can see the commands to manage concurrency in raku, but I can't find information on the concurrency model that raku uses.  For example, in C++ I know that the process hands off to the unix kernel through the stdlib thread library.  In elixir (or erlang), concurrency is managed by beam.  In perl5, a copy of the interpreter is instantiated. 21:28
What happens in the background for raku?
21:31 itcharlie joined 21:32 itcharlie left 21:33 itcharlie joined, itcharlie left
leont Essentially M:N threading, AFAIK 21:34
[Coke] 6guts.wordpress.com/?s=concurrency will at least have some interesting reading if not the exact answer to your question 21:37
wheaties Thanks Coke, definitely a step in the right direction 21:40
22:02 sena_kun left
wheaties Leon,  "M:N" is something I read somewhere, and I'm just about losing my mind looking for it.  I know it is a model that was adopted over time in the C++ concurrency library, and I know it turned out to be the right thing.  Now where did I read that....? 22:05
I assume that raku doesn't replicate the interpreter, but what does it do?  Does it manage it's own threads?  Does it pass them to the OS through a library?  What does a thread get?  A bit of compiled code? 22:07
22:09 sena_kun joined 22:13 sena_kun left 22:28 Sgeo joined
leont Basically, The number of tasks may be higher than the number of OS-level threads that are scheduled on them. Usually this is hidden from you and you don't have to think about it. 22:34
wheaties I'm thinking in terms of migrating software from perl5 to raku so that I could take advantage of concurrency, as many, many institutions are wont to do.  How would I explain the advantages of raku concurrency to management?  How would it compare to elixir?  What would my hardware recommendation be? 22:40
AlexDaniel wheaties: why do you need concurrency in this case? I'm curious 22:43
wheaties I need a concrete example?  How about a multi-national web service for a corporate conglomerate trying to migrate to cloud computing? 22:45
AlexDaniel but that sounds like you need performance? Have you considered that the rewrite in raku will be slower in terms of raw processing speed? And the memory usage will be times higher 22:46
maybe I'm misunderstanding your situation, please judge yourself of course 22:47
perl5 is a good workhorse, it's easy to forget how much you appreciate or need it 22:48
22:50 ToddAndMargo joined
AlexDaniel and just by the sound of it, Elixir might not be a bad option (though I have never used it myself) 22:51
wheaties I don't know what the best option would be.  I know there is a concerted investment in perl5, but there is also a strong desire to migrate to a language that supports concurrency.  Don't assume there is a specific case, think in terms of the general utility of raku and how its concurrency stacks up to other languages.  I love perl5, I want some
flavor of it to survive.  If, in my example, I could migrate to raku and get good concurrency, then it might be a win through reduced development costs.
Elixir is a good choice from what I can tell on the market.  Why couldn't raku also be a good choice?  Anyway, instead of trying to jump to an application, I would like to know how raku does concurrency 22:53
22:54 RakuIRCLogger left
tbrowder__ hi, i'm trying to deal with a file whose "file somefile" output shows "ISO-8859" 22:55
how can i get raku to read that without error?
with say $file.IO.lines i get error "Malformed UTF-8..." 22:58
wheaties Ha! Leon, I tracked down what I read on M:N  --- everything I know in that area came from "The Linux Programming Interface"  p 687 Thread Implementation Models  -- thank you 23:02
Xliff m: my $a = Promise.in(300).then: say "Boo"; $a.break; 23:03
camelia Boo
Type check failed in binding to parameter '&code'; expected Callable but got Bool (Bool::True)
in block <unit> at <tmp> line 1
Xliff m: my $a = Promise.in(300).then: { say "Boo" }; $a.break;
camelia Access denied to keep/break this Promise; already vowed
in block <unit> at <tmp> line 1
Xliff ???
How can you keep/break a Promise created via .in? 23:04
23:23 ToddAndMargo left 23:40 teatime joined, lichtkind__ left 23:42 teatwo left
tbrowder__ i'm trying to get an IO::handle or path and set its :encoding but no success yet 23:54