🦋 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:09 vlad joined 00:48 vlad left
japhb Anyone doing terminal work: More terminal design language examples very much welcome in github.com/japhb/Terminal-Widgets/issues/8 00:56
I'm trying to figure out the approximate direction to aim in while I'm throwing functionality into Terminal::Widgets. 01:02
01:02 teatime joined
japhb ... and if anyone is actually wanting to write TUI apps in the near future, that's where I'll aim. :-) 01:03
Xliff japhb: I'm actually at the point where my latest projects is planning on using TW
01:04 teatwo left
Xliff github.com/Xliff/raku-GLib-Top 01:04
Example usage: use GLib::Top::Server; .gist.say for GLib::Top.get_proclist( :io ).grep( *<rss> > 4e8 ) # Grab all processes with an RSS > 40,000,000 bytes 01:05
Example output:
(cstime => 13 cutime => 8 egid => 1000 euid => 1000 exe => /opt/google/chrome/chrome frequency => 100 fsgid => 0 fsuid => 0 gid => 1000 groups => NativeCall::Types::CArray[int32].new it_real_value => 0 mem-flags => 13 ngroups => 0 nice => 0 number => 1 pgrp => 3330 pid => 843671 ppid => 3330 priority => 20 proc-time-flags => 511 resident => 415633408 root => / rss => 415633408 rss_rlim => -1 rtime => 5716 session => 3330 sgid 01:06
=> 0 share => 270929920 size => 35188375552 start_time => 1712003394 stime => 1308 suid => 0 timeout => 0 tpgid => -1 tty => -1 uid => 1000 uid-flags => 65295 utime => 4408 vsize => 35188375552 wd-flags => 7 working-dirs => [NativeCall::Types::CArray[uint8].new] xcpu_stime => NativeCall::Types::CArray[uint64].new xcpu_utime => NativeCall::Types::CArray[uint64].new)
01:06 teatwo joined 01:07 teatime left
japhb Xliff: Nice set of details. What do you want the UI/UX to be like? 01:11
01:16 tea3po joined 01:20 teatwo left
Xliff Not sure yet. I think I'd like each piece of info in its own box, but that would make for a large UI for each PID. 01:21
Also need to work those CArrays out.
the xcpu times could work out to be quite large. 01:22
01:37 hulk joined 01:39 kylese left
japhb I assume "xcpu" means "per core"? 01:40
Xliff Probably. 01:41
Right now they are just struct names. I haven't had time to analyze each one, yet. 01:42
japhb Gotcha. 01:43
Xliff I've been working on this one for the last 3 weeks, but much of that time it was on hold due to #5534, to which I found a workaround for.
Anything that uses "HAS <type> @.attribute is CArray" needs to be C-allocated! 01:44
japhb How does one build/install github.com/Xliff/raku-GLib-Top ?
Xliff Raku will not allocate such a CStruct correctly?
japhb Odd
Xliff zef install GLib
And that's the trick. It's not quite ready for distro.
There is a c-component that needs to be installed. 01:45
And there's no META6.json, yet
If you want to brave the unknown, "cd c-dev; gcc glibtopnc.c `pkg-config --cflags libgtop-2.0` -fPIC -shared -o libglibtopnc.so `pkg-config --libs libgtop-2.0`; cp libglibtopnc.so ../resources/lib/linux/" 01:46
You can then use it from that directory using -Ilib
The root, rather 01:47
And those only work if you are using Ubuntu. 01:48
I seriously need some help getting my releases multi-distro ready.
japhb Linux Mint, but same difference
Xliff ( So help! :> )
japhb listens to his laptop fan attempting to cool the `zef install GLib` 01:52
Ah, missing libs. What packages need to be installed on a Debian/Ubuntu/Mint system to `zef install GLib`? 01:54
(Feel free to point to a README if it's described somewhere already)
02:15 hulk left, kylese joined 02:20 MasterDuke left
Xliff libglib-2.0 02:36
libglib2.0-0 on my current system
Yep... community.linuxmint.com/software/v...bglib2.0-0 02:44
japhb Seems to be looking for the wrong so name: 03:12
Cannot locate native library 'libglib.so.0': libglib.so.0: cannot open shared object file: No such file or directory 03:13
But what I have in my /usr/lib is:
Xliff OK 03:33
Do you have lsb_release? 03:34
If so what is the output of `lsb_release -a` 03:35
japhb No LSB modules are available. 03:56
Distributor ID:Linuxmint
Description:Linux Mint 21.3
Xliff Thanks. 04:44
japhb :+1: 04:47
Xliff japhb: github.com/Xliff/p6-GLib.git should have latest changes which should make life easier. 04:51
Also there is an ./install-prereqs.sh script you should run.
If that doesn't help, will handle tomorrow. Gotta sleep. Thanks for taking things for a test run. 04:52
Let me know any trouble spots you find! TIA!
japhb You bet, and thank you for your help! 04:55
japhb chuckles that Dependency::Sort is listed in the dependencies twice 05:10
Xliff: Can't install the prereq CompUnit::Util: 05:12
[CompUnit::Util] # Failed test 'all-loaded finds the correct units'
[CompUnit::Util] # at t/01-utils.t line 14
[CompUnit::Util] # You failed 1 test of 17
Is that test safely skippable, or does this indicate an actual problem that will affect GLib? 05:13
Geth docker/master: 4 commits pushed by AntonOks++, (Anton Oks)++, (Juan Julián Merelo Guervós)++ 05:22
Xliff You can skip that 05:31
I think I force install that one.
05:35 ptc joined 05:50 ptc left 05:51 hudo left, hudo joined 06:00 Sgeo left 06:35 catwin is now known as corwin 07:29 ptc joined 07:51 dakkar joined 08:05 abraxxa joined 08:11 sena_kun joined 08:49 jpn joined 08:50 abraxxa left 09:02 abraxxa joined 10:04 jpn_ joined 10:06 jpn left 10:08 jpn_ left 10:17 hudo left 10:33 hudo joined 10:57 jpn joined 11:09 abraxxa left 11:10 Maylay left 11:17 Maylay joined 11:35 abraxxa joined 12:16 jpn left 12:20 jpn joined 12:26 jpn left 12:39 jpn joined 12:50 vrurg left, vrurg joined 13:03 abraxxa left
tbrowder g'day, 2 questions: 13:15
1. is it possible in raku to define an operator to act like this $somearray[0][1] for an array of arrays? if so, please show how. 13:17
2. would it be useful to you to convert a csv file to a json string? 13:20
Voldenet m: my $a = [] but role { method AT-POS($ix) { role { method AT-POS($ix2) { $ix, $ix2 } } } }; say $a[3][42] 13:45
camelia (3 42)
Voldenet ah, it has to be an op 13:53
multi postcircumfix:<[[ ]]>($array, $a) { $a.map(* + 42) }; my $a = []; $a[[1,2]].say 13:54
13:54 abraxxa joined
evalable6 (43 44) 13:54
greenfork I'm writing a translation to Russian, how would you describe a "topic variable" as in $_, what would be a synonym for the word "topic"? 14:05
Voldenet I've looked up wikipedia translation of "topic" in grammars, and темой looks ok imo 14:09
greenfork Thanks, I'll try "переменная темы" as a translation for "topic variable" 14:11
tbrowder Voldenet: thanks! 14:12
14:48 jpn_ joined 14:50 jpn left 14:57 abraxxa left
librasteve tbrowder: as I mentioned above, the raku Dan module provides cascading 2D array accessors like say df0; github.com/librasteve/raku-Dan 15:06
it also provides row and col names and assocaitive accessors that can be mixed & matched with array accessors ... like say df[0]<A>; 15:07
Voldenet makes this look easy ... but it took me several days of trial and error AT-POS and so on to get it all to work in a consistent way 15:08
somewhere above, I have shown how to combine Test::CSV and Dan
o/ to all --- please can someone help me 15:09
I am trying this
for @!parts -> $part { my $module = $part.tc; Unit::($module).new.load: %!config{$p} } 15:10
I get the error Combination of indirect name lookup and call not supported
is there a way to call new on an interpolated module name? 15:11
Voldenet hmm, doesn't Unit::"$module" work? 15:12
librasteve lemme try that
Two terms in a row 15:14
Unit::⏏"$module".new.load: %!config{$p}
I tried using () around the double quotes and going my $x = Unit::"$module"; $x.new.load ... 15:15
neither of those worked
15:16 Voldenet left, Voldenet joined
Voldenet re AT-POS, I know there's a lot of edge cases, but they're specific to use cases mostly 15:17
like this uses .elems internally
m: my $a = [] but role { method AT-POS($idx) { $idx } }; say $a[* - 3]
camelia -3
librasteve Unit::{$module}.new.load: %!config{$part} 15:18
curlies did the trick! 15:19
antononcube Shouldn't something like this also work: ::("Unit::$module").new.load: blah 15:21
15:23 vlad joined
librasteve I guess something like that might work too ... thanks for the idea! 15:32
my $pqn = "Unit::" ~ $part.tc; ::($pqn).new.load: %!config{$part}; 15:40
is the final code
thanks for all the help!
antononcube 👍 15:51
japhb Xliff: OK, forced the install of CompUnit::Util as you suggest, and then did `zef install .` in my p6-GLib checkout. Got the same shared object file misname problem. 15:59
16:07 jpn_ left 16:39 dakkar left
Tirifto m: my %a{Str}; use trace; my %b{Str}; my %c{Str}; 17:02
camelia ===SORRY!=== Error while compiling <tmp>
Invalid hash shape; type expected
at <tmp>:1
------> my %a{Str}; use trace; my %b{Str}⏏; my %c{Str};
expecting any of:
Tirifto ↑ Am I missing something or is that a bug in trace? :o
(Constraining key types of a hash seems to work fine without ‘use trace’, but with ‘use trace’ it suddenly throws an error.) 17:04
lizmat yeah, that's a genuine bug, please make an issue :-) 17:06
looks like it is fixed in RakuAST, so I don't think it won't get fixed before 6.e though
Tirifto: the golf is: use trace; my %a{Str} 17:07
Tirifto I suppose there’s still no way to do that without a GitHub account, right? ^ ^’ 17:08
17:17 jpn joined 17:22 avuserow left 17:23 avuserow joined
lizmat Tirifto: yeah, ok, I'll take care of making an issue 17:35
Tirifto lizmat, thanks a lot! 17:37
17:37 vlad left
lizmat github.com/rakudo/rakudo/issues/5546 17:38
17:38 vlad joined 17:50 jpn left 18:26 ptc left
tbrowder librasteve: yes i looked at Dan but it looked too scary for my simple soul. 18:31
lot of exotic code there 18:32
18:36 abraxxa-home joined 18:49 abraxxa-home left, abraxxa-home joined 18:54 abraxxa-home left 18:55 abraxxa-home joined 19:25 vlad left
tbrowder but i'll probably revisit after i clean up some todo's 19:31
20:14 eseyman left 20:15 manu_ joined 20:16 manu_ is now known as eseyman 20:45 cleo left 20:46 jpn joined 20:52 jpn left 20:54 jpn joined 21:00 abraxxa-home left 21:05 jpn left 21:08 merp left 21:13 merp joined 21:17 bdju left 21:47 jpn joined 21:52 jpn left 21:59 bdju joined 22:08 kaskal joined, kaskal- left 22:19 kaskal left 22:24 kaskal joined 22:32 Sgeo joined 22:47 sena_kun left 22:52 DarthGandalf left 22:53 DarthGandalf joined 22:55 jpn joined 23:00 jpn left 23:56 jpn joined