🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
Geth ¦ rakudo: MasterDuke17 assigned to niner Issue Error with signed/unsigned natives when printing a buf64 that contains 2**64-1 github.com/rakudo/rakudo/issues/5348 04:11
lizmat m: use nqp; my uint @a = -1; my int $b = nqp::atpos_u(@a,0); say $b # this is fine 08:10
camelia -1
lizmat m: use nqp; my uint @a = -1; my int $b = nqp::if(1,nqp::atpos_u(@a,0)); say $b # this is not :-(
camelia Cannot unbox 64 bit wide bigint into native integer
in block <unit> at <tmp> line 1
Geth rakudo/main: 4347320283 | (Elizabeth Mattijsen)++ | src/core.c/Buf.pm6
Fix issue with uint64 Bufs and -1

Apparently there's some kind of coercion going on when there's not a direct assignment from a uint to an int. This coercion is throwing the error.
Fix this by making it direct assignments: for the represention in a gist, it doesn't matter whether the value was originally signed or unsigned.
Fixes #5348
08:28
roast: 0529a785e9 | (Elizabeth Mattijsen)++ | S03-operators/buf.t
Add test for #5348
08:44
Geth rakudo/main: c4b68d7f10 | (Elizabeth Mattijsen)++ | src/core.c/Exception.pm6
Allow "sorrows" to be specified as "sorries"

Apparently, in RakuAST the term "sorries" is used rather than
  "sorrows". This makes interfacing easier.
11:41
rakudo/main: 2caaf9f4d7 | (Elizabeth Mattijsen)++ | src/Raku/ast/resolver.rakumod
RakuAST: some more resolver streamlining

  - less need to unwrap lists, use HLL methods such as .elems, .AT-POS, .Bool
  - don't use return if it isn't needed
  - some internal docs additions
Geth rakudo/main: f604c78834 | (Elizabeth Mattijsen)++ | 2 files
RakuAST: some streamlining

  - kebab-case comp_unit tokens / methods
  - reduce number of dynamic var lookups
12:27
MasterDuke m: my $bufb = buf64.new(3, 1, 18446744073709551615); $bufb[2] = $bufb[2] + 1; 13:40
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
MasterDuke m: my uint64 $bufb = 18446744073709551615; $bufb++; say $bufb 13:41
camelia 0
MasterDuke m: my uint64 $bufb = 18446744073709551615; $bufb = $bufb + 1; say $bufb
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
MasterDuke m: my uint64 $bufb = 18446744073709551615; $bufb += 1; say $bufb 13:42
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
MasterDuke should ^^^ all fail? all succeed? or is current behavior correct? 13:44
lizmat I think the current behaviour is correct 13:48
hmmm 13:49
the problem with $bufb = $bufb + 1 13:50
is that "$bufb + 1" gets HLLized to an Int\ 13:51
m: my uint $a = 18446744073709551616
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
lizmat that's basically the error 13:52
m: my int $a = 18446744073709551616
camelia Cannot unbox 65 bit wide bigint into native integer
in block <unit> at <tmp> line 1
MasterDuke m: srand 0; my int64 $bufb = 2**63-1; $bufb += (4..10).pick; say $bufb 14:00
camelia Cannot unbox 64 bit wide bigint into native integer
in block <unit> at <tmp> line 1
MasterDuke m: srand 0; my int64 $bufb = 2**63-1; $bufb++ for ^(($bufb + (4..10).pick) - $bufb); say $bufb 14:01
camelia -9223372036854775802
MasterDuke same behavior for uint64s if you use 2**64-1 instead of 2**63-1
dunno. seems like people might want to wrap without having to do it via incrementing 14:02
m: srand 0; my int64 $bufb = 2**63-1; my int64 $add = (4..10).pick; $bufb += $add; say $bufb 14:04
camelia -9223372036854775802
MasterDuke you have to know to create the intermediate values explicitly typed as natives
lizmat it's a waterbed alright :-) 14:09
Geth rakudo/main: 703363eb18 | (Elizabeth Mattijsen)++ | src/Raku/Actions.nqp
RakuAST: refactor / streamlin Actions prologue

  - give subs / variables more meaningful names
  - add documentation
  - move logic of RakuAST class lookup to "Nodify" sub
  - change all self.r method lookups to just call Nodify
  - make the "r" method a common method, proxy for Nodify
15:44
lizmat unexpectedly: 937 (+6) 15:45
[Coke] any pointers on how to get all the pod nodes inside a document? I am trying do $file.IO.slurp.AST.visit-children({$_.^name.say}) and only getting a Doc::Block 16:13
lizmat [Coke]: gist ? 16:14
[Coke] oh, you still need to manually recurse. ah 16:15
how to get the children without visit-children? that needs a callable 16:17
lizmat with visit-children you do 16:18
fwiw, .map and .grep work on RakuAST nodes
so you should technically be able to do:
[Coke] recursively or only current children? 16:19
lizmat for $ast { ... }
recursively
[Coke] is there a way to get the info NOT recursively? 16:20
for $ast {} doesn't recurse 16:21
lizmat yeah, I just saw that, I wonder why
it should :-( 16:22
[Coke] ok. guess I will avoid this project for a bit then 16:23
lizmat ah, I misread your question
[Coke] :( 16:24
lizmat m: .say for Q|=foo blah|.AST.rakudoc # [Coke]
camelia RakuAST::Doc::Block.new(
type => "foo",
abbreviated => True,
paragraphs => (
"blah",
)
)
lizmat the .rakudoc will give you all of the RakuAST::Doc objects 16:25
[Coke] ah, wish I had that 30m ago, thank you 16:27
lizmat sorry... 16:30
I think I documented that though?
[Coke] we have your blog posts and type docs, not a howto. 16:31
so, probably you did, yes! 16:32
lizmat there's also lib/Rakudoc/To/Text.rakumod in the distribution
if you want to see some actual usage 16:33
[Coke] afk 16:34
[Tux] Rakudo v2023.06-227-gf604c7883 (v6.d) on MoarVM 2023.06-4-g75fe055c2
csv-ip5xs0.785 - 0.892
csv-ip5xs-205.165 - 5.729
csv-parser3.986 - 4.856
csv-test-xs-200.398 - 0.401
test6.463 - 7.070
test-t1.405 - 1.828
test-t --race0.831 - 1.053
test-t-2021.110 - 21.451
test-t-20 --race6.268 - 6.562
16:58
Geth rakudo/main: 86557c946a | (Elizabeth Mattijsen)++ | 2 files
RakuAST: more Actions streamlining

  - more comments
  - extract next-id logic to a sub, rather than a class method
  - rename comp-unit-stage0 to more descriptive comp-unit-prologue
17:15