🦋 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:02 buildable6 left, buildable6 joined 00:08 kjp left 00:10 kjp joined 00:15 Manifest0 left 00:27 buildable6 left 00:29 buildable6 joined
MasterDuke xinming: that's from dyncall, but moarvm includes it in its 3rdparty section. you could try `--has-dyncall` to use your system dyncall (assuming you have a dyncall package installed). or `--has-libffi` instead of dyncall 01:12
01:29 buildable6 left 01:32 buildable6 joined
xinming MasterDuke: thanks, with --moar-option='--has-libffi' solves the issue 01:42
It's quite strange, It works pretty fine 3 months ago
But never mind, probably system upgraded
MasterDuke cool 01:43
01:44 leah2 left 01:57 hythm joined 02:00 MasterDuke left 02:32 buildable6 left 02:33 buildable6 joined 03:33 buildable6 left 03:36 buildable6 joined 03:44 leah2 joined 03:48 Xliff joined
Xliff \o 03:48
tellable6 2023-10-23T22:35:29Z #raku-dev <japhb> Xliff Are you still looking for Terminal::Widgets advice? That was ~3 weeks ago I think.
Xliff .tell japhb Yup! Still interested.
tellable6 Xliff, I'll pass your message to japhb
Xliff How can I conditionally define a constant with a check to see if it already exists? 03:49
04:03 hythm left
Xliff m: package X { constant XEEE = 1 }; constant EEE = ::("X::EEE") ?? ::("X::EEE") !! 2; EEE.say 04:08
camelia 2
Xliff ^^ That's the best I can come up with. Is there a more idiomatic way?
Especially if the constant has already been exported?
04:36 buildable6 left 04:39 buildable6 joined
xinming For now, If we want to use raku to communicate with Serial port, What is the best way to do so? use modules from Inline::Perl5 ? Or some other better ways? 05:03
05:05 itaipu left 05:08 dbonnafo joined 05:18 itaipu joined 05:39 buildable6 left 05:42 buildable6 joined 05:56 abraxxa joined 05:59 dbonnafo left
tea3po Xliff, that didn't even work 06:24
Xliff tea3po: It didn't? 06:33
How did you use it?
tea3po weren't you expecting it to return 1? 06:34
Xliff No.
m: package X { constant EEE = 1 }; constant EEE = ::("X::EEE") ?? ::("X::EEE") !! 2; EEE.say
camelia 1
Xliff m: package X { constant XEEE = 1 }; constant EEE = ::("X::EEE") ?? ::("X::EEE") !! 2; EEE.say
camelia 2
Xliff Works just fine.
tea3po oh I misread it
carry on, sorry
Xliff Better than the RakuAST implementation I tried, too!
That one looked like this: 06:35
m: use MONKEY-SEE-NO-EVAL; use experimental :rakuast; constant EEE = 1; unless ::("EEE") { my \ast = RakuAST::VarDeclaration::Constant.new(name => "EEE", initializer => RakuAST::Initializer::Assign.new( RakuAST::IntLiteral.new(2) )); ast.DEPARSE.say; EVAL(ast); }; ::("EEE").say
camelia 1
Xliff m: use MONKEY-SEE-NO-EVAL; use experimental :rakuast; constant XEEE = 1; unless ::("EEE") { my \ast = RakuAST::VarDeclaration::Constant.new(name => "EEE", initializer => RakuAST::Initializer::Assign.new( RakuAST::IntLiteral.new(2) )); ast.DEPARSE.say; EVAL(ast); }; ::("EEE").say
camelia constant EEE = 2
2
tea3po lol 06:37
06:42 buildable6 left 06:45 buildable6 joined 06:49 buildable6 left, buildable6 joined 06:54 buildable6 left, buildable6 joined 06:58 buildable6 left, buildable6 joined 07:02 lichtkind joined 07:23 discord-raku-bot left 07:25 discord-raku-bot joined 07:40 simcop2387 left, perlbot left 07:45 buildable6 left 07:46 perlbot joined, simcop2387 joined 07:47 buildable6 joined 07:52 dakkar joined, Manifest0 joined 07:53 dakkar left 07:54 dakkar joined 07:59 abraxxa left 08:12 abraxxa joined 08:26 sena_kun joined 08:34 Sgeo left 08:35 jpn joined 08:47 buildable6 left 08:49 buildable6 joined 08:59 buildable6 left, buildable6 joined
ab5tract_ Xliff: for historical reasons, `.EVAL` does not require the pragma. Saves a lot of typing. 09:14
09:15 sena_kun left
nemokosch It's not clear whether this is intended or it was just easier to do 09:17
ab5tract_ No, it was likely an unintentional thing.
But code ended up using it. 09:18
nemokosch I probably brought this up earlier but couldn't the relevant types simply not have an EVAL method and the pragma would mix it in?
ab5tract_ That would probably work fine for 99% of cases. Any children of such a class would not get the mix in, though, because parent classes don’t know about their children. 09:20
That said, in my mind, what you propose is still a workable solution 09:21
nemokosch That sounds strange because method resolution is a runtime thing; it's the child that should know about the parent
ab5tract_ All I know is the rule: Augmenting a parent class doesn’t affect child classes 09:23
Not so familiar with the ins and outs of why, or whether we can fix this situation post-RakuAST 09:24
nemokosch Fair 09:25
But after the Range "fiasco", I don't really feel like proposing anything in the spirit of "let's make it consistent" 09:26
ab5tract_ I’d like to chainsaw the pragma down to `use EVAL;` and address the gap in coverage for 6.e though
nemokosch I honestly think there are much more potential users out there who would agree with these things but it's not realistic to go against the existing users who seem to actively cherish inconsistencies 09:29
lizmat
.oO( experience lies in the field of failed PRs )
09:49 buildable6 left 09:53 buildable6 joined
ab5tract_ Xliff: was there something wrong with the RakuAST implementations you shared? It seemed that they were behaving as expected to me. 10:10
10:53 buildable6 left, buildable6 joined 11:16 dpk left 11:17 dpk joined 11:24 dpk left, dpk joined 11:42 teatwo joined 11:45 tea3po left 11:53 buildable6 left 11:57 buildable6 joined 12:30 jpn left 12:57 buildable6 left 13:00 buildable6 joined 13:01 jpn joined 13:20 jrjsmrtn left 13:21 jrjsmrtn joined 13:26 abraxxa left
tbrowder__ .ask xinming can you please post results here of running $*DISTRO.name and $*DISTRO.version on your system? i'm curious about the response on other linux systems 13:34
tellable6 tbrowder__, I'll pass your message to xinming
13:37 teatwo left 13:38 teatwo joined
tbrowder__ m: say $*DISTRO.name; say $*DISTRO.version 13:42
camelia opensuse-leap
v15.4
tbrowder__ thnx camelia 13:43
13:51 Manifest0 left 13:52 Manifest0 joined 14:00 buildable6 left
[Coke] mswin32 v10.0.19042.746 14:01
14:02 merp joined, buildable6 joined
[Coke] also: macos v13.4 14:02
... neither of which is linux, sorry. 14:03
m: say "\x2665" 14:15
camelia
[Coke] yay, my unicode is working again 14:16
14:57 erik`` joined 15:02 buildable6 left 15:05 buildable6 joined 15:16 jpn left
tbrowder__ [Coke]: thnx 15:19
collecting data for my newly published module QueryOS 15:20
15:20 jpn joined
dakkar mine says `gentoo` and `v6.1.12.gentoo.x.86._.64` 15:20
(uname says `6.1.12-gentoo-x86_64`) 15:21
tbrowder__ thnx 15:23
dakkar weirdly, $*DISTRO.version is 2.14
no idea where it's taking that from
tbrowder__ well the rakudo code i peeked at said something about best guessed ;-) 15:24
*guesses 15:25
see $*ENVIRONMENT
m: say $*ENVIRONMENT 15:26
camelia Dynamic variable $*ENVIRONMENT not found
in block <unit> at <tmp> line 1
tbrowder__ m: say %ENV 15:27
camelia ===SORRY!=== Error while compiling <tmp>
Variable '%ENV' is not declared. Perhaps you forgot a 'sub' if this
was intended to be part of a signature?
at <tmp>:1
------> say ⏏%ENV
tbrowder__ back to drawing board 15:28
m: say %*ENV 15:29
camelia {HOME => /home/camelia, INVOCATION_ID => 83887c24b8444e9d88405c31503a95e1, JOURNAL_STREAM => 8:14271, LC_CTYPE => en_US.UTF-8, LOGNAME => camelia, ME => tbrowder__, PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin, PERL5LIB => /hom…
tbrowder__ m: uname -v 15:31
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routines:
uname used at line 1. Did you mean 'rename'?
v used at line 1
tonyo . 15:32
tbrowder__ m: uname
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
uname used at line 1. Did you mean 'rename'?
tonyo m: $*DIST.say;
camelia Dynamic variable $*DIST not found
in block <unit> at <tmp> line 1
tonyo m: dd $*OS;
camelia Failure.new(exception => X::Dynamic::NotFound.new(name => "\$*OS"), backtrace => Backtrace.new)
tonyo now you have me doing it tbrowder__
tbrowder__ :)
tonyo m; dd $*DISTRO; 15:33
m: dd $*DISTRO;
camelia Distro opensuse-leap = Distro.new(release => "15.4", path-sep => ":", name => "opensuse-leap", auth => "www.opensuse.org/", version => v15.4, signature => Blob, desc => "openSUSE Leap 15.4")
tbrowder__ m: say $*DISTRO
camelia opensuse-leap (15.4)
tonyo but i'm not using opensuse
jast this is cute: arch v3.10.0.957.1.3.el.7.x.86._.64 15:34
tonyo m: say qx`uname`
camelia Linux
tbrowder__ that’s the only one i’m using DISTRO
tonyo m: say qx`uname -a`
camelia Linux camelia 5.14.21-150400.24.55-default #1 SMP PREEMPT_DYNAMIC Mon Mar 27 15:25:48 UTC 2023 (cc75cf8) x86_64 x86_64 x86_64 GNU/Linux
tbrowder__ ah, cool 15:35
tonyo that'll be tricky to handle on windows
tbrowder__ mebbe that’s where rakudo gets some info 15:36
Xliff ab5tract_: Not really, but its a bit LTA that RakuAST::VarDeclaration::Constant does not allow for immediate use of the symbol. 15:56
Thanks for the .EVAL tip, BTW
[Coke] I have a sw_vers.bat on windows that gets me something similar: 15:57
systeminfo | findstr /B /C:"OS Name" /C:"OS version" 15:58
and then that outputs basically the same info as teh DIStRO vars but more verbose. 15:59
(systeminfo is 91 lines of output here) 16:00
tonyo not well divisible by three
ugexe raku ultimately uses libuv to get uname like information, which can be seen by the nqp function: 16:03
m: use nqp; dd nqp::uname()
camelia BOOTStrArray("Linux", "5.14.21-150400.24.55-default", "#1 SMP PREEMPT_DYNAMIC Mon Mar 27 15:25:48 UTC 2023 (cc75cf8)", "x86_64")
[Coke] m: (1..*).grep(*.is-prime).grep(* %% 3)[^1].say
camelia (3)
[Coke] ugexe++ that also works on windows. 16:04
ugexe yeah, you shouldn't have to call nqp::uname though
that data should be available in $*DISTRO or $*KERNEL or something
16:06 buildable6 left
ugexe m: say $*KERNEL.version; say $*KERNEL.hardware; say $*KERNEL.release; 16:06
camelia v1.SMP.PREEMPT_DYNAMIC.Mon.Mar.27.15.25.48.UTC.2023.cc.75.cf.8
x86_64
5.14.21-150400.24.55-default
ugexe m: say $*KERNEL.name 16:07
camelia linux
16:08 buildable6 joined
ugexe those would be the public interfaces to nqp::uname 16:08
lizmat m: say Kernel.version; say Kernel.hardware; say Kernel.release; 16:09
camelia Cannot look up attributes in a Kernel type object. Did you forget a '.new'?
in block <unit> at <tmp> line 1
lizmat hmm
ugexe it needs an instance because it caches data 16:13
lizmat ack 16:14
[Coke] That seems like something we shouldn't bother the user with. 16:18
tonyo which way? 16:20
ugexe the user should be using $*KERNEL so i dont see the problem 16:23
16:23 notna joined
ugexe if they want to use the Kernel class directly then they can just initialize it 16:24
dakkar wow, `Kernel linux = Kernel.new(release => Str, hardware => Str, arch => Str, bits => Int, name => "linux", auth => "unknown", version => Version, signature => Blob, desc => Str)` 16:25
impressive lack of details
ugexe maybe worth bothering the libuv repo about
also are you just outputting the .raku of a class? 16:27
because that isn't the same as calling the methods 16:28
m: say $*KERNEL.raku
camelia Kernel.new(release => Str, hardware => Str, arch => Str, bits => Int, name => "unknown", auth => "unknown", version => Version, signature => Blob, desc => Str)
dakkar aah!
calling the methods produces more details; still a bit weird 16:29
$*KERNEL.version → v2.SMP.PREEMPT_DYNAMIC.Sat.Feb.18.13.19.43.GMT.2023
$*KERNEL.arch → 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
ugexe why is that weird 16:30
dakkar I was expecting x86_64 for arch
and that "version"? .release says 6.1.12-gentoo-x86_64 so I was expecting 6.1.12 as version 16:31
but I may be expecting things wrong
ugexe are you just running uname and not e.g. uname -v, uname -m, etc?
tbrowder__ dakkar, to be clear, i'm only collecting existing data from $*DISTRO.name and $*DISTRO.version 16:32
ugexe github.com/rakudo/rakudo/blob/33a6...od#L93-L99
i agree that is kind of weird for arch
m: use nqp; dd nqp::uname(); # does this show x86?
camelia BOOTStrArray("Linux", "5.14.21-150400.24.55-default", "#1 SMP PREEMPT_DYNAMIC Mon Mar 27 15:25:48 UTC 2023 (cc75cf8)", "x86_64")
Xliff Are there YAML modules for Raku?
tbrowder__ and i'm collecting for any system using raku, including mac and windows and anything else it happens to run on 16:37
16:41 dakkar left
patrickb Xliff: There is YAMLish 16:42
[Coke] raku.land/?q=YAML&page=2 - one of the cases where "alpha order" is not as helpful 16:54
(there's another where an exact match is on like page 4). probably need exact, then initial, then remaining in alpha
16:58 dbonnafo joined
[Coke] raku.land/zef:ingy/YAMLScript looks like an absolute placeholder. :( 16:58
Xliff patrickb: Yeah, YAML is kinda heavy... how is YAMLish on loading multi dozen megabyte files?
[Coke] it has one method, run(), which just (say)s "YAMLScript coming to Raku soon"; (and it's a year old)
Xliff Currently using YAML::Parser::LibYAML which isn't TOO bad, but I eventually need to get that into a real RDBMS for performance reasons. 16:59
[Coke] no readme, no source... wonder if we want also a ranking system on raku.land.
jdv kwalitee is cool 17:02
17:06 dbonnafo left 17:07 xinming left 17:08 buildable6 left 17:09 xinming joined 17:10 buildable6 joined 17:14 buildable6 left, buildable6 joined 17:18 buildable6 left 17:19 buildable6 joined
tonyo ingy: ^^ 17:42
17:43 notna left
tonyo Xliff: i wrote that at PTS in 2018, it could most likely use a lot of love 17:43
[Coke]: zef eco has a kwalitee thing in the works, smoke the eco and a matrix of what rakudo/os/etc the tests pass on 17:44
jdv be cool if it wasnt eco specific
tonyo it could run against REA too, i'm sure it could against cpan but that gets sticky 17:45
jdv also gh, right?
tonyo yea REA is backed by GH, i thought anyway 17:46
jdv idk why sticky
i mean the og eco
tonyo oh, yea
first thing is the zef eco though. which is also getting better logging very shortly
jdv in any case, would be cool 17:47
was kwalitee a schwern thing or am i misremembering... 17:48
Xliff tonyo: No worries, mate. I just needed something that let C do the heaving IO and parse lifting for the YAML since the files are so large. It works just fine. If I run into anything, I'll send a PR if I'm able. 17:49
tonyo bless 17:50
Xliff In Javascript, when you see code adding something to a classes prototype like "Clutter.Actor.prototype.ease_property = function (propName, target, params) { ... }" 17:51
Is there a Raku equivalent?
jdv metaobj?
kinda:)
Xliff jdv: meaning?
.^add_method? 17:52
jdv i mean there isnt a direct equiv. class vs proto oo..
ugexe honestly it doesnt make sense to not make it ecosystem specific 17:55
jdv i dont recall a single eco being the original idea. 17:56
ugexe it isn't
jdv similar to moar and jvm, etc
ugexe the same reason REA isn't used as a primary ecosystem and it used as a backup ecosystem ony 17:57
the zef ecosystem can really only ensure stuff within its own ecosystem is what it says it is 17:58
and that stuff isn't changing from underneath it
Xliff jdv: Yeah... looks like .^add_method is the closest analog.
tonyo that's part of the reason cpan and gh get sticky ^ 17:59
ugexe for instance if you want to consume packages from both the zef ecosystem and the p6c ecosystem, you can't just consume REA and filter on auth = zef:
because I can still put arbitrary auths into REA 18:00
including zef:ugexe even if it isn't uploaded to the zef ecosystem
jdv how does that rule our kwaliteeing them all?
*out
ugexe because e.g. the zef ecosystem can't know what something from p6c is 18:01
jdv ok. i dont get why zef eco means kwalitee. 18:02
ugexe what are you gonna link to?
which version?
which commit?
jdv the time dimensioned thing
point in time...
ugexe can you search for a module by time dimension?
if not it isnt really useful 18:03
you cant for instance request Foo:timestamp<...>
jdv iirc you can on perl's kwalitee and cpantesters
ugexe on some web ui sure. but that is mostly useless without an identifier for whatever it is representing that e.g. zef or raku understands 18:04
jdv anyway, sure. just seems unfortunate.
18:08 sena_kun joined 18:10 buildable6 left 18:13 buildable6 joined
ugexe to clarify, a tool to generate some score doesn't need any ties to a specific ecosystem. but saving that data to show to users about distributions from non-secure ecosystems gets into all the same issues of using a git repository pointed at HEAD does 18:14
19:03 dbonnafo joined 19:08 dbonnafo left 19:14 buildable6 left 19:17 buildable6 joined 19:52 jpn left
jdv i get how p6c has unfixable issues but cpan was used as a foil for fez. 19:52
19:59 jpn joined 20:06 lichtkind left 20:07 jpn left
[Coke] anyone know if you can attach to a macos process that isn't responding and get crash info? 20:08
20:17 buildable6 left 20:20 buildable6 joined
ugexe the problem with cpan is it is just cpan and not pause 20:21
like there is no enforcement of namespace. i can do all the same p6c tricks on cpan raku distributions 20:22
cpan did help to transition off of just pointing at HEAD of git repos 20:23
20:24 buildable6 left, buildable6 joined 20:25 jpn joined 20:29 jpn left 20:47 jpn joined
jdv cpan doesnt exist sans pause. it could have been fixed just fine. 21:03
i get fez is "better" but the foiling was not necessary.
nemokosch what does foiling mean? 21:04
tonyo jdv: maybe it could've been fixed. cpan has other issues like a dist names not being indexed by auth, the packages also have no quality control around meta data or mechanism to remove bad fruit from the tree 21:20
21:21 buildable6 left
tonyo jdv: maybe it could've been fixed. cpan has other issues like a dist names not being indexed by auth, the packages also have no quality control around meta data or mechanism to remove bad fruit from the tree 21:21
oops - sorry for the spam, iwd is being wonky
21:23 buildable6 joined, jpn left
jdv it couldve been fixed. its fine:) i just dont like the onesidedness... 21:31
its just concerning
21:32 lichtkind joined
nemokosch to each their own concerns haha 21:32
jdv perhaps;) 21:33
vendethiel [Coke]: yamlscript is a wip, but it’s being worked on 21:40
Xliff Can someone help me translate this javascript construct to Raku: "const [transition] = transitions;" 21:44
Oh, ffs... it's .head 21:46
ugexe m: my @a = 1,2,3; my ($b) = @a; say $b
camelia 1
ugexe you can destructure it similarly
22:00 lichtkind left
nemokosch what did the parens achieve? 22:16
I mean, judging by the looks, they turned the item assignment into list assignment
yet another one-off behavior to memorise
22:23 buildable6 left
tonyo similar to the syntax in js: let [i1, i2, i3] = [1,2,3] 22:25
22:26 buildable6 joined
nemokosch Except in JS [i1] is really an array while in Raku the parens would achieve nothing besides grouping 22:48
22:52 sena_kun left
tonyo the parens aren't a grouping, they're extracting the value at the index from the array, effectively the same in the given example 22:53
nemokosch the point is exactly that this is a one-off behavior, inconsistent with the usual meaning of a bare pair of parens in Raku 22:55
23:05 dbonnafo joined 23:09 dbonnafo left 23:11 Sgeo joined, merp left 23:27 buildable6 left 23:30 buildable6 joined 23:35 buildable6 left, buildable6 joined
ugexe not really 23:38
m: sub foo(*@ ($x, *@)) { say $x }; foo(4,5,6)
camelia 4
23:41 teatwo left 23:42 teatwo joined, Manifest0 left 23:43 tea3po joined
ugexe m: my (:@a, :@b) := (1..10).categorize({ $_ < 5 ?? "a" !! "b" }); say @b 23:44
camelia [5 6 7 8 9 10]
ugexe for stuff like there is also precedence related to := 23:45
my :@a, :@b := ... would be like my :@a, (:@b := ...)
seeing as how destructuring is consistent across these different expression I don't see how it is a one off 23:46
23:47 teatwo left
nemokosch It's tricky because you used an expression that contains a comma 23:48
However, $a as a value is outright equivalent with ($a)
23:53 merp joined