10:46
yewscion left
11:04
jpn joined
11:09
jpn left
11:15
abraxxa-home left
11:16
abraxxa-home joined
11:25
yewscion joined
11:30
yewscion left
11:47
jpn joined
11:52
jpn left
|
|||
Voldenet | re `my $b; $b[1e18]="meow"` causing panic, I think this is a bug | 12:08 | |
lizmat | wow | 12:09 | |
yeah, please make an issue :-) | |||
12:09
ChanServ sets mode: -o lizmat
|
|||
Voldenet | idk what's the behavior I'd expect from it though - in js browsers behave differently in such case | 12:13 | |
12:19
maylay left
12:22
maylay joined
|
|||
lizmat | I suggest we don't allow bigInt values for indices | 12:24 | |
Voldenet | there's a few solutions, v8 uses sparse arrays | 12:27 | |
and firefox (spidermonkey, I think) simply ignores that error :> | 12:28 | ||
lizmat | I think we're going to opt to disallowing bigint values for now and throwing an execution error | 12:32 | |
m: my @a; @a[my $ = -1e13]="meow" # related meh | 12:36 | ||
camelia | ( no output ) | ||
Voldenet | hm… it doesn't crash on the newest version? | ||
m: my $b; $b[1e18]="meow" | |||
camelia | MoarVM panic: Memory allocation failed; could not allocate 8000000000000000008 bytes | ||
Voldenet | Ah, it does. | ||
lizmat | m: my @a; @a[-1e0]="meow" | 12:37 | |
camelia | ( no output ) | ||
lizmat | m: my @a; @a[-1]="meow" | ||
camelia | ===SORRY!=== Error while compiling <tmp> Unsupported use of a negative -1 subscript to index from the end. In Raku please use: a function such as *-1. at <tmp>:1 ------> my @a; @a[-1]<HERE>="meow" |
||
lizmat | meh | ||
Voldenet | Having "oom" to catch here would be a solution, but I'm not sure if it'd be actually useful | 12:40 | |
I've seen developers doing this in other languages, and obviously handling OOM didn't really add more ram properly :> | |||
in perl5, `eval { @b[1e15]=1; }` doesn't seem to be handled, but `eval { @b[1e20]=1; }` is handled | 12:44 | ||
ah, right the second one is not OOM and that is properly handled by raku too | 12:45 | ||
> github.com/rakudo/rakudo/issues/5835 | 12:48 | ||
stanrifkin_ | Not $b[1e15]? | ||
Voldenet | uh, right, I mean $b[1e15] | ||
lizmat | m: my @a; @a[my $ = -1]="meow"; dd @a # this feels very wrong | 12:51 | |
camelia | [] | ||
Voldenet | either way, checks for "arrays can be at most N bytes in size" would be probably better sanity check | ||
but if someone with 2EB of ram uses large arrays, they should work ;) | 12:52 | ||
m: my @a; my $n = -10e17; @a[$n]="meow"; dd @a | 12:54 | ||
camelia | [] | ||
Voldenet | I'm suspecting this code quietly does nothing instead of writing to arbitrary locations, otherwise it'd segfault | 12:55 | |
13:05
jpn joined
13:30
maylay left
13:32
maylay joined
13:35
jpn left
13:52
jpn joined
13:57
jpn left
14:22
jpn joined
14:26
Aedil left
14:27
jpn left
14:30
Aedil joined
15:01
liztormato joined
15:07
jpn joined
15:12
jpn left
15:13
liztormato left
15:18
maylay left
15:20
maylay joined
15:22
jpn joined
15:25
liztormato joined
15:27
jpn left
15:37
apac joined,
jpn joined
15:42
jpn left
15:52
liztormato left
16:11
jpn joined
16:16
jpn left
|