šŸ¦‹ 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.
00:04 jpn joined 00:09 jpn left 00:59 jpn joined 01:04 jpn left 01:12 hulk joined, MasterDuke left 01:13 kylese left 01:22 MasterDuke joined 01:29 nine left 01:30 nine joined 01:53 jpn joined 01:58 jpn left 02:04 jmcgnh left 02:07 jmcgnh joined 02:15 hulk left, kylese joined 02:45 guifa left 02:49 jpn joined 02:54 jpn left
antononcube I submitted a new package with fez a few hours ago, and I still do not see in raku.land or 360.pm. 03:11
03:19 gdown joined 03:28 defaultxr left 03:29 defaultxr joined, gabiruh left 03:43 gabiruh joined 03:45 jpn joined 03:50 jpn left 04:41 jpn joined 04:46 jpn left 05:09 jpn joined 05:14 jpn left 05:30 Sgeo left 05:36 gdown left 05:56 CIAvash joined 05:57 jpn joined 06:02 jpn left 06:50 kjp left 06:51 kjp joined 06:52 jpn joined 07:01 kjp left, kjp joined 07:02 kjp left 07:03 kjp joined
librasteve @antononcube - i normally go zef update & zef install My::Package to double check arrival that works right away - it's the raku.land website that takes a while to reindex the fez repo iirc 07:09
08:05 dawids joined 08:07 dawids left 08:12 dakkar joined 08:54 jpn left 08:55 wayland joined, wayland76 left 09:04 jpn joined
Geth Ā¦ problem-solving: jubilatious1 assigned to codesections Issue Feature Request: recognize "doubled" Unicode characters in Raku ternary operator (question mark and exclamation point). github.com/Raku/problem-solving/issues/433 09:41
Ā¦ problem-solving: lizmat unassigned from codesections Issue Feature Request: recognize "doubled" Unicode characters in Raku ternary operator (question mark and exclamation point). github.com/Raku/problem-solving/issues/433 09:52
10:15 CIAvash left 10:28 vrurg left 10:31 vrurg joined
librasteve o/ ... 10:46
m: say "1\t2"
evalable6 1ā‰2
Raku eval 1 2
librasteve m: say "1 2" 10:47
Raku eval 1 2
evalable6 1 2
librasteve wonders how to set spaces output by \t - on my machine its 8 spaces ;-(
(or maybe I have to explicitly set spaces since this is a property of the users terminal??) 10:48
lizmat yeah, tabs are fun 10:50
FSVO fun :-)
wayland Is there some automatic way to do smart matching on hash keys like maybe -- %hash{~~/^a/} -- for all keys that start with "a"? Or do we have to use map? 11:30
lizmat maybe raku.land/zef:lizmat/Map::Match is a thing for you? 11:33
librasteve wayland: you can have a slice (ie a list of keys) as the index - and that can be provided by a block (may need two levels of curlies will need to check) 11:34
or maybe lizmat already wrote that ! 11:35
lizmat well, for an immutable Map... mutable Hashes are something else
11:38 jpn left
wayland Oh, nice! Thanks to both of you. Now all I need is to be able to go %m<//a>, and it recurses down the tree finding everything with the name "a" :) (like XPath) 11:39
lizmat wayland: perhaps unexpected, but you can probably use raku.land/zef:tony-o/JSON::Path for that 11:41
because it works on hashes (aka what "from-json" produces 11:42
wayland Oh, very nice!
lizmat it's exposed in App::Rak as jp:... 11:43
wayland Sometime in the next couple of years, we're going to need some kind of documentation that says something like "If you're working with hashes (or whatever), then here's a quick writeup of each of the modules you could use.
lizmat would be nice for a blog post now :-) 11:44
wayland That'd be a good starting point, but it'd get buried over time I think. Or maybe not.
.tell antononcube Question: does github.com/antononcube/Raku-DSL-En...yWorkflows work for insert/update as well, or just querying? 12:00
tellable6 wayland, I'll pass your message to antononcube
12:06 jpn joined
kylese Greetings. I have 'my-sub A.new.value("Ava");'. The .value method is a combined accessor (getter + setter) always re-setting/returning a string, but not always used directly. The subroutine 'my-sub' is supposed to handle only types of classes A/B/Cā€¦. I'm looking for a way to pass the resulting instance of A itself. Like, 'my $a = A.new.value("Ava"); my-sub $a;'. (In this specific case, creating two instances like 'my-sub A.new(A.new.value("Ava")); 12:23
' would also actually work.) Is there any sub/method - maybe similar to .^raku , .^HOW , .^mro etc. - to get the instance of A more directly.. "in a one-liner"? Thx.
lizmat self ? 12:26
12:27 jpn left
kylese lizmat, I tried 'A.new.value("Ava").self' does not work.. 12:31
lizmat aha.. ok. question:what does .value return *exactly* ? 12:32
kylese lizmat, always a string value. In this case "Ava" (by default "none"). 12:34
lizmat then there's no way to get back to the A instance
kylese lizmat, I guess I always need two statements?? 12:35
12:35 jpn joined
kylese lizmat, ..at least.. 12:36
12:37 lain` left, lain` joined 12:39 lain` left, lain` joined
lizmat well, I guess you could try to mixin a method returning the instantiated A into the string 12:41
but it feels we need more info on what you're trying to achieve to give a good advice 12:42
kylese lizmat, yeap, you're right. (However, not intended.;) 12:43
12:46 jpn_ joined 12:47 jpn left
librasteve ab5stract: github.com/librasteve/raku-HTMX/bl.../README.md ... think like I have injected all my initial thoughts into this MVP attempt --- over to you and others now to take a look and feedback / contribute --- the big hole at the moment is the lack of any server side support - which maybe we need Hummingbird or Cro setup for 12:48
(was fun to hack on this so far)
12:50 jpn_ left 13:01 patrickb left, atweedie left, clarkema left, greenfork left, clarkema joined, atweedie joined, greenfork joined 13:02 patrickb joined 13:10 abraxxa-home joined 13:13 MasterDuke left, lain` left 13:16 lain` joined 13:21 lain` left, lain` joined 13:22 jpn joined 13:27 vrurg_ joined 13:29 vrurg left 13:32 abraxxa-home left 13:42 CIAvash joined 13:49 jpn left
[Coke] anyone using the MongoDB module? 14:01
14:08 jpn joined 14:09 Guest69 joined 14:11 lain` left
kylese lizmat, just FYI: I think I got you wrong. Sorry for that. You nailed from the beginning. I guess 'self' should work for proper implementations. According to .HOW I have a situation where: class A == A.new == A.new(x=>"ā€¦") == A.new("ā€¦") != A.new.value("ā€¦") (That was very unexpected.) But, for today I'm done. Thx, again. 14:13
14:13 guest20240723 joined
guest20240723 I'm currently reading docs.raku.org/language/concurrency , and while I appreciate the treatise, I was wondering if there are examples that (say) show for one thread to push something on to an array, and for another thread to pop things off the same array. 14:16
antononcube @Coke I am not, but considered using it after playing with "Marrow".
tellable6 2024-07-23T12:00:43Z #raku <wayland> antononcube Question: does github.com/antononcube/Raku-DSL-En...yWorkflows work for insert/update as well, or just querying?
guest20240723 I don't have much experience with concurrency / threading, so, if the process I've described for (say) an array doesn't meld well with things, please let me know. 14:17
I'm trying to have one thread "collect data" from somewhere, and another thread "process it", and I assumed that forming some sort of queue (using arrays) would be a way to approach the problem.
lizmat you'd want a Channel for that: docs.raku.org/type/Channel 14:18
guest20240723 lizmat thanks.Ā  Reading.
14:18 Guest69 left
lizmat arrays are non-thread safe 14:19
14:21 vrurg joined 14:24 vrurg_ left
antononcube New module "Math::SpecialFunctions". I took the implementations from here-and-there. (RosettaCode, LLMs, Andrew Shitov's posts.) That package is too small to feature it separately in a post or video, so I am proclaiming its existence here. 14:28
At some point Raku has to have a fuller support of special functions. I would say, at least the ones in Python's "SciPy". 14:29
14:30 CIAvash left
As usual for these kind of computational packages, extensive unit tests are very important. (I almost inclined to say that that is the harder part.) 14:32
14:48 jpn left
[Coke] antononcube - in core, or module OK? 15:02
antononcube @Coke Speaking of special functions? If yes, definitely first in a module. For example, the Gamma-function implementation I put in is precise enough, but not that precise. (Although, it passes the precision tests for known values of Gamma.) It would be nice to compute to arbitary precision, like, say the Bernounlli-B numbers. But might require are fair amount of other algorithms to be in place. 15:07
The rest of the functions that are currently in "Math::SpecialFunctions" -- factorial, binomial, and bernoulli-b -- are computed at arbitrary precision with FatRats. 15:09
[Coke] Our usage of DivideByZero is inconsistent. We have 3 bits of data on the X: using, numerator, details. We are inconsistent about if we set any of them, and using/numerator seems to be a more commonly used, more specific pair, while "details" is used less often but contains the same details as "using". 15:16
lizmat: Should we have a more consistent usage? I'd say we should get rid of details, and make the other two required. - is this something we'd have to do in a new language version? (probably?)
antononcube šŸ¤” 15:18
lizmat [Coke]: more generally, especially in light of localization, we need to get rid of "die" :-) 15:27
15:29 CIAvash joined 16:00 skyesoss1 joined
lizmat [Coke] but yeah, it feels like a language version thing 16:03
[Coke] ok; want a problem solving ticket? 16:11
lizmat guess so :-) if we don't have one already? 16:12
[Coke] I found it while writing docs, didn't check repo yet
Thanks.
16:14 jpn joined
[Coke] github.com/Raku/problem-solving/issues/434 16:20
guest20240723 Is there an equivalent to "perldoc" ?Ā  I have rakudo 2022.02-01 installed on Ubuntu. 16:34
antononcube @guest20240723 Yes, see "Pod6" and "RakuDoc". But I strongly encourage you to use (much) more recent rakudo version. 16:35
16:36 soverysour joined 16:38 CIAvash left
guest20240723 antononcube , thanks.Ā  When I get further in my journey, I will be looking at the more recent versions.Ā  I'm trying to use threading as a justification to invest more in raku; but I want to get the basics worked out before I get to (say) operationalizing the entire thing. 16:38
[Coke] there is a command line at github.com/raku/rakudoc but you have to jump through a hoop to read the core docs with it
The best way to read the docs right now is docs.raku.org/ 16:39
antononcube Well, more recent versions for rakudo would make your investment decision more informed.
guest20240723 I have a bunch of things that would benefit from concurrency.Ā  And I will stick with reading recent documents / tutorials on (say) docs.raku.org .Ā  Specifically, there's an example here: docs.raku.org/language/concurrency , that has this text above it "It is also possible to obtain a Channel from a Supply" .Ā  The example has 16:46
```sleep $r;``` , and when I run it on my machine, it appears that the "sleep $r" is not making the program wait $r number of seconds.
16:46 dakkar left
guest20240723 I wanted to "perldoc -f sleep" (or whatever the equivalent is) to see what the documentation for the current installed version was. 16:47
OH.Ā  I think I see what's happening 16:49
await is spawning multiple threads that are all waiting for different amounts of time
err, the code is spawning multiple threads. 16:50
antononcube @guest20240723 Does this manifest in the most recent versions of rakudo? 16:51
guest20240723 I misunderstood the code.
[Coke] from a docs standpoint, if you're coming from perl, there is docs.raku.org/language/5to6-perlfunc#sleep, and also docs.raku.org/type/Date#sub_sleep 16:58
(for future ref, sounds like you figured this one out!) 16:59
guest20240723 thanks 17:04
xinming releasable6: status 17:22
releasable6 xinming, Next release in ā‰ˆ2 days and ā‰ˆ1 hour. There are no known blockers. Changelog for this release was not started yet
xinming, Details: gist.github.com/89fafe393c614de888...0f4f233f11
lizmat clickbaits rakudoweekly.blog/2024/07/22/2024-...e-toolbox/ 17:45
17:46 soverysour left 18:07 soverysour joined
soverysour hey, what's the go-to authoring tool for raku? Mi6 18:08
or maybe another
antononcube Commaide 18:23
I mean, Commaide is another option.
18:23 soverysour left, CIAvash joined
[Coke] module authoring? many of us including liz use Mi6 18:51
19:07 sena_kun joined 19:09 CIAvash left 19:10 jgaz joined 19:11 jgaz left 19:12 jgaz joined
antononcube ...and vi. 19:14
[Coke] I think we have a variety of editors, but yes, a lot of us old timers use vi. :P 19:16
en.wikipedia.org/wiki/Michigan_Terminal_System - what I learned vi on. :P
(ooh, and my school is listed in the wikipedia page) 19:17
antononcube Aha, pretty much both a correlation and causation, and deja vu all over again.
19:26 vrurg_ joined 19:29 vrurg left 19:43 vrurg joined 19:46 vrurg_ left
[Coke] m: say (1+2i).Int; 19:54
camelia Cannot convert 1+2i to Int: imaginary part not zero
in block <unit> at <tmp> line 1
[Coke] m: say (1+2i).Int; CATCH { default { put .^name }}
camelia X::Numeric::Real
[Coke] ... why is that throwing a ::Real and not the more generic CannotConvert? 19:55
... because Int is Real, which still surprises me after 20 years. :P 19:58
[Coke] wonders what is left for CannotConvert.
m: Inf.Int 19:59
camelia Cannot convert Inf to Int
in block <unit> at <tmp> line 1
[Coke] (that one)
Why is that a CannotConvert and not a Real?
20:00 soverysour joined, soverysour left, soverysour joined
[Coke] Looks like someone maybe decided to make an alias for CC and then didn't convert all the usages. 20:00
20:09 jpn left 20:13 soverysour left
librasteve soverysour: for module authoring, App::Mi6 is indeed the go-to tool, for writing via an IDE then Commaide 20:38
tellable6 librasteve, I'll pass your message to soverysour
20:44 vrurg_ joined 20:46 vrurg left 20:50 sena_kun left
_grenzo @librasteve does fez work ok? 20:58
21:01 Maylay left
librasteve fez works well for me 21:01
21:04 Maylay joined 21:09 guifa joined
[Coke] fez++ 21:17
21:19 jpn joined 21:24 jpn left 21:37 jgaz left 22:24 guifa left 22:27 skyesoss1 left 22:43 Sgeo joined 23:04 wayland left, jpn joined 23:06 guifa joined 23:09 jpn left 23:19 MasterDuke joined