00:08 Voldenet left
guifa ugh crap I need to come up with a topic for advent calendar 00:11
antononcube: you're going to do the grammar as a token?
SmokeMachine This year I won’t be able to write a advent calendar post… :( 00:13
00:14 Sgeo joined
antononcube @giufa No. I am going to use that and tricks to show how bad are LLMs at playing chess using FEN. (See “FEN::Grammar”.) 00:17
Also, that “JavaScripdt::D3” can make very nice chessboard position plots. 00:18
00:30 yewscion joined 00:35 yewscion left, Voldenet joined
guifa ha 00:51
01:02 kjp left 01:04 kjp joined 01:06 kjp left 01:07 kjp joined 01:22 Voldenet left 01:32 Voldenet joined 01:49 Manifest0 left 02:40 hulk joined 02:42 kylese left
botato I'm a little confused reading the documentation for augment at docs.raku.org/language/variables 03:04
it says "For a better, and safer example, this is a practical way to create a class module to extend IO::Path by adding a currently missing method", does "unit class IO::Barename is IO::Path;" and then "augment class IO::Path {" 03:05
if i understand I think the intent was to make IO::Barename that is like IO::Path but with the barename method added 03:06
but the example actually monkeypatched the barename method onto IO::Path, was that a mistake and it's supposed to be "augment class IO::Barename" or am I not understanding what's going on? 03:07
03:15 hulk left, kylese joined 03:38 dpk joined
ugexe i dont understand what it is trying to say 03:41
i also don't understand what the example is trying to do 03:43
guifa antononcube: okay, maybe I'll do that and then you can just refer back to mine for the technique 03:51
04:10 zetaaaa left 04:18 tejr joined 04:33 Aedil joined 05:56 Aedil left 06:10 discord-raku-bot joined 06:30 Sgeo left 07:05 yewscion joined 07:10 yewscion left 07:26 yewscion joined 07:29 Aedil joined 07:32 yewscion left 07:43 yewscion joined 07:51 yewscion left 08:53 yewscion joined 08:57 yewscion left 09:07 sena_kun joined 09:08 Manifest0 joined 09:17 dakkar joined
timo botato: btw if you ever have something very tricky to debug, especially involving memory corruption and whatnot, have you already given rr a try? it lets you debug in reverse, and especially setting watchpoints and then reverse-continue is like absolute magic 09:29
SmokeMachine Does anyone have any idea why fez is refusing to accept ASTQuery? github.com/tony-o/raku-fez/issues/121 I don’t even know where to start debugging this… does anyone have any idea? 09:46
09:47 [Coke] left 09:59 yewscion joined
librasteve botato: the augment example in the docs you reference does this "test.txt".IO.barename.say; #test 10:00
(ie it strips the filename extension from the path string) 10:01
10:04 yewscion left 10:15 yewscion joined
I believe the idea of placing the augment in a unit class is to disable the augmentation from other code unless the unit is explicitly used - i.e. via use IO::Barename; and use can be done within a {} scope to avoid global changes to class methods. The purpose of the method new {...} is to let you go IO.Path.new or IO.Barename.new interchangeably - personally I think that this make the example hard to follow. I 10:16
would just reduce it to augmenting the class IO::Path by removing the method new and it could do with the use part being spelled out
10:20 yewscion left
lizmat fwiw, I think "augment" should be deprecated in favor of lexical refinement 10:20
10:22 yewscion joined 10:27 yewscion left
librasteve I've made a doc issue github.com/Raku/doc/issues/4533 - will let it mellow for a day or so and then go and make the change if everyone is happy 10:29
10:43 yewscion joined 10:47 yewscion left
Xliff \o 10:54
I'm trying to track down this error, but I don't know what it means:
"Use of uninitialized value % of type Any in string context."
Unfortunately it happens in an EVAL.
m: my %a; if %a<b> eq '1' { say "BOO!" }; 10:55
camelia Use of uninitialized value %a{'b'} of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
Xliff m: my %a; if %a eq '1' { say "BOO!" };
camelia ( no output )
librasteve it means that you have not initialized element %a<b> in the hash and then eq gets the error when it tries to coerce that element to a Str to check string equality ;-) 10:58
lizmat m: my %a; say %a.Str 10:59
camelia
lizmat an empty hash stringifies to ""
m: my $a; say $a eq '1' 11:00
camelia Use of uninitialized value $a of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
False
in block <unit> at <tmp> line 1
librasteve m: my %a; say %a<b>.Str;
evalable6 Use of uninitialized value %a{'b'} of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.

in block <unit> at /tmp/SVdPaJcIIe line 1
Raku eval Use of uninitialized value %a{'b'} of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at main.raku line 1
librasteve yeah, but unitiialized elements are Any, right? 11:01
lizmat yes
well, actually an uninitialized container
m: my %h; my $b := %h<a>; dd %h; $b = 42; dd %h 11:02
camelia {}
{:a(42)}
Xliff OK. I'll probably need more detail, but I'm using a hacked version of cro-webapp-form. 11:03
And it turns out one of my changes was causing the problems.
The root cause was an eval.
librasteve m: my %a; if %a<b> or '' eq '1' { say "BOO!" };
evalable6
Raku eval
Xliff So I've solved the issue. It was in the SmartDeref class if Cro::WebApp::Template::AST 11:05
antononcube @SmokeMachine I had and still have several packages that fez or Raku.land refuses to register . In one which I succeeded fixing and registering the problem was that I had a Cyrillic letter in the name of one of the test files. 11:24
In other one or two times my META6 file was wrong. (That was easier to figure out.) 11:26
lizmat if it's not in fez, it won't wind up in raku.land 11:28
fwiw, maybe raku.land/build contains some clues ?
11:31 yewscion joined 11:36 yewscion left 11:43 [Coke] joined
Xliff lizmat: Any new developments for RakuAST in the last few weeks? 11:43
lizmat none to speak off :-( 11:44
Xliff Ah.
SmokeMachine Thanks! I’ll take a look!
Xliff lizmat: I would expect folks to be gearing up for the holidays.
lizmat: Is there anything I can do to help?
SmokeMachine Xliff: have you seen I answered your issue on my old RakuAST-Matcher?
lizmat well, there are still 22 open slots in the advent calendar :-)
Xliff lizmat: Yeah, well.... writing is not my strong suit, these days. 11:45
lizmat well, I'd be ok to provide an editor role (as in copy editing :-)
Xliff Let me take a look and see. I'm still trying to release some of my stuff. If I can get something out, maybe I'll write about that.
lizmat: Cool! 11:46
lizmat that would be brill :-)
11:46 discord-raku-bot left, discord-raku-bot joined
Xliff SmokeMachine: Excellent. Let me take a look. 11:46
SmokeMachine Xliff: I’m not sure if you will find it excellent… :( 11:47
Geth advent/main: 932725f53b | (Nigel Hamilton)++ (committed using GitHub Web editor) | raku-advent-2024/authors.md
Update authors.md
11:49
Xliff SmokeMachine: URL? 11:51
SmokeMachine: That's OK. I still wouldn't mind looking at it.
I see ASTQuery, but there are no issues.
SmokeMachine github.com/FCO/RakuAST-Matcher/issues/2
Xliff: but take a look at ASTQuery, because I think that’s a much better solution than RakuAST::Matcher 12:08
12:16 tejr_ joined 12:18 tejr left, tejr_ is now known as tejr 12:19 yewscion joined 12:24 yewscion left 12:35 Aedil left
guifa ooh maybe I could also do one on combining cosmopolitan and Raku for cross-platform native-call stuff 13:10
I'd need to do a lot of testing for that though
lizmat ++guifa 13:17
antononcube Still no links on what is “cosmopolitan”… 13:27
BTW, any Go fens/players here? I am considering Go as a “next” visualization and LLM project. 13:29
patrickb github.com/jart/cosmopolitan 13:30
antononcube @patrickb Thanks! 13:35
But would anyone consider an American animal to be a cosmopolitan? (I.e. have you met any Americans?) 13:36
lizmat I've met plenty of cosmopolitan Amaricans outside of the USA :-) 13:37
El_Che same
antononcube Yeah, sure. BTW, have you noticed that they are easy to spot. 13:40
Here, I usually refer to the "opposite" observation: Europeans who moved to USA are different from the Europeans who stay in Europe. 13:42
Mostly, after hearing some generalizations about "what Europeans are", or similar.
@lizmat What is the "animated images" policy of the Advent posts? I am considering using animated SVG images, although, those might not play in WordPress posts. 13:55
lizmat well, since we are using WordPress, I guess we only support things that WordPress supports ? 13:56
antononcube Sure, but there might be a rule, like, "No animated GIFs ever" for the Advent posts. 13:57
lizmat I don't know of any such rule
not sure why there would be such a rule: it's more about the contents to be Raku related, I'd say ?
antononcube Ok. I am thinking that certain chess playing moves would look better animated. (SVG generated via Raku.) 13:59
13:59 orangebot joined
lizmat well, if the animated SVG works, all the better 13:59
otherwise, maybe convert to animated gif somehow ? 14:00
antononcube And if it doesn't I can make a GIF. 🙂
Right, but this is more about the readers being annoyed by animations. Anyone, after I finish the draft, I will have something more concrete to ask about. 14:01
lizmat yeah.. that should work
I mean, if an animated GIF is looping endlessly, then meh 14:02
antononcube At this point, BTW, I consider making drafts for two Advent posts.
lizmat but you can make one that would have a static representation of the move as the last frame, no? 14:03
++antononcube
antononcube Honestly, lately I prefer making movies. I can make easily posts from movie transcripts. So, I strongly consider that: 1) Make a presentation notebook (for whatever topic) 2) Record a presentation 3) Make a Markdown file post (based on the presentation) 14:05
I am mostly unsure what are good themes / topics to select. Last year writing about LLMs was a no-brainer. 14:08
14:09 El_Che left 14:10 El_Che joined 14:37 yewscion joined
[Coke] anyone know how to make powershell respect shebang? (or how else to make something like that work in powershell) 14:49
patrickb Ugh. I know little, but I thing shebangs are not a thing on Windows. I usually try to work with file extensions. 14:54
i.e. add .Raku and register raku as the respective handler.
The MSI installer does that automatically (or at least tries to, I'm unsure if recent Windowses still allow it). 14:57
[Coke] might be something nice for rakubrew to figure out, as we want the raku registered to be the main shim, not the individual one installed with the last downloaded installer 14:59
botato librasteve: if I understand the docs and what you're saying, the intent was to make it so you can do "test.txt".IO.barename.say, but safer by doing it in a separate IO::Barename class and not modifying the existing IO::Path class 15:00
but that's not what it does, it does monkey patch the IO::Path class, I remove the new method as you suggest and have the example from the doc in Augment.rakumod gist.github.com/bo-tato/d1b939d39f...f05d0c6eeb 15:01
and then in another script I require Augment, and IO::Path objects have the barename method monkeypatched on: gist.github.com/bo-tato/7d3484d320...9a38e901ed 15:03
15:04 Xliff left
patrickb Coke: I think I once put some thought into this. IIRC the issue was that file associations are global and rakubrew wants to localize changes to the current shell. Having rakubrew change the environment globally permanently when switching the version in some shell is a no-go I'd say. 15:05
[Coke] patrickb: ahhh 15:09
botato lizmat: I'm interested in your thoughts on on deprecating augment in favor of lexical refinement. obviously I don't have raku specific experience, but some with monkey patching in ruby and python. afaik ruby introduced lexical scoped refinements (called refinements), and basically noone uses it, though there are still some uses for monkey patches
15:10 Aedil joined
lizmat the problem with augment is that it basically makes the impossible to reliably precompiled it as part of another module 15:10
botato i think there's very few good use cases for monkey patching in user code, basically just to fix over some bug in a library or something without having to fork it until upstream is updated, in which case you can monkey patch and add comment and rememinder to check updating library on a certain date, and assert statement forcing you to notice and reexamine it if the library is updated 15:11
timo do we disable precompilation whenever augment is used?
botato but can sometimes be very nice when well used by libraries, there's some examples in python here: lukeplant.me.uk/blog/posts/pythons...perpowers/
timo not being able to precompile just means stuff is slower 15:12
lizmat at startup, yeah
botato ah interesting, so it'd would cause problems with having to recompile a lot on changes and be slow with largest projects? 15:13
timo yes, slower to start, right
we have an env var that lists precompilation activity in a concise format, right?
lizmat RAKUDO_PRECOMPILATION_PROGRESS 15:14
botato timo I have heard of rr, I'm always fascinated by time travel debuggers. I haven't used it though, in recent years i've only coded in high level languages not C 15:17
but these issues with c bindings would be a good excuse to have fun and learn something trying it
antononcube .seen grondilu 15:18
tellable6 antononcube, I saw grondilu 2023-12-10T16:58:07Z in #raku: <grondilu> m: my @idx = (1;2); say [[1,2,3],[4,5,6],[7,8,9]][|@idx]
patrickb Who manages the discord bot? Can we add the discord bridge to #cro? 15:19
lizmat discord-raku-bot: could you add the #cro channel ? 15:20
timo if you're fascinated by time travel debuggers, check out pernosco some time. it's an omniscient debugger by the RR people. it's like going from being a time traveller who can go forwards and backwards to becoming an eldritch 5th dimensional being that can see all of time at once 15:29
librasteve botato: if I have understood the intent of the docs example correctly, it is to monkeypatch method barename into class IO::Path - BUT that as a concession to safety the augment is placed in a unit class IO::Barename so that the only gets applied when you use IO::Barename (or require) - but when that is done it is done to the class IO::Path
timo does it actually work like that? lexically scoped augments? 15:30
that doesn't seem right?
botato interesting, flowstorm for clojure is the only time travel debugger I've actually used 15:34
timo the issue to solve for pernosco was apparently "saving everything that happens in a database is a lot of data" and the solution was something to do with "cloud machines with boatloads of ram are surprisingly cheap" or something 15:36
botato but I think it affects everyone else including external library code using IO::Path? not just you when you use IO::Barename? on the github I posted an example with 3 separate files, and the monkey patch affecting the third that doesn't use IO::Barename
timo yeah, i thought that's the point of augment 15:37
i have never used a time travelling debugger apart from rr, which is obviously C-focused; I would be interested to talk about higher-level-language time traveling debugging 15:38
for situations where you don't want to use "augment", you can apply a role to an existing object with does or but 15:40
botato I think flowstorm for clojure is especially interesting compared to what'd be possible for most languages, cause you're dealing with 99% immutable data structures, which makes it cheaper to hold onto past copies of data, so it actually works in practice recording a full trace of real programs on a normal laptop 15:42
timo right 15:43
rr does the thing where it only records stuff that makes execution nondeterministic, which i imagine is very common for time travelling debugging implementations. it's in a way "easier" for them to do since they are already at the level of individual assembly instructions and of course syscalls 15:44
botato or I guess for languages with mutable classes, a time travel debugger could store an immutable map that it updates when fields of the class are changed, so it acheives the same effect of recording all the modifications without having to fully copy the class each time it's modified, I'm not sure how time travel debuggers for mutable languages work, I think it's just snapshotting the program at various
points, and when you want to rewind, it actually just goes back to the last snapshot and then replays inputs to go forward until where you wanted to go?
timo yeah, this "go back to most recent snapshot, then play forward" thing is definitely in RR 15:45
if your code is purely computation, it can make reverse stepping very slow if you haven't had a syscall in a long while for rr to automatically create a snapshot, but you can also create snapshots manually?
something i'm missing in rr when all i have is the terminal ui of gdb is something akin to a timeline. pernosco has something nice for that 15:47
librasteve botato: I have replicated your example and, yes you are right - thank you for clarifying - I have updated the docs issue to just remove the whole idea of a better and safer augment 15:49
on the advent thing - I am hoping to pen a couple of items on Cro and HTMX 15:50
antononcube @librasteve Are these, like, five posts? 15:53
16:26 discord-raku-bot left, discord-raku-bot joined 16:31 TESTFORTM joined
TESTFORTM Test 16:32
16:32 TESTFORTM left 16:34 zetaaaa joined
timo oh is todd coming over again? 16:45
16:46 yewscion left
[Coke] I was checking to see if the web chat worked - he reported an issue a few days ago 16:52
timo oh you were checking *for* todd, that's what the name is about, 16:57
ok
17:00 yewscion joined
librasteve @antononcube I think a couple means one or, at most, two - I would be happy to see 24 authors and 24 posts ;-) 17:06
17:35 dakkar left 17:43 teatime left, teatime joined 18:03 teatime left 18:04 teatime joined 18:26 teatwo joined, teatime left 19:23 yewscion left 19:47 yewscion joined 19:50 simcop2387 left, perlbot left 19:57 yewscion left 20:03 yewscion joined 21:01 yewscion left 21:02 simcop2387 joined 21:03 perlbot joined 21:11 apac joined 21:16 yewscion joined 21:22 yewscion left 21:38 Aedil left 22:04 orangebot left 22:34 lizmat left 22:37 oodani joined, oodani left 22:38 oodani joined 23:00 sena_kun left 23:13 jjido joined 23:35 apac left 23:39 tobs left 23:41 tobs joined 23:56 yewscion joined 23:59 yewscion left