🦋 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.
tonyo it's not about saving keystrokes but about solving the problem, regex is meant to match patterns and it should put those functions before all else..the regex /foobar/ or /dead horse/ is just as easily read as /'foobar'/ or /'dead horse'/ and cleaner 01:17
librasteve m: my $s = 'dead horse'; say $s ~~ /horse/ 07:43
Raku eval 「horse」
librasteve m: my $s = 'dead horse'; say $s ~~ /d horse/
Raku eval Nil Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at /home/glot/main.raku:1 ------> my $s = 'dead horse'; say $s ~~ /d⏏ horse/
librasteve m: my $s = 'dead horse'; say $s ~~ m:s/d horse/
Raku eval 「d horse」
librasteve m: my $s = 'dead horse'; say $s ~~ /'d horse'/
Raku eval 「d horse」
librasteve ^^ just right imo 07:46
nemokosch well what can I do about it 07:53
I heavily disagree that it's cleaner or as easily read 07:54
it's not cleaner because it mixes instructions and literals 07:55
and if that doesn't make it harder to read already, significant whitespace also means that you cannot format it 07:56
I think these are fairly concrete arguments, on the other hand I only see this vague notion that it somehow stands in the way of solving the problem - how? 07:58
(also, /'some literal'/ really doesn't even require a regex) 08:02
tbrowder__ late to the dance, but if i were looking for "dead horse" i would use ~~ /dead \h* horse/ 10:35
m: say "dead horse" ~~ /dead \h* horse/ 10:37
camelia 「dead horse」
tonyo they're concrete arguments if you think only you can be correct, for sure 11:13
and i didn't say anything stands in the way of a problem so that's quite a few miles or kms out of context 11:14
antononcube I have a design or naming question. Given that "LLM" stands for "Large Language Model", which of these package / module names you find more / most "telling" for a package with the mission statement "Raku package for functions and function objects to access, interact, and utilize LLMs" : 0) LLM 1) LLM::Functions 2) LLM::Functors 3) LLM::Framework 4) LLM::Interlocutors 13:29
nemokosch Well you didn't say anything in particular 13:33
I assumed "it's about solving the problem" and "regex (...) should put those functions before all else" meant to communicate some argument 13:34
Maybe that was presumptuous on my side but I'd say in an argument that's actually the good faith attitude 13:35
Anyway, it's tiresome that some ad-hominem red herring gets thrown in, as if there wasn't an objectively measurable difference. 13:38
tonyo agreed, having to deny saying things i didn't say gets tiresome 13:52
if you have a framework the 3, otherwise 0 is what i'd look at
nemokosch then I guess we can agree that it's all about solving problems and tools that don't solve the problems are worthless 13:57
one got to know why I prefer quoted literals and not really why you prefer unquoted literals, that's all what happened 13:58
I really can't see what's the need for looking for hooks to cling something personal there 13:59
tonyo it was asserted that it's possibly uncontended that people prefer raku regex to PCRE. i stated i prefer PCRE syntax for the most part because i don't like quoted literals in the regex. not sure we're arguing about what my preferences are. 14:00
or why it's even really a discussion, as uninteresting as it is
lizmat and uninteresting it is.... 14:04
nemokosch well, then you basically reassured my point. I gave a reason that might convince someone that Raku regexes are better - you said that you prefer otherwise, because. 14:12
why would that make arguments that people can just evaluate and consider, invalid
anyway, we could have spared this if you just downright said "I fancy it more and that's that" 🤷‍♂️ 14:15
lizmat *sigh* 14:17
Voldenet I prefer pcre syntax only because I've been using it for two decades and tons of languages adopted very similar syntax 14:24
nemokosch at the end of the day, to be able to use whichever one syntax and transform it into as many variations as possible, is a win either way 14:33
[Coke] anything other than coding stopping us from adding a :pcre to support the syntax? (as opposed to linking to a library) 14:34
nemokosch imo the fact that the Raku syntax kind of stands out can even be a benefit for initial learning (less "which one was it" moments about the minuscule details) but once you only use one for some time, it doesn't matter as much anymore I guess 14:36
[Coke] in the future, could we have a PCRE syntax RE compiled with rakuast and then rendered as a raku RE? (or vice versa) 14:38
tonyo [Coke]: it'd be easy enough to hook up a PCRE library and grammar it 15:05
s/grammar/slang
or should it be: s/'grammar'/slang 15:06
tonyo isn't there a :P5 in the regex? 15:29
tonyo m: say so 'hello world' ~~ m:P5{o w} 15:30
camelia True
SmokeMachine m: use v6.e.PREVIEW; say “42.is-prime”.AST 15:40
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::ApplyPostfix.new(
operand => RakuAST::IntLiteral.new(42),
postfix => RakuAST::Call::Method.new(
name => RakuAST::Name.from-ident…
SmokeMachine m: use v6.e.PREVIEW; say “42.^name”.AST 15:41
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::ApplyPostfix.new(
operand => RakuAST::IntLiteral.new(42),
postfix => RakuAST::Call::MetaMethod.new(
name => "name"
)
Voldenet well, on top of :P5 there's inline perl 16:44
m: EVAL q!print ('hello world' =~ m{o w}!, :lang<Perl5> 16:45
camelia Could not find Inline::Perl5 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/perl6/core
CompUnit::Repository::Abs
lizmat Well, I guess that could be one approach: :P5 to call into Inline::Perl5 somehow 16:46
advantage would be that the P5 regex would always be compatible with the Perl version that is being used :-)
another approach could be to drop support for :P5 altogether :-) 16:47
and make a more general "pluggable" regex approach 16:48
Voldenet I think having the syntax for :P5 is better than using perl interpreter, but considering the maintenance cost pluggable regex (with Inline::Perl5) sounds better
it makes more sense on nqp-js, where js regexes are better fit 16:50
nemokosch also, should the "P5 regex" just be a different syntax for the same behavior or different behavior altogether? 17:24
I mean capture groups for example - do they nest and turn into arrays for quantifiers?
tonyo m: say 'abcdefghijk' ~~ m:P5{(.(.))}; 17:27
camelia 「ab」
0 => 「ab」
1 => 「b」
tonyo looks like they do
nemokosch hm, fair enough
actually, what I don't know is how it works in Perl 😅 17:28
tonyo you'd get ['ab', 'a', 'cd', 'd', 'ef', 'f', ...] 17:47
m: say 'abcdefghijk' ~~ m:P5:g{(.(.))}; 17:49
camelia (「ab」
0 => 「ab」
1 => 「b」 「cd」
0 => 「cd」
1 => 「d」 「ef」
0 => 「ef」
1 => 「f」 「gh」
0 => 「gh」
1 => 「h」 「ij」
0 => 「ij」
1 => 「j」)
tonyo contextually in p5 you could use a while over the regex to the data in the same format as raku's return, so it's not entirely unfamiliar 17:50
ScotDog Hello Everyone! 17:58
ScotDog Is anyone there? 18:01
ScotDog What is Raku? I have never heard of it. I am interested! 18:04
librasteve o/
raku is the new name for perl6
raku.org has some intro info 18:05
ScotDog Oh that is pretty cool 18:06
librasteve certainly is!
also the rakudo weekly news is worth a read - rakudoweekly.blog (have to say that or @lizmat will kill me) 18:09
ScotDog Thank you librasteve! I will check that out 18:11
gfldex m: spurt("/tmp/\xFEFF.txt", ‘oi‽’); slurp("/tmp/\xFEFF.txt").say; 19:56
camelia oi‽
gfldex m: shell('ls -la /tmp').say;
camelia total 4876
drwxrwxrwt 1 root root 56306 Jul 19 21:56 .
drwxr-xr-x 1 root root 136 Nov 17 2018 ..
drwxrwxrwt 1 root root 0 May 26 2015 .ICE-unix
drwxrwxrwt 1 root root 0 May 26 2015 .Test-unix
drwxrwxrwt 1 root …
gfldex m: shell('ls -la /tmp/*.txt').say; 19:57
camelia -rw-r--r-- 1 camelia users 5 Jul 19 21:56 /tmp/.txt
Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 0, signal => 0, pid => 11654, command => ("ls -la /tmp/*.txt",))
gfldex I better stop now, before I break something. :->
:D Windows explorer RMB/Properties doesn't work on that filename. 20:00
No wait, it does! But it takes over a minute to open the dialog. 20:01
jdv is there a ctags impl for raku anyone know about? 21:08
[Coke] blogs.perl.org/users/dmitri/2015/0...erl-6.html 21:11
github.com/universal-ctags/ctags/b...erl6.c#L28 21:12
jdv i just noticed that 21:13
is also maps weird extensions to "perl6"
[Coke] just old. 21:16
jdv yeah...
[Coke] github.com/universal-ctags/ctags/issues/377 21:39
github.com/universal-ctags/ctags/issues/3776
[Coke] jdv: github.com/universal-ctags/ctags/pull/3777 22:20
Seemed easy enough to take a stab at it, though I'm not sure it's complete.
jdv oh neat 22:57