Raku Conference Day 2 on Youtube: www.youtube.com/watch?v=BL9-XdC9WYI 🦋 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 14 August 2022.
[Coke] github.com/coke/sudoku-helper 02:10
(Had this script for ages, finally put it somewhere)
What do we need to do to make "use experimental :cached; 02:14
" not experimental?
er, rephrasing, to make "is cached" not require the use. 02:15
I see 2 tickets in rakudo/rakudo (#4665 and #4666) - anything else? 02:16
grondilu hi all 11:44
grondilu m: put blob32.new: 2**32 11:44
camelia Stringification of a Blob[uint32] is not done with 'Str'. The 'decode'
method should be used to convert a Blob[uint32] to a Str.
in block <unit> at <tmp> line 1
grondilu m: dd blob32.new: 2**32 11:44
camelia Blob[uint32].new(0)
grondilu m: dd blob64.new: 2**64 11:44
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
grondilu not sure why blob32 and blob64 would behave differently here 11:45
grondilu m: my uint64 $ = 2**64 11:47
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
grondilu m: my uint32 $ = 2**32 11:48
camelia ( no output )
grondilu :🤔
grondilu FYI I stumbled upon this when trying to implement SHA-512 11:58
lizmat m: m: my uint64 $ = 2**64 - 1 12:04
camelia ( no output )
lizmat grondilu: 2**64 does *not* fit in a 64 bit uint so the error message is correct 12:05
or one could argue it should just cut off...
thing is, 2**32 *can* be represented as a native int on 64 bit systems, so in that case it's a native int being put into a native int that is not large enough 12:06
m: my uint8 $a = 256; say $a
camelia 0
grondilu yeah I guess one could argue on the semantics. I think it should just cut off. 12:09
lizmat thing is, the logic is currently when converting from a bigint into a native int, is to throw if it doesn't fit
2**64 cannot be represented as a native int currently 12:10
hence the error
grondilu yeah but 2**32 can't be represented as a int32 either. It can be represented as a native int, but only because there are natives that are larger. 12:11
lizmat I bet it will give the same error on a 32bit system 12:12
the logic is "can be represented as a native int on this architecture" I guess
grondilu I see.
lizmat I guess we could think about a pragma for cutting off 12:13
or a dynamic variable
the logic for MoarVM is in nqp/MoarVM/src/6model/reprs/P6bigint.c 12:16
grondilu on a related note, it's a bit annowing that algebraic operations on native ints do not remain native ints, even when the result is assigned to a native int variable 12:18
m: my uint64 $ = (my uint64 $ = 2**63) * (my uint64 $ = 2) 12:19
camelia ( no output )
grondilu ah I thought that would die
m: my uint64 $a = 2**63; my uint64 $ = $a + $a
camelia ( no output )
grondilu damn I can't reproduce it 12:20
m: my uint64 $a = 2**63; put my uint64 $ = $a + $a + $a; 12:21
camelia 9223372036854775808
grondilu m: my uint64 $a = 2**63; put .WHAT given my uint64 $ = $a + $a + $a;
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.

in block at <tmp> line 1
grondilu m: my uint64 $a = 2**63; put .?WHAT given my uint64 $ = $a + $a + $a;
camelia ===SORRY!=== Error while compiling <tmp>
Cannot use .? on a non-identifier method call
at <tmp>:1
------> my uint64 $a = 2**63; put .?WHAT⏏ given my uint64 $ = $a + $a + $a;
expecting any of:
method arguments
grondilu m: my uint64 $a = 2**63; dd my uint64 $ = $a + $a + $a; 12:22
camelia -9223372036854775808
grondilu 😕
lizmat yup, as long as the compiler can assure something is a native, it will do cut off 12:23
with literal values, it assumes non-native
the exact reasoning I'm not sure about, feels like something that could change in the future 12:24
grondilu hang on 12:25
m: say (my uint64 $ = 5) ~~ uint64 # just checking type setting syntax
camelia False
grondilu ok how do I test if a variable points to a native? 12:26
lizmat good question... not possible without nqp afaik 12:28
afk for some fresh hot air &
grondilu sha-512 is supposed to be very similar to sha-256, so I thought I would be able to just substitute blob32 to blob64 and so on but apparently that won't work. 12:37
oh well
nine m: What prevents it from working? 12:56
camelia ===SORRY!=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> What prevents it from working⏏?
expecting any of:
infix
infix stopper
postfix
statement end
statemen…
nine What prevents it from working?
guifa grondilu: best you can do is 14:17
tellable6 guifa, I'll pass your message to grondilu
guifa my int $a = 42; my Int $b = 42; say $a.VAR.WHAT; say $b.VAR.WHAT 15:47
evalable6 (IntLexRef)
(Scalar)
stevied if someone has a moment and is knowledgeable about using NativeCall with Windows API, please have a look at www.perlmonks.org/?node_id=11146662 15:54
[Coke] You'll be better off using stack overflow than perlmonks, IME. 16:11
stevied Already went that route. See comments at stackoverflow.com/questions/735623...8_73562354 16:23
hmm, maybe the handle is the hex number found here in this file: metacpan.org/release/CHORNY/Win32A...gistry.pc? 16:37
does that even make sense? I guess I could try it.
ugexe `my $program-files-path = shell("echo %ProgramFiles%", :out).out.slurp(:close)` or some such is the quick and easy way 16:50
shell('echo "%ProgramFiles%"'... rather 16:56
ugexe PS C:\Users\ugexe\zef\bar> raku -e "say shell(q|echo %ProgramFiles%|, :out).out.slurp(:close)" 16:59
C:\Program Files
stevied yeah, wanted to see if I could learn how to use the API, though. 17:00
oh, and I did figure out how to use the API to get the paths 17:02
so I'm set with that
right now, I'm trying to figure out how to get the subkeys with the api
ugexe win: fix thread race in uv_cwd() and uv_chdir() (#3708) - github.com/libuv/libuv/commit/4db0...790734e2d3 17:09
hmm hopefully we update libuv soon :)
i guess thats not in a release yet though 17:11
ugexe same with the commit for fixing uv_os_uname to handle Windows 11 17:11
ugexe there is also a fix to make macOS return kilobytes for rss like all the other OS 17:13
there is a telemetry test that works around that issue
stevied figured out my problem querying the registry. Knowing that the constant's `HKEY_LOCAL_MACHINE ` value is `0x80000002` was indeed the key to figuring this out. stackoverflow.com/a/73594981/1641112 19:43
pats on the back welcome
leont I thought I made an issue for yesterday's dispatching issue, but apparently I didn't 20:54
And now I may have a new one
Geth doc: 1de7522804 | (Tom Browder)++ | doc/Language/variables.pod6
Add a practical example of augmenting class IO::Path
23:27
doc: 7e11a94430 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/variables.pod6
Merge pull request #4105 from tbrowder/aug-class

Add a practical example of augmenting class IO::Path
linkable6 Link: docs.raku.org/language/variables