🦋 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:00 sena_kun left 00:11 kaskal left 01:53 rasch joined 01:54 rasch is now known as raschip 02:14 raschip left 02:22 hulk joined 02:23 kylese left 03:15 hulk left, kylese joined 04:11 derpydoo left 06:24 k3ut0i joined
k3ut0i Will my program become inconsistent if .raku method does not produce the original object(via EVAL)? Should I just use .gist, if I want to do messy things? 06:39
06:40 avuserow left 06:41 avuserow joined 07:26 k3ut0i left 07:36 melezhik joined
melezhik o/ 07:36
happy upcoming holidays, Raku folks
07:37 melezhik left, jpn joined 07:42 jpn left 09:33 Sgeo left 09:37 sena_kun joined 10:00 sena_kun left
antononcube Thank you! Same to you ! 10:18
10:42 jpn joined 10:47 jpn left
librasteve k3ut0i: the convention is for .raku to return a string that can be used to dump / (re)construct the object - I have deliberately broken this convention in at least one pretty long lasting raku module (Physics::Unit) with no ill effects (except a couple of moans) so I am pretty sure that there are no parts of the raku language that depend on this - and anyway it's just a Str 10:50
tellable6 librasteve, I'll pass your message to k3ut0i
librasteve why did I break the convention? (i) well unit objects refer to other unit objects (eg ounce is a derivative of kg) and they have to be constructed in a certain chain avoiding circular definitions and (ii) for debug I wanted dd to show me all the inner details (the canonical definition is the unit string eg 'kg' which is then parsed) 10:56
10:58 k3ut0i joined
k3ut0i hi 11:01
tellable6 hey k3ut0i, you have a message: gist.github.com/026cf92e9f900cbfac...15f23af609
librasteve GetUnit('kg') === Unit.new( factor => 1, offset => 0, defn => 'kg', type => 'Mass', dims => [0,1,0,0,0,0,0,0], dmix => ("kg"=>1).MixHash, names => ['kg','kilogram','kilograms'] );
#True
(well it works for kg ... probably I will work to improve this in future 11:02
nemokosch Pretty sure eqv defaults to the content of .raku 11:47
lizmat (nqp::eqaddr(a.WHAT,b.WHAT) && nqp::iseq_s(a.raku,b.raku)) actually 11:50
12:07 hulk joined, kylese left
k3ut0i so .raku method needs to be deterministic. Docs could use this detail, but can't figure out where to add it. routine/raku is compiled from other modules. 12:12
nemokosch Well it doesn't "need to" be 12:23
Having said that, I wish you the best of luck to convince people to standardize reasonable conventions 12:25
13:47 derpydoo joined 13:55 mscha joined
mscha m: class Foo { ... }; class Bar { has Foo $.owner = CALLER::self }; class Foo { has Bar $.bar = Bar.new }; my $f = Foo.new; say $f; say $f.bar.owner; say $f eqv $f.bar.owner; 13:55
camelia Foo.new(bar => Bar.new(owner => Foo))
(Foo)
False
mscha CALLER::self doesn't DWIM.  Is there any way to do what I want, i.e. find the actual instance of the class who called Bar.new? 13:57
14:12 stanrifkin joined
roguerakudev You might have to define your own new 15:01
I think you can just have it nextsame after setting $!owner 15:02
Don’t take that as gospel though 15:03
antononcube "nextsame $ ! owner" sounds like a Voodoo chant. 15:08
(Not gospel...)
roguerakudev You can have your custom new take *% so it slurps all named parameters to pass along to the default new 15:22
So I was reading this article raku-advent.blog/2023/12/19/day-19...-bindings/ 15:29
And I was a little surprised to learn NativeCall doesn’t support passing structs by value 15:30
Are there any plans to add something like an “is by-value” trait?
Being able to bind to C libraries is a pretty major concern for adoption 15:31
15:32 Sgeo joined
jdv i haven't in a while but there's a bunch of examples of bindings out there 15:39
roguerakudev The author of the article I linked gets around the limitation pretty cleverly, but I feel that’s less than ideal in the long term because it requires writing C 15:41
Makes distribution difficult if your audience is not technically inclined enough, although I guess you could make an install script 15:42
jdv ah, i didn't read that post
i think a nativecall expert would be nine but he hasn't been around much lately 15:43
17:00 MoC joined 17:12 MoC left 17:52 sena_kun joined 18:15 k3ut0i left 19:09 stanrifkin left 19:13 jpn joined 19:15 MasterDuke joined 19:48 mscha left 20:24 jpn left 20:38 derpydoo left
nemokosch Didn't HAS (upper cased) somehow mitigate this? 21:06
Ah nevermind, this is not about struct composition 21:08
21:43 Guest59 joined
Guest59 is there a mod-raku, (like mod-perl) for Apache?  Starting a new project, want Raku for extensibility. But want mod-perl for speed. 21:45
El_Che Guest59: wiat for for informed opinions, but I think fcgi is the way to go (I would use a reverse proxy) 21:52
jdv pretty sure there is no mod_raku 22:13
i *think* there was a mod_parrot way back when
idk about fcgi. id probably just setup a set of containers running the app and rev proxy, but i havent raku'd a webapp so idk. 22:19
lizmat Guest59: perhaps cro.services is what you're looking for 22:49
Guest59 Looked at the site. Not sure what cro actually does. Looks like a framework for building peer to peer or hot standby systems? 22:52
22:52 sena_kun left
lizmat well, raku.land and irclogs.raku.org run on it 22:53
basically, you create "subs" for the routes on your server
22:55 Guest1 joined
Guest59 I've looked at FastCGI and FastCGI::NativeCall modules. The FCGI protocol itself seems pretty small, so both look good at a glance.  Has anyone here evaluated both and chose one or the other? Why? 23:00
23:51 Guest59 left 23:53 Summer joined 23:58 epony left