🦋 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:00 reportable6 left 00:02 reportable6 joined
Nemokosch as I said - @list.elems will explode on you if you happen to have a lazy list 00:03
ugexe if it was lazy i would expect it to be $list.elems 00:17
a lazy list rather
m: my $a := (42, 99).map({ say $_ }); say ?$a; say $a.elems 00:18
camelia 42
True
99
2
Nemokosch m: my @a = lazy 1, 2, 3; say ?@a; say @a.elems 00:19
Raku eval True Exit code: 1 Cannot .elems a lazy list onto a Array in block <unit> at main.raku line 1
ugexe i don't think that 'lazy' does anything 00:20
Nemokosch I mean, you can see it does, can't you
rf Can I augment a role
ugexe its used internally
Nemokosch (the error message got fixed since but it still wouldn't work)
rf I keep hitting: expecting a generic role Cannot augment Role because it is closed 00:21
ugexe i see its listed in the docs
which kind of surprises me
Nemokosch "lazy" is a really unfortunate term for it because yes, something can be lazy without being "lazy" 00:23
a "lazy" lazy thing is, for example, an infinite sequence
m: my $seq = (1, 3 ... *); $seq.elems 00:26
Raku eval Exit code: 1 Cannot .elems a lazy list onto a Seq in block <unit> at main.raku line 1
ugexe m: my $seq := (42, 99).map({ say $_ }); say $seq.is-lazy; say $seq.elems 00:28
camelia False
42
99
2
Nemokosch m: my $seq = (1, 3 ... * == 100); #`[ this one is also infinite but it doesn't know about it ] $seq.elems
ugexe i guess if .is-lazy is False it can .elems a lazy list
Raku eval Failed while reading stream: Max execution time exceeded
ugexe even if it is indeed lazy
Nemokosch yes, it is decided by that exact check 00:29
this "lazy" rather means "shouldn't start fetching values from this" than laziness by usual terms 00:31
ugexe github.com/rakudo/rakudo/wiki/is-lazy
Nemokosch has anyone seen AlexDaniel and me at the same time...? lol 00:33
joke aside, I didn't know about the ranges part 00:34
el can you send data to a generator 00:41
Nemokosch what would that do? 00:44
00:44 Manifest0 left
elcaro You might be looking for Supply's 00:45
el def gen(): a = yield print(a) g = gen() next(g) g.send(1) # 1 00:46
^
Nemokosch next is part of the interface of the iterator, right? 00:47
el yes
Nemokosch then probably not
iterators don't take an argument to produce the next value 00:48
el if it also has yield from it will become a coroutine 00:49
Nemokosch I have used yield from but I didn't look at it as a coroutine, just recursion over a generator 00:50
el its like a context switch or smth
or await 00:53
Nemokosch elcaro is probably right 00:56
I'd look around Supply
elcaro jnthn's done a few conference talks on Asynchrony and Parallelism (with slides usually available on his site) that may also help digesting the different async/concurrent constructs 01:14
www.youtube.com/watch?v=l2fSbOPeSQs www.youtube.com/watch?v=hGyzsviI48M www.youtube.com/watch?v=E_ho6McixV0 www.youtube.com/watch?v=xg8tAv35YFg www.youtube.com/watch?v=xg8tAv35YFg 01:16
01:24 epony joined 01:52 melezhik joined
melezhik . 01:52
tellable6 2023-02-09T22:50:01Z #raku <rf> melezhik I have a large JVM based code base I want to run in CI, does Sparrow support JVM images?
melezhik rf let me see, anyone know what is the way to install rakudo-jvm on linux boxes?
I did not see anything on rakudo.org/downloads/rakudo for rakudo jvm 01:53
rakubrew seems does not have it also?
rakubrew download jvm-2022.12
Couldn't find a precomp release for OS: "linux", architecture: "x86_64", version: "2022.12"
.tell rf - I  am going to build docker image with rakudo-rvm installed from source (version 2022.12) and sparrow agent installed on it, so you could you use it in SparrowCI, I will let you know when it's ready 02:09
tellable6 melezhik, I'll pass your message to rf
rf . 02:13
Makes sense, I will try it
melezhik rf ++ 02:25
02:36 melezhik left 03:36 linkable6 left, evalable6 left, evalable6 joined 03:38 linkable6 joined 03:47 razetime joined 03:58 melezhik joined
melezhik .tell rf - just to clarify, you mean you want to run some Java code on SparrowCI or you are interested in rakudo-jvm? 03:59
tellable6 melezhik, I'll pass your message to rf
04:26 melezhik left 04:43 freeside left 04:52 freeside joined 05:00 ispyhumanfly left 05:10 pingu left 05:25 ispyhumanfly joined 05:40 ispyhumanfly left 05:43 razetime left 05:46 razetime joined 05:53 ispyhumanfly joined 05:58 ispyhumanfly left 06:00 reportable6 left 06:01 reportable6 joined 06:12 ispyhumanfly joined 06:16 ispyhumanfly left 06:44 razetime left 06:45 ispyhumanfly joined 06:52 ispyhumanfly left 07:04 ajdplaysalto joined 07:05 ajdplaysalto left 07:14 ircuser is now known as merpaderp 07:24 ispyhumanfly joined 07:25 Sauvin left 07:28 ispyhumanfly left 07:41 Sauvin joined 07:47 razetime joined 07:49 lichtkind joined 07:54 Sgeo left 08:05 nort joined 08:26 razetime left
el how do i create a coroutine 08:27
08:31 ajdplaysalto joined
oh its start 08:37
08:39 ispyhumanfly joined 08:44 ispyhumanfly left 08:57 ispyhumanfly joined 09:00 jpn joined 09:01 Manifest0 joined, ispyhumanfly left 09:04 jpn left 09:07 epony left
moritz `start` starts a task that potentially runs in its own thread, governed by the currently active thread pool scheduler 09:07
which isn't quite the same as a coroutine, if my understanding of threading/coroutines is correct
09:26 Simerax joined 09:39 codesections left
nine Coroutines don't require parallel processing. They are just routines that maintain their state while they give other routines a chance to run. gather/take is probably closest to what people expect. 09:52
That said, I don't think the concept of coroutines forbids actual parallel processing. 09:53
Nemokosch does that mean that "start creates a coroutine"? 09:55
09:55 ab5tract joined
lizmat no, what moritz said: `start` starts a task that potentially runs in its own thread, governed by the currently active thread pool scheduler 10:02
if the current threadpool scheduler doesn't support threads (like CurrentThreadScheduler), then "start" is the same as "do" 10:04
remember: it's all pluggable in Raku :-)
Nemokosch okay, so it runs to completion in the thread it's assigned to? 10:05
lizmat in 6.c it did, in 6.d there is no such guarantee 10:10
if the thread is waiting for something, it may get another job to do 10:11
this allows Raku to have more connections open in e.g. Cro than there are threads
10:14 app-test joined 10:17 app-test left 10:18 ab5tract left
Nemokosch I'm just trying to figure out if what start does matches "routines that maintain their state while they give other routines a chance to run" 10:18
and it feels like we are entering S5 modular logic 😅 10:19
lizmat well, in Raku s/routine/block/ and I guess that'd be a correct description 10:20
10:21 jpn joined 10:31 sena_kun joined 10:32 sena_kun joined 10:37 Simerax left, sena_kun left
el gather/take = coroutine so how do i await in gather takr coroutine 10:39
await? 10:41
Nemokosch it would help to know what you are actually trying to achieve 10:45
these are the parts of any language that probably won't map 1-to-1 10:46
el i think just use start and Channel 10:50
Nemokosch Channel is like a queue 10:51
if that's what you mean
el those are sufficient
Nemokosch you probably know Promises 10:52
the interface is really similar to JS, even
el ik 10:55
start also create promises
lizmat see also: andrewshitov.com/2019/09/09/sleep-...in-perl-6/ 10:58
Nemokosch constant time! 10:59
11:04 freeside left
el more like O(n) time 11:07
Nemokosch nope, it's """"constant"""" 11:09
of course that's assuming that there are arbitrarily small time units
and then you can just divide with a huge number
11:11 ab5tract joined
In other news, I'm done with the egoistic author (well, not even author, rather just maintainer) of Ddt; another thing goes to the bucket list... 11:18
11:26 ispyhumanfly joined 11:30 ispyhumanfly left 12:00 reportable6 left 12:03 reportable6 joined 12:21 freeside joined 12:26 freeside left
el whos ddt 12:27
12:46 ab5tract left, freeside joined 12:51 freeside left
Nemokosch Ddt is supposedly an alternative to mi6 12:54
It was meant to be more elaborate from what I can tell 12:55
13:16 ispyhumanfly joined
lizmat since it's a developers tool, I don't think it's worth spending much time on unless you're a user 13:21
13:25 ispyhumanfly left
el and what happened with the author 13:32
13:32 ispyhumanfly joined 13:46 freeside joined 13:51 freeside left
rf .tell melezhik I am interested in both 13:59
tellable6 rf, I'll pass your message to melezhik
14:17 freeside joined 14:22 freeside left, ajdplaysalto left 14:25 jgaz joined, ajdplaysalto joined 14:27 ab5tract joined
Nemokosch The author stopped using the language years ago basically, leaving the tool in a highly incomplete stage 14:29
lizmat the maintainer you mean? skaji san is still maintaining App::Mi6 afaik ? 14:31
Nemokosch skaji is maintaining App::Mi6
14:31 SARA-MARKTING joined
to be honest, if I thought the situation was so great, I wouldn't bother with the whole thing 14:33
I think App::Mi6 could be maintained better - but it's being maintained so I don't have much business there
however, Ddt, which I think has a more ambitious core design, is completely unmaintained for years 14:35
in this time, all the contribution from the supposed maintainer was, as much as I can see: 1. complaining how Raku is not production-ready 2. leaving PR's dangling 3. preaching about having "high standards" 14:36
tonyo fez is getting some dist features 14:37
tellable6 2023-02-09T22:21:23Z #raku <melezhik> tonyo - that's ok, I can wait till the issue is fixed, anyway I have already renewed my fez token, so it's not possible to reproduce the bug now
tonyo i'm also very bad about PRs, i get 500+ notifications from github a day and they just kind of turned into noise 14:38
my most long standing one being from when i worked on nodejs core 10+ years ago and probably my most downloaded module
14:39 SARA-MARKTING left
Nemokosch fez dist features - that's definitely a welcome thing 14:40
frankly, mi6 is better than nothing, it's good enough for the caretaker stuff I usually do with a module 14:41
but to think that this is "what we can offer", well... in that light, it's not much
El_Che tonyo: I disabled github notifications, too many 14:43
tonyo i already see a bug in ddt that i was getting in fez
El_Che: it's awful, and the `focused` dashboard is equally poor 14:44
Nemokosch for github notifications - the other problem is NOT getting notifications about something you might want
tonyo currently working on removing the os dependency of gzip and tar from fez so it has all it needs to package directly
Nemokosch like "github discussions"; for the main Raku repos, I would like to be notified about everything 14:45
14:51 ab5tract left 15:05 ab5tract joined
[Coke] . 15:06
tellable6 2023-02-08T02:25:31Z #raku <melezhik> [Coke] , do you mean me , when say "create a ticket" ?
2023-02-08T17:42:58Z #raku <melezhik> [Coke] - github.com/Raku/doc/issues/4195
hey [Coke], you have a message: gist.github.com/ee67b3b2b172694c21...0ec71530b6
15:15 ab5tract left 15:36 david_ left 15:47 Sgeo joined 15:48 david_ joined 15:57 SARA-MARKTING joined 15:59 SARA-MARKTING left 16:01 ab5tract joined 16:22 perlbot left 16:23 simcop2387 left 16:27 perlbot joined, simcop2387 joined 16:28 ispyhumanfly left, ispyhumanfly joined 16:41 melezhik joined
melezhik o/ 16:42
tellable6 2023-02-10T13:59:34Z #raku <rf> melezhik I am interested in both
melezhik .tell rf for just java app testing please use this - github.com/melezhik/SparrowCI/blob...lpine.yaml 16:43
tellable6 melezhik, I'll pass your message to rf
melezhik .tell rf as for rakudo with jvm backend I have a couple of blockers preventing me from building docker images for SparrowCI - github.com/rakudo/rakudo/issues/5197 and github.com/rakudo/rakudo/issues/5198 16:45
tellable6 melezhik, I'll pass your message to rf
16:45 razetime joined 16:46 ajdplaysalto left
melezhik .tell rf I mean I can build a custom SparrowCI image with rakudo jvm backed in, but it's not going to have a zef or pakku dependency managers, I am not sure this is something you're after ... 16:49
tellable6 melezhik, I'll pass your message to rf
16:52 melezhik left 16:57 freeside joined 16:58 Guest7016 joined 17:02 freeside left 17:07 Guest7547 joined 17:18 lichtkind left 17:22 razetime left
rf .tell melezhik Thank you so much I will try the Java one this weekend 17:23
tellable6 rf, I'll pass your message to melezhik
17:23 Guest7016 left 17:29 freeside joined 17:33 freeside left, melezhik joined
melezhik . 17:35
tellable6 2023-02-10T17:23:04Z #raku <rf> melezhik Thank you so much I will try the Java one this weekend
melezhik rf: sure 17:36
17:42 melezhik left 18:00 reportable6 left 18:01 reportable6 joined 18:06 freeside joined 18:11 sena_kun joined, freeside left
tonyo m: multi MAIN('s'|'short') { 'short'.say; }; 18:16
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> multi MAIN('s'|⏏'short') { 'short'.say; };
expecting any of:
constraint
p6steve since Dan and Dan::Polars have a common API, I thought I'd do a cheeky benchmark gist.github.com/p6steve/4684eeca6b...1de16e0464
18:17 Oshawott left
turns out that Rust is about 60x faster than Raku to sum a DataFrame column 18:18
tonyo i guess rust has some optimization to do 18:19
p6steve BTW I suspect that this is roughly what you would get comparing vanilla Python with Python + (Rust) Polars
well, I am spending serious tuits on Dan::Polars these days and would like there to be some concrete benefit ;-) 18:20
lol 18:21
Nemokosch yeah that response really was tongue in cheek
18:28 Guest3763 joined
tonyo hmm, do we have a way of using a junction in the signature like that to shorten MAIN argument matching? something akin to MAIN(:h(:$help)) which matches `-h --help` ? 18:31
Nemokosch you can just "nest" this pair syntax as much as you want I think 18:34
:h( :help( :blah( :$bar ) ) ) 18:35
tonyo i want it to match `someprog h|help`
without the flag requirement
Nemokosch hmm
no better idea than the where clause so far... 18:38
tonyo yea that mangles the auto uSAGE 18:43
m: multi MAIN(Str $fff where * ~~ 'x'|'xxx') { }
camelia Usage:
<tmp> <fff>
Nemokosch Even when anonymous? 18:46
tonyo yea 18:49
even less info that way 18:50
m: multi MAIN(Str:D $ where * ~~ "r"|"run") {}
camelia Usage:
<tmp> <Str where { ... }>
Nemokosch Krrr 18:53
rf Finally figured out how to get RakuLSP working on Emacs 19:02
tellable6 2023-02-10T03:59:18Z #raku <melezhik> rf - just to clarify, you mean you want to run some Java code on SparrowCI or you are interested in rakudo-jvm?
2023-02-10T16:43:23Z #raku <melezhik> rf for just java app testing please use this - github.com/melezhik/SparrowCI/blob...lpine.yaml
2023-02-10T16:45:13Z #raku <melezhik> rf as for rakudo with jvm backend I have a couple of blockers preventing me from building docker images for SparrowCI - github.com/rakudo/rakudo/issues/5197 and github.com/rakudo/rakudo/issues/5198
2023-02-10T16:49:08Z #raku <melezhik> rf I mean I can build a custom SparrowCI image with rakudo jvm backed in, but it's not going to have a zef or pakku dependency managers, I am not sure this is something you're after ...
rf I think I'll write a guide for it
tonyo rf: are you interested in testing the fez dist management side? 19:05
there's enough in there for it to be useful
(but no guides for it yet)
[Coke] <garak>Especially when anonymous</garak> 19:06
rf Yeah I'm pretty swamped until sunday, if you can wait until then :D
tonyo i can
rf Excellent, i'll let you know then! 19:07
tonyo open testing, just working on getting everything in there still
rf Totally, I'm excited to see what you came up with
tonyo it's on the branch `dist` @ github.com/tony-o/raku-fez - once checked out you can just `zef install --force-install .` and use fez dist funcs
19:10 Guest3763 left 19:11 Guest3763 left
rf tonyo: Holy-cow just quickly skimmed that branch, this looks amazing! 19:13
Geth doc: coke self-assigned Need to note unordering-ge for Map/Hash/QuantHash/Bag/Set/Mix/BagHah/SetHash/MixHash github.com/Raku/doc/issues/2174
coke self-unassigned Need to note unordering-ge for Map/Hash/QuantHash/Bag/Set/Mix/BagHah/SetHash/MixHash github.com/Raku/doc/issues/2174
19:28
tonyo rf: 🙌 19:29
19:35 epony joined 19:36 freeside joined 19:40 freeside left 20:12 Guest8086 joined 20:20 Guest7547 left 20:32 jpn left 20:34 jpn joined 20:39 jpn left 20:42 Guest8086 left
Nemokosch rf++ 20:51
20:55 derpydoo joined 20:57 jpn joined 21:06 jpn left
21:10 Monalika9 joined 21:29 Monalika9 left 21:33 jpn joined 21:38 jpn left 21:47 sena_kun left, derpydoo left
rf What's the best way for a multiline string in an array literal? 21:56
lizmat q:to/STRING/; 22:07
foo
bar
STRING
docs.raku.org/language/quoting#Heredocs:_:to 22:08
rf How can I do this within an array? 22:15
like [q:to/EOF/ abc abc abc EOF, ...
Nemokosch > The contents of the heredoc always begin on the next line, so you can (and should) finish the line. 22:17
Moreover:
> You can begin multiple Heredocs in the same line. If you do so, the second heredoc will not start until after the first heredoc has ended.
22:32 jpn joined 22:37 freeside joined 22:39 tejr left 22:40 jpn left 22:41 freeside left 22:42 tejr joined, ajdplaysalto joined 22:43 ajdplaysalto is now known as Guest6727 22:45 Guest6727 left 22:46 Guest6727 joined, Guest6727 left 22:48 ajdplaysalto joined 22:50 ajdplaysalto left 22:51 ajdplaysalto joined 22:52 jpn joined 22:54 freeside joined 22:57 jpn left 22:59 freeside left 23:02 redashes joined
redashes Hello 23:03
23:04 redashes left 23:09 jpn joined 23:10 jgaz left 23:12 ajdplaysalto left 23:15 jpn left
rf redashes: Hello! 23:16
tellable6 rf, I'll pass your message to redashes
rf What is the ~ sigil? 23:18
I keep seeing it, but not sure what it does, coerce to string?
moritz yes, though it's a prefix, not a sigil 23:19
rf That's what I thought, thanks! 23:20
I guess its the string version of my $abc = '123'; +$abc; 23:21
[Coke] this gives a LOT more info, but you can see it's a prefix with: raku --target=ast -e '~"3"' 23:26
23:28 jpn joined
[Coke] er, ~3 is sufficient. :) 23:30
23:36 jpn left
Geth doc/main: ebd0a68122 | (Monalika Patnaik)++ (committed using GitHub Web editor) | CONTRIBUTING.md
Update CONTRIBUTING.md (#4197)

  * Update CONTRIBUTING.md
23:38
[Coke] Anyone who has some spare tuits to work on documentation, I've created a milestone on raku/doc for things that I'd like to get done by the end of March: 23:41
github.com/Raku/doc/milestone/4 ; if any of these are on topics you're interested in, or think you can write something up for, we'd love the help, feel free to swing by #raku-doc to ask questions about how docs works, and ask here about how stuff works (if needed) 23:43
We also still need help running QA against the upcoming site; feedback about gaps compared to the original site esp. welcome. 23:44
23:48 jpn joined 23:56 derpydoo joined 23:58 jpn left