🦋 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.
wayland76 Interesting problem that occurs in my code, but not separately. If I use either "say" or "print" twice in this particular function, then it hangs on the second one. But if I use "shell 'echo blah'", it works. ??? :) Not expecting solutions since I can't come up with a small bit of code that does this, but interesting nonetheless. 02:00
antononcube Consider mentioning the operating system and raku(do)’s version... 🙂 02:46
wayland76 OS: Alpine Linux 3.18.2 (in a docker container). Raku version: 2023.06. MoarVM. Language v6.d 02:48
wayland76 OK, everyone. At this point I've spent about 8 hours wrestling with this, and I've *finally* found the problem. It's not raku, but it affected raku. When I run docker exec, if I don't pass the -t option, then I don't get all the output. Hope this helps someone someday. 03:34
teatwo wayland76, what does -t do 04:43
thebb -t attaches to terminal 05:10
detaching runs it in the background 05:14
wayland teatwo it allocates a terminal inside the docker container to the running program. 06:59
If you want an interactive shell in docker, use: docker exec -it <container> /bin/bash 07:00
p6steve o/ 09:44
tellable6 2023-02-08T04:45:46Z #raku <deoac> p6steve: macOS Ventura 13.1.  I installed rakudo with the Rakudo Star Bundle.  I used your recipe from #raku-beginner 3 February.
2023-02-11T22:59:11Z #raku <rf> p6steve: stackoverflow.com/questions/754238...ative-call
2023-03-24T19:30:22Z #raku <tonyo> p6steve: github.com/tony-o/raku-fez/blob/di...kumod#L706
2023-03-24T19:34:53Z #raku <tonyo> p6steve: a lot of uses in that code base but you may need to grep
2023-03-24T19:50:01Z #raku <rf> p6steve: github.com/rawleyfowler/JSON-Simd/...rakumod#L8
librasteve i'm using NativeCall and want to be able to pass a CArray like (1,2,3,null,5) via ffi 09:48
anyone know what special C value is for null (I can detect Nil on the raku side but don't know what to write to the CArray item) 09:49
please?
lizmat a CArray is basically a Buf is it not? 09:50
librasteve dunno, here is what works sub se_new_i32(Str, CArray[int32], size_t) returns SeriesC is native($n-path) { * } 09:51
sub carray( $dtype, @items ) { my $output := CArray[$dtype].new(); loop ( my $i = 0; $i < @items; $i++ ) { $output[$i] = @items[$i] } $output } 09:52
^^ i have one of these for each datatype - i64, f32, f64 and so on 09:53
str, bool
when 'i32' { se_new_i32($name, carray( int32, @data), @data.elems) } 09:54
sorry missed this bit
lizmat if it's a native int array at the lowest level, then there are no special values possible, other than 0 maybe? or -1 ? 09:58
librasteve thanks - i continue to research this arcane topic... apparently C does not do NULL values (only NULL pointers which are 0000) ... so maybe this is a feature of the Polars/Arrow library... 10:01
nemokosch in C, it's all just #define NULL 0 10:06
librasteve ironically NaN and Inf "just work"
thank you . please can you explain how to write this in raku so it can be assigned at the $output[$i] line? 10:09
nemokosch for pointers, it says that the type object represents the NULL value
how that fits for native types that have no type object iirc... 10:09
librasteve this is not for pointers, but for values
nemokosch I think it all boils down to what that 32-bit number represents 10:10
librasteve I have tried already Num, (Num), Nil
nemokosch if it's really just an int in the C code, then it cannot be optional in C either
librasteve ^^^ these get an error This type cannot unbox to a native integer: P6opaque, Str
or
Cannot unbox a type object (Nil) to int. 10:11
nemokosch if it's a pointer semantically then 0 is probably reserved as the null pointer
so this would be my question: what is the meaning of that data?
librasteve well I was thinking maybe its a special char rather like \n
pola-rs.github.io/polars/py-polars...pr.is_null 10:13
this explains the meaning of the data
nemokosch is this like a database? 10:15
lizmat native ints can *only* contain native int values 10:16
any sentinel value *must* be an int value then 10:17
nemokosch that's how it is in C as well, so I wonder what the C API looks like 10:18
arrow.apache.org/docs/format/Colum...null-count 10:21
the underlying data format is a bit tricky; basically there is a bitmask that marks valid positions
so null is not directly represented in the data itself 10:22
librasteve .oO yes that's v. helpful thanks 10:24
guess I need to make a Validity bitmap on the raku side and then pass that as an additional arg to the new and then somehow apply on the rust side - ho hum 10:25
tbrowder__ .tell ugexe i've updated the doc RESOURCES PR. 13:48
tellable6 tbrowder__, I'll pass your message to ugexe
antononcube It is a (very serious) attempt to bring the R concpet of "data frame" into Raku. Other efforts like that exist in Python, Julia, and Swift. 15:43
nemokosch I don't think it's about Raku
antononcube So, yes, it is like a database, but should be more powerful.
Well, "Polars" is data frame library for Rust. Steve tries to connect Raku's "Dan" with Rust's "Polars". 15:49
Also, "Polars" has a Python interface. 15:56
Related to that previous note are these two (objective) observations for data wrangling in Raku efforts: - Steve tends to use the awkward, unfinished, clunky (wrong) concepts and tools: Data frames, Python, Rust, Jupyter notebooks - Anton tends to use the (much better) concepts and tools: Datasets, Mathematica, Swift, Mathematica notebooks 15:58
lizmat antononcube: I assume the "clunky (wrong) and tools" are your *opinion*, right? 16:01
nemokosch Swift be like 16:09
antononcube As I mentioned, the conveyed observations are objective. 16:11
In general, I was surprised that someone would take R-data-frame-in-Python route for data wrangling in Raku. I find that route too difficult with too many gotchas. (Meaning, I would personally not take it.) 16:14
Jupyter has been clunky and buggy for many years. It became more swifter and more stable relatively recently. (a pretty much around the time the notebook patents of Wolfram Research started to expire.) 16:16
Rust is unfinished — as far as know it does not have a standard, and until recently only worked via LLVM. (Maybe it still does.) 16:20
My previous two notes sound too serious — I expect it to be fairly obvious that I am biased toward Mathematica, hence, whatever claims for objectivity I make should be taken with some skepticism… 16:27
nemokosch 🤠 16:30
antononcube Speaking again about data wrangling in Raku, for me the duality of the two approaches -- Steve's vs mine -- is very interesting: - If one takes the data frame approach, almost inevitably would look for efficient, external solutions, like "Polars", justifying with performance objectives - If one takes the dataset approach, almost inevitably would try to justify it with minimalism, unintrusiveness, and social 16:39
contracts with the users
nemokosch what is the difference? 18:11
antononcube Hmm... between the concpets of "data frame" and "dataset" and their projections in Raku, or the justification approaches? 🙂 18:15
I assume you are asking about the latter -- see the sub-section "Dataset vs Data frame" in the section "Datum fundamentum" of this article: rakuforprediction.wordpress.com/20...with-raku/ 18:17
> A dataset is a table that as a data structure is most naturally interpreted as an array of hashes, each hash representing a row in the table. > A data frame is a table that as a data structure is most naturally interpreted as an array of hashes, each hash representing a column in the table. 18:19
nemokosch how would a column be a hash? 18:33
wouldn't that rather be an array
antononcube Data frames can have both column names and row names. So, each column can be seen as an ordered or sorted hash. Alternatively, row-indexes can be seen as the keys (of each column-hash.) 18:55
nemokosch weird
antononcube Not that much! R has ubiquitous element naming of the elements of its data structures: - List elements can have names 19:10
Also, R has formula objects. So, the element naming and formula objects allow R to have some sort of "semi-symbolic" computations. 19:12
"Jupyter::Chatbook" teaser (with DALL·E cells): i.imgur.com/Ugj4DPu.png 19:25
librasteve my ears are burning - so let me (briefly, for it is late) chime in: 20:34
100% agree
I am truly mad to do this (since I had to learn Data Science and Rust concepts from scratch and it is a hard problem) 20:35
100% agree ... and also we probably need raku to have a way to get to a fast native library or raku will always lose on the performance side 20:37
@nemokosch - this is my intro to DataFrames in raku talk conf.raku.org/talk/171 20:39
the famous examples are R, Pandas (Python) and now Polars (Rust) 20:41
nemokosch this is from last year, right? 20:47