This channel is intended for people just starting with the Raku Programming Language ( Logs are available at
Set by lizmat on 8 June 2022.
01:03 MasterDuke joined 02:24 tea3po joined 02:25 tea3po left 02:26 tea3po joined 02:27 teatwo left
joking how does one actually compile with the Rakudo compiler? most of what i've tried just gives errors or empty out files 02:47
MasterDuke what do you mean "compile with the Rakudo compiler"? compiling a script to bytecode? or just running the script? 02:49
joking the first
the help doc lists a bunch of flags like -o or -optimize, but they mostly just error 02:51
MasterDuke ah yes, that's not *really* supported for users. writing bytecode is mostly used for precompilation, which the compiler handles for you
though i admit it seems more broken than usual. i seem to remember that it worked with the `--output=<filename>` version of the flag, but not the `-o <filename` version, but now both produce zero sized files 02:54
the --optimize flag seems to be working fine though 02:55
joking so you can't compile Raku code into a standalone executable? 02:56
MasterDuke but they aren't really related, the --optimize flag is for the rakudo "static" optimizer, which happens before bytecode would be generated
sort of. there was a google summer of code project a couple years ago that got 90% of the way there, but the work hasn't been finished up 02:57
there are some modules that can do it, but i believe mostly by bundling the compiler 02:58
joking the optimize error i'm seeing seems to be only when using it combined with -o apparently; Cannot stringify object of type NPQArray 02:59
i'll look into that, thanks for the help
MasterDuke yeah, you pretty much can't use -o with/for anything right now. fwiw, i'm not sure if there is an issue for that in the rakudo repo, feel free to create one 03:03
also, not sure why you're using the --optimize flag, but normal use shouldn't require setting it to anything other than the default 03:05
joking just wanted to see if it would make my code faster, idk 03:07
MasterDuke heh. the default value is the highest (most optimization), so hopefully changing it wouldn't speed anything up... 03:08
oh, maybe we should mention that in the --help output 03:09
07:46 habere-et-disper joined
habere-et-disper How do I ask a sequence if it is arithmetic or geometric ? 07:47
nemokosch That's not a property of sequences on language level - a sequence could easily be neither 07:50
07:51 dakkar joined
habere-et-disper Right. I was expecting like `is-lazy` and `is-eager` we could introspect here. 07:52
nemokosch Who created the sequence probably knows the rule of it and could store it in a way that is useful for later investigation 07:55
07:56 saint- left
habere-et-disper 👍 07:57
07:59 sivoais left 08:00 sivoais joined 09:47 ToddAndMargo joined
ToddAndMargo Would someone give me a link to the list of options for regex "s", such as $x~~s:global/blah/blah/.  I am after everything thing I can put after the ":". 09:49
moritz_ 09:51
ToddAndMargo Sorry, I can't make heads or tails out of that.  I am looking for a simple list:  g or global; i or case insensitive; etc.. 09:55
moritz_ if you scroll down a bit, that list comes in the form of headings 09:56
nemokosch it's literally listed on the sidebar...
moritz_ but there is a bit of understanding you *have* to invest, because not every modifier/adverb can be used in every context 09:57
ToddAndMargo I realize that and since I can not find what I am looking for in the sidebar ...   I really would like a list that goes with "s:", which I presume means subsitute 10:01
.oO( /me refrains from making a snide remark )
nemokosch it doesn't mean substitute anyway 10:02
if you think about it, that doesn't make conceptual sense for a regular expression. A regular expression describes textual patterns in itself
lizmat fwiw, I've gotten myself used to using .subst 10:04
ToddAndMargo I use regex "s" a ton to tear apart source codes from web pages.  I have gotten pretty handy with it.  The two after the ":" that I use are "g" and "i".  I am after what else is available.   It would help is the documentation was written for beginning users and not advanced users who don't need it anyway. ".oO". 10:11
If "s" is not "substitute" what does it stand for? 10:12
To be frank, it doesn't take an expert to go through a couple of headlines 10:13
ToddAndMargo Me dumb dumb.  I am use to Perl 5's docs, which are written so a beginner can understand. 10:14
nemokosch And while the content of the criticism is valid, your personal record of wanting everything ready-made with little investment doesn't help with the case
ToddAndMargo so "s" stands for ":sigspace".  I see in teh doc that it is used as ":s".  I have been dropping the ":" and using $x~~s//.    Should I be using $x~~:s instead?  Or does it not mater? 10:16
dakkar the `s` operator and the `:sigspace` adverb (which can be abbreviated to `:s`) are completely different things 10:17
ToddAndMargo Good technical written starts with the simple and then moves to the advanced, as in P5's docs.
Okay then, what does the "s" stand for? 10:18
dakkar which one?
nemokosch s:s/// could be a thing
ToddAndMargo $z ~~ s/xxxx/yyyy/
dakkar that's the substitution operator
ToddAndMargo So the "adverbs" come after the ":"? 10:19
dakkar the `:` is part of the adverb, they're pretty much boolean named arguments
(and if you don't understand what I've just written, you need to go back to studying the basic structure of the language) 10:20
ToddAndMargo Got it. Can I have a list of them please?  Only the ones that work with "m" (match) and "s" (substitution).
dakkar look at the documentation that moritz_ linked you to 10:21
nemokosch also 3 bonus adverbs at the end 10:24
moritz_ we have just the documentation that we have. If you want it in a different form or format, you'll have to invest some effort yourself 10:28
ToddAndMargo "<nemokosch>"  Perfect !  Thank you, Thank you , Thank you!!!! 10:34
":samecase or :ii".  Is that not the default? 10:37
"The :samecase or :ii substitution adverb implies the :ignorecase adverb".  You guys know that is improper English?   ":i" means to ignore the case; ":ii" means case sensitive.  ":ii" implies the opposite of  ":i".  What would you guys do without out beginners around! 10:43
moritz_ no, :i means ignore the case while matching, and :ii means do something with the case while substituting 10:44
ToddAndMargo Also the link left off :global 10:45
moritz_ :global is part of the match adverbs, which can also be used for substitutions 10:46
ToddAndMargo Where is ":ii substitution adverb implies the :ignorecase adverb" does it say that?  And where is the explanation
any others not listed? 10:47
moritz_ please read the whole section on the adverbs 10:48
there's some explanation about why there are three different kind of adverbs, where each of them apply, and then there's a list of each type of adverb 10:49
ToddAndMargo found ":global and ":pos" at the top. 10:50
And I found "Here you can see that the first replacement string a got capitalized, because the first string of the matched string was also a capital letter.'   That is something entirely different that "implies the :ignorecase". 10:51
It means to reuse the case that that is being substituted. 10:53
10:53 moritz_ left
ToddAndMargo Oh, above the given link, there is a bunch of great stuff in "".  Very cool! 10:57
dakkar yes, that's why we keep telling you to *read the whole thing* 11:03
ToddAndMargo "read the whole tihng" meant to me read "".  That was the link I was given.  I found "" by accident.  And the former link doid not go into which "matching adverbs" could be used in substitutions. 11:07
dakkar it's the same page 11:08
and since the first half of the substitution operator is a (matching) regex, of course the "matching" bits are relevant 11:09
could the documentation be improved? sure! always! but please try to see what's already there before saying it's lacking
lizmat and perhaps give back by providing a doc PR ? 11:13
ToddAndMargo The lacking remark was in response to ".oO( /me refrains from making a snide remark )".  The two links provided were an exact answer for what I asked.  As far as the documentation goes, I see it as a work in progress.  raku is a relatively new language.  I am sure it will get better with time.  The technical writers should go through and start 11:21
with the simple and work up to the complex.  And do not use the examples to brag about how to use it with complex features that are doubtful to be understood by others.  As I said, a work in progress.   And, I have incorporated the two links into documentation I write myself, so I will not have to ask again.  (I call my docs "Keepers", but
they are written specifically for me, so not very useful to others.  Sometimes I do copy them over on the mailing list when a question arises covered by one of them.)
Did you see the post over on the mailing list called "Need regex in the middle wildcard help"?  At the bottom of the third post I show an example of a failed regex that I believe is a bug, but I am not sure.   `$x~~s:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a href="] )  (.*?) ( $(Q[">] ) )  /$0$1 $2/;`  the $x's do not work, but do 11:23
work when used in a match `m:`
"and perhaps give back by providing a doc PR ?"  What is a "PR".  if it is an enhancement request.  I have tried that.  I always get show down.  So I stopped. 11:25
11:54 habere-et-disper left
lizmat and yet another Rakudo Weekly News hits the Net: 12:34
12:36 ToddAndMargo left 14:23 teatwo joined 14:24 teatwo left 14:25 teatwo joined, avuserow left 14:26 avuserow joined, tea3po left 14:59 ToddAndMargo joined, ToddAndMargo left 16:40 dakkar left 16:45 samebchase joined 18:38 ToddAndMargo joined 20:07 SmokeMachine left 20:08 SmokeMachine joined 20:53 Guest2884 joined 22:39 Guest2884 left