🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
japhb I merged the PR. One of the downsides of really deep OO design is action at a distance, and this is a perfect example: the first time you access the body-byte-stream, it may only then set the Content-Length header, and good luck figuring that out. Unless you happen across the comment block that mentions that. 04:38
07:46 rakkable left 07:47 rakkable joined 08:35 finanalyst joined
librasteve thanks! 08:47
09:32 finanalyst left 13:30 librasteve_ joined
lizmat sanity check: is irclogs.raku.org down for anybody ? 13:53
ah... I see the problem... 13:54
transferring one of my own domains to another registrar... and that appears to have invalidated the DNS for that domain 13:55
librasteve dowen for me 13:57
14:16 vrurg_ joined, vrurg left
[Coke] submitted a PR to Text::CSV to avoid the .perl deprecation 14:29
lizmat m: say "foo bar baz".index("bar ") 15:33
camelia 4
lizmat sometimes I wish I had a named argument to that that would automatically add the needle length
m: say "foo bar baz".index("o b", :after) # produce 2 + 3 = 5 15:34
camelia 2
lizmat am I alone?
[Tux] [Coke] I think I already addressed all occurences. Did I not? 15:48
[Coke] t/ 15:58
there were some leftovers there.
I submitted a PR to update those.
m: say "foo bar baz".match( /<?after 'o b'>/).from #slightly more verbose but works today 16:17
camelia 5
[Coke] or maybe pos is more declarative (pos and from should always be the same with an after like that.) 16:25
18:55 rakkable left, rakkable joined
librasteve_ rakudoweekly.blog/2026/03/02/2026-...0-2026-02/ 19:03
timo [Coke]: can i get your opinion on github.com/timo/json_fast/issues/95 ? that's the "more debug output please" ticket for json_fast where I've got a pull request that adds more debug output (so you can't just grab the latest release of json::fast to try it out) 20:50
[Coke] timo: should it always be giving the debug output? 20:55
I don't see an env in the diff. 20:56
timo it spits it out in error messages
[Coke] not seeing it. Do i need to something more than:
timo so it only lands in stdout or stderr if you print the exception
[Coke] RAKULIB=. raku -MJSON::Fast -e 'say from-json "repositories.json".IO.slurp' on a file with an error in a checked out copy of the repo on that branch?
ah 20:57
so I have to catch it and print it?
timo with just your from-json it should get output if the file fails to parse
did you check out the right branch for the pull request?
"git switch errors_with_context" 20:58
[Coke] git checkout -b errors_with_context, but yes
timo ah, it doesn't create the branch for you without -b?
[Coke] I also have JSON::Fast installed, so not sure if it's picking the installed version
I don't know, muscle memory for 20 years
timo i usually -I instead of RAKULIB, not sure if that makes a difference with regards to priority 20:59
[Coke] er... maybe my memory is bad.
yah, -b is "new branch, please", not "track branch please" 21:00
timo they both output something like "1 RMD: try-load source at ./lib/JSON/Fast.pm6"
[Coke] needs more context.
Context: t\"\n →}←,\n (corresponding start 218 characters earlier, at 72905)
managed to miss all the actual text 21:01
timo the default for "git switch" is to --guess which if there's no branch with that name locally but a remote has one, it will create a tracking branch for you
[Coke] 40 is better.
I will try to use switch going forward, thanks. 21:02
timo switch is kinda neat
[Coke] even 20 is fine.
timo it's one of the "git commands are shit, let's create new commands for things people commonly want to do and have them better organized" bits
[Coke] that's why I don't know about it, I learned git when it came out and then didn't re-learn any of it. :) 21:03
timo do you think making the number of context characters configurable is a good idea?
ideally there would actually be a real exception class that does the pulling-out-context stuff last-minute with methods or something 21:04
but then if you .raku the exception it might be huge since for that to work it would have to keep the original parse target in an attribute too :D
well doesn't have to be a public attribute
[Coke] Maybe make it something my constant CONTEXT-LENGTH = %*ENV<JSON_FAST_DEBUG>.Int // 20; ? 21:06
If you have a clever way to hide the innards, that's fine. As long as I have a way to say "why the hell is this json dying", I'm good. 21:07
honestly, even if it was to run something based on "expected to see a ':' after an object key at 73123"
timo constant would be pulled in at compile time, this would want to be run-time i assume?
[Coke] where you had a separate json-fast-context-dump ../file 73123 # have this dump teh context.
timo how often do you have the content just as a file on disk you can point the tool at? :D 21:08
i'd assume often enough it'd be from a network request or taken out of a bigger file somehow
[Coke] for json that's causing a problem? that's near 100%. most APIs don't give me bad json
(and my original bug request here? that was hand rolled .JSONC) 21:09
timo :D
[Coke] and worst case, I could, as a treat, save some network loaded JSON to a file to do the debug step second. 21:18
but this implementation is fine, as long as content-length is longer than 5
timo i'll take it under advisement 21:28
[Coke] thanks! 21:29