🦋 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. |
|||
00:04
linkable6 left,
evalable6 left
00:05
linkable6 joined
00:07
reportable6 left
01:05
evalable6 joined
01:51
kjp left
01:54
kjp joined
02:02
razetime joined
02:18
seednode99 joined
02:28
seednode99 left,
seednode99 joined
02:46
seednode99 left
02:47
seednode99 joined
02:51
frost joined
03:10
reportable6 joined
03:24
Kaiepi left
03:25
Kaiepi joined
03:29
dynamite left
03:32
dynamite joined
03:51
razetime left
04:21
tonyo1 is now known as tonyo
04:34
kjp left
04:36
kjp joined
04:43
frost left
05:02
Sgeo joined
05:03
Sgeo_ left
05:04
frost joined
05:41
frost left
06:04
frost joined
06:05
dynamite left
06:08
reportable6 left
06:10
reportable6 joined
06:28
qeqeqw joined
07:00
ufobat joined
07:10
frost left
07:19
seednode99 left,
seednode99 joined
07:29
Sgeo left
07:34
japhb left
07:36
japhb joined
07:37
razetime joined
08:23
frost joined
08:30
mykhal_ is now known as mykhal
08:33
abraxxa joined
08:47
abraxxa left,
abraxxa joined
08:58
squashable6 left,
hasrthur joined
09:00
sienet_ja_LSD[m] left
09:06
tejr joined
09:09
dakkar joined
09:11
frost left
09:34
razetime left
09:35
razetime joined
10:00
squashable6 joined
10:40
razetime left
10:48
[Coke] left
10:54
frost joined
11:02
qeqeqw left
11:12
Geth left
11:19
frost left
11:51
dynamite joined
12:02
Geth joined
12:05
[Coke] joined
12:06
Geth left,
Geth joined
12:07
reportable6 left
12:12
kjp left
12:14
kjp joined
13:06
jercos_ is now known as jercos
13:09
reportable6 joined
13:32
qeqeqw joined
13:35
razetime joined
14:12
morte_ joined,
squashable6 left
14:46
kylese joined
14:51
dynamite left
14:54
discord-raku-bot left,
discord-raku-bot joined
15:04
frost joined
15:05
discord-raku-bot left
15:06
dynamite joined
15:08
discord-raku-bot joined
15:11
Sgeo joined
15:12
discord-raku-bot left
15:13
discord-raku-bot joined
15:34
qeqeqw left
15:35
frost left
15:44
morte_ left
15:45
morte_ joined
15:50
morte_ left
15:58
MasterDuke left
16:14
MasterDuke joined,
squashable6 joined
|
|||
guifa | re some of the discussion on opreator overloading, reading the synopses for something else I noticed something really interesting | 16:42 | |
it should be possible to do | 16:43 | ||
multi sub GLOBAL::infix:<+> (Str, Str) { … } | |||
16:47
Tiriftoj joined
|
|||
guifa | but it throws X::Syntax::Extension::Category, something not done for other globals (although those multis aren't actually installed AFAICT) | 16:48 | |
El_Che | lizmat, *: I requested the Twitter Raku community before someone else squats it. It's a new Twitter feature | 16:51 | |
lizmat | El_Che++ | ||
URL ? | |||
El_Che | none, until approved | 16:52 | |
lizmat | I see... ok | ||
El_Che | here is the perl one to keep you busy: twitter.com/i/communities/1471579416216145924 | ||
:P | |||
lizmat | no, thank you :-) | ||
El_Che | If approved, I'll give active people moderator status and pass it on if desired | 16:53 | |
lizmat | thanks! | ||
Tiriftoj | Hello! Is there a nice way to delegate all methods which haven’t been overridden locally in a class to another object? The closest I got was ‘has $.object handles *’, but the Whatever also stands for any inherited methods, which I would like to exclude from the dispatch. | 16:57 | |
guifa | sounds like the job for a trait | 16:58 | |
[Coke] | kind of like FALLBACK? | 17:01 | |
you could have a FALLBACK that re-dispatched to the handler. | |||
Tiriftoj | guifa: Any trait in particular? :o | 17:02 | |
guifa | Tiriftoj: it'd be a custom one. Basically though, question one would be creating a list of the methods you want redispatched. Then you'd make a trait that adds a fallback (or even installs local methods) that redispatch to some object (which you might define via an attribute) | 17:03 | |
Tiriftoj | [Coke]: Oh right, I can use a HyperWhatever for that. I’ll see if that takes precedence…! | 17:04 | |
17:14
razetime left
17:26
abraxxa left
|
|||
ugexe | m: class MyBar { method bar { 42 }; method dupe { 1 }; }; class MyClass { has $.object handles MyBar; method dupe { 69 } }; my $obj = MyClass.new(object => MyBar.new); say $obj.bar; say $obj.dup | 17:27 | |
camelia | 42 No such method 'dup' for invocant of type 'MyClass'. Did you mean any of these: 'DUMP', 'dupe'? in block <unit> at <tmp> line 1 |
||
ugexe | m: class MyBar { method bar { 42 }; method dupe { 1 }; }; class MyClass { has $.object handles MyBar; method dupe { 69 } }; my $obj = MyClass.new(object => MyBar.new); say $obj.bar; say $obj.dupe | ||
camelia | 42 69 |
||
ugexe | has $.object handles Some::Class | 17:29 | |
guifa | ugexe++ I didn't realize handles would take a class that way | 17:30 | |
And here I was trying to do that with a trait ha (although TIL there's a huge difference in saying class Foo is traitbar { … } and class Foo { …; also is traitbar } ) | 17:31 | ||
Is there any way to, uh, put a trait on a trait so it's done later rather than sooner? | |||
Tiriftoj | [Coke]: Okay, so it looks like inheritance takes priority over FALLBACK for ‘handles’… or at least this didn’t work for me: | 17:32 | |
m: class A { method m { say “A!” } }; class B { method m { say “B!” } }; class Z is A { has $.b handles ** = B.new(); method FALLBACK ($name, *@args) { say “Z!” } }; Z.new.m; | |||
camelia | A! | ||
17:34
dakkar left
|
|||
Tiriftoj | (I made it say “Z!” to show that A’s inherited method is preferred to local FALLBACK; the end goal for me would be to call B’s method without explicitly specifying I want $.b to handle “m”.) | 17:34 | |
Inherited methods are also preferred to delegation by explicit classes, it seems: | 17:38 | ||
m: class A { method m { say “A!” } }; class B { method m { say “B!” } }; class Z is A { has $.b handles A = B.new(); }; Z.new.m; | |||
camelia | A! | ||
17:40
jjido joined
|
|||
Tiriftoj | guifa: I had no idea custom traits were a thing. The idea seems sort of awing, but I’ll read up on them! :-) | 17:42 | |
guifa | basically, a custom trait gives you at compile time a reference to the class / method / whstever, and you can call methods on it to set all sorts of stuff up | ||
basically, a custom trait gives you at compile time a reference to the class / method / whstever, and you can call methods on it to set all sorts of stuff up | 17:43 | ||
Tiriftoj pardon the crazy URL but | 17:44 | ||
tio.run/##dZLRTsIwFIbv9xQHQrLNQBM1...Qzs1130vUb | |||
JNHIoockHZJopGl@AA | |||
17:47
ph88 joined
|
|||
ph88 | where can i find the raku compiler source code ? | 17:47 | |
i looked on github and couldn't figure out which repository it is | |||
guifa | github.com/rakudo/rakudo | 17:48 | |
ph88 | thx | 18:05 | |
18:06
morte_ joined,
reportable6 left
|
|||
ph88 | can rakudo be run as a single binary or does it need a bunch of files ? | 18:06 | |
guifa | Not by default. I'm sure there's a way to compile into a single one, but I'm not good with that type of stuff. I'm sure someone experienced in C could figure it out though | 18:16 | |
El_Che | ph88: it works like perl, python or ruby | 18:17 | |
sjn | ph88: rakudo requires a bunch of files; at minimum the program and the raku VM and it's support libraries. I'm pretty sure noone has tried making something that produces a single executable file... | ||
El_Che | sjn: there was an summer of code intern that got pretty far iirc | 18:18 | |
sjn | strace ./raku -e '1' 2>&1 | grep open|wc -l | 18:19 | |
...gives 48 calls to openat() | |||
most are precompiled libraries | 18:20 | ||
ph88 | does someone know a good video or so to tell what is good about raku ? | ||
sjn | ph88: www.youtube.com/watch?v=LEFVQaSgJ60 is a decent intro | 18:22 | |
ph88: you might also appreciate replies to similar questions as your's on www.reddit.com/r/rakulang/ | 18:23 | ||
ph88 | thanks | 18:26 | |
Tiriftoj | guifa: I’ll have to spend a while with the code to feel comfortable with it, but I see it works for the intended purpose. Thanks a lot! | 18:27 | |
ph88 | are more people using raku than perl for any arbitrary metric ? | 18:28 | |
18:29
kylese left
|
|||
sjn | Raku is still a small language, but growing. Perl has a much larger install base, so whatever you compare with, it'll pretty much have more users in any metric. | 18:30 | |
ph88: but if you look at the language, you'll see that it solves a *lot* of issues that other languages still struggle with, so when you're considering tools for new development, you'll do yourself quite the favor by considering Raku | 18:32 | ||
18:32
lichtkind joined
|
|||
sjn | So let's say "Raku is more future-focused", which makes it not particularly good at scoring high marks on "past-focused" questions, like your's | 18:33 | |
ph88: if your most important metric for a language is "popularity", then I'm sad to say Raku doesn't quite measure up in this regard (yet :) | 18:36 | ||
ph88 | thanks sjn | 18:45 | |
18:47
jjido left
19:02
jjido joined
19:07
reportable6 joined
19:25
mexen left
|
|||
ph88 | anyone know of some simple benchmarks comparing raku to js, python and php ? | 19:35 | |
Nemokosch | 😬 | ||
19:42
morte_ left
19:44
morte_ joined
19:50
hasrthur left
20:05
jjido left
20:16
Kaiepi left
20:17
Kaiepi joined,
Kaiepi left
20:18
Kaiepi joined
20:23
euandreh left
20:25
euandreh joined
20:35
hasrthur joined
20:38
hasrthur left,
hasrthur joined
21:04
MasterDuke left
21:05
Tiriftoj left
|
|||
[Coke] | ph88: best bet is to google, I don't think we have a dedicated raku site. | 21:13 | |
(er, dedicated to benchmarks) | |||
21:21
MasterDuke joined
21:41
GreaseMonkey left
21:42
greaser|q joined
22:00
ufobat left
22:15
Tiriftoj joined
22:19
Tiriftoj left
22:27
lichtkind left
23:06
perlmaros left,
perlmaros joined
23:07
xkr47 left
23:09
xkr47 joined
23:10
swim joined
23:13
swim left
23:23
hasrthur left
23:38
morte_ left
23:40
greaser|q left,
greaser|q joined,
greaser|q is now known as GreaseMonkey
|