🦋 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:06 reportable6 left 00:19 mykhal left 00:20 mykhal joined 00:30 linkable6 joined 01:13 spacekookie_ left 01:15 spacekookie joined, sisar joined 02:15 unicodable6 left, squashable6_ left, statisfiable6_ left, quotable6 left, releasable6 left, committable6 left, greppable6 left, linkable6 left, sourceable6_ left, bloatable6 left, shareable6_ left, bisectable6_ left, coverable6 left, nativecallable6_ left, notable6 left, benchable6 left 02:16 quotable6 joined, nativecallable6 joined, sourceable6 joined, squashable6 joined, statisfiable6 joined 02:17 bloatable6 joined, greppable6 joined 02:18 coverable6 joined, releasable6 joined 02:21 sisar left 02:23 ggoebel left 02:29 evalable6 joined 03:09 reportable6 joined 03:16 notable6 joined, bisectable6 joined 03:17 shareable6 joined 03:34 frost joined 03:36 guifa joined
guifa o/ 03:36
04:17 linkable6 joined, benchable6 joined, unicodable6 joined 04:47 floppy_disk joined 04:56 floppy_disk left 04:58 [Coke] left 05:17 committable6 joined 06:07 reportable6 left 06:10 [Coke] joined 06:28 Sgeo left 06:47 ggoebel joined 06:48 mexen_ joined
CIAvash Happy Nowruz everyone! 06:50
06:50 mexen_ is now known as mexen_wfh 06:52 ggoebel left, ggoebel joined 07:12 mexen_wfh left 08:08 abraxxa joined 08:14 abraxxa left 08:15 abraxxa joined 08:35 sena_kun joined 08:48 dakkar joined 08:55 Manifest0 left 09:00 Manifest0 joined
Nemokosch What is that, good sir 09:22
10:00 evalable6 left, linkable6 left
CIAvash Persian new year and international day("renewal of nature" and "culture of peace") en.wikipedia.org/wiki/Nowruz www.un.org/en/observances/internat...nowruz-day 10:05
Nemokosch ohh 🧚 10:07
10:09 reportable6 joined 10:28 TempIRCLogger left 10:29 TempIRCLogger joined, peder left 10:30 peder joined 10:33 TempIRCLogger left, TempIRCLogger joined 10:34 zacts joined 10:47 zacts left 11:00 evalable6 joined 11:03 linkable6 joined 11:04 razetime joined 11:49 Guest93 joined
Guest93 Hi. How can I perform multiple tests of a same file in 'if' condition without repeating file name? 11:56
if "/etc/os-release".IO.f && "/etc/os-release".IO.r and ... {
  CODE
}
So I would like to get rid of repeating "/etc/os-release" multiple times. For me it's very common to call boolean methods on same object in one 'if' condition, so I wonder if there is a short Perl-ish form of it.
Nemokosch You could deal with the topic variable I think 11:57
either using "given" or in this case, I find it tempting to just use "andthen"
Guest93 $_ doesn't work in 'if' condition 11:58
Nemokosch which is a closer equivalent of "with"
it does, why wouldn't it 11:59
if "/etc/os-release".IO andthen .f && .r and ... {
}
however, dor this .f and .r business, I would expect that there is some smartmatching stuff
and you don't even need to replace the IO in the first place
MasterDuke m: with "tmp".IO { if .e and .d { say "hi" } }     # or  something like this perhaps
camelia ( no output )
lizmat .f && .r && .x with "/etc/os-release".IO 12:00
Nemokosch '/etc/os-release'.IO ~~ :f & :r 12:01
this is also correct, isn't it
lizmat that is also correct, but would create the IO object twice
Guest93 >>> if "/etc/os-release".IO andthen .f && .r and ... { 12:03
WORKS!!
Nemokosch that sounds optimizable though, not an inherent treat of the syntax?
I love this andthen, Jan Krňávek for president
Guest93 >> MasterDuke 13:59:33 12:07
>> m: with "tmp".IO { if .e and .d { say "hi" } }     # or  something like this perhaps
also nice tip. THANK you!!
12:08 reportable6 left
Nemokosch the difference between `with` and `given` is that `with` skips on missing value 12:09
lizmat .defined must be true for with to trigger 12:10
Guest93 >> lizmat 14:00:50 12:11
>> .f && .r && .x with "/etc/os-release".IO
looks cool, but get syntax error when use in if block like this
if .f && .r with "/etc/os-release".IO {
  say "true";
} else
evalable6 true
Guest93   say "false";
}
evalable6 false
lizmat yes, it does... you can't mix with and if like that
m: say "foo" if 0
camelia ( no output )
lizmat m: say "foo" with 0
camelia foo
Nemokosch and andthen enforces boolean context, right? 12:12
lizmat docs.raku.org/routine/andthen 12:13
12:13 razetime left
lizmat The andthen operator returns Empty upon encountering the first undefined argument, otherwise the last argument. 12:13
12:13 razetime joined
Nemokosch so it is exactly like with 12:13
I like this way more but the name was a bit suggestive in the other direction 12:14
Guest93 >>> <Nemokosch#9980> '/etc/os-release'.IO ~~ :f & :r 12:15
checking ..
[14:01:26] <discord-raku-bot> <Nemokosch#9980> '/etc/os-release'.IO ~~ :f & :r 12:17
[14:01:31] <discord-raku-bot> <Nemokosch#9980> this is also correct, isn't it
Works!! THanks!!
these 3 forms are workable: 12:20
if "/etc/os-release".IO andthen .f && .r { 12:21
  say "true";
} else {
evalable6 true
Guest93   say "false";
}
evalable6 false
Guest93 with "/etc/os-release".IO {
  if .f and .r {
    say "true";
  } else {
evalable6 true
Guest93     say "false";
  }
evalable6 false
Guest93 }
if "/etc/os-release".IO ~~ :f && :r {
  say "true";
} else {
evalable6 true
Guest93   say "false";
}
evalable6 false
12:21 discord-raku-bot left, discord-raku-bot joined
lizmat Guest93: please use gists for extended code examples 12:21
Guest93 how?
lizmat by using e.g. gist.github.com and posting the url here 12:22
Guest93 👍👍👍 12:27
gist.github.com/AlexEnz/b3922058d3...57fb4fea00 12:28
thank you all !!!
12:41 Altai-man joined 12:46 Guest93 left 13:02 [Coke] left 13:07 Altai-man left, [Coke] joined 13:12 [Coke]_ joined 13:13 [Coke] left 13:22 frost left 13:26 [Coke]_ is now known as [Coke] 13:54 Sgeo joined 13:56 Xliff_ left 13:58 peder left 14:11 reportable6 joined, peder joined 14:46 wingfold joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/03/21/2022-...easomatic/ 14:56
guifa lizmat++ (also yay, I snuck in my update just in time) 14:58
Nemokosch sneaked reeeeee 15:15
Voldenet when you look at the link raku.land/cpan:BDUGGAN/Dawa the last paragraph's header looks like this i.imgur.com/PoxH3cW.png and it's caused by colliding ids of elements on the page containing readme's contents 15:17
Nemokosch It's never a bad time to state how much I adore the topic variable as it is in Raku 15:19
Voldenet the best part is how you can skip it and just do .something-like-this 15:20
Nemokosch I feel this enables a whole next level of maintainability 15:21
[Coke] docs.microsoft.com/en-us/windows/c...ng-margins - Nifty, this basically does what I want for my status line with a scrolling window. 15:31
(windows only) but I could use this on windows and the termios stuff on linux.
japhb You don't need termios unless you're doing raw *input*. 15:51
If all you're doing is sending ANSI sequences, just do that.
[Coke] thanks. 15:52
japhb (And FWIW escape sequences with names starting with "DEC" are VTnnn sequences)
Util College memories of sneaking into the lab reserved for upperclassmen, to use the large *color* DEC VT340 terminals with ReGIS and Sixel graphics, instead of the main lab's amber monochrome VT100`s. Good times, good times. 16:08
16:26 colemanx joined
theangryepicbanana dude sixels are so cool 16:27
I remember messing with them a bunch when I started programming a several years ago
[Coke] have something working on windows that puts a header and a terminal spinners bar on the last two lines while the viewport is everything above that. need to dynamically get the console size, and reset the viewport when done so that I don't have to hit enter to get past the progress bar. 16:29
(and wrap it up into a module instead of a bunch of hard coded stuff) 16:31
(and make it work on linux)
can we get raku into the microsoft store? 16:34
I just typed "python" in a command window, got a very nice "click here" and am now installing python 3.x 16:35
16:44 abraxxa left 16:47 abraxxa joined 16:51 abraxxa left 16:52 abraxxa joined 17:05 razetime left
colemanx I like the "Did You Know" section of this week's newsletter 17:33
Nemokosch 👎
oops, wrong one :\ 17:34
thumbs UP
17:36 dakkar left
colemanx :) 17:43
17:57 nine left, m_athias left 17:58 nine joined, m_athias joined 18:00 ilogger2 joined 18:02 lucs_ is now known as lucs 18:04 wingfold left 18:05 camelia left, m_athias left, nine left 18:06 m_athias joined, nine joined 18:09 reportable6 left 18:14 camelia joined 18:18 abraxxa left
guifa [Coke] as soon as I figure out packaging for Mac, I can do that for the apple store at elast 18:22
[Coke] ++guifa 18:24
Geth doc: ad6c0c6c54 | (JJ Merelo)++ | doc/Type/Label.pod6
Adds new Label stuff #4043
18:42
linkable6 Link: docs.raku.org/type/Label
18:43 linkable6 left 19:03 melezhik joined
melezhik . 19:03
Geth doc: 72dce1aa2c | (JJ Merelo)++ | doc/Type/Date.pod6
Adds new Date 2022.03 #4043
19:09
doc: 46a9c05072 | (JJ Merelo)++ | doc/Type/DateTime.pod6
Adds new DateTime features for 2022.03 closes #4043
SmokeMachine guifa: You mean Raku in the AppStore? For iOS too??? 19:16
tonyo is star still being maintained? 19:19
Nemokosch the Question™️ 🤣 19:23
guifa SmokeMachine for the App Store. I don't know how we could pull it off on iOS, outside of using the JS RT 19:26
SmokeMachine guifa: there is pythonista on iOS App Store 19:27
Geth doc: 910fd68a79 | (JJ Merelo)++ | doc/Type/independent-routines.pod6
Minor fix :pencil2:
19:30
lizmat tonyo: yes, Anton Oks is the new maintainer 19:31
Geth doc: a21a3aed7f | (JJ Merelo)++ | doc/Type/independent-routines.pod6
Minor fix :pencil2:
19:32
19:49 melezhik left 20:21 wingfold joined 20:54 melezhik joined 21:01 melezhik left
guifa SmokeMachine: I guess Apple loosened restrictions a while back 21:02
21:10 reportable6 joined 21:34 wingfold left 21:40 Tom joined 21:42 Tom is now known as Guest750
Guest750 I'm running Ubuntu 20.04; I have been running rakudo-2021.04 and rakudo-star. I just tried to install rakudo-star-2022.02, but the mods to my .bashrc don't seem to work. In particular the env. var 'PATH' references 'share' but there is no share directory in the rakudo-star-2022.02. Any thoughts? 21:45
21:47 melezhik joined
melezhik sena_kun SmokeMachine yes, idea is to run tests on sparky cluster built on top off azure container instances - with per seconds price model - azure.microsoft.com/en-us/pricing/...instances/ 21:48
in that case there is no need to keep multi core pricy VM, and runs docker container on demand and then shutdown them 21:49
how many modules blin tests? 21:50
SmokeMachine we don't even need to have a k8s cluster - azure container instance are spawned and shut down on demand - it's pretty cheap and effective 21:51
tonyo melezhik: what are you building? 21:52
melezhik this is an example how to do this for parallel ( on many docker containers on the same time ) Rakudo spec test - github.com/melezhik/fastspec/blob/...parrowfile
tonyo I am thinking about building distributed test systems built on top of Sparky and azure docker instances 21:54
we could run tests on 20 containers in parallel and this would give us 20X speed ))) 21:55
we could apply this pattern to any distributed nature tasks, I am just suggesting community modules testing against raid commits / releases as an obvious example 21:56
maybe there are other niches for that
japhb melezhik: At a certain point, the overall time to complete parallel tests becomes dominated by imbalance between the individual tests, by work needed to distribute the tests, and startup/shutdown/cleanup of each run test. 21:57
21:57 destroycomputers left
melezhik like I said as a prove of concept I tried to do Rakudo test spec on multiple spec chunks on sparky cluster - github.com/melezhik/fastspec/blob/...le#L49-L78 21:57
japhb You can mitigate the imbalance problem by using feedback from previous runs to sort the tests by longest-runtime-first in the work distribution queue. 21:58
21:59 Guest750 left
melezhik japhb the thing is it'll hugely improved with the an era of docker. Also Sparky cluster  job api does all the job - it's all already implemented - github.com/melezhik/sparky#cluster-jobs 21:59
tonyo melezhik: i started down that path but you'll run into wanting different OSes to test against, eg something will work in linux but not bsd or windows, etc 22:00
melezhik so, yes there are some overheads to manage distributed queue, but they are not that significant, like I said
japhb The imbalance problem is the bigger one. 22:01
melezhik tonyo this was my previous work, with rakudist, but now I am talking about something different - about parallel cluster tests for community modules
but this also could be applied to parallel tests on various os, distributions 22:02
japhb - "and startup/shutdown/cleanup of each run test." - it's already solved one runs tests on clean docker containers and then just kill them 22:03
this is completely the case with azure container instance, and you can see how it works with fast spec - github.com/melezhik/fastspec/blob/...wfile#L135 22:04
japhb I'm glad you've solved the second problem. Just don't forget the first problem, is all I'm saying. :-) 22:08
melezhik yeah, this is why I've referenced (addressed) only the  second part of your statement ))),  so you are saying we are always limit by the slowest and greatest test, right? )) 22:10
japhb Well, the big problem is when you get unlucky and after a well distributed run in which all workers are happily churning along, and you've gotten almost to the end of the work queue, you have the bad luck of the last couple tests being outsized huge -- so only those two workers have anything at all to do, and it takes them a long time to finish, meanwhile you can't use the rest of your fleet capacity to help 22:12
at all.
melezhik yeah, I see, but I guess my level of granularity is a module is being tested not a certain test, right? 22:13
so paralyzation is made by modules not by tests
japhb Right, but how do you know which modules have nearly-no tests, and which have lots of test files but are really fast to execute them, and which have tests that run for several minutes? 22:14
melezhik so roughly speaking we are guaranteed to have an even workload for all workers in a cluster, at least with some good aproximation ...
tonyo right but no matter what the background OS is using (eg even if your os is win, the container is still using only linux)
melezhik yeah, that's true, I still think for the sake of Rakudo testing , (back compatibility ) not module testsing, we can think of the of 100 most breakable modules if you will so that to tests against them every Rakudo commit 22:15
tonyo so you might have RCM modules that work only against the container and the system library provided by linux (GNU) but not the library provided by BSD (this crept up in an issue with a module running tar)
japhb melezhik: Yes, but that approximation is only as good as the granularity of parallelism you can achieve and the variance of its grains 22:16
Anyway, I'm just trying to provide a hint. Either you will be lucky, or you won't ... and then you'll remember this conversation. ;-)
melezhik tonyo japhb I get all that, thanks ... well the idea - have very fast (1 minute total time  ) test for 100 💯 Raku modules against every Rakudo commit, to give Raku devs fast feedback on regression 22:17
will they be happy about that? :-)))
japhb That would be awesome, yes. :-) 22:18
tonyo i think a nightly would suffice, yea, and if it automatically managed the issue in GH (eg, closed the issue when the problem is fixed) then yea i think it'd be less than objectionable noise on the repo
melezhik it could be just 1 hours of containers CPU/memory time per day, so dirt cheap - remember - it's per second price for azure container instances ? )))
so, I'll go ahead for this next journey ?  ha-ha ))) 22:19
tonyo yeah, we could start with your nightly Rakudo builds - it'll be even cheaper .... 22:20
tonyo i like the idea, don't take the opinions as criticism 22:21
melezhik not at all  )))
:]
El_Che I hate it with passion and hate you all! 22:22
just kidding :)
melezhik )))
tonyo melezhik: i also had the thought of dedicating 10 cores of my desktop to that task but running against a VM so you can have a matrix of oses with it (bsd, osx, linux, win) 22:26
nine Why reinvent that wheel? 22:30
If we want to test a larger part of the ecosystem on every rakudo commit, all it takes is someone running the github.com/wbiker/module2rpm script on more modules and submit them to build.opensuse.org/project/show/ho...rakudo-git 22:31
22:32 melezhik left
nine Fully parallelized, dependency aware integration test on a > 1500 machine cluster. 22:32
MasterDuke is there any way to get notifications of failures? 22:33
nine Including web and command line interfaces, notifications, set-up of native dependencies and I don't know what else
And of course an API, on which you can automate everything and get all the data. 22:34
Oh, and it's completely free. Both in terms of license and for use.
22:46 linkable6 joined 23:07 monkey_ joined 23:44 melezhik joined
melezhik nine is it 1500 machines cluster for Rakudo modules only or this cluster shared by all other clients? 23:45
23:56 melezhik left 23:59 kj4tip joined