🦋 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 inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
guifa Ah I just found some samples of it online. 00:00
Yeah, that psuedo code will translate rather nicely in Raku
Zgredu[m] That's great to hear. I tried Racket and Scheme for a while but the way they handled arrays was a bit too strange. Go was OK but a bit too opinionated and poor in some aspects. Ada was almost ideal if not for the fact that all implementations are not garbage collected and Oberon-2 has no compilers at all. Raku just seemed like a nice language when I went through the examples on Rosetta Code and compared it with others 00:10
Should I start with raku.guide/ or somewhere else?
guifa Raku is also nice in that if something isn't working how you like, it's fairly easy to craft something that does and use it 00:14
raku.guide is nice. also I think Laurent Rosenfeld has a book that dives into algorithms and such 00:15
Zgredu[m] "Think Perl 6: How to Think Like a Computer Scientist"? 00:16
guifa Yeah. ALthough actually I just glanced through it, it's no where near as deep dive as CLRS — Rosenfeld calls it a book for beginners so it teaches a lot more fundamental concepts that you probably already understand fairly well 00:17
like the next to the last chapter goes over quick sort :-)
elcaro I just tried to do `@a.shift(2)`... seems like something that Raku might implement, but alas, no 05:38
I know about `splice`... just musing
lizmat elcaro: maybe @a.batch(2) ? 08:54
leont Good * 09:32
patrickb is there some #raku-fosdem or so channel? 09:54
lizmat there's a #raku-conf channel
gfldex m: my @a = 1..10; say @a.shift xx 2; dd @a; 11:01
camelia (1 2)
Array @a = [3, 4, 5, 6, 7, 8, 9, 10]
11:01
gfldex elcaro: ^^^
jdv codesections: you're zest thing seems neat. i did a almost not related thing a long time ago with just one op. github.com/jdv/p6-tolerance 14:36
iirc that was before the =~= was impl
'd
andinus is there a better way to do "$var"() 15:51
m: my $x = "sum"; say "$x"(1, 2)
camelia No such method 'CALL-ME' for invocant of type 'Str'
in block <unit> at <tmp> line 1
MasterDuke m: my $x = "sum"; say ::("&" ~ $x)(1, 2)   # andinus 16:10
camelia 3
ugexe can also use &::($x) 16:11
MasterDuke ugexe++ i was looking for that and tried pretty much every other placement of the '&' 16:15
leont Is there a way to connect to a unix domain socket? 16:34
ugexe i thought IO::Socket::INET supported unix socks 16:37
leont I'm seeing that suggestion in the issue tracker now, but it has never been documented 16:40
Next question: does IO::Socket::Async support it, because that's what I actually need.
andinus m: put &::("sum")(1,2) 17:02
camelia 3
andinus m: put sum()
camelia 0
leont Can anyone explain why this doesn't seem to work: my $a = Supplier.new; my $b = Supplier.new; $a.emit($b.Supply); $a.done; react { whenever $a.Supply { dd $_ } }' 19:34
ugexe based on where you are calling .done i would expect $a to be a Supplier::Preserving 19:36
leont Ah, yeah that makes sense 19:37
Yes that works wonderfully 19:38
ugexe also seems like maybe thats something docs.raku.org/type/Supply#method_migrate might be used for
leont just got a basic but working asynchronous postgres client in raku working 19:45
japhb leont++ 19:49
leont Anyone have a clue what's up if Supplier::Preserving.emit hangs? 23:18
It appears to hang when something starts listening to the Supply 23:24
I'm rather suspecting a deadlock 23:30
Voldenet code snippet would be nice, Supplier::Preserving.emit doesn't hang 23:32
m: my $s = Supplier::Preserving.new; start { sleep 1; $s.emit("boom"); $s.done }; react whenever $s { .say } 23:35
camelia boom
leont Well, it's in the middle of a big piece of code, I'm not entirely sure how to produce it 23:37
Voldenet though I agree, it's suspiciously easy to accidentally produce deadlocks with supplies 23:39
leont And now I can't install App::MoarVM::Debug, because I can't install Data::MessagePack, because that uses [email@hidden.address] url that github has deprecated -_- 23:41
ugexe it fetches for me still 23:43
leont pastebin.com/ikkaKLzg 23:45
ugexe what does it show with --debug
leont Nothing informative, just that it's fetching via Zef::Repository::Ecosystems<p6c> 23:47
ugexe ===> Fetching [OK]: Data::MessagePack:ver<0.1.2> to /Users/ugexe/.zef/tmp/1644104797.21486.6370.395852674107/Perl6-Data-MessagePack.git 23:48
`rm -rf ~/.zef` is the cargo culty thing to try
or `zef nuke RootDir` 23:49
leont Removing the zefdir didn't do anything 23:50
japhb I had to switch to [email@hidden.address] URLs because the https ones got deprecated .... 23:52
ugexe https ones arent deprecated
or at least not the most recent deprecation 23:53
japhb You can read with them, but not push with them.
ugexe should just be git:// that is affected 23:54
leont Then I don't know what issue I'm dealing with, and it's not giving me much information 23:55