🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Anton Antonov Should I expect any (significant) "performance penalties" from using `sym<>` regexes or rules? I plan to do my own experiments, but any related observations or knowledge from others would help... 14:17
lizmat if there are any penalties, it's in compile time 14:18
[Coke] going to try to write something with ansi terminal sequences for my utility script need. I basically want something I can plug Terminal::Spinners into to get the status update line on the bottom of the screen, and have all output emitted from the script scroll in the area above. Would anyone else find this sort of thing useful? 14:19
lizmat probably :-)
[Coke] I think I'd take over the whole window. Ideally if I knew I was in a pipe, I'd ignore all of this and just pass through the output. 14:20
japhb [Coke]: Yeah, and I'm curious to see exactly what sequences you use. (Most of the ones I use are the ones needed for Terminal::Print or Terminal::LineEditor.) 14:26
[Coke] ah, nifty, thanks. 14:35
Anton Antonov @lizmat Thank you! (And it makes sense.) 14:36
[Coke] the literal "AUTHOR" text here raku.land/zef:japhb/Terminal::LineEditor is vertical.
lizmat so don't do that in scripts :-) 14:37
[Coke] ah. Terminal::Print is not portable, is it. 14:39
(relies on termios)
Anton Antonov @Coke I want to use Raku for making chat-bots through CLI scripts, so the functionalities you mention would help ... 14:41
japhb [Coke]: Yeah ... I mean, I assume it probably works under WSL2, but I've never tried.
As for the AUTHOR text on raku.land, I have *no idea* why it is doing that. 14:42
lizmat japhb: that's a known issue in the renderer 14:44
aru Hi, I'm messing around with grammars. Could anyone give me a hint why in this example p.teknik.io/T3FeL this works, but if I use the other definition for words, I get nil for all the examples? From what I gathered both definitions should be equivalent 14:52
ahh, silly me 15:00
aru but I'm still failing to use a newline as a delimiter 15:05
moritz aru: 'rule' implies automatic matching of whitspace. Newline is also whitespace, so it'll be used up automatically 15:29
you could do something like token ws { \h+ }
aru right, I made it work in the meantime, without fully understanding what's going on
moritz \h matches only horizontal whitepsace
moritz (and 'ws' is what 'rule` use to parse whitespace) 15:30
Nemokosch oh, the legendary moritz... 15:35
Xliff Talk about interesting...
Nemokosch perhaps you know whether left recursion in grammars can be dealt with in Raku grammars? 15:36
Xliff Can someone post some links on educational resources for Raku?
Xliff An educational opportunity has rolled up on my desk. I'd like to submit a lesson plan centered around Raku. I then might be offered the opportunity to teach the class. 15:36
moritz Nomokosch: no left recursion in grammars, no 15:39
Xliff: perl6book.com/ has lots of resources, for one
Xliff Wasn't there a lesson plan for Raku? 15:40
Nemokosch tldr it seems like the grammar of Rust has left recursion in it and someone tried to parse it not so long ago
moritz andrewshitov.com/2021/01/13/the-course-of-raku/
Xliff moritz++ 15:41
moritz I don't think left-recursion is part of a language, just of a grammar. You can always come up with a grammar for the same language that's not left recursive
moritz in fact, there are parser generators that do that automatically (possibly bison?) 15:41
("always" is to be used with caution here; I think the theoretical proof applies to context-free grammars) 15:42
Nemokosch the question is, at what cost? 15:46
moritz with a bit of experience it's usually not too bad 15:47
Nemokosch > for example, we descend from <expression> into <expression-without-block>, into <operator-expression>, into <comparison-expression>, but then back up into <expression> 15:48
moritz there are lots of examples out there on how to structure an expression grammar that it doesn't run into left recursion 15:50
[Coke] wonders when moritz got famous. :) 15:51
also: hey, dude.
moritz [Coke]: i wondered that as well :-) Hi there 15:52
In fact I'm pretty sure that both the parsing book and my general raku book contain examples for mathemtical expressions that avoid this left recursion pitfall 15:54
Nemokosch well it's not my problem, thank God, so I'm perfectly satisfied with knowing that there are established solutions 😛 15:56
thundergnat {Coke] RE: ANSI terminal scroll regions. You may be able to steal some ideas from rosettacode.org/wiki/War_card_game#Raku or rosettacode.org/wiki/Launch_rocket...tdout#Raku . Or you may recoil in horror, who knows. :-) 16:28
Oops, wrong bracket... [Coke] ^^^ 16:29
tonyo next module upload to zef will be the 1000th 16:30
[Coke] thundergnat: nifty 17:04
rir Fiveish thinking: [ (), (0), (1,2) ].grep( .elems >= 2); How do I make a smartmatch work? Or am I missing a callable? 17:17
CIAvash rir: `.grep(*.elems >= 2)` or `.grep({ .elems >= 2 })` or `.grep: * ≥ 2` 17:23
rir CIAvash, thanks for setting right. I was surprised then followed the no 'Bool as Matcher' in the wrong direction. 17:39
lizmat most newbies initially think of "*.elems" as some magic, without realizing it is actually just syntax to create a Callable 17:46
tonyo m: [ (), (0), (1,2) ].grep({@$_ >= 2}) 17:49
camelia ( no output )
tonyo m: dd [ (), (0), (1,2) ].grep({@$_ >= 2})
camelia ($(1, 2),).Seq
tonyo star also just works
m: dd [ (), (0), (1,2) ].grep(* >= 2);
camelia ($(1, 2),).Seq
Nemokosch this reminds me... 17:51
what is the difference between .cache and .List?
more specifically... it seems to me that .cache doesn't fetch the whole list 17:54
rir lizmat, that is because it is weird and found in other items' doc before one knows it exists. That invites copying w/o much comprehension when 'getting it done' overwhelms curiosity. Then that zero/tiny comprehension is validated... 18:12
lizmat I see... hmmm... 18:15
Geth ecosystem: 576e52ee4f | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Delete modules uploaded to the fez ecosystem
19:44
tonyo "Number::Denominate:ver<2.002002>:auth<zef:raku-community-modules>" is the 1k mark for zef's hosted dists 20:36
that version number, heh