🦋 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.
[Coke] looping over a 900K line csv file with $csv.getline is slow. Any suggestions on a different method? 03:32
ugh. part of this advent article is "hey, this is slow, but we're clever and can work around it." 03:36
....and getting a segfault in raku. 03:38
*sigh* 03:41
I feel like if I lean into the "workaround" aspect here, it's just going to make us look bad. 03:53
[Coke] anyone want to review the article before I hand it off to liz? Nearly done. 04:36
ab5tract [Coke] I know the feeling :) 11:34
it's slow, but is it at least lazy and thus memory efficient? 11:35
you can always play up the positive
lizmat has played with a bit and got it down from 9.82 to 3.00 11:51
and learned that Text::CSV objects are *not* thread-safe 11:52
if that could be made to be threadsafe, it should go down to about 2.4s 11:53
Geth advent/main: 1401fcb8fb | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | raku-advent-2023/authors.md
Schedule Coke's post on the 17th
12:22
lizmat only 5 slots left in the Raku Advent Calendar: if you feel like writing a post, now is the time! 12:23
if you feel comfortable writing it in markdown, rather than in WordPress directly, that's also possible: /me will take care of editing / posting 12:24
librasteve [Coke] you can do this: 13:49
use Dan; use Dan::Polars; my \sw = DataFrame.new; sw.read_csv("test_data/dfStarwars.csv").show;
then Dan::Polars will use the Rust Polars read csv function ... but the setup overhead is high (needs rust, cargo, etc) and probably detract from the main thrust of your tale 13:51
jdv what in the world does "!cursor_start_cur cannot restart a cursor" mean? 14:58
gist.github.com/jdv/70520031234f7b...0197320136 15:02
[Coke] if I am editing an advent article, do I need to save my work? 15:15
ah, hopefully re-hit "Schedule" seems to have done it and not actually published it 15:17
lizmat: mentioning it here in case you want more eyes on it, I added in your suggested code (Thanks!), and have edited the article on wordpress. Also caught a few other things I missed when editing the file at midnight last night. :) 15:19
nemokosch jdv: you just stomped onto something I have been complaining about so much 15:28
the godforsaken shared namespace that grammar-ish things (like the <print> token) and usual methods use 15:29
thank you very much, I'm stealing the gist
lizmat m: "foo" ~~ / .+ /; $/.print # shorter golf 16:11
camelia !cursor_start_cur cannot restart a cursor
in block <unit> at <tmp> line 1
lizmat m: "foo" ~~ / .+ /; $/.Any::print # workaround 16:27
camelia foo
jdv ih, no. thats not good. 17:07
*uh
defaultxr hi, is it possible to expand a variable within a docstring? i'd like to do something like "#= The supported options are %options.keys" and have %options.keys expand to the value of that expression 22:22
librasteve "#= The supported options are {%options.keys}" 22:43
oh - you mean rakudoc I guess ... sorry that may not work then 22:45
defaultxr ah, yes, that didn't seem to work :( thanks though. do you know if it's something that is possible? or is there some way to set a function's docstring dynamically, i.e. other than with the #= syntax? i'm trying to document the possible options for one of my MAIN() function's arguments. 22:49
japhb defaultxr: See github.com/Raku-MUGS/MUGS-UI-TUI/b...#L195-L235 for how I factored a similar problem 23:13
Not by setting the docstring dynamically, but by overriding USAGE
Sorry, GENERATE-USAGE
defaultxr ohhh, good idea! yes, i think something like that would work for me. thanks! 23:14
japhb That has the advantage of being able to factor out both common options and common argument *values* 23:15
defaultxr: You're quite welcome! :-)