🦋 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.
guifa o/ 03:36
CIAvash Happy Nowruz everyone! 06:50
Nemokosch What is that, good sir 09:22
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
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!!
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
lizmat The andthen operator returns Empty upon encountering the first undefined argument, otherwise the last argument. 12:13
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
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 !!!
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
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
colemanx I like the "Did You Know" section of this week's newsletter 17:33
Nemokosch 👎
oops, wrong one :\ 17:34
thumbs UP
colemanx :) 17:43
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
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
guifa SmokeMachine: I guess Apple loosened restrictions a while back 21:02
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
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
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
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
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.
melezhik nine is it 1500 machines cluster for Rakudo modules only or this cluster shared by all other clients? 23:45