🦋 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:03
Garbanzo joined
00:07
reportable6 left
00:08
reportable6 joined
00:47
eseyman left
00:55
eseyman joined
00:56
Sankalp left,
Sankalp- joined
00:57
Sankalp- is now known as Sankalp
01:57
benchable6 left,
sourceable6 left,
bloatable6 left,
statisfiable6 left,
tellable6 left,
committable6 left,
unicodable6 left,
nativecallable6 left,
notable6 left,
quotable6 left,
shareable6 left,
evalable6 left,
greppable6 left,
coverable6 left,
reportable6 left,
releasable6 left,
bisectable6 left,
linkable6 left,
shareable6 joined,
releasable6 joined
01:58
notable6 joined,
linkable6 joined,
committable6 joined,
unicodable6 joined,
evalable6 joined
01:59
greppable6 joined,
coverable6 joined,
benchable6 joined,
sourceable6 joined,
tellable6 joined,
bloatable6 joined,
bisectable6 joined,
quotable6 joined,
statisfiable6 joined,
nativecallable6 joined
02:00
reportable6 joined
03:00
quotable6 left,
coverable6 left,
sourceable6 left,
shareable6 left,
notable6 left,
tellable6 left,
linkable6 left,
nativecallable6 left,
evalable6 left,
bloatable6 left,
greppable6 left,
benchable6 left,
reportable6 left,
bisectable6 left,
unicodable6 left,
releasable6 left,
committable6 left,
statisfiable6 left,
statisfiable6 joined,
shareable6 joined,
evalable6 joined,
benchable6 joined,
bloatable6 joined
03:01
tellable6 joined,
releasable6 joined,
unicodable6 joined,
quotable6 joined,
greppable6 joined
03:02
sourceable6 joined,
linkable6 joined,
reportable6 joined,
nativecallable6 joined,
coverable6 joined,
notable6 joined,
bisectable6 joined
03:03
committable6 joined
03:36
ToddAndMargo joined
|
|||
ToddAndMargo | newbie question: is there a way I can create a buf such that I can dynamically add toit, like a string, or do I always have to allocate their size with the .new at creation? | 03:38 | |
03:46
discord-raku-bot left
03:47
discord-raku-bot joined
04:01
guifa left
04:11
ToddAndMargo left
04:12
Sgeo joined
04:41
sftp left
04:42
sftp joined
05:42
coverable6 left,
nativecallable6 left,
bloatable6 left,
notable6 left,
tellable6 left,
committable6 left,
reportable6 left,
benchable6 left,
linkable6 left,
shareable6 left,
unicodable6 left,
quotable6 left,
sourceable6 left,
greppable6 left,
releasable6 left,
evalable6 left,
statisfiable6 left,
bisectable6 left,
nativecallable6 joined,
evalable6 joined
05:43
greppable6 joined,
unicodable6 joined,
quotable6 joined,
benchable6 joined,
bloatable6 joined,
reportable6 joined,
linkable6 joined
05:44
shareable6 joined,
committable6 joined,
coverable6 joined,
releasable6 joined,
statisfiable6 joined
05:45
notable6 joined,
bisectable6 joined,
sourceable6 joined,
tellable6 joined
05:49
Garbanzo left
06:08
reportable6 left
06:09
reportable6 joined
06:15
frost joined
06:42
melezhik joined
|
|||
melezhik | Anton Antonov I do see last builds failed for Data Reshaper on sparkyci - sparrowhub.io:2222/report/665 hopefully you will this useful | 06:44 | |
06:48
melezhik left
|
|||
nine | TodddAndMargo: you dont have to allocate the size at all. Buf will auto grow when you docs.raku.org/type/Buf#method_push or assign to a position outside its current size | 06:52 | |
tellable6 | nine, I'll pass your message to ToddAndMargo | ||
07:21
Sankalp left
|
|||
Anton Antonov | <@779471841270038528> Thanks — I will investigate. | 07:25 | |
07:47
Sankalp joined
07:58
melezhik joined
07:59
melezhik left,
melezhik joined
08:00
melezhik left
08:02
ToddAndMargo joined
|
|||
ToddAndMargo | anyone on newbie duty? | 08:02 | |
tellable6 | 2022-06-19T06:52:01Z #raku <nine> TodddAndMargo: you dont have to allocate the size at all. Buf will auto grow when you docs.raku.org/type/Buf#method_push or assign to a position outside its current size | ||
ToddAndMargo | Hi tellable6. Thank you! got it working! | 08:03 | |
08:04
frost left
|
|||
ToddAndMargo | I have a string `$x ="0x1B, 0xB6, 0x7A, 0xE8, 0x5A"`. I would like to load these values into a new buffer using `my buf8 $y = buf8.new( 0x1B, 0xB6, 0x7A, 0xE8, 0x5A )` EXCEPT I want to use the string variable to do such. `my buf8 $y = buf8.new( $x )` does not work. How do I get a variable to work inside .new? | 08:07 | |
Nemokosch | It was nine 😂 | 08:19 | |
Tellable is the name of the IRC bot | 08:20 | ||
Just like I'm writing via the discord bridge | |||
Anyway... so the string contains all the data you'd like to pass? | 08:21 | ||
ToddAndMargo | yes | 08:22 | |
so far I wind up with with ord("0"),ord("x"),ord("1"),etc. using encode. Not the hex values in the string | 08:24 | ||
Nemokosch | Perhaps not the nicest solution but you could definitely compose an EVAL call. | ||
If you want to parse the string into values, split and comb can be your friend | |||
ToddAndMargo | can you show me a quick example using some of my values? | 08:25 | |
nine | Start out with a string holding a single one of those values. Once you made it with that, you can try a string with multiple values. | ||
Programming is all about making your own life easier. | |||
Nemokosch | docs.raku.org/routine/parse-base | 08:26 | |
ToddAndMargo | My 2 cents: the purpose of a computer is to automate repatives tasks | ||
Kaiepi | ToddAndMargo, saw your mailing list post, but am unsure how to reply from thunderbird. there's a list of encodings in Encoding::Registry (src/core.c/Encoding/Registry.pm6), though it doesn't appear to be exposed beyond its find method | 08:28 | |
Nemokosch | That's what scripting is all about, pretty much :) | ||
Id go about it using comb and parse-base, that's for sure | |||
ToddAndMargo | any chance of a comb and parse-base example? | 08:29 | |
I am about to do it with a loop | |||
08:31
discord-raku-bot left,
discord-raku-bot joined
|
|||
Anton Antonov | <@779471841270038528> I cannot reproduce that failure of sparrowhub.io:2222/report/665 . I just installed successfully the package on newly downloaded 2022.04 and 2022.06. I will try to make SparkyCI setup. | 08:31 | |
<@779471841270038528> I cannot reproduce that failure of sparrowhub.io:2222/report/665 . I just installed successfully the package on newly downloaded 2022.04 and 2022.06. I will try to make a SparkyCI setup. | |||
Nemokosch | I'm not at a PC so I might mess up sth | 08:32 | |
08:35
lichtkind joined
08:37
discord-raku-bot left,
discord-raku-bot joined
|
|||
ToddAndMargo | This would work in a loop: `> say "0xBB".Int.base(16)`Â BBÂ Push the on one at a time | 08:38 | |
Nemokosch | ```perl | 08:39 | |
my $x = '0x1B, 0xB6, 0x7A, 0xE8, 0x5A'; | |||
my @int-values <== | |||
$x.comb: / '0x' <( <[0-9A-F]>{2} )> / | |||
andthen .map: *.parse-base(16); | |||
``` | |||
Id be happy if someone could check this | |||
nine | ToddAndMargo: of course you are free to ignore my advise. Your loss | 08:41 | |
ToddAndMargo | Hi Nine, Do you mean "Start out with a string holding a single one of those values". I have not been able to get that working | 08:42 | |
Nemokosch | Oof | 08:43 | |
The thing is, I'm not sure about the interface of Buf itself | 08:44 | ||
But what I posted, assuming I haven't messed it up, should turn the string into an array of integers with the right value | 08:45 | ||
08:49
discord-raku-bot left,
discord-raku-bot joined
09:13
melezhik joined
|
|||
melezhik | . | 09:13 | |
09:14
melezhik left
09:15
lichtkind_ joined
09:17
lichtkind left
|
|||
ToddAndMargo | buf8 wont push an integer either | 09:21 | |
Did I just trip across a bug? > my uint8 $z = 0xBC; | 09:25 | ||
188 | |||
[9] > say $z.base(16); | |||
Cannot invoke object of type 'NQPMu' | |||
 in any at gen/moar/stage2/NQPCORE.setting line 893 | |||
` | |||
nine | m: my uint8 $z = 0xBC; say $z.base(16); | 09:30 | |
camelia | BC | ||
09:33
Sgeo left
09:35
thundergnat joined
|
|||
ToddAndMargo | break it up into two lines: | 09:36 | |
thundergnat | m: my $x = '0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73'; say Buf.new($x.match(/(<xdigit> ** 2)/, :g)».Str».Int).decode; | ||
camelia | TIMTOWTDI | ||
ToddAndMargo | > my uint8 $z = 0xBC; say $z.base(16); | 09:37 | |
BC | |||
> my uint8 $z = 0xBC; | |||
188 | |||
> say $z.base(16); | |||
Cannot invoke object of type 'NQPMu' | |||
 in any at gen/moar/stage2/NQPCORE.setting line 893 | |||
That is the bug. | |||
Fedora 35; rakudo-pkg-2022.6.0-01.x86_64 | |||
nine | REPL has many issues | 09:39 | |
ToddAndMargo | > my Str $x = '0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73' | 09:40 | |
0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73 | |||
> my buf8 $y = buf8.new($x.match(/(<xdigit> ** 2)/, :g)».Str».Int).decode; | |||
Type check failed in assignment to $y; expected Buf[uint8] but got Str ("TIMTOWTDI") | |||
 in block <unit> at <unknown file> line 1 | |||
REPL is getting better. It use to not let me constrain variables with Str and such | 09:41 | ||
thundergnat | Well you've decoded it into a string. I just decoded it to demonstrate that it was indeed a buf. | 09:44 | |
m: m: my $x = '0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73'; say Buf.new($x.match(/(<xdigit> ** 2)/, :g)».Str».Int) | 09:46 | ||
camelia | Buf:0x<54 49 4D 54 4F 57 54 44 49> | ||
ToddAndMargo | Well, buf finally takes the data, but it does not come out right | 09:49 | |
> my Str $x = '0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73' | |||
0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73 | |||
> my buf8 $y = buf8.new($x.match(/(<xdigit> ** 2)/, :g)».Str».Int); | |||
Buf[uint8]:0x<54 49 4D 54 4F 57 54 44 49> | |||
thundergnat | Just be careful about decimal - hexadecimal conversion (like I screwed up above) | 09:51 | |
m: my $x = '0x54 0x49 0x4d 0x54 0x4f 0x57 0x54 0x44 0x49'; say Buf.new($x.match(/(<xdigit> ** 2)/, :g)».Str».parse-base(16)); | |||
camelia | Buf:0x<54 49 4D 54 4F 57 54 44 49> | ||
ToddAndMargo | Works | 09:52 | |
thank you! | |||
oops! | 09:54 | ||
> my buf8 $y = buf8.new($x.match(/(<xdigit> ** 2)/, :g)».Str».Int); | |||
Buf[uint8]:0x<54 49 4D 54 4F 57 54 44 49> | |||
 > my buf8 $y = buf8.new($x.match(/(<xdigit> ** 2)/, :g)».Str».parse-base(16)); | |||
Buf[uint8]:0x<84 73 77 84 79 87 84 68 73> | |||
still not right | |||
Nemokosch | Well, what's not right about it | 09:55 | |
ToddAndMargo | 0x54 ne 0x84 and so on | 09:58 | |
thundergnat | Like I said, be careful about decimal hexadecimal conversion. The ».Int was a thinko on my part. | 09:59 | |
Nemokosch | Well it is the timtowdi string | ||
And i would still pick comb over match :P | 10:01 | ||
thundergnat | TIMTOWTDI | 10:02 | |
Nemokosch | You immediately don't need either :g or the >>.Str part | ||
ToddAndMargo | something is funny. Give me a few minutes to double check some stuff | ||
thundergnat | Um. Well. Yes you do. | 10:03 | |
Nemokosch | That seems kinda superior to me | ||
thundergnat | Oh wait, when you use comb. Ok yes you are correct. | 10:04 | |
Nemokosch | :P | ||
ToddAndMargo | My fault. Much better now. I restart REPL and started over. | ||
> my Str $x = '0x84 0x73 0x77 0x84 0x79 0x87 0x84 0x68 0x73' | |||
> my buf8 $y = buf8.new($x.match(/(<xdigit> ** 2)/, :g)».Str».parse-base(16)); | |||
Buf[uint8]:0x<84 73 77 84 79 87 84 68 73> | |||
thankyouthankyouthankyouthankyouthankyouthankyouthankyouthankyou | 10:05 | ||
Nemokosch | TIL <xdigit> and ** in regex | 10:08 | |
thundergnat | You pick this stuff up over time. Raku is a large language. | 10:09 | |
And I've been messing around with it off and on since long before it was Raku | 10:10 | ||
My oldest module is from 2010 | 10:11 | ||
10:20
Guest99 joined
|
|||
Guest99 | Hello | 10:20 | |
How do i loop chars backwards in a string? | 10:21 | ||
my $word = "1234567890"; | |||
loop (my $i = 0; $i < $word.chars(); $i++) { | |||
  say substr $word, $i, 1; | |||
} | |||
I can do it only forward | |||
I want to see 0 9 8 7 6 5 4 3 2 1 | 10:22 | ||
10:22
guer joined
|
|||
Anton Antonov | @Guest99 You can just do `$word.comb.reverse` | 10:34 | |
lizmat | m: .say for "1234567890".flip.comb | 10:36 | |
camelia | 0 9 8 7 6 5 4 3 2 1 |
||
Guest99 | thank you very much | 10:37 | |
Anton Antonov | @Guest99 If you really want to use a loop you can do: | ||
``` | |||
for ($word.chars-1)...0 -> $i { | |||
say substr $word, $i, 1; | |||
} | |||
``` | |||
10:40
discord-raku-bot left,
discord-raku-bot joined
|
|||
lizmat | m: my $word = "foo"; say $word.substr($_,1) for (^$word.chars).reverse | 10:41 | |
camelia | o o f |
||
10:42
Guest99 left
|
|||
ToddAndMargo | Thank you! Signing off | 10:45 | |
11:21
ToddAndMargo left
|
|||
Nemokosch | What is flip? | 11:51 | |
Voldenet | a move like this: o/ o` `o \o _o o_ o/ | 11:54 | |
a Str routine that reverses a string | 11:55 | ||
12:07
reportable6 left
12:09
reportable6 joined
12:39
Nemokosch joined
|
|||
Nemokosch | this looks completely unreadable thanks to markdown 😅 | 12:41 | |
uzl[m] | m: say 'hello'.flip eq 'olleh' | 13:05 | |
camelia | True | ||
uzl[m] | I wonder if there's a set of test cases for common data structures 🤔 Like let's say I'm implementing DFS traversal on a BT, it'd be nice to have a series of test cases that I could simply plug into my language's test suite | 13:08 | |
Voldenet | I wonder if there's any plans to support things like python's `with` automatically closing the underlying resource | 13:14 | |
I'm using libarchive and `with archive-write("out.zip") { …; .close }` is bug-prone for no useful reason | 13:17 | ||
13:21
cmburn joined,
cmburn left
13:22
cmburn joined,
cmburn left,
cmburn joined,
cmburn left
13:23
cmburn joined,
cmburn left,
cmburn joined
13:24
cmburn left,
cmburn joined,
cmburn left
|
|||
Nemokosch | yeah not sure it should be related to `with` though | 13:30 | |
that's rather confusing in Python as well | |||
13:33
discord-raku-bot left,
discord-raku-bot joined
|
|||
lizmat | Voldenet: what is wrong with .spurt ? | 13:35 | |
Voldenet | `libarchive` is the key word here, the full code is something like `with archive-write($storage.file, format => 'zip') { .write: 'file1', $blob; .close }` | 13:45 | |
and, ofc, I forgot the .close | 13:46 | ||
it's minor pain though, doesn't happen often | 13:47 | ||
lizmat | docs.raku.org/routine/spurt#(IO::H...thod_spurt | 13:59 | |
.spurt: "file1", $blob ? | 14:00 | ||
then you cannot forget the close ? | |||
Voldenet | but then you keep opening archive for every file | 14:02 | |
not exactly nice if you have more than 100 files | |||
lizmat | but wouldn't you need to re-open everytime if you're closing ? | ||
lizmat apparently doesn't understand the problem | 14:03 | ||
Voldenet | `with archive-write($storage.file, format => 'zip') { for ^100 -> $n { .write: 'file' ~ $n, $n.Str; }; .close }` | 14:04 | |
lizmat | hmm. I misread the docs: .spurt on IO::Handle actually doesn't close by default | 14:09 | |
on IO::Path it does :) | |||
afk& | |||
14:33
evalable6 left,
linkable6 left
14:34
evalable6 joined
14:35
linkable6 joined
15:20
Garbanzo joined
|
|||
Util | uzl[m]: I have also wished for such, for data structures and special functions. | 15:29 | |
I have had success scraping special function test data from www.boost.org/ ; the Stanford GraphBase *might* have what you need for some data structures: www-cs-faculty.stanford.edu/~knuth/sgb.html | |||
15:35
discord-raku-bot left
15:36
discord-raku-bot joined
15:57
Garbanzo left
16:28
guer left
16:42
Nemokosch left
|
|||
Anton Antonov | I see that the routine `combinations` produces sorted lists -- each list is a combination -- but is that guaranteed ? | 16:43 | |
Nemokosch | docs.raku.org/routine/combinations | 16:48 | |
okay gg I might have missed the key word | 16:49 | ||
"sorted" | |||
But then I'm not sure what you mean, actually | |||
you mean that the elements appear in the same order as in the original list? | 16:51 | ||
Anton Antonov | Yes! Thanks. | ||
See this code: | |||
``` | |||
my $t = ("A"..."F").pick(6); | |||
say $t; | |||
say $t.combinations(3) | |||
``` | |||
Nemokosch | hm I don't see any note about it in the docs... Roast should be checked | 16:53 | |
17:01
Xliff joined
17:17
sena_kun left
17:21
sena_kun joined
17:33
perlbot left,
simcop2387 left
18:07
reportable6 left
18:09
reportable6 joined,
sena_kun left
18:10
sena_kun joined
18:12
Sgeo joined
19:12
notable6 left,
quotable6 left,
coverable6 left,
benchable6 left,
greppable6 left,
bloatable6 left,
nativecallable6 left,
tellable6 left,
releasable6 left,
shareable6 left,
statisfiable6 left,
evalable6 left,
reportable6 left,
committable6 left,
bisectable6 left,
linkable6 left,
sourceable6 left,
unicodable6 left,
linkable6 joined,
sourceable6 joined,
bisectable6 joined
19:13
statisfiable6 joined,
shareable6 joined,
coverable6 joined,
quotable6 joined,
reportable6 joined,
greppable6 joined,
notable6 joined
19:14
bloatable6 joined,
tellable6 joined,
committable6 joined,
benchable6 joined
19:15
evalable6 joined,
nativecallable6 joined,
unicodable6 joined,
releasable6 joined
19:39
sena_kun left
19:42
sena_kun joined
20:03
simcop2387 joined
20:04
perlbot joined
|
|||
japhb | Anyone know how to deal with the MacOS "loading libcrypto in an unsafe way" failure on GHA? | 20:25 | |
github.com/japhb/Cro-CBOR/runs/695...e#step:7:5 | 20:26 | ||
lizmat | japhb : github.com/rakudo/rakudo/blob/mast...S.md#macos | 20:29 | |
20:38
vrurg_ is now known as vrurg
|
|||
uzl[m] | Util: Thanks! Any specific directories you remember looking? | 20:39 | |
japhb | lizmat: Ah thank you. What a damn mess | 20:40 | |
lizmat | yeah, jnthn is also becoming more and more enamoured with MacOS. Not. | ||
japhb | That plus the inability to create long-lived test certs (so requiring new releases of otherwise stable code just to make cert validation happy for -- again -- TEST certs) is making me grumbly today. | 21:07 | |
El_Che | japhb: what do you need specifically as certs? | 21:23 | |
(longest is 1y nowadays) | |||
japhb | El_Che: Yeah, I know about the 1 year limit. What I want is for my otherwise completely stable code to not suddenly break because I didn't notice the TEST cert's window expiring. I keep emphasizing TEST because it's bloody annoying when tests break for reasons completely unrelated to whether the code works. :-( | 21:25 | |
It's hostile to people who contribute heavily to the ecosystem. | |||
El_Che | japhb: and a long-lived self signed one + CA is not an option? | 21:27 | |
japhb | El_Che: Last I checked, a long-lived self-signed will fail validation. The 1 year limit for leaf certs seems to be hard-enforced. | 21:28 | |
El_Che | I ask because I don't know how you validate stuff | 21:32 | |
with openssl, by example, you can give the CA to use for validation | |||
(I don't know the code if it was not clear :) ) | 21:33 | ||
21:38
evalable6 left,
linkable6 left
21:39
linkable6 joined,
evalable6 joined
|
|||
japhb | Right, you can override the CA, and that's expected for a test cert, but that doesn't help with the 1 year limit on the leaf cert, unless I'm misunderstanding you. | 22:20 | |
22:32
Furor joined
|
|||
Xliff | If I were to get a new Mac, what should I get? | 22:34 | |
22:35
Colere left
|
|||
vrurg | Xliff: depends on you budget and the purpose. | 22:36 | |
Xliff | vrurg: ~1800. Raku dev and general Mac use | 22:38 | |
vrurg | I'd consider a mini, unless you need a portable. | 22:41 | |
Xliff | Yeah, that's what I'd like, too. | 23:23 | |
Any particular models in mind? | |||
vrurg | Xliff: there is not so many options. Best is just to play with the constructor on the site. | 23:32 | |
Surprisingly, they still sell Intel version. | 23:33 | ||
23:35
evalable6 left,
linkable6 left
23:36
evalable6 joined
23:38
linkable6 joined
|
|||
vrurg | Xliff: What I don't like is the 16GB limit on M1 minis. I'd try to go a little over the budget and consider a Studio with M2 and 32G in the base. | 23:38 | |
SmokeMachine | Are there studios with M2 already?! I thought M2 was only for Mac book air and pro for now… | 23:46 | |
Geth | ¦ doc: coke self-assigned Fix duplicated index entries and avoid them in the future by adding a test. github.com/Raku/doc/issues/1912 | 23:50 | |
Voldenet | It would be very useful to set up mac m1 VM from x86 machine, I wonder if anyone even tries implementing that | ||
[Coke] | lizmat: Geth is reporting on assignment of issues in doc, but not creation of new issues | 23:58 | |
added github.com/Raku/doc/issues/4090 for anyone on the *-users list |