🦋 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. |
|||
Voldenet | in fact, that "shorter" syntax is very much like pairs, but weird | 00:00 | |
m: my @a = <a b c d>; for @a.pairs -> $item { say $item.value; say $item.key; } | |||
camelia | a 0 b 1 c 2 d 3 |
||
Voldenet | m: my @a = <a b c d>; for @a.pairs { say .value; say .key; } # the shortest | 00:01 | |
camelia | a 0 b 1 c 2 d 3 |
||
wayland76 | Oh! I somehow didn't realise that .kv worked on arrays too! Thanks! :) | 00:33 | |
00:39
arkiuat left
00:51
arkiuat joined
|
|||
timo | m: my @a = <a b c d>; for @a[]:p { say .value; say .key; } | 01:01 | |
camelia | a 0 b 1 c 2 d 3 |
||
timo | even shorter by two letters | 01:02 | |
SmokeMachine | weekly: dev.to/fco/bringing-structural-pro...-raku-2ook | 01:25 | |
disbot3 | <jubilatious1_98524> m: my @a = <a b c d>; .say for @a.pairs; | 01:30 | |
<Raku eval> 0 => a 1 => b 2 => c 3 => d | |||
01:36
kylese left
01:37
kylese joined
|
|||
tbrowder | thanks, all. btw, i use the @a.kv -> $i, $v all the time. early on i was marveling at all the stuff getting cleaner syntax than Perl and i wondered about @arr and whether there was some magic way the index number of an item could be incremented if were initialized in a statement before @arr so it would be 1 for the first element. Zoffix was fooling around with tweaking @arr and he wondered why i would want to do that and i said | 01:46 | |
because my typical use case was to alway refer to do that. i got chastized and dismissed. | |||
later i learned about .kv i think from lizmat and later .kv -> $i is copy, $v and i was very happily surprised one more time. i have never looked back at perl except to translate my old stuff to raku. | 01:52 | ||
disbot3 | <jubilatious1_98524> m: my @a = <a b c d>; @a.kv.join(",").put; | 01:55 | |
<Raku eval> 0,a,1,b,2,c,3,d | |||
tbrowder | Voldenet: if all my common vars are single-valued isn't a plain hash simpler to use on the receiving sub side? | 02:04 | |
no, maybe the array with the index as key... | 02:06 | ||
i'll sleep on it. nitey nite... | |||
disbot3 | <jubilatious1_98524> m: my @a = <a b c d>; dd @a.pairs | 02:08 | |
<Raku eval> (0 => "a", 1 => "b", 2 => "c", 3 => "d").Seq | |||
<jubilatious1_98524> hmm... appear to be Int keys? | 02:09 | ||
02:15
kylese left,
kylese joined
03:45
kylese left
03:48
kylese joined
04:10
bisectable6 left
04:15
tjr left
04:16
[Coke] left
04:23
frost joined
04:56
Aedil joined
05:03
frost left,
frost joined
05:08
frost left
06:07
arkiuat left
06:12
[Coke] joined
06:20
arkiuat joined
06:25
arkiuat left
06:34
lizmat joined
06:52
arkiuat joined
06:57
arkiuat left
07:26
arkiuat joined
07:31
arkiuat left
07:48
arkiuat joined
07:53
arkiuat left
08:04
librasteve_ joined
|
|||
disbot3 | <librasteve> o/ | 08:07 | |
librasteve_ | wayland76: hi! can we have a quick chat about “Intsall”? | 08:08 | |
08:10
abraxxa-home joined
08:12
abraxxa-home left
08:21
halloy3051 joined
08:22
arkiuat joined
08:27
arkiuat left
08:49
arkiuat joined
08:54
arkiuat left
09:18
jjido joined
09:24
arkiuat joined
09:29
arkiuat left
|
|||
wayland76 | weekly: wayland.github.io/blog/raku/genera...sation.xml | 09:32 | |
09:32
jjido left
|
|||
wayland76 | SmokeMachine / librasteve_ I'm not seeing the Weekly bot respond to the weekly messages. | 09:34 | |
09:50
arkiuat joined
09:55
arkiuat left
09:59
Sgeo left
|
|||
librasteve_ | can you raise that with the bot guys? | 10:04 | |
10:22
arkiuat joined
10:28
arkiuat left
|
|||
wayland76 | I don't know who the bot guys are :) | 10:47 | |
10:51
arkiuat joined
10:56
arkiuat left
|
|||
disbot3 | <librasteve> me neither - maybe @whistlingzephyr ? | 10:56 | |
<whistlingzephyr> I only handle the Discord side of bots (bridge and Discord eval), not sure about IRC bots. maybe lizmat could help | 10:58 | ||
<librasteve> thanks for clarifying | |||
<whistlingzephyr> no problem | |||
11:09
halloy3051 left
11:20
arkiuat joined
11:24
arkiuat left
|
|||
wayland76 | .tell melezhik You might be interested in github.com/spitsh/spitsh :) | 11:33 | |
tellable6 | wayland76, I'll pass your message to melezhik | ||
wayland76 | I've just done a bit of an eyeball, and there's no notable6 bot listening on this channel. So that's the problem. | 11:35 | |
lizmat: Whom do we complain to when the bot is down? | |||
disbot3 | <librasteve> that's odd | ||
11:52
arkiuat joined
11:57
arkiuat left
|
|||
Voldenet | tbrowder: Well, plain hash is simpler but loses type info fast - you can never be sure what's inside the hash, using a class is a tradeoff where you know exactly what can be stored, but it's a lot of typing | 12:06 | |
tbrowder | agree, i wound up using a class | 12:13 | |
disbot3 | <librasteve> hi folks - I have noticed that the old repl Linenoise / Readline issue continues to create unwated friction for newcomers to raku | 12:14 | |
<librasteve> github.com/rakudo/rakudo/issues/5932 | |||
<librasteve> This Issue is imho the number one thing that newcomers to raku complain about. It detracts from the overall raku experience at the exact point when a newcomer is judging the overall quality and reliability of our language. | |||
<librasteve> Please can we fix this in the next release? (I'm happy to make a PR - but want to allow time for a bit of discussion in case there's a better way) | 12:15 | ||
12:20
arkiuat joined
12:23
lichtkind joined
12:24
arkiuat left
|
|||
Voldenet | good idea, I gave it a like because I have nothing to add – readline mostly works everywhere and has great compatibility with everything | 12:39 | |
linenoise feels experimental, I end up not being able to use some keys depending on the terminal | 12:40 | ||
Terminal::LineEditor could be good, but I haven't tried it | |||
in fact, "no NativeCall needed" is really promising to me | 12:41 | ||
after testing it a bit, some home/end keys don't work depending on terminal (linenoise-like) – I suppose the cause is that readline is just old and has tons of users able to test them out | 12:43 | ||
12:53
arkiuat joined
|
|||
disbot3 | <librasteve> ok | 12:58 | |
12:59
arkiuat left
|
|||
disbot3 | <librasteve> dumb question - why does rakudo / rakudo-star just bundle Readline? | 12:59 | |
jdv | what should be bubndled then? slippery slope | 13:08 | |
and then you end up with dual life... | |||
13:21
vasko4 left
13:27
arkiuat joined
13:40
vasko4 joined
13:53
wayland joined
13:54
wayland76 left
14:10
arkiuat left
14:11
arkiuat joined
14:15
arkiuat left
|
|||
disbot3 | <librasteve> jdv: ok ... but every newcomer that installs raku and tries the repl is going to hit this bump | 14:35 | |
ugexe | sure, but really the same could be said of most bugs. if a newcomer and uses the thing that is buggy, they are going to hit a bump | 14:38 | |
disbot3 | <librasteve> ugexe: by bump I mean anything on lines of your line editor is incomplete ... go zef install Something ... its still a bump even if the action is successful ... today it's usually unsuccessful which is more of a hump | 14:41 | |
14:43
arkiuat joined
14:47
arkiuat left
|
|||
SmokeMachine | wayland: thanks! Let me try again… | 15:08 | |
weekly: dev.to/fco/bringing-structural-pro...-raku-2ook | 15:09 | ||
weekly: help | |||
15:18
arkiuat joined
15:22
arkiuat left
15:51
arkiuat joined
15:56
arkiuat left
16:24
arkiuat joined
16:29
arkiuat left
|
|||
timo | looks like notable6 isn't here, that's the bot that does these things | 16:33 | |
.seen notable6 | |||
tellable6 | timo, I saw notable6 2025-07-14T18:41:31Z in #raku: <notable6> librasteve_, Moved existing notes to “weekly_2025-07-14T18:41:30Z” | ||
16:34
simcop2387 left
16:42
human-blip left
|
|||
[Coke] | .. did someone MOVE the whateverable repo? | 16:43 | |
I have a checkout with it at Raku/whateverable.git | 16:44 | ||
16:44
human-blip joined
|
|||
[Coke] | but it is now at github.com/raku-community-modules/whateverable | 16:44 | |
so it would not surprise me if many things are now unhappy | |||
the auto redirect should work for a bunch of stuff (but not for me to push a commit to force a bot restart) | 16:45 | ||
16:52
arkiuat joined
17:02
arkiuat left
|
|||
jdv | liz started to "communityify" it but gave up so far | 17:08 | |
i guess consider it "frozen" for a few days/weeks | 17:09 | ||
also, note that the July release will not happen because i have better things to do on 7/25 than push out a more or less low value release | 17:10 | ||
[Coke]: you can if you really want to... | 17:11 | ||
17:30
arkiuat joined
17:34
Sgeo joined
17:35
arkiuat left
17:48
arkiuat joined
17:56
arkiuat left
|
|||
jdv | librasteve: that seems like a valid point | 18:00 | |
i have never and will likely never use a repl. i mean, i've tried them but i find them unuseful, for me. | 18:01 | ||
so i'm the wrong person to be talking about this:) | |||
18:07
arkiuat joined
|
|||
Voldenet | I don't use repl because it's stateful | 18:11 | |
so it prevents you from actually testing code, you test the code against current state | 18:12 | ||
instead of repl, I use `raku -e '…'` most of the time | 18:13 | ||
servers similar purpose, but without anything stateful | |||
serves* | |||
and when the code in -e becomes too long, i just dump it into the file, it's way more difficult to do that with repl | 18:14 | ||
disbot3 | <librasteve> yeah i rarely use repl (expect for crag) … but i guess it’s one of the first things a newcomer will reach for | 18:15 | |
Voldenet | I'm not sure - I don't think I've ever user repl for anyting, even when I was an actual beginner | ||
disbot3 | <librasteve> please all keep tagging weekly: even if the bot does nt work and i’ll trawl the logs for now | ||
<librasteve> yeah even if you go there, soon gonna outgrow it | 18:16 | ||
Voldenet | I use repl in js a lot, but the annoying part is that `const/let` actually pollute global state | 18:17 | |
18:18
arkiuat left
|
|||
Voldenet | so… I'm doing `async function x() { … }; x()` instead | 18:18 | |
so I'm actively doing workarounds for having things running in repl | |||
it might be just "me" issue, but it might be worth figuring out if newcomers want to use REPL at all | 18:20 | ||
otoh It'd be good if it was just working well, so if compiled package tested if readline/linenoise was installed and pull the right module | 18:21 | ||
it'd be probably the right thing | |||
otherwise use Terminal::LineEditor automatically | |||
s/use/install/ | |||
OTOH sbcl just requires rlwrap without even telling you that | 18:23 | ||
tbrowder | if anyone has watched ruth’s toc presento on youtube, i was interested in the point about CVEs. seems to me that’s an incentive to enable checking and deleting data from zef/fez. | 18:24 | |
18:26
arkiuat joined
18:31
arkiuat left
|
|||
ugexe | If something has a severe CVE and is relatively new and unused, sure. Otherwise that is a recipe to break production systems and why most ecosystems of any language disallow doing that. The correct response is to fix the bug or write a better library, not force everyone to figure it out once their systems break from someone else removing it | 18:36 | |
I’m also typing on a phone so I can’t continue this conversation at the moment 🙃 | 18:37 | ||
Geth | ¦ problem-solving: lizmat assigned to codesections Issue A PURL specification for Raku modules github.com/Raku/problem-solving/issues/488 | 18:51 | |
¦ problem-solving: lizmat unassigned from codesections Issue A PURL specification for Raku modules github.com/Raku/problem-solving/issues/488 | 18:52 | ||
18:53
arkiuat joined
18:57
arkiuat left
19:00
jjido joined
|
|||
[Coke] | ugexe++ | 19:03 | |
19:25
arkiuat joined
19:45
rir joined
|
|||
Voldenet | only removing openly malicious versions of packages should be allowed, in any other case auditing tools do the job well | 20:00 | |
every version in ecosystem could have vulnerabilities list somewhere, or there could be json file containing vulnerable versions of packages | 20:03 | ||
20:21
jjido left
20:30
jjido joined
|
|||
arkiuat | I use the REPL quite a lot, mostly to check my understanding of points where the documentation isn't clear to me. Which is quite often because most of the documentation is on the taciturn edge of terse. | 20:32 | |
I'm well past the point where I can never go back to Perl 5, but still learning a lot about Raku most weeks | 20:33 | ||
I've certainly run into trouble with getting my Readline working, but it hasn't been a problem at all in recent months | 20:34 | ||
disbot3 | <antononcube> @arkiuat Using Jupyter and/or LLMs would speed up your Raku studies. | 20:35 | |
<jubilatious1_98524> I prefer Linenoise | 20:38 | ||
20:41
Aedil left
|
|||
disbot3 | <jubilatious1_98524> There's also Linenoise-NG, which purports to be UTF-8 (read: wide-character) friendly: github.com/arangodb/linenoise-ng | 20:42 | |
<antononcube> But it is archived / abandoned. | 20:43 | ||
<jubilatious1_98524> BSD license, anyone can host/adopt/extend | 20:44 | ||
21:13
vasko4 left
|
|||
jdv | shouldn't this basically echo what is typed?: raku -e '$*IN.Supply.tap: *.raku.say' | 21:19 | |
21:24
vasko4 joined
|
|||
jdv | how would one write "tail -f" in raku? | 21:30 | |
disbot3 | <antononcube> shell("tail -f your-file.log"); | 21:35 | |
21:42
arkiuat left
|
|||
disbot3 | <jubilatious1_98524> @jdv Not sure if I've posted an exact answer, but react blocks might fit the bill, see here: unix.stackexchange.com/a/722746/227738 | 21:44 | |
21:55
arkiuat joined
21:59
arkiuat left
22:00
simcop2387 joined
|
|||
Voldenet | consider `raku -e '$*IN.lines.Supply.tap: *.raku.say'` | 22:02 | |
Supply on IO::Handle will read chunks of given size | 22:04 | ||
timo | there are many things to consider when tailing a file, like truncation of the file for example. ideally, you'd take a module from the ecosystem that someone has built that takes into account all the nasty edge cases | 22:05 | |
Voldenet | e.g. raku -e '$*IN.Supply(:5size).tap: *.raku.say' | ||
I thought the question was not about file reading but Supply on handle | 22:07 | ||
timo | i didn't read back further than a few lines so maybe i missed something? | 22:08 | |
Voldenet | but well this doesn't seem to work anyway | 22:12 | |
obviously any read on eof would return eof | 22:13 | ||
so to tail -f properly, one would have to do something like this (not prod code, just PoC): | 22:17 | ||
> raku -e 'my $size = 0; loop { given "blah".IO.open(:r) { .seek($size); if my $n = .slurp { $n.say }; $size = .tell } }' | |||
> raku -e 'my $size = 0; loop { given "blah".IO.open(:r) { .seek($size); if my $n = .slurp { $n.say }; $size = .tell; .close } }' | 22:19 | ||
also add a sleep probably | |||
22:21
vasko4 left,
vasko4 joined
22:26
arkiuat joined
|
|||
Voldenet | > sub x { state $size = 0; given "blah".IO.open(:r) { say "foo"; .seek($size); if my $n = .slurp { $n.say }; $size = .tell; .close; } }; x; loop { say "boo"; react whenever "blah".IO.watch { x } } | 22:27 | |
disbot3 | <librasteve> wonders if you could stick a Supply onto a tail -f | 22:29 | |
Voldenet | it's not perfect still… | ||
22:31
arkiuat left
|
|||
Voldenet | yes, you could | 22:31 | |
disbot3 | <librasteve> @jubilatious … looks like your volunteering to adopt the Linenoise module and fix it on macOS and Linux (otherwise it’s going to bit rot away) | ||
Voldenet | > raku -e 'react whenever shell("while : ; do date; sleep 1 ; done", :out).out.Supply(:5size) { [$_].say }' | ||
or .lines.Supply ofc | 22:32 | ||
disbot3 | <librasteve> =b | 22:34 | |
Voldenet | in fact… `while : ; do date; sleep 1 ; done | raku -e 'for lines() { [$_].say }'` | 22:35 | |
22:44
arkiuat joined
22:52
sftp joined
|
|||
disbot3 | <jubilatious1_98524> I wish I were that talented. But linenoise is 1/6th (??) the size of readline, correct? So I'll be able to learn the linenoise codebase 6-times faster! | 22:57 | |
<jubilatious1_98524> @librasteve Actually the issue is I installed linenoise to get around problems with the MacOS readline dylib. There were numerous readline problems at the time (@DrForr era). Moral of the story: just becaues the pendulum has swung the other way, don't assume it will always stay that way. | 23:00 | ||
SmokeMachine | Is weekly already back? | 23:01 | |
timo | notable6 is still missing | 23:03 | |
jdv | no. should be able to open a file and "select(2)" on it or something | 23:25 | |
i know tge edge cases. i just want the simplest case of it. | 23:26 | ||
SmokeMachine | Does anyone think that “structural protocol” makes sense in Raku? (dev.to/fco/bringing-structural-pro...ook/stats) | 23:35 | |
(No /stats, sorry) | |||
23:36
jjido left,
lichtkind left
|
|||
Voldenet | well it's something that most languages lack | 23:51 | |
in C# I used interface + dynamically generated adapters for so I could say "this object here needs method X returning string" and turn it into `interface IXable { string X(); }` | 23:53 | ||
imo use for dynamic validation covers this use case better, but can't be done in C# | 23:54 |