🦋 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.
coleman what's LTM mean in this context? 00:23
guifa patrickb: here's a way 00:52
my @routines = <abc defg hijklm>; my %routines := @routines.Set; my token routine { <!ww> $<name>=[.*?] <!ww> <?{ %routines{~$<name>} }> }; say 'asd abc woek' ~~ &routine 00:53
evalable6 「abc」
name => 「abc」
guifa basically, you grab what COULD be a match -- once -- and then check it in a set which is O(1), much better than O(n) that is a bare @routines 00:54
lizmat / ab5tract : AIUI {} breaks LTM for the token itself, @routines is like inserting the a|b|c in a [ ], so the LTM still has to happen for that particular group 00:55
ab5tract That’s what I figured
guifa oooh -- I wonder if it would be possible to optimize this for at compile time 00:56
guifa like if you have @foo = <abc ade foo fooo>, you could do O(@foo), capture that, analyze it at compile time (so must be known then) and rewrite it as [ a [bc|de] | foo o? ] 00:57
obviously, can only do it for compile time stuff, but it'd be a pretty straight forward algorithm 00:59
coleman: LTM is longest token matching. A old gotcha in regex of yore was to do something like (go | going | gone) and try to match it on 'He's going to the store'. 01:00
It'll actually match go first, because it's the first alternation 01:01
so most of the time you'd need to sort it. LTM basically says "we'll try each alternation, and the one that's the longest wins first" 01:02
patrickb Thinking a bit on this, I think the problem is not the LTM. I'm pretty sure Raku is smart enough to sort the LTM alternatives and create a decent NFA. Instead the issue probably is, that interpolating that variable means the regex is dynamic and it will have to recreate the thing from scratch on every use. 08:58
patrickb I didn't verify yet (by doing some timing tests), but I'll do so. My guess is, that the idea to match blindly and check afterwards should work (but not as optimal as could be) and the best way would be to just type out the alternatives in the token literally and not do any interpolation at all. 09:00
jdv coleman: Longest Token Match 11:33
tbrowder i have a question on using rak in a program. as i understand from reading its docs, the first arg must be either a pattern to search for in files or a Callable. 11:54
my question is: how do i construct a Callable that says "look at all files that meet this test"? 11:56
rak has very many ways to say that with with named args, so i need a Callable that says "pass me on to the named args" 11:57
in debian using find i would start with "find /" and press on 11:58
but i haven't figured out how to do that with rak 12:02
lizmat '{ .meets-the-test }' 12:08
librasteve just a thought… this may be an opportunity for rakuAST … ie inspection of the AST produced by that token/alternation may be quite inefficient and maybe you could cut out unneeded actions? 12:19
lizmat weekly: andrewshitov.com/2024/11/02/a-language-a-day/ 12:22
notable6 lizmat, Noted! (weekly)
tbrowder lizmat: thanks! 12:28
tbrowder lizmat: it looks like rak is inspecting file contents even with {.meets-the-test}. is there a way to completely ignore inspecting the contents? 13:15
lizmat did you specify --find ? 13:22
tbrowder no 13:23
lizmat rak --find '{ $_ contains an IO::Path object of each selected file }'
tbrowder hm, i added .find and now get errors about meets-the-test doesn't work on path object 13:26
lizmat --find you mean?
we should probably move this to #raku-rak or to an issue 13:27
tbrowder i need to join that channel... 13:28
Geth raku.org: 690b09d8c0 | (Patrick Böker)++ | source/compilers/index.html
Remove broken and mostly redundant link

  ... to the rakudo.org Download page. It's redundant because `rakudo.org/`
has a huge and prominent "Download" button in the center. So linking to
  `rakudo.org/` is sufficient. Also linking to subpages of other sites is a
bit of a bad practice.
16:46
raku.org: b191ec22f1 | (Patrick Böker)++ | source/compilers/index.html
Be less flashy in the compilers/impl headings

By de-emphasizing the NQP GitHub link a bit.
raku.org: 0f99be9d82 | (Patrick Böker)++ (committed using GitHub Web editor) | source/compilers/index.html
Merge pull request #224 from patrickbkr/fix-broken-impl-download-link

Fix broken impl download link
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/11/04/2024-43-one-of-21/ 17:41
librasteve 🍬 17:44
[Coke] wonders if anyone else here has to do "CPE" training for their job (continuing professional education) (mainly a requirement any place I've worked with accountants, even if you're not an accountant yourself) 19:44
coleman Yes, for American Express, which I was a contractor at for a while 19:48
Lots of stuff about financial crimes that wouldn't come up most likely, but compliance demands that all employees complete training every year 19:49
timo on zef.land i regularly run into 429 Too Many Requests; am I doing something wrong? 21:58
Geth raku.org: 3b00eb592e | (Coleman McFarland)++ | 2 files
Add Dockerfile to serve static files with Caddy

We add a basic Caddyfile that compiles static assets to ./online and then serves these from the web root /usr/share/caddy inside the container.
404 handlers are TODO
22:12
lizmat timo: I've seen that occasionally 23:06
timo i wonder if it has to do with the search-as-you-type in the search box? 23:07
lizmat could very well be
reminds me one time at former $work where a bug in JS caused a DDOS on the servers :-) 23:09
El_Che hallo 23:45