|
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
|
|||
| 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,
rmv left,
rmv joined
09:35
rmv left
10:06
abraxxa1 left
10:09
abraxxa joined
10:19
abraxxa left,
abraxxa1 joined
10:24
acidsys left
10:28
acidsys joined
10:52
topnep left,
topnep joined
10:55
lizmat left,
lizmat_ left
10:56
lizmat joined
11:01
rmv joined
11:06
rmv left
11:21
guifa_ joined
|
|||
| 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 | 11:58 | |
|
12:45
oodani left
12:46
oodani joined
12:53
rmv joined,
rmv left,
rmv joined
12:58
rmv left
13:06
wayland76 joined
13:07
wayland left
|
|||
| patrickb | tbrowder: All thanks for rakudo-pkg go to El-Che. | 13:13 | |
| jubilatious1_98524 | URL? | 13:19 | |
| [Coke] | ah, bah, working on a refactor and ending up with circular modular dependencies. :| | 13:47 | |
|
14:02
nine left,
nine joined
14:39
japhb left
14:42
japhb joined
|
|||
| 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,
thatonelutenist left,
atweedie joined
15:29
thatonelutenist_ joined,
thatonelutenist_ is now known as thatonelutenist
15:31
rmv left
15:36
Eric22 joined
|
|||
| [Coke] | Is there no way to use JSON::Fast to jsonify a custom object? | 15:38 | |
|
15:38
Eric22 left
|
|||
| 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. | ||
| 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 | ||
| Voldenet | hm, ideally a lib would separate serializing/deserializing from objects for separation of concerns | 15:57 | |
| 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 | ||
| 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; });` | |||
| or | 16:03 | ||
| > 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:04 | ||
| and afterwards, json.write(X.new(x => 42)); my $x = json.read(X, $str) | 16:05 | ||
| OR to-json and from-json using dynamic $*JSON variable for customization | 16:06 | ||
| 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:10 | ||
| just trivial `write property name, write str/bool/int value, write array, write object` | 16:11 | ||
| and symmetric api for `if property name, read str/bool/int value, expect array, expect object` | 16:12 | ||
| maybe with another `.read(X)` and `.write($x)` inside serializer | |||
|
16:15
abbe_ joined
|
|||
| 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:18 | |
| that probably wouldn't be as fast, but could be used as building block for anything more advanced | 16:19 | ||
|
16:23
abbe left,
abbe_ is now known as abbe
|
|||
| 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:23 | |
| in case someone would want to handle `["42"], [42], [{x:42}]` the same | 16:24 | ||
|
16:26
vrurg_ joined
|
|||
| Voldenet | even better, `is-start-array, is-end-array, is-property, is-start-object, is-end-object` etc., of course | 16:26 | |
|
16:29
vrurg left
|
|||
| Voldenet | which would basically wrap `nqp::iseq_i($token,91)` etc. | 16:31 | |
| tbrowder | El_Che: thnx for the rakudo-pkg for old debian bullseye! (and i'm finally in the process of upgrading to bookworm) | 16:44 | |
| Voldenet is watching [DKB] Katainaka no Ossan, Kensei ni Naru - S02E01 [------0-1--2--3-------0-1-] [ 10s / 23:33 ] | 16:52 | ||
|
16:53
dakkar left
|
|||
| Voldenet | yes, totally bad channel, sorry | 16:54 | |
| [Coke] | for my particular small use case, will implement a 'method get-hash' which returns a Hash which is easily json-ifiable. | 17:06 | |
|
17:07
topnep left
|
|||
| 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
|
|||
| lizmat | weekly: dev.to/lizmat/governance-and-the-r...ation-1b6b | 17:13 | |
| notable6 | lizmat, Noted! (weekly) | ||
|
17:17
abraxxa1 left
|
|||
| Voldenet | in case of JSON::Fast you can implement Associative | 17:19 | |
| m: use JSON::Fast; class X is Associative { has $.x; method list { "x" => $!x } }; to-json(X.new(x => 42)).say | |||
| camelia | ===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… |
||
| Voldenet | that's totally not what Associative should be implementing, but it works in this case | 17:21 | |
|
17:29
Sgeo joined
18:24
tadzik joined
19:01
rmv joined,
rmv left,
rmv joined
19:13
topnep left
19:15
topnep joined
20:03
librasteve_ joined
|
|||
| 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 | |
| (digs around) | |||
| librasteve_ | www.irccloud.com/pastebin/bwr4Gr07 | 20:08 | |
| librasteve | I called it "action-hash" but ymmv | 20:09 | |
| and then | |||
| librasteve_ | www.irccloud.com/pastebin/KraCgR6S | 20:10 | |
|
20:10
leppard joined
20:34
vrurg_ left
|
|||
| Voldenet | yeah, that works but I wouldn't want to benchmark it | 20:49 | |
| guifa_ | Voldenet: I've been very much enjoying the registration pattern tbh. | 20:50 | |
|
20:51
vrurg joined
|
|||
| wayland76 | Isn't the .raku method supposed to be object serialisation? | 22:32 | |
| Or is the problem that that would introduce security concerns, and serialising as JSON is safer? | 22:34 | ||
|
22:42
librasteve_ left
22:54
dmvrtx left
23:00
sjn left
23:01
sjn joined
23:05
dmvrtx joined
|
|||
| guifa_ | I don't think there's security concerns, just interoperability for serialization more than anything I'd guess | 23:06 | |