🦋 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:02 lizmat left, phogg joined 00:57 japhb left 01:01 japhb joined 01:04 jpn joined 01:06 japhb left 01:09 jpn left 01:11 japhb joined 01:20 japhb left 01:22 tirnanog joined 01:25 japhb joined 01:33 japhb left 01:35 japhb joined 01:55 antim0d3s joined 01:56 sdfgsdfg left 02:26 TieUpYourCamel left 02:33 jpn joined 02:38 jpn left, TieUpYourCamel joined 02:52 hulk joined 02:53 kylese left 03:15 hulk left, kylese joined 03:25 edr left 03:27 jpn joined 03:33 jpn left 03:37 derpydoo left 04:03 tirnanog left 04:23 jpn joined 04:28 jpn left 05:19 jpn joined 05:25 jpn left 06:01 CIAvash joined 06:16 jpn joined 06:18 CIAvash left 06:19 CIAvash joined 06:21 jpn left 07:02 jpn joined 07:07 jpn left 07:46 jpn joined 07:54 jpn left 07:58 japhb left 08:01 japhb joined 08:06 CIAvash left 08:11 jpn joined 08:17 jpn left 08:32 japhb left 08:33 japhb joined 08:42 japhb left 08:48 lizmat_ left 08:49 lizmat joined, lichtkind_ joined 09:15 grondilu joined
grondilu How could I classify a list of words by longest prefixes? 09:15
grondilu searches rosettacode 09:17
09:18 dakkar joined 09:28 Sgeo left
lizmat grondilu: raku.land/zef:lizmat/String::Utils provides a "root" function 09:38
raku.land/zef:lizmat/String::Utils#root 09:39
09:50 sena_kun joined 10:12 japhb joined 10:17 japhb left 10:21 jpn joined 10:24 abraxxa joined, verzit joined 10:45 jpn left 11:00 jpn joined
Geth planet.raku.org: cb42a0a252 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | perlanetrc
Add John Haltiwanger's website
lizmat DarthGandalf: re yesterdays discussion: github.com/Raku/problem-solving/issues/406 11:08
11:09 merp left 11:10 jpn left 11:14 merp joined 11:17 jpn joined
DarthGandalf lizmat: cool, will subscribe to it :) I don't have much to add to the discussion there 11:50
11:51 lichtkind__ joined 11:54 lichtkind_ left 12:32 abraxxa left
grondilu I'm a bit confused about unicode normalization. docs.raku.org/language/unicode#Normalization How do I prevent normalization, exactly? 12:47
Like what do I do if I have un-normalized string literals that I want to process without any normalization whatsoever? 12:48
12:48 MasterDuke left
grondilu m: put q{ábaco}.encode('UTF8-C8') 12:49
camelia Stringification of a Blob[uint8] is not done with 'Str'. The 'decode'
method should be used to convert a Blob[uint8] to a Str.
in block <unit> at <tmp> line 1
grondilu m: dd q{ábaco}.encode('UTF8-C8') 12:50
camelia Blob[uint8].new(195,161,98,97,99,111)
grondilu m: say q{ábaco}.encode('UTF8-C8')>>.fmt("%02X")
camelia (C3 A1 62 61 63 6F)
grondilu m: say q{á}.encode('UTF8-C8')>>.fmt("%02X") 12:51
camelia (C3 A1)
grondilu I think the unormalized string should be (61 CC 81) 12:52
m: say q{á} 12:53
camelia á
grondilu also on my terminal this gives a weird looking string: a􏿽xCC􏿽x81 12:54
12:56 jpn left
lizmat m: say "á".NFC; say "á".NFD 12:58
camelia NFC:0x<00e1>
NFD:0x<0061 0301>
lizmat grondilu: ^^ perhaps that's what you're looking for ?
grondilu looks it up in the doc 12:59
how do I print these? 13:04
oh, `put` seems to work 13:06
13:06 verzit left
grondilu m: put 'á'.NFC 13:06
camelia á
lizmat yeah, Uni is Stringy 13:09
13:22 lizmat left 13:30 verzit joined
tbrowder__ Hi! I'm working on a more robust release of module CSV-Autoclass and would love to have someone submit a PR with a test case using non-ASCII characters for the csv file name and class name and csv content. The WIP is on branch "next-rel" at github.com:tbrowder/CSV-Autoclass. 13:34
13:35 jpn joined 13:43 jpn left 13:45 jpn joined 13:46 edr joined 13:57 derpydoo joined 14:11 abraxxa joined 14:58 japhb joined 15:05 japhb left 15:16 lichtkind__ left 15:17 lichtkind joined 15:22 morte joined 15:30 grondilu left 15:35 japhb joined
nemokosch I'm porting Python code, and it has sys.maxsize written. It's apparently the maximum pointer value on the platform. How can I write it in Raku? 15:47
It is simply used for computation, to construct a number that doesn't fit into the platform's native integer type
15:58 lizmat joined 16:00 lizmat left 16:03 lizmat joined 16:08 abraxxa left 16:17 japhb left
librasteve 32-bit: the value will be 2^31 – 1, i.e. 2147483647 64-bit: the value will be 2^63 – 1, i.e. 9223372036854775807 16:22
^^^ from www.geeksforgeeks.org/sys-maxsize-in-python/
nemokosch yes; for now, I did that as a workaround, just hardcoded 2**63 - 1 16:24
I wonder if there is a high-level way to at least get the "native int size" 16:25
lizmat m: dd int64.Range 16:26
camelia -9223372036854775808..9223372036854775807
lizmat m: dd uint64.Range
camelia 0..18446744073709551615
lizmat nemokosch ^^
m: dd Int.Range 16:27
camelia -Inf^..^Inf
lizmat m: dd UInt.Range
camelia 0..^Inf
librasteve m: dd int.Range 16:32
evalable6 -9223372036854775808..9223372036854775807
Raku eval -9223372036854775808..9223372036854775807
librasteve m: say int.Range.max == 2**63-1 16:33
Raku eval True
evalable6 True
librasteve I extrapolated from Liz answer since int is the one that varies with the machine native size (in the very odd case that you are running raku on a 32-bit architecture) 16:34
16:41 japhb joined
Announced in October 2011,[14] Armv8-A (often called ARMv8 while the Armv8-R is also available) represents a fundamental change to the ARM architecture. It adds an optional 64-bit architecture named "AArch64" and the associated new "A64" instruction set. 16:42
ah - now I see why raku needed to handle both 32- and 64-bit words when it was designed!
lizmat technically I think Rakudo still supports 32bit architectures 16:43
nemokosch okay, thank you 16:45
looks good
apparently I don't get how Test is supposed to work, though
in my mind, if I have 10 subtests and do skip 'NYI', 10, as long as the code compiles, no tests should fail, even if they throw exceptions internally 16:46
it should be all silenced
librasteve well there are still some new CPU cores at 32-bit like SiFive essential series 16:47
nemokosch and is doesn't tend to complain, that much is true
but is-deeply hits hard
16:59 sftp left 17:01 josh203 joined 17:10 josh203 left 17:36 dakkar left 17:43 jpn left 17:47 jpn joined 17:52 jpn left 17:57 morte left 18:26 suman joined
suman While passing an array from Raku to C, I need to do @array>>.Num. 18:34
As every element is converted to Num independently, how to do it in parallel utilizing all cores?
In case of billion elements in array, how to do it in parallel using all cores of CPU in Raku? Is it possible? 18:35
m: my @array = [-1, -0.777778, -0.555556, -0.333333, -0.111111, 0.111111, 0.333333, 0.555556, 0.777778, 1]; say @array».Num
camelia [-1 -0.777778 -0.555556 -0.333333 -0.111111 0.111111 0.333333 0.555556 0.777778 1]
nemokosch in fact, >>.Num already does that
well, not sure with what presets but it's called a "hyper meta-operator" for a reason
18:56 suman left 18:59 japhb left 19:00 Xliff joined
Xliff . 19:00
[Coke] If you want to be more explicit about it, I think it's @array.hyper.map({.Num}) 19:17
then you can pass args to hyper() if you want to control how hyper it is.
m: my @a=1..100; dd @a.hyper.map(*.Str) 19:20
camelia HyperSeq.new(configuration => HyperConfiguration.new(batch => 64, degree => 3))
[Coke] m: my @a=1..100; dd @a.hyper.map(*.Str).list
camelia ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "…
[Coke] (So you get something that will give you the values, then you can flatten it with .list, or iterate over it yourself)
19:20 gfldex left
[Coke] ... and they've been gone for a while already, haven't they. 19:21
nemokosch well, maybe the IRC logs can still come useful 19:29
20:30 japhb joined 20:35 jpn joined 20:52 jpn left 21:15 swaggboi left 21:34 jpn joined 21:44 atweedie left 21:45 atweedie joined 21:46 patrickb left, atweedie left, clarkema left, atweedie joined, clarkema joined 21:47 patrickb joined
librasteve suman: suggest you also try @array>>.num (ie. native Num) ... maybe also worth looking at the ingestion phase and coercing to Num|num when you do the csv parse or whatever 22:08
tellable6 librasteve, I'll pass your message to suman
22:32 grondilu joined
grondilu So, I have something that I had a hard time reproducing with a small code. I now have something I think I can show. 22:32
m: say "cañón rubí abdomen petróleo borrar feliz gloria mojar mujer tema bodega".encode("utf8
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> ia mojar mujer tema bodega".encode("utf8⏏<EOL>
expecting …
grondilu hang on 22:33
m: say "cañón rubí abdomen petróleo borrar feliz gloria mojar mujer tema bodega".encode("utf8-c8").subbuf(0, 9)
camelia Blob[uint8]:0x<63 61 C3 B1 C3 B3 6E 20 72>
grondilu m: say "cañón teatro famoso donar catre máscara júpiter flauta metro cara pez".encode("utf8-c8").subbuf(0, 9)
camelia Blob[uint8]:0x<63 61 C3 B1 C3 B3 6E 20 74>
grondilu god damn it doesn't work anymore 22:34
well nevermind, I'll try again later 22:38
22:48 grondilu left 22:54 verzit left 22:59 sena_kun left 23:37 Sgeo joined 23:41 lizmat_ joined 23:44 lizmat left, Sgeo left 23:47 lizmat_ left, lizmat joined