🦋 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.
Xliff Why would self.bless return a Nil? 00:07
[ multi method new (JsonNode $node, :$ref = True) { say "NewNode: { $node // '»NoNODE«' }"; $node ?? self.bless(:$node) !! Nil; } ] 00:08
How could the above method return nil if the value of $node is non-nil at the time of the say()?
guifa can you confirm it's on calling self.bless? 00:18
multi method new (JsonNode $node, :$ref = True) { say "NewNode: { $node // '»NoNODE«' }"; $node ?? (say "yup" andthen self.bless(:$node)) !! Nil; } ] 00:19
Xliff If I see a "yup" then is that confirmation? 00:49
guifa yup (sorry, I couldn't resist) 01:06
01:15 discord-raku-bot left, discord-raku-bot joined 01:20 Manifest0 left
Xliff lol 01:38
tbrowder yo, looking for some opinions about good attribute names for a new module 01:52
it is a class to hold the header and data lines for a CSV file (table) 01:53
the class can query the table as a hash of hashes or an array of arrays. 01:54
my current attr names are: @!fields-a, @!lines-a, %!fields-h, %!lines-h (lame, I know) 01:56
shorter (without the !): @aF, @aL, %hF, %hL 02:00
unless there is a raku magic way to access the arrays and hashes with the fields and lines having the same name 02:01
02:05 haxxelotto_ left 02:06 haxxelotto_ joined 02:08 hulk joined 02:09 kylese left
tbrowder Fhash, Flist, Lhash, Llist 02:14
02:48 MasterDuke joined 03:09 haxxelotto_ left 03:10 haxxelotto_ joined 03:13 guifa left 03:15 hulk left, kylese joined 03:26 haxxelotto_ left 03:31 ptc joined 03:42 ptc left 03:54 gabiruh left 03:55 gabiruh joined 04:13 vrurg left, vrurg joined 05:54 xinming left 06:23 kjp left 06:26 kjp joined 06:48 haxxelotto_ joined
ab5tract guifa: worth filing a bug report, but I don’t actually know whether last-ness can be determinable in the face of a return statement 07:56
tellable6 ab5tract, I'll pass your message to guifa
ab5tract m: sub foo ($x) { ENTER say "entered"; LEAVE say "left"; for ^$x { FIRST say "first"; LAST say "last"; last if $_ == 0; }}; foo 42 07:57
camelia entered
first
last
left
07:57 Sgeo left
patrickb MasterDuke: Xliff has a build issue related to NQPP5QRegex. I guess it's related to your recent changes. See above discussion. 08:19
08:31 jpn joined 08:36 jpn left 08:39 jpn joined 08:57 jpn left 08:58 haxxelotto_ left 08:59 Manifest0 joined 09:00 jpn joined 09:09 Sevalecan left 09:10 Maximus joined, dakkar joined, Maximus is now known as Sevalecan 09:32 sena_kun joined 09:34 ptc joined
librasteve tbrowder: you could use raku Dan - github.com/librasteve/raku-Dan 10:17
this has fairly lightweight DataFrame structures - so a DataFrame from a CSV will have row index (default is 0..Inf) or you can specify row names and column names 10:20
my \dates = (Date.new("2022-01-01"), *+1 ... *)[^6]; my \df = DataFrame.new( [[rand xx 4] xx 6], index => dates, columns => <A B C D> ); say ~df;
use Dan :ALL; use Text::CSV; my @lines = csv( in => 'DemographicData.csv' ); my \stats = DataFrame.new( columns => @lines[0], data => @lines[1..*-1] ); ~stats[0..5]^; # head 10:23
you can also use Dan::Polars to engage the polars CSV parser which is super fast (but needs some Rust and some tolerance for work in progress status) 10:25
btw Dan is an AoA (with row & column headers) ... it also has mixable cascading accessors so you can do stuff like: 10:28
say df[0][0]; say df[0]<A>; say df{"2022-01-03"}[1];
antononcube @tbrowder ''> the class can query the table as a hash of hashes or an array of arrays. 10:35
raku.land/zef:antononcube/Data::TypeSystem 10:37
librasteve good point - fwiw I see Data::TypeSystem as DataFrames 2.0 (ie much more mutable and fluid) 10:50
(sorry about any "promotion" here ... just wanted to share what's out there) 10:51
antononcube @librasteve Thanks. The scope of "Data::TypeSystem" is limited to just getting or verifying the types of typical "data science" datasets. I.e. lists, tabular datasets, or lists/hashes of tabular datasets. I use it in several other packages for the subs of which certain conditions on the input data have to be verified. (E.g. "JavaScripdt::D3" .) 10:57
"Data::TypeSystem" does not have currently a verification function named, say, is-data-frame , but it seems a good idea to have one. Data frames, though, can be checked via deduce-type. 11:00
gfldex tbrowder: this is how I would *start* with an interface for CSV: gist.github.com/gfldex/9874a7deddf...12664650fb 11:25
11:40 snonux left 11:41 snonux joined, Geth left, slu left 11:42 Geth joined 11:44 slu joined 12:18 MasterDuke left 12:26 sena_kun left 12:27 sena_kun joined 12:28 sena_kun left, sena_kun joined 12:57 jpn left
tbrowder gfldex: thnx but i have my head cleared overnight and have my own path now 13:07
i've found that writing the docs first is a good design method for me and it did help. i have not yet looked at yr link but will now, 13:09
antononcube @tbrowder Head cleared by Circadian rhythms or by cicadas rhythms? 13:10
tbrowder antononcube: 😄 quiet and sleep did it. i have house full of children and grandchildren, very NOISY 13:13
antononcube 👍 👏
tbrowder btw, granddaughter is looking at FAU at Boca Raton for college next yr 13:14
we watched a virtual tour on youtube, very slick production. college at the beach is very appealing to surfer girls 13:15
break break 13:16
my new csv module is at github.com/tbrowder/CSV-Table
antononcube Lots of retired professors, musicians, and artists from MidWest, New York, or similar, teach in Del Ray Beach or Boca Radon... 13:17
tbrowder have you thought about doing that?
yr work should be very interesting to the budding researchers 13:19
13:24 merp joined
antononcube @tbrowder Are you asking about the CSV functionalities of your package, or about teaching in South FL? 13:31
Handling CSV files reliably and fast is not trivial. And, yes, missing data or data created at different (non-EN) locales can be fairly problematic. 13:35
13:38 jpn joined 13:42 jpn left
[Coke] tbrowder: is CSV::Table intended to eventually be a full CSV parser? (e.g. handling quoted cells) 13:51
lizmat Or cells with newlines :-) 13:52
[Coke] I see it's under limitations, but wasn't sure if you were planning to eventually add those, apologies.
13:59 jpn joined
Geth setup-raku/macos-arm64: d688f28546 | (Shoichi Kaji)++ | 3 files
support macos arm64
14:08
setup-raku/macos-arm64: 3babe980ee | (Shoichi Kaji)++ | 2 files
npm run build
setup-raku: skaji++ created pull request #34:
support macos arm64
14:17
setup-raku: d688f28546 | (Shoichi Kaji)++ | 3 files
support macos arm64
14:18
setup-raku: 3babe980ee | (Shoichi Kaji)++ | 2 files
npm run build
setup-raku: 5eecc7b2ff | (Shoichi Kaji)++ (committed using GitHub Web editor) | 5 files
Merge pull request #34 from Raku/macos-arm64

support macos arm64
setup-raku: 6dae7b93c7 | (Shoichi Kaji)++ | CHANGELOG.md
v1.8.0
14:21
[Coke] OOC, why do we have something in the Raku github group with an MIT license? 14:29
15:00 vlad joined
tbrowder antononcube: teaching in s fl 15:19
[Coke]: maybe, but right now it's not capable. those things i don't think will be too hard, but i don't have a use case for it now. 15:21
I just need something to make it easy to use a simple csv table maybe enroute to conversion an existing raku ORM 15:23
wow, @skaji is back! cool! 15:24
ref csv, 15:26
csv::table, added capability is motivated by others interested in filing issues and submitting prs, but i'm not quite ready to release yet. may use custom operators... 15:28
15:39 xinming joined 15:54 Xliff left
tbrowder [Coke]: i think CSV::Table will already handle at least simple cases of quotes since the separator char can be user-defined. 16:09
hm, normalizing text (the default) would possible hamper that 16:10
*probably
newlines are a different beast. right now i read by line. tony-o's csv parser can handle newlines in a cell 16:13
lizmat: ^^ 16:14
[Coke]: looking closer i think quotes should be handled ok even with normalization as long as there is a definite separator char that is NOT used inside a quote. i use the pipe <|> a lot and that takes care of most problem text. 16:49
*for my uses. and (not tested yet) you can define multiple chars as separators. i just send it to split(/sepstr/) and use its results as cells (to normalize or not) 16:53
17:03 AntonOks joined
AntonOks Could someone grant `write` permissons for me for raku/docker (github.com/Raku/docker/pull/58)? 17:04
17:11 haxxelotto joined
antononcube @tbrowder Some South Florida universities reach out to me for teaching. But they require too much certification and vetting of diplomas, etc. -- I always think that is too much effort, so I'm not doing it... I do go present to conferences and meetups in South FL, though. 17:32
17:47 dakkar left 17:57 Xliff joined
Xliff \p 17:57
Er... \o, even
lizmat: Is there a pure raku version (that doesn't attempt to implement p5) of your P5getpwnam? 17:58
lizmat you mean, one that doesn't use NativeCall ? 17:59
Xliff One that isn't necessarily based on any other implementation, really? NativeCall or not.
lizmat I don't know of any 18:00
antononcube @lizmat Are sources of the rumors for NativeCall 2.0 spelled out or detailed somewhere?
Xliff WTF? NativeCall 2.0?
Since when?
lizmat antononcube don't know anything of the kind
Xliff lizmat: Does raku have decent process querying capabilities (core or module-land)? 18:01
lizmat could you be more specific?
librasteve my emperience of Boca Raton was sleeping in the conference room I gave my presentation in the next day (Hilton iirc ca 1987) 18:02
[I arrived late and they had given my room away)
Xliff lizmat: Let me restate... does raku have something close to this in moduleland: developer-old.gnome.org/libgtop/st...index.html
Because now that I have a workaround for #5534, I wanna port it. 18:03
lizmat perhaps raku.land/?q=Linux has something for you? 18:06
18:08 vlad left
Geth docker: ed7f82d7df | (Daniel Mita)++ | 5 files
Bump to 2024.02
18:27
docker: 1357b3acb5 | (Anton Oks)++ (committed using GitHub Web editor) | 5 files
Merge pull request #58 from m-dango/2024.02

Bump to 2024.02
lizmat AntonOks++ 18:28
antononcube @lizmat "could you be more specific?" -- I saw a comment here.
Here it is: > Is there any news on a "version 2" of NativeCall? I'm still hankering to be able to pass C structs by value :^) 18:29
So, I might be mis-characterzing it ...
18:31 codesections left, codesections joined 18:32 codesections left
patrickb There is a (non textualized) list of shortcomings of the current NativeCall implementation. So it's clear that at some point there has to be an API version two. One of the shortcomings I can recall off hand is passing structs by value. 18:32
Ah antoncube beat me to it.
I think there is no one actively working on it. 18:33
Takers welcome! :-P
18:33 codesections joined 18:36 codesections left, codesections joined
Xliff patrickb and antoncube: I think that particular limitation is more a limit on FFI than NativeCall. 18:37
antononcube @Xliff So, we should expect both FFI 2.0 and NativeCall 2.0 ? 18:40
18:40 codesections left, codesections joined
Xliff FFI as in libffi and you'd have to take it up with those maintainers before NativeCal 2.0 could be considered. 18:41
18:41 codesections left, codesections joined 18:43 codesections left, codesections joined
Xliff Me personally, I'd want formal C-Callbacks as parameters. I'm tired of doing sub "myCFuncWithCallback( &callback (uint32, uint32, uint32 --> Pointer) )", when I could do something like "&myFuncCallback( |&callback )" which would form a function callback parameter from the definition of "sub callback" 18:44
lizmat how would that be different from syntactic sugar ?
Xliff Reuse 18:45
I could care less if it's sugar or not.
antononcube Interesting!
lizmat feels like it could be something in a trait ?
Xliff Or even a Signature used in a NativeCall parameter def, which would be the same thing! 18:46
Which would be a great use of the Signature object, IMHO 18:47
m: my $a = :(Int, Int, Int --> Str); $a.^name.say 18:48
camelia Signature
Xliff The latter method only requires a change in NativeCall to parse Signatures in the parameter list as function pointers.
lizmat PRs welcome! 18:49
18:51 codesections left, codesections joined 18:53 jpn left 18:54 codesections left, codesections joined 18:55 codesections left 18:59 codesections joined 19:02 codesections left, codesections joined
antononcube @lizmat I find appealing the cross tabulation of contrbutors -vs- content type -vs- content references using your rakudo-weekly posts. 19:19
lizmat glad they are of use :-) 19:20
sometimes I wonder why I bother :-)
antononcube Maybe is just me though. So, I a make larger tables derived for each month, I can issue PR's to articles repository? 19:21
lizmat you mean the CCR ?
antononcube Hmm... actually I do not know. You keep Markdowns of your articles somewhere in GitHub. 19:22
"sometimes I wonder why I bother " -- I am sure a fair amount of people find them useful.
lizmat yeah, I know :-) 19:24
antononcube github.com/lizmat/articles 19:25
antononcube Yeah, that is one I had in mind. 19:26
librasteve lizmat: rakudo-weekly is the heart of the community - your work is very much appreciated! 19:34
lizmat librasteve thank you for your kind words 19:37
19:52 haxxelotto left
roguerakudev @antononcube / lizmat - I was referring to this issue: github.com/rakudo/rakudo/issues/4970 20:16
niner mentions that passing structs by value "is ver<2> material" and that "a lot of work has already been done" on other features that would be 2.0 material 20:17
But that was 1.5 years ago now and I'm not sure where to keep up with newer developments (if there are any) 20:18
20:33 AntonOks left, guifa joined 20:48 haxxelotto joined 20:54 librasteve_ joined 21:12 guifa left 21:20 codesections left, codesections joined 21:21 codesections left 21:22 codesections joined, codesections left 21:24 codesections joined, codesections left 21:27 codesections joined 21:32 codesections left 21:37 ptc left 21:43 codesections joined 21:44 jpn joined
Xliff lizmat++: I agree with librasteve, btw! 21:45
21:48 codesections left 21:49 jpn left 22:15 sena_kun left
tbrowder ditto 👍 22:31
patrickb Not entirely Raku related, but here goes. I've finally managed to finish one of my projects (written in Raku), the Executable Runner Generator. I've written a small blog post introducing the tool: dev.to/patrickbkr/better-wrapper-scripts-158j 22:42
22:51 Sgeo joined, teatwo left 22:52 teatwo joined
patrickb Xliff I've just looked at the libffi docs. They can pass around structs. I don't know about libnativecall though (I think we still use that on Windows). But plans have been made to get rid of it. 22:54
Xliff patricb++ # ERG? NOICE ONE!!!! 23:22
Well that makes this next bit.... underwhelming... ;) 23:23
For future release....
"use GLib::Top::Server; .gist.say for GLib::Top.get_proclist.head[].grep({ .<euid> == 1000 })'" # Will retrieve all processes along with uid, mem and working directory information 23:24
I too just pushed it across a line...
I had to solve issues with NativeCall.
multi sub postfix:<M> ($n) { $n * 10e5 }; use GLib::Top::Server; .gist.say for GLib::Top.get_proclist.head[].grep({ .<euid> == 1000 && .<size> > 1200900M }) # Process list with UID and Memory filter 23:31
23:32 Manifest0 left 23:34 jpn joined 23:39 jpn left
Xliff And my math is all wrong... that's what I get for coding while hungry. 23:42
tbrowder patrickb: i looked at yr generator, looks very interesting! 23:51