🦋 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.
00:01 thundergnat left 00:02 [Coke]__ left 00:06 [Coke]_ joined 00:08 reportable6 left 00:09 reportable6 joined 00:23 guifa_ joined 00:24 guifa left 00:31 [Coke]__ joined 00:33 [Coke]_ left
thowe_ the man himself... At least I can feel like I know good when I see it. 00:39
00:59 Oshawott left 01:31 squashable6 left 01:33 squashable6 joined 01:36 [Coke]__ left 01:38 [Coke] joined 02:08 [Coke]__ joined 02:10 [Coke] left, archenoth joined 02:16 [Coke]_ joined 02:18 [Coke]__ left
elcaro thowe_: There is similar code in the Net::Netmask module, which parses subnets into objects with a bunch of handy methods 02:21
02:24 frost joined 03:04 vrurg left 03:05 vrurg joined 03:48 [Coke]_ left 03:50 [Coke]_ joined 04:44 swaggboi left, swaggboi joined 05:24 [Coke]___ joined 05:26 [Coke]_ left 05:29 azawawi joined
azawawi hi 05:29
tellable6 2022-09-28T04:42:46Z #raku <[Coke]___> azawawi raw.githubusercontent.com/azawawi/...META6.json
2022-09-28T04:43:06Z #raku <[Coke]___> azawawi raw.githubusercontent.com/azawawi/...META6.json - you are on main, but you've published master
azawawi Coke++
github.com/azawawi/raku-godot-fun # Baby steps :) 05:30
05:30 [Coke] joined 05:32 [Coke]___ left 05:41 azawawi left 06:05 epony left 06:07 reportable6 left 06:09 reportable6 joined 06:20 dogbert17 joined, dogbert11 left 06:26 dogbert17 left 06:30 epony joined 06:34 dogbert17 joined 07:01 [Coke]___ joined, abraxxa joined 07:04 [Coke] left 07:06 abraxxa left, abraxxa joined 07:23 ramesh joined
ramesh Should I learn perl 5 or Raku? I have just started. 07:24
Nemokosch It depends. Currently, I'd say there are two things Perl is fundamentally better at. 07:30
1. backwards-compatibility and accessibility overall. These were the main concerns that resulted in the split in the first place so while Raku was about trying to fix things, Perl moves very slowly and carefully, so that something from 30 years ago will still work. 07:32
smol-hors they're both cool but my fav is Raku 07:35
Nemokosch 2. performance. I'm not sure how much this is intrinsic to the design (hopefully not too much) but as it stands, Perl is way faster and can be compiled to native code. If you want to compete with other mainstream scripting languages regarding speed right here and right now, Perl is ready for that while Raku is not. 07:38
07:39 Sgeo left
What you get in return is: 1. an overall much more versatile and outsider-friendly language 2. generally much more willingness to move things forward and change things if necessary 07:40
Depending on what is your thing, you might like minor details like raku has a REPL and it can generate decent CLI from the signature of the MAIN subroutine 07:41
Or the zef/fez macroverse over oldschool CPAN 07:42
07:43 MoC joined, ramesh left
For the performance: iirc Perl is actually written in C. Now, if you know some C (perhaps any language with binary compatibility?), Raku has great FFI tools and you can do the heavy lifting with a C dynamic library. 07:44
07:51 ramesh joined
Raku also has actual object model and multiple dispatch over types/custom conditions 07:51
I think I couldn't switch to Perl even if I wanted, I'd miss too much of Raku 😄
ramesh Thank you for the detailed information. I appreciate. 07:55
Nemokosch 🍬 08:01
08:09 dakkar joined 08:11 archenoth left 08:37 ramesh left 08:38 [Coke] joined 08:40 [Coke]___ left 08:45 sena_kun joined 08:46 [Coke]__ joined 08:47 [Coke] left
Voldenet raku has better syntax and is more fun to write, it feels more modern 08:55
09:04 dogbert17 left 09:23 dogbert17 joined 10:10 archenoth joined 10:16 [Coke] joined 10:18 [Coke]__ left 11:18 linkable6 left, benchable6 left, unicodable6 left, quotable6 left, bisectable6 left, reportable6 left, tellable6 left, greppable6 left, evalable6 left, squashable6 left, committable6 left, notable6 left, releasable6 left, bloatable6 left, statisfiable6 left, coverable6 left, nativecallable6 left, shareable6 left, sourceable6 left 11:19 coverable6 joined, releasable6 joined, committable6 joined, unicodable6 joined, notable6 joined, sourceable6 joined, tellable6 joined, reportable6 joined 11:20 Maylay left, bloatable6 joined, statisfiable6 joined 11:21 nativecallable6 joined, quotable6 joined, shareable6 joined, evalable6 joined, squashable6 joined, bisectable6 joined, greppable6 joined, linkable6 joined, benchable6 joined 11:22 Maylay joined 11:36 silug left, silug joined 11:43 epony left 11:47 frost left 11:53 [Coke]__ joined 11:55 [Coke] left 12:01 [Coke] joined 12:03 [Coke]__ left 12:05 Kaiepi left 12:06 rypervenche left, reportable6 left 12:09 reportable6 joined 12:13 rypervenche joined 12:33 Kaiepi joined
Geth doc/m-dango-patch-1: 46a7298394 | (Daniel Mita)++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
Modify embedded comments documentation
doc: m-dango++ created pull request #4111:
Modify embedded comments documentation
[Coke] ooh, a patch 12:45
Nemokosch Very nice 🥳 12:53
Although I for one wouldn't completely remove examples of what the "open punctuation characters" are, at least a few
or maybe a link to a unicode description
12:58 Kaiepi left 13:01 Maylay left 13:07 Maylay joined 13:26 Maylay left
leont Apparently C<> doesn't work inside a POD table 😑 13:26
13:34 Maylay joined
Nemokosch what would C<> do normally? 13:38
docs.raku.org/language/pod#Code gotcha 13:39
leont It's a formatting code, it seems the other also don't work.
13:46 Kaiepi joined 13:47 sena_kun left 13:48 sena_kun joined 13:49 MoC left
Nemokosch raw.githubusercontent.com/perl6/sp...tation.pod 13:59
14:00 Maylay left
if you look up =head2 Blocks 14:01
it seems to me it should work, or I don't understand you
14:01 discord-raku-bot left, discord-raku-bot joined 14:04 Maylay joined 14:05 razetime joined 14:25 Sgeo joined 15:25 reportable6 left, notable6 left, squashable6 left, tellable6 left, statisfiable6 left, committable6 left, nativecallable6 left, coverable6 left, sourceable6 left, linkable6 left, quotable6 left, bloatable6 left, shareable6 left, evalable6 left, bisectable6 left, benchable6 left, unicodable6 left, greppable6 left, releasable6 left, linkable6 joined, benchable6 joined, bisectable6 joined, squashable6 joined, committable6 joined 15:26 tellable6 joined, notable6 joined, releasable6 joined 15:27 shareable6 joined, statisfiable6 joined, coverable6 joined, bloatable6 joined, greppable6 joined 15:28 sourceable6 joined, quotable6 joined, nativecallable6 joined, reportable6 joined, evalable6 joined, unicodable6 joined
Geth doc: c9cbe0fa58 | (Daniel Mita)++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
Modify embedded comments documentation (#4111)
linkable6 Link: docs.raku.org/language/syntax
15:32 linkable6 left 15:33 linkable6 joined 16:13 epony joined 16:36 dakkar left 16:40 abraxxa left 17:14 razetime left 17:28 polarbearX joined 17:29 jetchisel joined
polarbearX What is right raku's idiomatic way to replace perl' s : while(<>) { s/A/B ; ; print }   # ? ? ? 17:34
[Coke] m: $*IN.slurp.subst(/A/, 'B').print 17:38
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Bm Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] m: $*IN.slurp.subst(/a/, 'B').print
camelia »WBnn treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] Depending on size, you might want to do that by line instead of .slurping the whole thing.
ah, sorry: in fact you do need to do it by lines to get the same effect. one sec. 17:39
polarbearX I tried:  for lines() { s/A/B/; .say }    # got "Cannot assign to an immutable value" 17:41
[Coke] m: .subst(/a/, "B").say for $*IN.lines # better
camelia »WBnn treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, Bm Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die FlBmm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] m: .subst(/A/, "B", :g, :i).say for $*IN.lines # better 17:42
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Bm Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] (ignore that last one, testing)
18:07 reportable6 left 18:10 reportable6 joined 18:13 polarbearX left 18:20 MoC joined 18:23 discord-raku-bot left, discord-raku-bot joined
gfldex m: for lines() <-> $_ { s/A/B/; .say } 18:27
camelia Parameter '$_' expects a writable container (variable) as an argument,
but got '»Wann treffen wir drei wieder zusamm?«' (Str) as a value
without a container.
in block <unit> at <tmp> line 1
gfldex m: for lines() <-> { s/A/B/; .say }
camelia Too many positionals passed; expected 0 arguments but got 1
in block <unit> at <tmp> line 1
18:27 discord-raku-bot left 18:28 discord-raku-bot joined
gfldex m: for lines() -> $_ is copy { s/A/B/; .say } 18:28
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Bm Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
lizmat gfldex: but what is the point of storing the substitution if it is discarded ? 18:34
gfldex I would never rule out the possibility to find use for a Raku idiom. Mostly, because I'm not smart enough to contain the whole of Raku in my head. 18:36
Rog Is there a way to get a manually written multi method to work alongside the an autogenerated field accessor? Naïvely this is what I tried: `class Investment { has Rat $.balance; multi method balance(Investment:U: --> Rat) { 0.0 } }` 18:56
`s/the an/an/`
xinming m: class Investment { has Rat $.balance; multi method balance(Investment:D: --> Rat) { 1.0 }; multi method balance(Investment:U: --> Rat) { 0.0 }; }; Investment.balance.say; Investment.new.balance.say; 19:21
camelia 0
Rog Sure, but now try returning the balance field in the defined case 19:23
19:28 evalable6 left, linkable6 left
gfldex m: class Investment { has Rat() $!balance is built; multi method balance(Investment:D: --> Rat) { $!balance }; multi method balance(Investment:U: --> Rat) { 0.0 }; }; Investment.balance.say; Investment.new(:balance(42)).balance.say; 19:29
camelia 0
gfldex <@102059593697361920> There is always a way. :-> 19:30
19:30 evalable6 joined
ugexe "...to work alongside the an autogenerated field accessor?" 19:30
19:30 linkable6 joined
gfldex The autogenerated accessor is of no help, because it isn't a multi. I believe Rog was missing `is built` to make it work. 19:31
lizmat fwiw, you can create your own methods, even if the attribute is public 19:35
the accessors are created *after* a class is parsed and only for those attributes that don't have an accessor yet 19:36
m: class A { has $.foo; method foo() { "bar" } }; my $a = A.new(foo => 42); dd $a; dd $a.foo 19:37
camelia A $a = A.new(foo => 42)
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/09/29/rabbitholeing/
Rog Ahh, I had not heard of `is built`
19:49 melezhik joined
melezhik o/ 19:49
I have spinned up alpine repository for raku modules, so far this is just a few modules - github.com/melezhik/raku-alpine-repo , ping me if you want to add your module ... thanks 19:50
19:51 melezhik left 20:06 MoC left 20:21 sena_kun left 20:23 sena_kun joined
Nemokosch I wonder how many years of Raku wizardry is required to comprehend a gfldex post 😅 20:33
21:05 polarbearX joined 21:21 polarbearX left 21:34 Maylay left 21:38 Maylay joined 21:45 Maylay left 21:49 Maylay joined 22:01 Maylay left 22:03 Maylay joined 22:26 sena_kun left 22:28 sftp left 22:29 sftp joined 22:43 _4d47 joined 22:51 _4d47 left 22:53 Maylay left 22:54 Maylay joined
tonyo .tellable github.com/tony-o/envy/ 23:19
or whatever it is?
.weekly github.com/tony-o/envy/ 23:20
weekly: github.com/tony-o/envy/
notable6 tonyo, Noted! (weekly)
23:43 Maylay left 23:47 spacekookie left, Maylay joined 23:48 spacekookie joined