🦋 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.
Geth ecosystem/main: 71a14e3001 | (Nick Logan)++ (committed using GitHub Web editor) | META.list
More rename Perl6->Raku and master->main
01:28
lizmat forgot to clickbait this yesterday: rakudoweekly.blog/2022/09/05/2022-...-in-at-50/ 10:25
grondilu Hi all 11:39
I stumbled upon a case where a 'partially dimensioned view of array from fixed-sized array' would be very convenient. 11:41
it's NYI AFAIU
mentioned in github.com/Raku/old-issue-tracker/issues/6075
is it in the works?
FYI I was looking at implementing SHA-3 11:42
where the state is a three-dimensional array 11:43
csrc.nist.gov/publications/detail/.../202/final for details 11:45
I'm not even sure it's even in the test suite rn, though. 11:47
most relevant file I see seems to be github.com/Raku/roast/blob/master/...slice-6e.t and I don't see any test of partially dimensiond views 11:48
lizmat grondilu: could very well be that there are no tests :-( 11:49
grondilu oh wait there are whatevers sent as indices in this file 11:51
no fixed-size, though 11:59
lizmat as always... PRs welcome :-) 12:00
grondilu ah my bad the relevant dir might be S09-multidim 12:05
grondilu maybe S09-multidim/indexing.t 12:07
grondilu I don't often request pulls, and this one does not offer much, but it's a start : github.com/Raku/roast/pull/821 12:18
lizmat weekly: deprogrammaticaipsum.com/alan-perl...languages/ 13:02
notable6 lizmat, Noted! (weekly)
leont That is a great article, though I think they miscategorized Raku 13:42
Voldenet "miscategorized"? 13:46
I agree that raku is more or less improvement over perl 13:50
vrurg Voldenet: more or less? ;) 13:56
leont I think it's in the third category
Voldenet I'm not sure about scale, but it's non-revolutionary I think 13:57
(none of languages in "useful" category fit the description though)
vrurg Voldenet: sometimes it is not particular features that make the revolution but how they're put together. I consider Raku to be of this kind. 13:59
Voldenet It certainly is more opinionated and less "there's more than one way to do it" 14:01
so people just do async stuff without comparing POE and AnyEvent 14:02
vrurg Are you sure you miss nothing? There is not only async, but there is concurrent. But then there are other paradigms we use sometimes not even noticing we do it. It is all just naturally bind together making one focus more on their task and less on implemenmtation. 14:05
Voldenet async is just an example, but yeah, the "batteries included" mindset is quite revolutionary 14:06
since in perl every single useful thing is closed behind cpan module 14:07
lizmat and worse: in most cases hidden behind XS 14:11
within that module
leont It's not about how much batteries, it's about which batteries, IMO 14:28
You want to include the actually generic things (like an async framework), but necessarily the common things. If only because common changes a lot more over time than generics do.
Altreus +not? 14:41
Voldenet for a second I was wondering where "not" was missing and realized that I read it without a typo… 14:42
Altreus heh, this AI has CRC 14:44
Voldenet People have freedom to not use standard library though, the only risk of including too much is breaking backward compatibility later
leont Yeah, "but not necessarily" 15:28
leont See also: the life of CGI.pm 15:30
Altreus Counterpoint: DateTime.pm 15:32
tonyo use warnings; 15:35
El_Che hi 15:39
Altreus does that work every time? 15:40
use warnings;
tonyo it's a thing in perl, there was a large, heated discussion about making those the defaults at some point but i think no progress was made (there is use warnings; and use strict;) 15:42
Altreus that's what perl7 is for 15:43
in theory 15:44
tonyo kind of out of the loop on perl goings on since sawyer left and perl7 was announced (was writing in go mainly and now main job is python) 15:45
ugexe put ssl in the score you cowards!! 15:49
core^
Altreus I think there was a problem doing that 15:50
ugexe yeah i imagine there are tons of problems with doing that
Altreus does raku have it? 15:52
ugexe no. having ssl+useragent and a tar library in the core like Go would make fetching modules better in e.g. zef 15:55
Altreus Presumably similar challenges are faced?
My stolen opinions about Go suggest that they have done that despite the problems, rather than having solved them 15:56
tonyo that's kind of go's schtick, i think 15:59
leont Altreus: yes, DateTime a good example of important and generic 16:05
(though it would have been nice if Datetime.timezone actually returned a timezone)
Altreus leont: yeah, but over time the interface to Perl5's DateTime got under people's skin and so we now have several preferable ones on CPAN 16:19
so it was more of an example of something that is currently included but that might deteriorate 16:20
Seems less likely than CGI.pm though :D
Geth doc: d56e6f5d09 | (Mathias Reitinger)++ (committed using GitHub Web editor) | doc/Language/concurrency.pod6
Update concurrency.pod6 (#4106)

Move the "only one whenever block will be executed at any time" part before the example: it's easy to miss at the bottom but represents a big caveat.
16:26
linkable6 Link: docs.raku.org/language/concurrency
leont I didn't see this one coming: 16:27
m: enum Foo <A B>; say True ~~ B
camelia True
leont (they're both 1) 16:29
Kaiepi leont, enums smartmatch on WHICH apparently (??) 16:43
ohhh 16:48
&[===] is a little more than that, but a smartmatch delegates to that
on an enum
leont === will check type too, AFAIK 16:50
Geth ecosystem/main: c2587a1a15 | (Nick Logan)++ (committed using GitHub Web editor) | META.list
More renaming
17:37
ecosystem/main: More renaming
review: github.com/Raku/ecosystem/commit/c2587a1a15
17:38
reol m: sub why(uint64:D $x) { say $x; }; why(0xE5AF9BFD1EAF5AF4); 18:11
camelia 16550618667053701876
reol m: sub why2(uint64:D $x) { say "x=", $x; }; why2(0xE5AF9BFD1EAF5AF4);
camelia x=-1896125406655849740
reol Can anyone tell me why the second result is negative?
japhb A native int/uint/num can't be undefined, so :D doesn't do anything there -- but yeah, looks like you found a bug. 18:21
reol ok ty. is there a way to explicitely cast an integer to uint64? uint64($x) results in 'Impossible coercion from 'Int' into 'uint64': no acceptable coercion method found' 18:24
japhb reol: my uint64 $y = $x; 18:25
reol that is what I did actually. Is there an anonymous way too? 18:27
japhb Not so much anonymous, but I will often do it to force optimization in the middle of a larger expression, as in: github.com/japhb/Terminal-Widgets/...rakumod#L9 18:37
(In that particular case I *also* did a multi to allow either objects or natives to be passed in, with the latter skipping the first coercion.) 18:38
reol didn't know that you can allocate symbol names within expression. I could fix a couple of problems by using explicit casts, ty. 18:42
tonyo does that work in this case? 18:47
m: sub why2(uint64 $x) { say "x=", $x; }; why2(my uint64 $x = 0xE5AF9BFD1EAF5AF4);
camelia x=-1896125406655849740
reol you have to cast when passing the args to say 18:48
tonyo i mean the inlining that japhb posted 18:49
reol m: sub why2(uint64 $x) { my uint64 $y = $x; say "x=", $y; }; why2(0xE5AF9BFD1EAF5AF4);
camelia x=16550618667053701876
tonyo ah
reol no the inline version fails too
tonyo changing that signature to UInt also just works
reol m: sub why2(uint64 $x) { say "x=", my uint64 $y = $x; }; why2(0xE5AF9BFD1EAF5AF4);
camelia x=-1896125406655849740
tonyo (not to say uint64 shouldn't)
reol Uint fails too 18:50
tonyo m: sub why2(UInt $x) { printf "\%x\n", $x; }; why2(0xE5AF9BFD1EAF5AF4 );
camelia e5af9bfd1eaf5af4
tonyo that seems to work for me
reol maybe I just tried uint. I don't know anymore 18:52
another strange problem is the following 18:55
m: class foo { has $.x; method new(uint $x) { self.bless(:$x); } }; foo.new(1);
camelia ( no output )
reol class foo { has $.x; multi method new(uint $x) { self.bless(:$x); } }; foo.new(1);
m: class foo { has $.x; multi method new(uint $x) { self.bless(:$x); } }; foo.new(1);
camelia Default constructor for 'foo' only takes named arguments
in block <unit> at <tmp> line 1
reol however without the type constraint it works. 18:56
m: class foo { has $.x; multi method new($x) { self.bless(:$x); } }; foo.new(1);
camelia ( no output )
reol Is there a way to use (anon) unix domain sockets in Raku? The IO::Socket API doesn't seem to support it 22:01