🦋 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.
emakei hi! maybe there already exists some brief introduction on how i can use Raku for admin my Linux laptop and use for find files sorting by date creation and so on? 07:27
guifa leont: I'd like to assume that someone contemplated modules doing different things to .timezone, since offset is defined to be a number, but timezone is an Anya 10:07
thundergnat m: my $int = 5; dd $int; dd << $int >>; 10:38
camelia Int $int = 5
IntStr.new(5, "5")
thundergnat ^^ Coerce to IntStr
thundergnat m: my ($w,$x,$y,$z) = 5,5.1,5e1,5i; dd << $w, $x $y $z >>; # Allomorphs in general 10:43
camelia (IntStr.new(5, "5"), ",", RatStr.new(5.1, "5.1"), IntStr.new(50, "50"), ComplexStr.new(<0+5i>, "0+5i"))
thundergnat Hmm. 10:44
m: my ($w,$x,$y,$z) = 5,5.1,5e15,5i; dd << $w, $x $y $z >>; # Allomorphs in general
camelia (IntStr.new(5, "5"), ",", RatStr.new(5.1, "5.1"), NumStr.new(5e+15, "5e+15"), ComplexStr.new(<0+5i>, "0+5i"))
thundergnat Ah. that's more like it. 10:45
tbrowder__ lizmat: ref pod and RakuAST, with your new, successful code push you can probably easily fix some other NYI things, to wit: (1) =defn, (2), :config exetended over multiple lines, and (3) numbered =items. i'm rooting for you, hooray! 11:35
*extended
lizmat :config extended over multiple lines should already work
# to indicate :numbered, is already put in the config 11:36
I'm not sure what you mean by NYI for =defn ?
tbrowder__ last time i looked the =defn block didn't work correctly. same with numbered items. but i haven't checked lately. 11:38
lizmat numbered items indent afaik 11:39
tbrowder__ not quite, i'll check it out more soon 14:36
rf Morning folks 15:13
lizmat rf o/ 15:17
[Coke] Hio. 15:18
Xliff \o # rf 15:22
lizmat published a blog post again: dev.to/lizmat/rakuast-for-early-adopters-576n 15:45
Anton Antonov @lizmat Hopefully, RakuAST for late (and lazy) adopters will come up soon. 16:14
lizmat yes, there will be... but for that we would need documentation...
Anton Antonov Great! 🙂 16:17
lizmat ah.. you're willing to write documentation? :-)
tonyo . 16:47
Xliff Is it possible that RakuAST emitted bytecode could be stored somewhere to be run later? Like a file or a database? 19:08
leont has two module that could use some RakuAST to generate a regex, should play with it at some point 19:09
lizmat Xliff: for now, you would put that in a module and have the RakuAST run at BEGIN time and have it stored in a variable that gets serialized 19:11
Xliff lizmat: Yes, but I'm more thinking about trees that get built at runtime by one program, to be used at runtime by another. 19:15
Xliff Assume each mention of "runtime" is a separate instance. ;) 19:15
lizmat would they be running at the same time ?
Xliff Maybe.
For now though... "assume not" 19:16
lizmat well, there's no way to save the bytecode of an AST, because the AST by itself doesn't do anything 19:17
it needs to be EVALled to have something happen 19:18
Xliff Figured that. Just wanted to put the bug in someone's head.
Xliff I'm thinking in the (hopefully) not so distant future I can compile a Template6 or Cro::WebApp::Template, store it to database. Then later, load that bytecode from the database and execute it. 19:19
lizmat what I'm saying is that the EVAL provides a context and a resolver
Xliff O I C
And therein lies the glitch.
lizmat and if that bytecode refers to anything outside of itself, it needs to have a compiler ID match 19:20
Xliff So when RakuAST is ready, maybe AST's can resolve to bytecode and $bytecode.EVAL can attach the context and resolver and then execute?
lizmat remember: precompiled modules in Rakudo are a dynamically updated static library
Xliff Well, if there is a compiler ID mismatch, the tree will be stored "beside" it ready to be re-EVAL'd if necessary. 19:21
lizmat but the only way to save the tree, is to save it as source, at least atm
it's not that I don't understand what you're getting at: but it's slightly more complicated than you'd think 19:22
Xliff lizmat: I get it. I just hope something like this is possible... soon™ 19:26
lizmat actually, I think most, if not all of the hooks are there already: it just needs someone investing time in it (and maybe develop some missing parts) 19:27
Xliff m: $*RAKU.compiler.id.say 19:28
camelia 7EB97B56661B0658943719014AEAE87BA0536E52
Xliff So that's there. And can be a part of the schema....
lizmat perhaps, but really ugexe and/or nine should chime in on this 19:29
Xliff lizmat: They are busy enough. I guess this can be tabled until RakuAST is near completion.
But I have plans.....
Muahahahaha!
lizmat yeah, I think so: first get the setting to build with RakuAST
Xliff Oh.. you weren't supposed to hear that last bit.
lizmat had some Tina Turner on loud, so didn't hear that 19:30
Xliff Oh good.
lizmat
.oO( who sadly left us today :-( )
Xliff WHAT?
lizmat yeah :-( 19:31
Xliff Oh my.
lizmat www.bbc.com/news/65669653
[Coke] (turner) ah, crap. 19:37
Xliff [Coke] - Yeah.
She will be missed.
gfldex Her music made her immortal, tho. 19:40
ugexe I don't know why it wouldn't be possible now 19:43
see: github.com/ugexe/Raku-CompUnit--Re...ry--Github
lizmat ugexe++ 19:44
ugexe although I don't think I ever got precompilation working in any of my external CU modules
lizmat well, that's what I meant with ' I think most, if not all of the hooks are there already: it just needs someone investing time in it (and maybe develop some missing parts)'
vrurg ugexe: wish you had time to properly implement what I failed with: versions from META6 and META6 as a dependency for recompilation check. 19:58
It's impossible to tell how many hours of my time was spent on figuring out why code fails when it depends on content of the 'resources' key. 19:59
drudge I'm having difficulty understanding a block from 'Learning Perl 6'. Specifically, I'm trying to understand how the following `seq` works: 20:31
```
my $triangle := 0, { ++$ + $^a } ... *;
```
I understand that the previous figure is an anonymous scalar, and the latter is a placeholder variable
what I don't understand is how an argument is assigned to the block, or how the anonymous scalar continues to iterate without a `state` object 20:32
librasteve $ is the anonymous state variable - each iteration of the block will increment it 20:33
drudge oh, ok. So $ *is* a state 20:34
librasteve $^a is a shorthand for -> $a { ... $a ... } so it takes on the value passed in
^^ yep
drudge In the triangle example, what's considered passed in to the block? 20:35
I understand how a placeholder functions in a subroutine
but I haven't been able to complete a seq exercise without looking at the answers
librasteve probably starts from the 0 and then is the previous result 20:36
yeah - this is a hard example (raku can be very compact) 20:37
drudge ooooh, I think I see what's going on. When you actually call the `seq` you pass an argument
e.g. `$triangle[5]` or whatever
and then THAT is what's passed in
to $^a
librasteve no, the [5] is a positional index so it is just taking the 5th item you make 20:39
m: my $triangle := 0, { ++$ + $^a } ... *; say $triangle[0..5]; 20:40
Raku eval (0 1 3 6 10 15)
librasteve [0..5] is a slice index so it gives you the first items up to 5
so you are going 0, (1+0), (2+1), (3+3) and so on 20:42
drudge m: my $triangle := 0, {$^a}...*; say $triangle[0..3];
camelia (0 0 0 0)
drudge so it's pulling the placeholder from the first 'argument' of the sequence
librasteve the placeholder is the result of the previous iteration (staring with 0) 20:43
drudge ok, this is explicitly the result OF THE BLOCK
librasteve then the $++ state just counts up from 0 each iteration
drudge and has nothing to do with the 0 passed in beforehand
m: my $test := 1, {$^a}...100; say $test[0..5]; 20:44
camelia (1 1 1 1 1 1)
librasteve 0, (1+0), (2+1), (3+3) == (start), (state + prev), (state + prev) ...
so without the incrementing state you just have (start) (prev) (prev) == 1 1 1 1 ... 20:45
yeah - the previous result of the BLOCK 20:46
drudge Okay, I think I get what's going on now. I'll test some more locally to verify. Thanks for your time Steve! I'm working through this book very slowly, have no formal compsci degree or math beyond high school algebra 2 so visualizing this stuff sometimes is very challenging fo rme 20:48
librasteve a pleasure - imo raku is a great way to learn because it is very natural - but it is quite big and dense so can be daunting in comparison to eg Python 20:50
personally I relearned coding after a long break and started with Think Perl6 (now Think Raku) greenteapress.com/wp/think-perl-6/ 20:51
which was a rewrite of Think Python for Raku
and both books follow the same syllabus from the point of view of someone who is entirely new to coding ... so a great intro to OO, functional, regex and so on 20:52
Xliff Hmmm... can someone run the script in the comment that starts with "Latest version", and run it in the rakudo/src/Raku directory and tell me why its hanging in "signature.rakumod", please? 20:55
Post is here: gist.github.com/Xliff/b4741a42ab83...f3e9b79528
Hrm... looks like it's my nested-braces regex. This was working though. 21:00
Xliff So class Rakuast::Signature is the culprit 21:09
Xliff Something in RakuAST::Parameter 21:16
RakuAST::Parameter.IMPL-TO-QAST 21:17
Something in that method is causing an endless loop
lizmat yeah, there's still some issues with RakuAST::Parameter, such as default value aka ($a = 42) 22:16
ugexe vrurg: after seeing what it took for you to get it working *at all* I'm not sure I have the patience to also get it working, let alone in a way that satisfies the perfectionist in me 23:40
I wonder if the stale resources issue you saw would be fixed by using the handle from $*DISTRIBUTION.content($*DISTRIBUTION.meta<resources/foo).open 23:43
instead of using %?RESOURCES
Guest88 quick question - what's with the trademark sign attached to the Raku name? 23:45
[Coke] recommendation from legal team to help enforce the trademark. 23:47
Guest88 why does the trademark need to be enforced if it's FOSS? 23:48
it just kinda stands out to me as opposed to every other language i've come across 23:50
avuserow python.org has a TM on their home page, fwiw
Guest88 right you are 23:51
[Coke] I use FOSS all the time for $dayjob, and work with the legal team all the time to respect copyright and trademark (if any).
avuserow I'm not a lawyer but trademark is kind of orthogonal to open source. enforcing trademark gives the legal team the power to prevent impersonation (e.g. maybe useful to prevent a non-open source impersonator) 23:52
[Coke] rakudo HEAD build failing for me on mac m2 23:53
ah, removing previous install did it 23:55