🦋 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 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 8 June 2022.
00:07 reportable6 left 00:10 reportable6 joined
vrurg SmokeMachine: nah, my mistake. M1 yet. 00:12
00:44 thundergnat left 01:44 nativecallable6 left, notable6 left, statisfiable6 left, greppable6 left, releasable6 left, tellable6 left, reportable6 left, linkable6 left, sourceable6 left, benchable6 left, bisectable6 left, shareable6 left, evalable6 left, quotable6 left, unicodable6 left, committable6 left, coverable6 left, bloatable6 left, notable6 joined, evalable6 joined 01:45 coverable6 joined, tellable6 joined, greppable6 joined, statisfiable6 joined, bisectable6 joined 01:46 quotable6 joined, reportable6 joined, shareable6 joined, bloatable6 joined, nativecallable6 joined, committable6 joined 01:47 linkable6 joined, releasable6 joined, benchable6 joined, unicodable6 joined, sourceable6 joined 01:50 lichtkind_ left 02:50 bisectable6 left, releasable6 left, linkable6 left, bloatable6 left, evalable6 left, unicodable6 left, notable6 left, benchable6 left, nativecallable6 left, tellable6 left, quotable6 left, sourceable6 left, greppable6 left, coverable6 left, committable6 left, statisfiable6 left, shareable6 left, reportable6 left 02:51 unicodable6 joined, sourceable6 joined, tellable6 joined, benchable6 joined 02:52 coverable6 joined, linkable6 joined, statisfiable6 joined, evalable6 joined, releasable6 joined, quotable6 joined, bisectable6 joined, shareable6 joined, nativecallable6 joined 02:53 reportable6 joined, notable6 joined, bloatable6 joined, greppable6 joined, committable6 joined 03:02 frost joined 03:14 frost left 03:58 Furor is now known as Colere 04:21 crystalfrost[m] left, uzl[m] left, pierrot left, SmokeMachine left, mtj left, aqua1 left, codesections left, zostay left, dpk left 04:22 dpk joined, aqua1 joined, mtj joined, zostay joined, SmokeMachine joined, codesections joined, pierrot joined 04:25 crystalfrost[m] joined 04:27 phogg left, Juerd left, mjgardner left, ecocode left, ecocode joined, mjgardner joined, phogg joined, phogg left, phogg joined 04:28 Juerd joined 04:30 ilogger2 left, gugod left, MitarashiDango[m left, Altreus left, ecocode[m] left, andrea[m]1234 left, BinGOs left, patterner____ left, patterner____ joined, bingos joined, bingos left, bingos joined, ilogger2 joined 04:31 Altreus joined, uzl[m] joined 04:32 gugod joined 04:37 Sankalp left 04:44 Sankalp joined 04:46 andrea[m]1234 joined 04:47 MitarashiDango[m joined 04:49 ecocode[m] joined 04:51 greaser|q joined, Sankalp left 04:52 rypervenche_ joined, broquain1 joined, facetious joined 04:53 perlmaros left, kybr left, broquaint left, jjatria left, charsbar left, rypervenche left, tailgate left, GreaseMonkey left 04:54 jjatria joined 04:55 perlmaros joined, charsbar joined 04:58 Sankalp joined 05:02 kybr joined 05:49 Garbanzo joined 06:07 reportable6 left 06:09 reportable6 joined 06:10 Garbanzo left 06:19 abraxxa joined 06:23 abraxxa left 06:24 abraxxa joined 06:25 mexen joined 06:29 abraxxa left 06:30 abraxxa joined 06:41 Sgeo left 06:45 abraxxa left 06:46 abraxxa joined, abraxxa left, abraxxa joined 07:31 bingos is now known as BinGOs 07:52 dakkar joined 08:03 donpdonp|z left, donpdonp|z_ joined 08:20 frost joined 08:24 frost left 08:26 frost joined 08:31 lichtkind_ joined 08:46 ToddAndMargo joined
ToddAndMargo Newbie bitwise buffer question:  what am I doing from with this bitwise OR? 08:49
[6] > say (buf8.new(0x5D) +| buf8.new(0x00));
1
evalable6 WARNINGS for /tmp/bpYSjCc3aL:
1
Useless use of ">" in expression "[6] > say (buf8.new(0x5D) +| buf8.new(0x00))" in sink context (line 1)
ToddAndMargo [6] > say (buf8.new(0x5D) +| buf8.new(0xFF));
1
evalable6 WARNINGS for /tmp/DAqVjPotd6:
1
Useless use of ">" in expression "[6] > say (buf8.new(0x5D) +| buf8.new(0xFF))" in sink context (line 1)
dakkar why are you comparing a 1-element array to the result of `say`?
in other words, why are you starting with `[6] > `?
also, buf8 is a class, so the result of buf8.new is an object 08:51
not a number
bitwise ops don't make much sense for objects…
ToddAndMargo I am trying to show examples of buffers and bitwise operations.  I am starting with OR.  Yo know what.  My bad.  REPL will show me the result.  No need for say. 08:54
dakkar I'm pretty sure you can not do bitwise ops on bufs 08:55
ToddAndMargo I do XOR and cells all the time 08:56
dakkar interesting!
can you show me some expressions that work? because I'm not seeing it 08:57
ToddAndMargo [15] > my buf8 $i= buf8.new(0x5D, 0xAE); 08:59
Buf[uint8]:0x<5D AE>
[16] > my buf8 $j= buf8.new(0xAB, 0xCD);
Buf[uint8]:0x<AB CD>
[17] > $i[0] += $j[0];
8
[18] > $i[1] += $j[1];
123
dakkar aah, but you're not operating on the buf!
you're operating on the elements of the buf 09:00
which are numbers
ToddAndMargo [19] > $i[0] +^ $j[0];
163
[20] > $i[1] +^ $j[1];
182
dakkar yes, those are elements (see the square-bracked subscript?)
ToddAndMargo just the cells in the buffer.  I can't get away with it on the entire buffer as I can with an integer.  This manes sense, since a buffer is an array of bytes and anot a data structure like an integer 09:01
Thank you .  I realize what I am doing wrong now. 09:02
SmokeMachine m: say buf8.new(0x5D).head +| buf8.new(0xFF).head
camelia 255
SmokeMachine m: say buf8.new: buf8.new(0x5D).head +| buf8.new(0xFF).head 09:03
camelia Buf[uint8]:0x<FF>
ToddAndMargo this is what I wrote up on my Keeper document (,odt) on buffers: 09:07
Bitwise Operations:
Please note that a buffer is NOT a data structure other than an “array of (raw) bytes”. You can only do bit wise operations on a single cell at a time.
> my buf8 $i= buf8.new(0x5D);
> my buf8 $j= buf8.new(0xAB);
Bitwise AND:
> $i[1] +& $j[1];
0
and so on and so forth
09:25 ToddAndMargo left
lizmat Note that you can iterator over Bufs: 09:36
m: my $b = Buf.new(1,2,3); $_++ for $b[]; dd $b
camelia Buf $b = Buf.new(2,3,4)
09:52 discord-raku-bot left, discord-raku-bot joined
Nemokosch japhb: you are the author of Terminal::LineEditor, right? 09:53
10:35 frost left 10:51 lichtkind joined 10:52 lichtkind_ left 11:52 frost joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/06/20/2022-...will-raku/ 12:02
12:08 reportable6 left 12:11 reportable6 joined 12:33 frost left 12:54 dogbert11 joined, dogbert17 left 13:23 Kaiepi left 13:24 Kaiepi joined 13:28 frost joined 13:38 jgaz joined
frost lizmat++, in the news, the code `say @a; say @b'` has an extra `'` 13:50
14:01 lizmat left 14:02 kueppo joined 14:05 morte_ joined 14:09 kueppo left 14:14 Kaiepi left 14:15 Kaiepi joined 14:16 Kaiepi left 14:17 Kaiepi joined 14:21 saint- joined 14:22 frost left
japhb Yes, I am the author of Terminal::LineEditor. 14:29
(For some reason, irsii didn't highlight my nick when sent via the Discord relay. Dunno why.) 14:30
14:30 Kaipei joined 14:34 Kaiepi left 14:36 Kaiepi joined 14:38 Kaipei left 14:57 Kaiepi left 14:59 Kaiepi joined 15:04 Kaiepi left
uzl[m] Will the in-person presentations be recorded? 15:29
lizmat++
I am liking these `Did You Know?`s haha. Quite informative! 15:31
15:32 Sgeo joined
uzl[m] weekly: lobste.rs/s/hpxa66/make_raku_progr...e_familiar 15:33
notable6 uzl[m], Noted! (weekly)
perryprog Raku mentioned on the HN's as well: 15:51
weekly: news.ycombinator.com/item?id=31797918
notable6 perryprog, Noted! (weekly)
perryprog just realized lizmat was the one who posted it
15:53 Kaiepi joined
Voldenet > :(@b, @a) := (@a, @b); 15:56
that's neat, but it doesn't compose well 16:03
m: my @a = <1 2 3>; my @b = <a b c>; :(@b, @a) := (@a, @b); say @a, @b
camelia [a b c][1 2 3]
Voldenet m: my @a = <1 2 3>; my @b = <a b c>; if True { :(@b, @a) := (@a, @b); }; say @a, @b 16:04
camelia Lexical with name '@b' does not exist in this frame
in block <unit> at <tmp> line 1
Voldenet m: my @a = <1 2 3>; my @b = <a b c>; if True { my @t := @b; @b := @a; @a := @t; }; say @a, @b 16:05
camelia [a b c][1 2 3]
Voldenet "dumb code" works
16:06 Kaiepi left
andinus are there examples of Persistent session management with Cro on the web? 16:13
apart from the official docs: cro.services/docs/http-auth-and-se...management
SmokeMachine andinus: github.com/FCO/Cro-HTTP-Session-Red 16:24
andinus thanks 16:26
SmokeMachine (That can be very useful if you are using Red… 16:29
Voldenet also github.com/croservices/cro-http-session-pg
16:35 dakkar left 16:58 mexen left 17:02 jgaz left
vrurg I wonder if it would be ok to transfer JSON::Unmarshal to community modules. It seems to be long abandoned. And tadzik is not around for nearly a year. 17:14
17:19 saint- left 17:22 lizmat joined
lizmat frost: thanks for the headsup, fixed 17:24
tellable6 lizmat, I'll pass your message to frost
vrurg lizmat: what do you think about JSON::Unmarshall? 17:28
SmokeMachine vrurg: I don't think that's abandoned... recently we got the opt-in update to JSON::Marshal and JSON::Class 17:34
vrurg SmokeMachine: Unmarshall is a separate module by tadzik.
SmokeMachine oh, ok... sorry... 17:35
Voldenet original author is on libera, so you can just ask ┐(´~`;)┌
vrurg SmokeMachine: try to unmarshall class Foo is JSON::Class { has CustomClass:D %.cc; }
Voldenet: we're on libera, ain't we? ;) 17:36
SmokeMachine Custom class needs JSON::Class as well?
vrurg SmokeMachine: Yes, but it doesn't matter. Perhaps Int:D or Str:D would do as well.
SmokeMachine oh! :D is the problem... 17:37
?
Voldenet …I think so, all of my configs say "freenode" because I only changed server names and certs :P
vrurg SmokeMachine: aha. The module doesn't care about nominalizables. 17:38
Somehome coercion doesn't break it. It's a miracle. :)
SmokeMachine (talking about marshalling... I really miss a was to serialise an object and the data includes the class name, to be possible to do something like: `$representation.deserialise` and that would create the object) 17:39
vrurg *Somehow
SmokeMachine: Implement! :D
17:39 jgaz joined
lucs Can I have a MAIN-like method in a module, that is, its args would be read from the command line and parsed in the same way MAIN does? 「▸ raku -e 'use Foo; Foo.MAIN' -a=42」 17:40
SmokeMachine vrurg: I was implementing it... but Red drains all my free time... 17:42
vrurg lucs: try looking into Rakudo sources, src/core.c/Main.pm6. Though be careful, it's undocumented.
SmokeMachine: I know. That's where the smile comes from.
SmokeMachine: BTW, I was very much missing oracle driver. But neither had time to implement it, nor to wait for implementation. 17:43
17:45 morte_ left
SmokeMachine vrurg: I still have to find some time to finish the MySQL driver: github.com/FCO/Red-Driver-MySQL 17:45
vrurg You need more people. The project is growing beyond single-person maintainability. Wishful thinking, though. 17:46
SmokeMachine vrurg: yes, more people helping would help a lot! That Squishathon with people was helping Red was great, for example... 17:48
lucs vrurg: Thanks 17:49
SmokeMachine And I really want to release the first stable version as soon as possible (github.com/FCO/Red/issues/470#issu...786132637) 17:51
vrurg SmokeMachine: crossing my fingers 17:52
vrurg is afk. Too much work too. :)
17:57 sena_kun left 17:58 morte_ joined 18:00 sena_kun joined
japhb lucs: MAIN can be exported as a multi from modules. That's how many App::* modules work (including all of mine, both public and private). I know that's not the same as a method, but you could also declare them `our` and access them through stashes instead, if that's your wont. 18:08
18:09 reportable6 left 18:10 reportable6 joined
lucs japhb: Interesting. I'll look into that, thanks. 18:14
18:17 Garbanzo joined
lucs japhb: Um, would you happen to have a link to one of those public App::* modules? 18:30
18:33 guifa joined
japhb Give me a sec 18:34
github.com/Raku-MUGS/MUGS-UI-CLI/b...kumod#L360 18:35
Also shows partial override of USAGE generation 18:36
guifa is about to die
Moving went waaaay slower than expected this weekend, and now I've only got like 24 hours to finish writing my talks for P&RC and yeah.... no where close :-( 18:37
18:37 Garbanzo left
lucs japhb: Thanks a bunch. 18:38
japhb Sure, no problem! :-) 18:39
guifa: Ackpth! Good luck! 18:40
guifa japhb thanks. I actually just realized my first talk isn't until Thursday so… yay. but just means I'll be antisocial on Wednesday at the conference lol 18:41
19:06 jgaz left
sena_kun wow, the conference looks lively 19:11
guifa, good luck with the prep! 19:12
19:15 morte_ left 19:16 MasterDuke left
drakonis oh, it starts tomorrow, right? 19:19
19:45 discord-raku-bot left, donpdonp- joined 19:46 discord-raku-bot joined, guifa left, abraxxa left, abraxxa joined 19:47 donpdonp|z_ left 19:49 morte_ joined 19:56 guifa joined
guifa drakonis yeah, tomorrow there's some of the typical preconference stuff (classes, etc) and Wednesday starts the talks 20:16
guifa came up with his advent day post for this year
making a regex for email
but like, actually following the RFC to the letter, with no false positives or negatives. is actually possible in Raku 20:17
20:19 japhb left 20:47 japhb joined 21:11 Garbanzo joined 21:32 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey
perryprog is that even possible 21:42
with POSIX regex 21:43
21:46 discord-raku-bot left 21:57 Nemokosch joined
Nemokosch Voldenet: no question that you can swap two variables the same way you could in C, no need for binding even :D 21:58
tellable6 2022-06-15T14:17:06Z #raku <SmokeMachine> Nemokosch: I think it's possible: github.com/FCO/GccJit
Nemokosch the thing is, it would work fine with $variables
21:59 guifa left 22:00 guifa joined 22:05 morte_ left 22:08 discord-raku-bot joined 22:11 Nemokosch left 22:24 abraxxa left 22:29 discord-raku-bot left, discord-raku-bot joined
Nemokosch m: dd $(1, 2; 5, 6) 22:31
22:32 Nemokosch joined
Nemokosch m: dd $(1, 2; 5, 6) 22:32
camelia WARNINGS for <tmp>:
Useless use of constant integer 2 in sink context (lines 1, 1)
Useless use of constant integer 1 in sink context (lines 1, 1)
$(5, 6)
Nemokosch the question is: what happened here?
m: dd (1, 2; 5, 6) 22:33
camelia ((1, 2), (5, 6))
Nemokosch where did (1, 2) go? 😅
22:33 Nemokosch left
gfldex Does a multi-dim scalar make sense? Where should it bind the 2nd dimension to? 22:39
Nemokosch it makes exactly as much sense as $((1, 2), (5, 6)) 22:54
which does exist
also, trust me it's pretty useful when you do matrix algebra
23:08 rir joined
the more I use Raku, the more I grow to realize @ was created to simply annoy coders 23:29
drakonis if raku gets a new major version 23:34
delete sigils
alternatively, idk
Nemokosch if you have a multi-dimensional array 23:35
$a[0] will contain a proper list
but @a[0] will contain a scalar!
whyyyyy
with no particular hints why this should happen, and how to opt out
and you know what makes it so painful? that Z and X and stuff like this will always bring that implicit Scalarness 23:37
even though that's not even needed for them since they aren't recursive anyway
if I want the elements to be treated as scalars, I will say it!
23:37 Nemokosch joined
Nemokosch here, see... 23:38
m: my @a = (1, 2; 3, 4); dd @a; dd @a[0];
camelia Array @a = [(1, 2), (3, 4)]
List @a = $(1, 2)
Nemokosch the Scalar appears out of nowhere, for hell's sake
m: my $a = (1, 2; 3, 4); dd $a; dd $a[0]; 23:39
camelia List $a = $((1, 2), (3, 4))
(1, 2)
Nemokosch but if I just take the multidimensional list itself as a scalar, magic: the elements will stay proper 23:40
at this point I'm considering a style where I never use @variables and prefix my scalars if need be 23:41
probably there won't be much need because
m: my $a = (1, 2; 3, 4); dd $a[]; dd $a[0]; 23:42
camelia ((1, 2), (3, 4))
(1, 2)
Nemokosch What other reason would there be to use the @ sigil? 23:43
23:44 Kaiepi joined
rir @Nemokosch, I not really equipped to give you a clear full answer; I have never used ';' as a separator in an array. 23:49
But if you are looking for shaped arrays those are not yet supported. 23:51
Beyond that I am not sure if you are lost or just unhappy with the actions or both. 23:52
Nemokosch I just came across this while trying to compose a call that takes me closer to the Kronecker product
Honestly, the situation is a bit awkward 23:53
drakonis Nemokosch: at least raku doesnt have perl's contexts
i hear it is a much bigger problem there
Nemokosch I do find $(1, 2; 5, 6) bug-worthy. It's the least to expect it to work consistently, once it's promoted as a literal syntax for multi-dimensional arrays. 23:54
However, it's a minor nuisance; one could live without this syntax, after all
@variables never cease to disappoint, on the other hand
And I suspect that's not really a bug or whatever 23:55
It's just design that leaves me clueless who thought this abstraction was a good idea and why
rir I don't have that math. Instead of contexts Raku has containers. I thought context was the key part of Perl that made it better than most scripting languages.
Better meaning a little higher. 23:56
Nemokosch Really, even in this case where it's clear as water that I do want a "positional", a (multi-dimensional) list in particular
$ works way more predictable and flexible 23:57
rir If you want to understand Raku re: this stuff, I can point you at some topical words.
Nemokosch ... that $variables iterate as one single element? Is this the big problem @variables are meant to solve? This is already solved by zen-slicing, without the confusing semantics. 23:58
rir Else there is little reason to not use $ary with @#ary.
Oops, That should be your @$ary 23:59
Nemokosch @variables have no "assignment" (yes, they have "list assignment" but that's simply not a variable assignment if you are coming from any imperative language)
@variables don't work well with typing