00:23 rmv left 01:55 hulk joined, kylese left 02:10 Sgeo_ left 02:11 Sgeo joined 02:15 hulk left, kylese joined
disbot4 <simon_sibl> I am getting crazy xD is that expected that when I assign to a @variable using a ternary !! ?? the hash I create get flattened ? 02:37
<simon_sibl> @!files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join('/')), :length(.<length>))} !! [%( :path($!name), :length(%info<length>) )]; 02:38
<simon_sibl> even when using [%()] it somehow flattens it and then I get error when I wanna do @!files>>.<length>.sum 02:39
Voldenet hm, but it does work 02:44
m: my %info = files => [{ path => ["foo","file1.txt"], length => 123 }, { path => ["dir","sub","file2.txt"], length => 456 }]; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! [%(:path($name), :length(%info<length>) )]; say @files>>.<length>.sum; say @files.raku 02:45
camelia 579
[{:length(123), :path("foo/file1.txt")}, {:length(456), :path("dir/sub/file2.txt")}]
disbot4 <simon_sibl> hmmm how come 02:55
<simon_sibl> in my code when I do @files>>.<length> it gives me (Nil, 661651456) wihch then error, and it gives Nil because it flattens the map, so :path of course isnt a number
02:57 Sgeo left
disbot4 <simon_sibl> glot.io/snippets/hjtmuwf01c 02:57
<simon_sibl> I really dont know whats going on xD 02:58
<simon_sibl> Oh wait your example yes, it works for me with multiple files But when there is only one so not the <files> then it doesn’t work 03:01
03:04 Sgeo joined 03:08 Sgeo left 03:09 Sgeo joined
disbot4 <simon_sibl> is it a bug or I am doing something stupid 03:09
03:16 Sgeo_ joined 03:18 Sgeo left 03:25 Sgeo_ left, Sgeo joined 03:44 Sgeo left 03:45 Sgeo joined
wayland76 simon_sibl: More context would help. Note that in Voldenet's case, he gave some sample data, and code that actually runs. Yours likely wouldn't run because it's inside a submethod that never gets called. Are 03:46
you able to give us something more focussed? 03:47
disbot4 <simon_sibl> let me try to give some data for the test
<simon_sibl> glot.io/snippets/hjtoavcwfl 03:50
<simon_sibl> here can see the issue with the data
03:51 cm left 03:58 cm joined
wayland76 simon_sibl: I have a solution for you 04:02
disbot4 <simon_sibl> amazing, did I do something wrong or its expected behavior ? 04:03
wayland76 Just after the parenthesis closing the has (and just inside the `]` ) add a comma.
disbot4 <simon_sibl> omg indeed 04:05
<simon_sibl> but why xD why does it require a comma ?
<simon_sibl> thank you !!
wayland76 I think it's something to do with docs.raku.org/language/list#Flatte...context%22 .
04:07 Sgeo left 04:08 Sgeo joined
wayland76 Maybe not -- I'm still looking. 04:08
My mistake -- I was inspired by the part of docs.raku.org/language/list -- the first code block. 04:10
Maybe someone who knows more will chime in.
04:42 Sgeo left 04:43 Sgeo joined 04:50 Sgeo left 04:52 Sgeo joined 04:54 rmv joined 04:58 rmv left 05:06 Sgeo left 05:07 Sgeo joined 05:33 vasko4535586 left 05:39 vasko4535586 joined 06:18 Sgeo left 06:19 Sgeo joined 06:30 Sgeo left, Sgeo joined 06:34 Sgeo left
disbot4 <simon_sibl> if in a whenever block I put a await Promise.in(5), during those 5 seconds will other whenever block be ran or it will just block everything for 5 seconds ? since I read that only 1 whenever block can run at a time 06:47
lizmat it will block 06:48
disbot4 <simon_sibl> hmmmm
<simon_sibl> not sure whats the right/easy way to have a whenever Supply.Interval but with a dynamic interval..
<simon_sibl> (the interval is a variable that changes over time basically)
lizmat my $time = 1; my $interval = Promise.in($time); react { whenever $interval { $interval = Promise.in($time * 2 } } } 06:51
off the top of my head
$time *= 2 06:52
disbot4 <simon_sibl> wait to be very sure, is there a reasy to do $time*2 ? 06:54
<simon_sibl> why cannot reuse $time ?
lizmat sure, I just used *= 2 because you wanted it to be variable
disbot4 <simon_sibl> ah okok, all good then xD thanks !!
lizmat and doubling timeout is a common idiom 06:55
disbot4 <simon_sibl> but I am still a bit confused, if I do whenever Supply.interval($var) it wont work, but if I give whenever $interval it works ? why in the first case it doesnt eval again the whenever but in the second case it does ? 06:56
lizmat if I remember react / whenever internals correctly, it is just syntactic sugar for setting up a call to an internal WHENEVER subroutine that takes code blocks (the whenever blocks) 06:59
hmmm... sorry, I got up at 5am to open all windows to cool everything a bit down, as it's going to be at least 38 degrees here today 07:02
disbot4 <simon_sibl> I believe my brain is too tired to understand this statement now xD
07:03 abraxxa joined
disbot4 <simon_sibl> ouch good luck ! enjoying the AC at the office now 07:03
lizmat I'm probably to sleepy now to be coherent...
*too
disbot4 <simon_sibl> helped me a lot already ! I can get the peers from the tracker and respect the timeout xD
wayland76 lizmat: Good idea (with the windows, though we usually do it the night before). As an Australian my advice is also: a) shut all blinds on the sunny sides, and b) a damp washcloth on the forehead (or neck, or back) and a fan blowing on the washcloth can go a long way. HTH, 07:06
lizmat thanks... we have blinds, and almost all have gone down by now :-) 07:07
32.1 at 9am 07:09
07:20 rmv joined, rmv left, rmv joined 07:25 rmv left
disbot4 <librasteve> crag "32.1ºC in 'ºF'" #89.78°F 08:25
apogee_ntv AC is cranked all the way down. Heat is dispersing. 08:33
Power bill will not be pleasant.
disbot4 <librasteve> its 27ºC now in SE England heading to 32ºC max - and humidity is 67% (down from 85% and 36ºC on Weds) ... imo humidity is the killer ... saving £££ on holidays in Spain 08:37
apogee_ntv 26 here heading to 33 (Midlands) 08:38
I live on a narrowboat so humidity is definitely the killer
disbot4 <librasteve> on t'cut
apogee_ntv Parked in a Marina for the heat wave just to run the air con 08:39
But yes usually :D
Been topping up like £12 a day in electric... 08:40
I am used to a lifestyle where everything runs on my solar array lol, usually only do marina in winter to avoid getting frozen in place in the middle of nowhere 08:41
And because solar in winter in the UK gives you basically nothing 08:42
Weeks like this I miss winter :D 08:51
disbot4 <librasteve> it'll be back when the gulf stream shuts down 08:52
librasteve_ on the racket vs raku discussion, I am still a bit vague about the differences / similarities, so I thought I would try making the invoice DSL example play.slangify.org/266cc36037e8c54f...8843ab786f in Racket 09:16
www.irccloud.com/pastebin/IY0Z8pcR
did the same in Rhombus also 09:18
www.irccloud.com/pastebin/QmJXAyuB
even the Rhombus one looks too lispy ((()))) for my taste ;-) 09:36
it seems that Racket / Rhombus is a bit more structured than Raku when it comes to “I want to make a `#lang invoice_dsl` module (see chatgpt.com/s/t_6a3e476211488191be...06c3dc30d0 - warning LLM!!) … I sense a new post coming “how to package your Raku slang as a standalone compiler” 09:38
wayland: I am curious about your point that Raku slangs cannot reuse syntax from the main Raku Grammar … now that the RakuAST project has recast the rakudo front end as a Raku Grammar, my expectation is that you could fairly easily inherit chunks from that in your own custom Grammar? 09:41
patrickb librasteve_: Just so you are aware: The legacy compiler is also a raku grammar (i.e. written in raku using grammars). 09:44
disbot4 <librasteve> interesting - can you do something like this then:- 09:47
<librasteve> grammar Base { token TOP { <word>+ } token word { <[a..z]>+ } } grammar Extended is Base { token word { <[a..z]>+ | <[0..9]>+ } }
<librasteve> does Rainbow also have a Raku Grammar? is there an optimum way to actually use the Grammar such as use Base; in my example? 09:49
patrickb I know near to nothing about grammar extensibility and would delegate that question to someone else. 10:11
timo i'm also surprised why you said specifically the fact that slangs are roles means you can't reuse code from the existing grammar
patrickb Rainbow is also written using a ralu grammar.
timo if you just pretend a grammar is just a class and a regex/rule/token is just a method, you'll be very close to how it works and what you can do with it 10:12
wayland76 librasteve_: That's what I was hoping too, but when I tried to use <signature> in my grammar, it complained that it couldn't find it. I think it's because, if it was a grammar that inherited, it would inherit <signature>,and everything would work, but because it's the grammar equivalent of a role that then gets mixed into the live grammar, it can't reference the rules in the live grammar. 10:32
That was my experience, but I've been a pretty early adopter, so someone may've adjusted that.
timo when you put a slang in, i'm pretty sure it mixes in your role to the language at-the-time. if you can reproduce that issue still, that's either a bug or something wrong in the rest of your code 10:37
wayland76 timo: The first part of your statement is correct, but the problem is that it fails to parse it with references to <signature> before it even gets to that point. 10:45
timo interesting. early at compile time of the module you declared your slang role in? 10:46
m: role blergh { regex a { <signature> } }
camelia ( no output )
wayland76 timo: See the example at docs.raku.org/language/slangs#A_Slang_Example 10:47
timo right, I expected you'd be using Slangify 10:50
wayland76 timo: Yes, that's correct. But I've had a bit of a look, and that may've been corrected. 10:54
Which would be nice :) .
timo cool, maybe you posted the error in here and someone figured it out and committed a fix?
wayland76 Might just've been the price of being too early an adopter :) 10:55
Yeah, could be.
disbot4 <librasteve> aha - that example is just the missing piece I was looking for - I had missed the point that Slangify can override internal tokens (need to sharpen up my Slangify skills) 11:04
wayland76 librasteve_: I wrote that Slangs page because it was the piece I was missing :) . But the code is lizmat's. 11:08
11:18 rmv joined 11:23 rmv left 12:38 donaldh left 12:40 donaldh joined 13:20 rmv joined 13:22 donaldh left 13:23 abraxxa left 13:25 rmv left
[Coke] (5am) we got up at 5am here to turn the AC on because it was already miserable :) 13:41
14:07 hurufu joined 14:54 Sgeo joined
timo today it was already getting too hot to keep the windows open before 9am; 29 degC 15:02
15:12 Sgeo left 15:14 Sgeo joined 15:31 donaldh joined 15:35 Sgeo left 15:36 Sgeo joined 15:42 wayland joined, wayland76 left 15:46 human-blip left, Aedil left 15:48 human-blip joined 16:00 Sgeo left 16:01 Sgeo joined 16:12 Aedil joined 16:14 Sgeo left 16:17 Sgeo joined
Voldenet I've looked at the example I've posted earlier again and indeed, the second branch is wrong because it converts hash into list of pairs – [] is not even necessary 16:18
m: my %info = length => 42; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! [%(:path($name), :length(%info<length>) )]; say @files>>.<length>.sum; say @files.raku # broken
camelia Use of Nil in numeric context
42
[:path("default.txt"), :length(42)]
in block <unit> at <tmp> line 1
Voldenet m: my %info = length => 42; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! {:path($name), :length(%info<length>)},; say @files>>.<length>.sum; say @files.raku # note the , after {}
camelia 42
[{:length(42), :path("default.txt")},]
16:19 Sgeo left 16:21 Sgeo joined 16:25 Sgeo left, Sgeo joined 16:35 Sgeo left 16:38 Sgeo joined 16:47 Sgeo left
disbot4 <simon_sibl> finally its usable: github.com/4zv4l/rbt 16:48
<simon_sibl> although very barebone
<simon_sibl> much cleaner than the one I made in Golang few months ago
<simon_sibl> at least it allows me to download debian netinstall xD 16:50
16:52 Sgeo joined
disbot4 <librasteve> @simon_sibl ++ 17:05
<simon_sibl> It’s probably just me not getting the doc right, but not being able to see exception from start {} blocks made it quite hard to find why the peers got disconnected all the time xD 17:06
<simon_sibl> (For the Peers.work method) 17:07
timo if you don't `await` the promise from a `start { ... }`, you're not going to get the exception, yeah 17:08
you should almost always be awaiting your promises or otherwise reacting to their statuses 17:10
disbot4 <simon_sibl> I didn’t think of adding a whenever in the loop on which I start the peer workers, something I could try 17:26
<simon_sibl> In*
17:31 Sgeo left, Sgeo joined
Voldenet wow, impressive 17:32
17:32 hurufu left
timo ah you're in a supply or react block. yes, then "whenever" is probably the better choice 17:36
17:41 guifa_ joined
Voldenet actually Downloader already uses .then on .work 17:43
so it contains the cause
but the whole contraption of `supply { whenever { promise().then(…) }}` may make it quite hard to understand 17:45
also, having `start { }` inside whatever seems to be single-threaded code is such a waste 17:51
17:52 Sgeo left 17:54 Sgeo joined
guifa_ so ended up shifting focus for a talk @ TPRC. Instead of multicast (since I didn't have time to fully finish getting that implemented), going to talk about my new URI module 17:55
Voldenet m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download" }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) { whenever Peer.new(:me($_)).work { } } 18:04
camelia (2 c)
(3 c)
(1 c)
(4 c)
(5 c)
(1 download)
(2 download)
(3 download)
(4 download)
(1 end)
(5 download)
(2 end)
(3 end)
(4 end)
(5 end)
18:09 El_Che left
guifa_ although I'm slightly annoyed that there's another module called `URI` lol 18:18
18:19 Sgeo_ joined 18:20 Sgeo left 18:22 librasteve_ left
[Coke] theoretically that doesn't matter. 18:24
guifa_ theoretically 18:37
both the URI and URL modules work fine, but they're either don't implement all the standard strictly or implement far more than the standard. I'm aiming for an extensible strictly compliant module 18:38
FWIW: Ruth just announced TPRF currently has funds available for Raku community grants 18:39
Voldenet oh and continuing the above, to handle the errors in `work` QUIT can be used in the right place 18:42
m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download"; die "three" if $.me == 3 }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) { whenever Peer.new(:me($_)).work { } } # fails
camelia (1 c)
A react block:
in block <unit> at <tmp> line 1

Died because of the exception:
three
in block at <tmp> line 1

(3 c)
(4 c)
(2 c)
(5 c)
(1 download)
(2 download)
(3 download)
Voldenet erm 18:44
ah, right, it works right but stderr is misplaced ;p
timo yeah, camelia tends to mix stdout and stderr together 18:45
Voldenet m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download"; die "three" if $.me == 3 }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) -> $me { whenever Peer.new(:$me).work { QUIT { default { say "peer $me failed ", $_ } } } } # nesting supplies 18:46
camelia (1 c)
(2 c)
(3 c)
(4 c)
(5 c)
(1 download)
(2 download)
(3 download)
peer 3 failed three
in block at <tmp> line 1

(1 end)
(4 download)
(5 download)
(2 end)
(4 end)
(5 end)
Voldenet one peer dies, but other peers are alive
and the whole supply lives until any peer is up
the whole react, even 18:47
I'm not sure if info about QUIT in docs is sufficient, it's very terse 18:53
18:53 disbot4 left 18:54 disbot1 joined
Voldenet but it's crucial to use when writing loops with sub-loops 18:55
18:58 guifa_ left 19:10 Guest98 joined
Guest98 Hello, I am a long time lurker and has been a while I don’t check raku 19:11
I wonder how much it improved, did the rakuast landed?
I wonder if anyone knows what happened to a lad called Zoffix Znet? I cannot find any updated info on the net 19:13
does anyone also remember him? 19:14
did he switch to python like everyone else? 19:16
timo last I heard he was just doing stuff other than raku, but that was already a while ago. I do remember, and miss him
19:21 Guest98 left
timo but yes, RakuAST has mostly landed. the team's been busy ironing out bugs that show up when running the ecosystem modules' tests with a rakudo that's compiled itself with rakuast and then also the module and tests with rakuast 19:23
patrickb I'd like to build a CLI where I have a fixed set of options first, then a positional followed by arbitrary further args. (debugger args: e.g. "--suspend script.raku some args for that --script") 20:12
There is little chance to do this with MAIN, right?
Will Get opt::Long help? 20:13
It seems getopt::long will not help. Possibly ARGS-TO-CAPTURE can do the trick... 20:21
20:22 guifa_ joined
guifa_ Zoffix does pop around once in a blue moon, I think he submitted a PR a few months ago iirc 20:22
timo i think there's an option you can set for the MAIN feature 20:30
hm, actually, maybe not
you want something like "--", right? 20:31
patrickb Yeah. The tricky bit is to make the first positional be a separator. Known associatives ("--bla") before, anything after. 20:34
Args-to-capture might really do the trick.
20:46 guifa_ left
lizmat note that you can pre-process @*ARGS in any way, shape or form you want :-) 20:51
m: @*ARGS = "foo"; sub MAIN($a) { dd $a } 20:52
camelia "foo"
21:18 MasterDuke joined 21:21 guifa_ joined 22:08 MasterDuke left 22:14 guifa_ left 22:48 guifa_ joined 22:52 guifa_ left