»ö« #raku and #raku-dev are OPEN FOR BUSINESS | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by mst on 15 October 2019.
hungryd27 hello, does Perl6 have a way to handle matrices? 12:04
I need to do some math
Hello everyone,I need to do some math about matrices. 12:10
tadzik hungryd27: github.com/pierre-vigier/Perl6-Math-Matrix may be what you need 12:14
I found it on modules.raku.org/search/?q=matrix :)
hungryd27 Oh, thanks.
Ulti the only downside to that implementation is you end up with perl6 lists of rats very easily... rather than native arrays of floats or something a bit more efficient/vectorisable 14:18
its not a binding to low level libs like blas/lapack or anything 14:19
"Multiple shapes not yet understood" for native arrays is I guess one of the reasons no one has gone here yet 14:30
timotimo native arrays are working very well, and have not-terrible performance 14:39
the performance of native *shaped* arrays and shaped arrays in general is poor, though. barely any optimization work has gone into them as far as i know
Ulti timotimo: at the moment you can't even define them though 14:48
timotimo can you give an example? 14:49
Ulti you also can't do C like trickery where you allocate a big single dim but access with multi dimensions
timotimo m: my int @foo[5,4]
evalable6
timotimo m: my int @foo[5][4]
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Hx2TMuu2tU
Multipl…
timotimo, Full output: gist.github.com/3425d99f7caf287743...d538c39c47
timotimo is that what you tried?
Ulti the second one yeah 14:50
timotimo i honestly have no clue what "multiple shapes" means
Ulti so is the first a 5 by 4 2D array?
timotimo yes
Ulti lol then for real what is the second o____O
timotimo m: my int @foo[5,4]; @foo[3,2] = 1
evalable6 (exit code 1) Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at /tmp/RP3Zm8oiGq line 1
timotimo m: my int @foo[5,4]; @foo[3;2] = 1; say @foo.perl 14:51
evalable6 array[int].new(:shape(5, 4), [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0])
Ulti so I guess multi shape is you say it can be a 1D and a 2D or something? like you have different dimensioned views? so int @weirdthing[10][5,2] = ^10; 14:53
timotimo oh? i have no idea how to actually use that tho?
Ulti that is pure speculation but my only guess at what it could possibly do as valid syntax if [x,y] is the syntax for a 2D declaration 14:54
timotimo hm, greppable6 uses perl6 regex, right?
greppable6: my \s+ int \s+ "@" <ident> \s* \[\d+\]\[\d+\] 14:55
greppable6 timotimo, Found nothing!
timotimo greppable6: help
greppable6 timotimo, Like this: greppable6: password # See wiki for more examples: github.com/perl6/whateverable/wiki/Greppable
timotimo oh, module ecosystem, not spec tests
and perl5 regex, too 14:56
Ulti also it feels bad that I could have been using multi dim native arrays this whole time
timotimo performance is, like, really bad though 14:57
Ulti :D 16:40
Ulti yeah but if no one uses it and complains about it that is unlikely to improve... given how much better most of my other code has gotten from moaning for the last ten years >:P 16:41
timotimo true 16:44
tony-o hh 16:59
pycer bye 17:00
off to #raku