🦋 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 1 May 2021.
00:01 reportable6 left 00:02 reportable6 joined 00:27 mowcat left 00:51 Black_Ribbon joined 01:09 tejr left 01:16 Doc_Holliwood left 01:27 [Sno] joined, kvw_5_ joined 01:30 |Sno| left 01:31 kvw_5 left 02:12 marcusr left 02:13 marcusr joined 02:18 QhpAptyj9hj0RQwM left 03:18 bisectable6 left, bloatable6 left, statisfiable6 left, quotable6 left, sourceable6 left, linkable6 left, committable6 left, evalable6 left, releasable6 left, reportable6 left, tellable6 left, coverable6 left, shareable6 left, squashable6 left, unicodable6 left, greppable6 left, nativecallable6 left, benchable6 left, notable6 left, committable6 joined, linkable6 joined, shareable6 joined, nativecallable6 joined 03:19 bisectable6 joined, greppable6 joined, coverable6 joined, quotable6 joined, squashable6 joined 03:20 reportable6 joined, bloatable6 joined, tellable6 joined, unicodable6 joined, benchable6 joined, squashable6 left, statisfiable6 joined, releasable6 joined 03:21 notable6 joined, evalable6 joined, squashable6 joined, sourceable6 joined 03:40 a3r0 joined 04:00 MasterDuke left
tonyo anyone interested in a talk about fez for raku conf? trying to figure out what might be interesting about it to people? the benefits over cpan? how it actually works? the technologies behind it and what goes into an upload? 04:23
something else?
04:44 frost-lab joined 04:46 maggotbrain joined 04:50 wamba joined 05:21 wamba left 05:22 wamba joined 05:25 Sgeo left 05:27 wamba left 05:28 wamba joined 05:29 defaultxr left 05:30 defaultxr joined 05:45 wamba left 05:49 parabolize left 05:50 brtastic joined 06:00 brtastic1 joined 06:02 brtastic left, brtastic1 is now known as brtastic, reportable6 left, reportable6 joined 06:03 Black_Ribbon left
ecocode[m]1 maybe an intro on how to create a new module for upload to raku modules ? which tools to use; setup of the repo; necessary files; integration with git; what about NativeCall libraries; tests; module metadata ... 06:10
06:13 ecocode_ joined 06:14 ecocode_ left, ecocode_ joined 06:16 ufobat joined 06:22 wamba joined 06:32 abraxxa joined 06:33 patrickb joined
patrickb o/ 06:33
tellable6 2021-05-12T21:18:03Z #moarvm <MasterDuke> patrickb you said something a little while ago about windows vms?
06:36 abraxxa left 06:38 abraxxa joined, stoned75 joined
patrickb tony-o: I'd like to see a talk about fez. It should include: A joke about the naming (fez vs zef), some history including the limitations of p6c and cpan, a technical overview of how the server works and why (scalability, ...), instructions of how to use it in practice, outlook including a nod toward raku.land. The talk should have slides, then it 06:40
can serve as a resource to point interested people at.
MasterDuke: I can't remember talking about Windows VMs. Can you recall what I wrote about? 06:41
tellable6 patrickb, I'll pass your message to MasterDuke
06:42 patrickb90 joined 06:46 patrickb left 06:54 patrickb90 left 06:56 domidumont joined 07:08 frost-lab left 07:15 wamba left 07:18 ecocode_ left 07:21 stoned75 left 07:35 patrickb joined 07:44 dakkar joined 07:47 wamba joined 07:50 frost-lab joined 07:58 MasterDuke joined 08:00 frost-lab left 08:09 pecastro joined 08:17 frost-lab joined 08:20 wamba left 08:37 holli joined 08:40 stoned75 joined 09:40 evalable6 left, linkable6 left 09:42 linkable6 joined, evalable6 joined 09:47 wamba joined 09:55 wamba left 10:11 mowcat joined 10:32 Elvin joined 10:39 kini left 10:40 kini joined 10:44 donaldh left 10:48 Guest67 joined 10:49 Guest67 left 10:50 Guest67 joined 10:51 Elvin left 10:56 unclechu joined
unclechu hey, is there any “autodie” thing for `run` command? 10:57
for instance if i write something like this: `run(«foo bar», :out).out.slurp(:close).chomp` it does not fail if `foo` program is not found 10:58
instead it silently continues returning empty string as a result
timotimo you'll need to sink the object you're currently calling .out on, rather than discarding it 11:13
lizmat but if you sink it, then you won't be able to get at its :out ? 11:22
11:33 wingfold joined 11:38 wingfold left
unclechu timotimo: what do you mean by “sinking”? 11:53
the only solution that comes to mind is to add a subroutine wrapper that would just check for `.exitcode` at the end and throw an exception if it’s not 0 11:54
but the lack of error messages is sad. nothing is telling me what the problem is (missing `foo` in `PATH`)
12:02 reportable6 left 12:04 reportable6 joined 12:06 MasterDuke left 12:11 MasterDuke joined 12:14 patrickb left
lizmat unclechu: run(...) without putting it into a variable 12:21
"void context" in other languages 12:22
but I see your point: maybe we need a :throw named argument to "run" to have it throw if something went wrong 12:23
unclechu lizmat: yeah, i have the same question then. how do i slurp the `out` then? 12:24
lizmat right, indeed
what you *could* do as a workaround is to actually call .sink yourself
my $proc = run(....); $proc.sink; # will throw if something went wrong
"sinking" is really just calling .sink on an object 12:25
unclechu lizmat: that should work i think, thanks. though it wouldn’t be a one-liner anymore
lizmat in most cases, it won't do anything
unclechu would be happy to see `:throw` or something like this in the future
lizmat I'll make a PR in a moment 12:26
12:28 linkable6 left 12:31 linkable6 joined 12:43 linkable6 left 12:46 linkable6 joined 12:47 patrickb joined 12:59 linkable6 left 13:01 linkable6 joined 13:08 xelxebar left 13:09 xelxebar joined 13:20 asymptotically joined
lizmat unclechu: github.com/rakudo/rakudo/pull/4368 13:20
unclechu thanks 13:22
13:22 Nasrudin left 13:23 uzl[m] left, Garland_g[m] left
unclechu for now i did it like this: `do with run(«foo bar», :out) { .sink; .out.slurp(:close).chomp }` 13:23
13:23 GeekRuthie left, sienet_ja_LSD[m] left
unclechu though i’m not sure if it’s a correct way of doing it. `.sink` waits for the end of the program, right? 13:24
what if the output does not fit the buffer for `out`?
or it is okay?
does raku has its own way of buffering? 13:25
13:27 mowcat left, Garland_g[m] joined
lizmat clickbaits rakudoweekly.blog/2021/05/17/2021-...nodelayed/ 13:28
13:28 sienet_ja_LSD[m] joined 13:29 timeless left 13:30 uzl[m] joined, caasih left 13:33 rjeli left
stoned75 hi. I cannot convience myself that substr-rw method works on allomorph types. Any example to give to me ? 13:35
13:36 Nasrudin joined
lizmat m: my $a = <42>; $a.substr-rw(0,2) = 666; dd $a 13:36
camelia Too many positionals passed; expected 1 to 3 arguments but got 4
in block <unit> at <tmp> line 1
lizmat hmmm
afk for a bit&
13:37 caasih joined
stoned75 I meant with current rakudo. and yes I'm seeing exactly that lizmat. I feedled around without any luck 13:37
13:38 rjeli joined 13:41 asymptotically left, asymptotically joined, asy joined
stoned75 *fiddled 13:42
13:44 timeless joined 13:49 holli left, [Sno] left 13:50 holli joined, [Sno] joined, ufobat left, ufobat joined, cog joined 13:57 asy left 13:59 [Sno] left, vrurg left, vrurg_ joined 14:00 [Sno] joined, perigrin left, perigrin joined, brass left, eater left, brass joined 14:01 samcv_ joined, Kaiepi left, Kaiepi joined, patrickb left, samcv left, eaterof joined 14:02 patrickb joined 14:04 APic left 14:07 wingfold joined
lizmat stoned75: looks like a thinko on my part, care to create an issue for it ? 14:09
stoned75 sure. And I could look into adding a couple of tests in roast if that can help ? 14:10
14:11 wingfold left 14:12 Sgeo joined
lizmat yes, please! 14:12
14:14 wingfold joined 14:20 b2gills left
spacebat2 is there a raku equivalent of ruby's tap or yield_self methods? a method just about every object has, that expects a lambda and calls it with self as the argument 14:20
14:21 b2gills joined, brtastic1 joined 14:22 brtastic left, brtastic1 is now known as brtastic 14:24 tomasz7 joined
lizmat you don't need that 14:24
m: sub twice($a) { $a ~ $a }; say "foobar".&twice() 14:25
camelia foobarfoobar
lizmat the .&methodname() syntax allows you to call a sub as a method on any object
spacebat2 ^^ is that what you meant ? 14:26
14:26 wingfold left
spacebat2 that might do yes 14:26
14:27 wingfold joined
tomasz7 hi, has raku got into any linux distribution as a standard? 14:27
lizmat only really old versions
but El_Che manages a lot of Linux packages for Raku 14:28
nxadm.github.io/rakudo-pkg/ # tomasz7 14:29
tomasz7 i can easily find and install it on my Debian, but I wonder if it's getting any popular
14:31 wingfold left
tomasz7 perl5 is installed by default and many standard tools are in p5 14:31
that's what i'm asking about raku - has any distribution reached for it so far? 14:32
El_Che tomasz7: most distributions ship raku 14:36
14:36 ufobat_ joined
tomasz7 ok but do they use it? 14:37
14:39 ufobat left
El_Che internally? probably not, I think that only python and perl are used that way 14:40
it's a blessing and a curse
for modern languages you are better off leaving system $lang to the system and install a recent version yourself 14:41
tomasz7 ruby too 14:43
tx 14:50
14:50 tomasz7 left 14:51 parabolize joined 14:59 linkable6 left 15:02 linkable6 joined 15:03 APic joined
stoned75 lizmat: saw your fix. that's strange I'm pretty sure I tried that without luck :-} I must have been confused 15:06
ok that's what I thought after I read your commit log. And yes I had tried that but decided against it because after the substr-rw the allomorph is no more. is that really ok with you ? 15:10
well that was the behaviour before the introduction of the Allomorph class if I am not mistaken 15:11
15:21 reario joined 15:23 reario left
stoned75 ok, according to your commit ba814fde4fc46607eb143ebddeaa9ecdba85a036 we do want substr-rw to return a Str 15:30
so be it :)
15:30 linkable6 left 15:31 linkable6 joined 15:33 jmerelo joined
tonyo ecocode[m]1: patrickb: those are good suggestions, thanks 16:10
16:27 [Sno] left 16:34 dakkar left 16:36 Guest67 left 16:42 domidumont left 17:03 stoned75 left 17:10 ecocode[m]1 left 17:16 [Sno] joined 17:22 patrickb left 17:31 stoned75 joined 17:39 stoned75_ joined, stoned75 left 17:42 samcv_ is now known as samcv, samcv left, samcv joined 17:44 jmerelo left 17:46 swaggboi left 17:55 swaggboi joined 17:59 mowcat joined 18:00 aborazmeh joined 18:02 reportable6 left, ErgoXX______ joined
ErgoXX______ Is this where one comes to be reborn into a perl god 18:03
18:03 reportable6 joined
lizmat ErgoXX______ : probably not ? 18:04
18:05 flouncy joined 18:25 ufobat_ left 18:38 holli left 18:43 aborazmeh left 18:46 MasterDuke left 19:01 ufobat_ joined
unclechu is there a way to find a full path to an executable from `PATH` environment variable? like what `which` command does? 19:15
19:15 camelia left
kybr i think i found a minor error in the docs; i thought i might confirm. i'm curious 19:15
qw/.../; # is more commonly rendered as C<< <...> >> in Raku. 19:16
19:16 nine left
kybr it's line 1444 of the 5to6-perlfunc.pod6 19:16
unclechu kind of equivalent to builtin `type -P` in Bash. for instance `type -P cat` would return `/usr/bin/cat` (the path would depend on OS)
kybr the line uses C<< <...> >> to code-quote, but it does so within a =for code :lang<perl> 19:17
19:18 MasterDuke joined
kybr so we see the C<< <...> >> whereas i think we want to see <...> 19:19
stoned75_ kybr: you're quite right
19:22 japhb left
Geth doc: kybr++ created pull request #3884:
minor fix: code quote within code quote
19:24 japhb joined 19:34 camelia joined 19:37 camelia left 19:38 nine joined 19:39 nine left 19:43 nine joined 19:45 camelia joined 19:48 stoned75_ left 19:49 stoned75 joined 20:34 linkable6 left 20:37 linkable6 joined
tusooa <unclechu "kind of equivalent to builtin `t"> why not just traverse the PATH variable? 20:47
unclechu tusooa: because maybe there already is a simpler solution? 20:49
tusooa: traversing `PATH` would take splitting string by `:` (this separator i believe also depends on OS), and checking each item for executable permission 20:51
this should be a lot of code but already too noisy comparing to something like `'some-executable-name'.expand-path` 20:52
don’t want to reinvent the wheel if it’s already invented
tusooa i can understand
unclechu this should not be 20:53
tusooa i guess it could be a nice to have
maybe there are modules for it?
unclechu maybe, but in my standalone script i’m looking for a builtin solution. so i would probably end up with traversing `PATH` instead of using some dependency 20:55
flouncy hi
ugexe no there is no built in solution because its not an easy problem to solve in a cross platform way 20:58
what gets executed on a given system when you type 'some-command' is not just/always based on PATH depending on your system
20:58 flouncy left 20:59 gordonfish- joined
tusooa well, on some shells it could be hashed 20:59
tonyo it's really not even a system thing but a shell thing 21:00
21:01 gordonfish left 21:05 rir joined 21:19 ufobat_ left 21:27 asymptotically left 21:44 mowcat left 21:46 Zaid joined
gfldex unclechu: here is an example of how to scan $PATH: github.com/gfldex/raku-shell-pipin...kumod#L342 21:58
22:01 dogbert17 joined
ugexe that can be simplified further with `$*SPEC.path` 22:03
(as well as be slightly more cross platform) 22:04
22:06 dogbert11 left
unclechu gfldex: yeah, i kind of did the same: 22:12
`my List:D \paths = %*ENV{'PATH'}.split(':').cache;`
`{ with IO::Path.new: e, :CWD($_) { return .absolute if .e } } for paths;`
ugexe: good to know that `$*SPEC.path` exists 22:13
tonyo : won't work on windows 22:16
ugexe github.com/ugexe/zef/blob/602c54f1...#L170-L181 this is what zef uses 22:20
unclechu tonyo: yeah, that i was worried about too. that it depends OS 22:21
ugexe $*SPEC.path handles the OS-specific path seperator
but there is still PATHEXT to worry about 22:22
unclechu changed to this: `{ with IO::Path.new: e, :CWD($_) { return .absolute if .e } } for $*SPEC.path;`
and error throwing after this line if it passes without `return`ing anything
ugexe because on windows there is no e.g. `git`, there is `git.exe` or `git.bat` 22:24
hence utilizing PATHEXT
23:06 evalable6 left, linkable6 left 23:07 evalable6 joined 23:08 linkable6 joined 23:15 thundergnat left 23:16 brtastic left 23:25 AlexDaniel` left 23:26 patrickbkr[m] left 23:27 juanfra__ left 23:30 daxim left 23:34 daxim joined 23:41 pecastro left 23:43 AlexDaniel` joined 23:46 patrickbkr[m] joined 23:51 juanfra__ joined