[00:31] *** lizmat_ joined
[00:33] *** lizmat left
[01:40] *** hulk joined
[01:42] *** kylese left
[01:55] *** librasteve_ left
[02:05] *** topnep_ left
[02:07] *** topnep joined
[02:15] *** hulk left
[02:17] *** kylese joined
[09:15] *** Geth left
[09:16] *** Geth joined
[09:16] <lizmat> melezhik up again

[09:16] <tellable6> 2026-07-09T07:01:53Z #raku <melezhik.> lizmat: looks like irclog.raku is out of sync

[09:30] *** rmv joined
[09:30] *** rmv left
[09:30] *** rmv joined
[09:35] *** rmv left
[10:06] *** abraxxa1 left
[10:09] *** abraxxa joined
[10:19] *** abraxxa left
[10:19] *** abraxxa1 joined
[10:24] *** acidsys left
[10:28] *** acidsys joined
[10:52] *** topnep left
[10:52] *** topnep joined
[10:55] *** lizmat left
[10:55] *** lizmat_ left
[10:56] *** lizmat joined
[11:01] *** rmv joined
[11:06] *** rmv left
[11:21] *** guifa_ joined
[11:58] <tbrowder>   hi, i thought my old debian bullseye wasn't going to get rakudo-pkg again but it was there this moring and installed fine. thanks to patrickb and crew

[12:45] *** oodani left
[12:46] *** oodani joined
[12:53] *** rmv joined
[12:53] *** rmv left
[12:53] *** rmv joined
[12:58] *** rmv left
[13:06] *** wayland76 joined
[13:07] *** wayland left
[13:13] <patrickb> tbrowder: All thanks for rakudo-pkg go to El-Che.

[13:19] <disbot1> <jubilatious1_98524> URL?

[13:47] <[Coke]> ah, bah, working on a refactor and ending up with circular modular dependencies. :|

[14:02] *** nine left
[14:02] *** nine joined
[14:39] *** japhb left
[14:42] *** japhb joined
[14:55] <Voldenet> melezhik.: `sudo cat /etc/sudoers` tells me `@includedir /etc/sudoers.d`, which is suboptimal :>

[14:55] <tellable6> 2026-07-09T06:50:32Z #raku <sp1983> Voldenet: "and sudo has no `show me current full config`", you can just use `sudo cat /etc/sudoers`

[15:02] *** topnep left
[15:03] *** topnep joined
[15:26] *** rmv joined
[15:28] *** atweedie left
[15:28] *** thatonelutenist left
[15:28] *** atweedie joined
[15:29] *** thatonelutenist_ joined
[15:29] *** thatonelutenist_ is now known as thatonelutenist

[15:31] *** rmv left
[15:36] *** Eric22 joined
[15:38] <[Coke]> Is there no way to use JSON::Fast to jsonify a custom object?

[15:38] *** Eric22 left
[15:38] <ugexe> is there any fool proof way to serialize raku objects?

[15:38] <[Coke]> be nice if there was a method I could define that it would use.

[15:39] <[Coke]> I don't expect it to do it without me writing any code. But it would be nice if I could put that code in the object and not have to call it explicitly.

[15:39] <ugexe> you could use like JSON::Class but even something like that isn't going to be fool proof

[15:57] <Voldenet> hm, ideally a lib would separate serializing/deserializing from objects for separation of concerns

[16:02] <Voldenet> e.g. json.register-serializer(:type(X), :write(-> \j, X $x { j.start-object; j.property('x', $x.x); json.end-object; }, :read(-> \j { j.start-object; my $x = X.new; if(j.property('x')) { $x.x = j.int; }; json.end-object; });

[16:02] <Voldenet> erm, should be `json.register-serializer(:type(X), :write(-> \j, X $x { j.start-object; j.property('x', $x.x); j.end-object; }, :read(-> \j { j.start-object; my $x = X.new; if(j.property('x')) { $x.x = j.int; }; j.end-object; });`

[16:03] <Voldenet> or

[16:04] <Voldenet> > json.register-serializer(:for(* ~~ X), :write(-> $_, X $x { .start-object; .property('x', $x.x); .end-object; }, :read(-> $_ { .start-object; my $x = X.new; if .property('x') { $x.x = .int; }; .end-object; });

[16:05] <Voldenet> and afterwards, json.write(X.new(x => 42)); my $x = json.read(X, $str)

[16:06] <Voldenet> OR to-json and from-json using dynamic $*JSON variable for customization

[16:10] <Voldenet> it could be even very similar to JSON::Fast, but entry point would first attempt to find a sub to read/write and have tiny wrapper for interacting with json (without knowing if it's pretty printed etc)

[16:11] <Voldenet> just trivial `write property name, write str/bool/int value, write array, write object`

[16:12] <Voldenet> and symmetric api for `if property name, read str/bool/int value, expect array, expect object`

[16:12] <Voldenet> maybe with another `.read(X)` and `.write($x)` inside serializer

[16:15] *** abbe_ joined
[16:18] <Voldenet> in fact, this could be built based on quite basic json interface – `my $j = json-write; $j.int(42); my $str = $j.end; my $j = json-read($str); my $i = $j.int; $j.end` (in write case, end/start are just writing tokens, in read case they expect that the token is there)

[16:19] <Voldenet> that probably wouldn't be as fast, but could be used as building block for anything more advanced

[16:23] *** abbe left
[16:23] *** abbe_ is now known as abbe

[16:23] <Voldenet> ah, right, reader could also have `is-array, is-int, is-string, is-bool, is-null, is-object` for probing next token type

[16:24] <Voldenet> in case someone would want to handle `["42"], [42], [{x:42}]` the same

[16:26] *** vrurg_ joined
[16:26] <Voldenet> even better, `is-start-array, is-end-array, is-property, is-start-object, is-end-object` etc., of course

[16:29] *** vrurg left
[16:31] <Voldenet> which would basically wrap `nqp::iseq_i($token,91)` etc.

[16:44] <tbrowder> El_Che: thnx for the rakudo-pkg for old debian bullseye! (and i'm finally in the process of upgrading to bookworm)

[16:52] * Voldenet is watching [DKB] Katainaka no Ossan, Kensei ni Naru - S02E01 [------0-1--2--3-------0-1-] [ 10s / 23:33 ]

[16:53] *** dakkar left
[16:54] <Voldenet> yes, totally bad channel, sorry

[17:06] <[Coke]> for my particular small use case, will implement a 'method get-hash' which returns a Hash which is easily json-ifiable.

[17:07] *** topnep left
[17:08] <lizmat> I vaguely remember using that trick once or twice

[17:08] <[Coke]> and then @array-of-stuff.map(*.get-hash). good enough for today.

[17:09] *** topnep joined
[17:13] <lizmat> weekly: https://dev.to/lizmat/governance-and-the-raku-foundation-1b6b

[17:13] <notable6> lizmat, Noted! (weekly)

[17:17] *** abraxxa1 left
[17:19] <Voldenet> in case of JSON::Fast you can implement Associative

[17:19] <Voldenet> m: use JSON::Fast; class X is Associative { has $.x; method list { "x" => $!x } }; to-json(X.new(x => 42)).say

[17:19] <camelia> rakudo-moar f59a02a58: OUTPUT: «===SORRY!=== Error while compiling <tmp>␤Could not find JSON::Fast in:␤    /home/camelia/.raku␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/pe…»

[17:21] <Voldenet> that's totally not what Associative should be implementing, but it works in this case

[17:29] *** Sgeo joined
[18:24] *** tadzik joined
[19:01] *** rmv joined
[19:01] *** rmv left
[19:01] *** rmv joined
[19:13] *** topnep left
[19:15] *** topnep joined
[20:03] *** librasteve_ joined
[20:07] <disbot1> <librasteve> i'm a little late to the party - but I had to swap replace JSON::Class with JSON::Fast recently and ended up with a method get-hash {...} of sorts

[20:07] <disbot1> <librasteve> (digs around)

[20:08] <librasteve_> https://www.irccloud.com/pastebin/bwr4Gr07

[20:09] <disbot1> <librasteve> I called it "action-hash" but ymmv

[20:09] <disbot1> <librasteve> and then

[20:10] <librasteve_> https://www.irccloud.com/pastebin/KraCgR6S

[20:10] *** leppard joined
[20:34] *** vrurg_ left
[20:49] <Voldenet> yeah, that works but I wouldn't want to benchmark it

[20:50] <guifa_> Voldenet: I've been very much enjoying the registration pattern tbh.

[20:51] *** vrurg joined
[22:32] <wayland76> Isn't the .raku method supposed to be object serialisation?  

[22:34] <wayland76> Or is the problem that that would introduce security concerns, and serialising as JSON is safer?  

[22:42] *** librasteve_ left
[22:54] *** dmvrtx left
[23:00] *** sjn left
[23:01] *** sjn joined
[23:05] *** dmvrtx joined
[23:06] <guifa_> I don't think there's security concerns, just interoperability for serialization more than anything I'd guess

