Zoffix QAST::IVal, QAST::NVal, and QAST::SVal should be doing QAST::CompileTimeValue, shouldn't they? 00:41
yoleaux 5 Apr 2018 23:12Z <samcv> Zoffix: i've just added permissions for all people on Team MoarVM on github to have perms to the appveyor project
Zoffix m: use QAST:from<NQP>; BEGIN $*W.compile_time_evaluate: $, QAST::Op.new: :op<call>, :name<&say>, QAST::SVal.new: :value(QAST::Op.new: :op<concat>, QAST::SVal.new(:value<me>), QAST::SVal.new: :value<ows>) 00:44
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a BEGIN
at <tmp>:1
Exception details:
5===SORRY!5=== Error while compiling
cannot stringify this
at :
Zoffix I'll take that as a "yes" (QAST::WVal already does it)
oh and QAST::BVal is that too always compile time? 00:45
refers to a QAST::Block and *rakes brain* pads are immutable, so yeah should be safe 00:53
samcv Zoffix: i have a potential fix for the randomness issue of .rand 01:06
it's at least 10,000 better than before
maybe. err actually maybe not
still seems to have issues with very large ones 01:07
Zoffix But are you sure there's a problem in the first place?
samcv yeah
Zoffix What does the fix do? 01:08
samcv m: say ((10**300)).rand.base(16)
camelia F9AD8B6F9F64080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Zoffix But there's only 17 sigfigs of precision
samcv that is pretty unrandom. it's only apparent if you use base(16) though is that also maybe caused by float?
Zoffix m: say 1e300.base(16)
camelia 17E43C8800759C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
samcv ah ok
Zoffix m: say 1e20.base(16)
camelia 56BC75E2D63100000
samcv that is true
what's the way to do a random integer? moarvm has a function for it but idk if we have one in rakudo? 01:09
Zoffix There's nqp::rand_I but looks like it's only used in the guts of Range 01:11
m: use nqp; dd nqp::rand_I(10**100, Int) 01:12
camelia 9459655568654579812141384835898965024064900079022219319823570042804819449176602894675134833113932965
Zoffix m: use nqp; dd nqp::rand_I(10**100, Int).base: 16
camelia "71E9099B8EE0E6F8899394638174AA9458C85F4CD98C114DC58E08985657E2D4FEB43F84A0D19E676E7"
samcv i'm sure plenty of people use rand just for random integer numbers. and since it's pretty unrandom for large ones we may want to provide a way to use rand_I 01:16
Zoffix yeah 01:17
samcv e
Zoffix m: (1e300.rand xx 100_000).unique.elems.say 01:18
camelia 100000
Zoffix
.oO( that was surprisingly fast... )
m: (1e300.rand xx 10_000_000).unique.elems.say
camelia (timeout) 01:19
samcv well our rand_I is fairly random but i haven't tested the double one
Zoffix m: (1e300.rand xx 1_000_000).unique.elems.say
camelia 1000000
samcv just have to figure out best way to convert it to a Buf. i mean i could convert them to an Int but is that really random?
i guess i might as well try it anyway
Zoffix m: say 1e100.Int == 1e100.Int
camelia True
Zoffix don't look to be random 01:20
m: say 1e100.Int == (1e100+1).Int
camelia True
Zoffix m: (1e7.rand xx 1_000_000).unique.elems.say
camelia 1000000
Zoffix m: (1e16.rand xx 1_000_000).unique.elems.say 01:21
camelia 1000000
Zoffix shrugs
getting "Cannot unbox a type object (NQPMu) to a str." so I guess those nodes can't be just be made CompileTime value :( 01:22
samcv i guess my random generation values are not being random anymore 01:28
testing with this www.fourmilab.ch/random/
perl6 -e 'use nqp; $*OUT.write: Buf.new(nqp::rand_I(0xFF+1, 0) xx 1000) for ^10000' | pv | ./random/ent
getting 5% and 95% alternatng (should be ~50%) 01:29
was getting 45% before. but i guess that's based on how random the random state we keep
Zoffix I think if you ping something you get more entropy available? sudo ping -f some host 01:37
samcv what? well moarvm's randomness isn't related to the system's randomness 01:38
Zoffix: i think this funcion reseeds the uint64 random github.com/MoarVM/MoarVM/blob/mast...mt64.c#L68 01:40
and this generates the double we use in rand_n github.com/MoarVM/MoarVM/blob/mast...t64.c#L113
Geth nqp: 6689823e26 | (Zoffix Znet)++ | 3 files
Implement `cvalue` method for [NIS]Val QAST Nodes

A lot of the values we set to these nodeas are compile-time known, and this is a convenience method to mixin QAST::CompileTimeValue and set $!value/$!compile_time_value to the given value, right from the constructor.
Originally, I tried `does` QAST::CompileTimeValue to these nodes, like we do with QAST::WVal, but NQP compilation would blew up.
Zoffix that stuff's over my head. 01:41
samcv well it doesn't look like it adds any "actual" randomness back in 01:42
it does a lot of fancy bitshifting and OR and XORing 01:56
Zoffix ah
samcv dunno if there's some way we could seed randomness in from moarvm based on something
if we have any number and XOR it with the random seed numbers we use. then it will still be just as random theoretically
Zoffix
.oO( I think I'm going about it the wrong way )
01:59
ZofBot: what do you think? 02:00
ZofBot Zoffix, When people die they are sometimes put into coffins, which means that they donā€™t mix with the earth for a very long time until the wood of the coffin rots
Zoffix eww, gross
I got the hint... next time, I'll ask someone else -_- 02:01
Yeah, there's just one spot I saw that cares about .has_compile_time_value on an IVal we're shoving into a spot. The rest is all is just blind guess. 02:09
Geth nqp: e20fdaa20f | (Zoffix Znet)++ | 3 files
Revert "Implement `cvalue` method for [NIS]Val QAST Nodes"

This reverts commit 6689823e263b3e8d3105f9042d9f72e864203717.
YAGNI irclog.perlgeek.de/perl6-dev/2018-...i_16011781
02:10
Zoffix m: { sub { loop { LAST Nil; last if $++ > 10 } }(); say now - ENTER now } 02:29
camelia (timeout)
Zoffix m: my int $i; { sub { loop { LAST Nil; last if $i++ > 10 } }(); say now - ENTER now }
camelia No such method '!capture_phasers' for invocant of type 'Code'
in block at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix lesigh
m: say (Seq.from-loop({say $++; last if $++ > 100 })).head: 100 02:33
camelia 0
()
Zoffix m: my int $i; say (Seq.from-loop({say $++; last if $i++ > 100 })).head: 100 02:34
camelia 0
()
Zoffix m: my int $i; sub { loop {say $++; last if $i++ > 100 } }() 02:35
camelia 0
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
44
45
46
47
48
49
50
51
5ā€¦
Zoffix I don't get it :/
I don't get why m: my int $i; say (Seq.from-loop({say $++; last if $i++ > 100 })).head: 100 gives an empty list 02:36
m: my int $i; eager do loop { say $i++; last if $i > 10 } 02:55
camelia 0
Cannot call method 'eager' on a null object
in block <unit> at <tmp> line 1

1
2
3
4
5
6
7
8
9
10
Zoffix Man, do we have *any* tests for `loop`? 02:56
m: my int $i; say eager do loop { say $i++; last if $i > 10 } 02:57
camelia 0
1
2
3
4
5
6
7
8
9
10
()
Zoffix ^ that works by accident; another bug that gens crap code in this instance
ZofBot: or is that a feature? 03:00
ZofBot Zoffix, Alexander said, ā€œIs this about Wellington?ā€ And nodded because that didnā€™t count as being a detective
Geth rakudo/better-loop: c1906c1af1 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Improve codegen of `loop {}` when we want its value

We gen Seq.from-loop that has a special case for when the condition is always true. I'd imagine it to be faster, but currently this work is blocked by a deficiency in that case in that it's treating empty slips as end of loop.
03:01
Zoffix Filed as R#1692 03:20
synopsebot R#1692 [open]: github.com/rakudo/rakudo/issues/1692 Seq.from-loop(&body) does not behave like `loop { ... }`
Zoffix And that commit ^ also re-breaks the broken state vars in `do loop { ... }` 03:21
*the recently-fixed ones I mean 03:23
lizmat hmmm./... MoarVM doesn't build for me anymore :-( 04:58
Zoffix lizmat: you may need to nuke 3rd_party/libatomic or whatever it's called 05:33
3rdparty/libatompic_ops in MoarVM's dir
geekosaur git and submodules don't always get along 05:34
lizmat yeah, that fixed it, thanks! 05:39
Zoffix: shouldn't nqp be bumped again to have the revert in nqp be seen in rakudo ?
Zoffix lizmat: not necessary as I didn't end up using the new methods in rakudo 05:41
lizmat ok 05:42
Zoffix and like the now-reverted commit only added new methods to qast nodes
[Tux] Rakudo version 2018.03-162-ge348b8f21 - MoarVM version 2018.03-87-g677d4e9a8
csv-ip5xs0.883 - 0.929
csv-ip5xs-208.460 - 8.667
csv-parser36.799 - 37.738
csv-test-xs-200.436 - 0.455
test8.441 - 9.652
test-t2.424 - 2.540
test-t --race1.021 - 1.057
test-t-2043.431 - 44.087
test-t-20 --race14.806 - 16.237
06:24
Geth roast: d9a4a65b1c | (Ben Davies)++ | S29-os/system.t
Add tests for Proc.pid
12:41
roast: ronaldxs++ created pull request #409:
Update class-and-instance.t - tests for class and instance only methods
17:29
roast: eeb1086cf9 | (Ben Davies)++ | S29-os/system.t
Improve Proc.pid tests

This tests for proper .pid updates when run/shell fails and removes a test that could potentially fail in rare cases.
18:06
roast: 503021a7a6 | (Ronald Schmidt)++ | S12-methods/class-and-instance.t
Update class-and-instance.t to add tests for class and instance

only methods selected by invocant concreteness (eg ::?CLASS:[U|D]:). GH roast issue #217.
18:38
roast: 9ab28e208e | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | S12-methods/class-and-instance.t
Merge pull request #409 from ronaldxs/class-xor-instance-method

Update class-and-instance.t - tests for class and instance only methods
synopsebot SPEC#217 [open]: github.com/perl6/roast/issues/217 [testneeded] Tests needed for using method invocant to distinguish between class and object methods
brrt ohai 19:45
Geth rakudo: cfc6b1094c | (Zoffix Znet)++ | src/Perl6/Actions.nqp
In tweak_loop: Add node refs / clean up a bit

A bit of prep for fixing R#1623
  github.com/rakudo/rakudo/issues/1623
21:28
synopsebot R#1623 [open]: github.com/rakudo/rakudo/issues/1623 Phasers FIRST/LAST in sub-loop doesn't compile: Cannot reference undeclared local 'LOOP_BLOCK_1'
AlexDaniel FWIW there are currently 10 blockers 21:55
5 of them are assigned, and other 5 probably need more eyes 21:56
nooninm Page 10 of Thinking in Perl 6 shows different output than below > say(1, 234, 567).WHAT 1234567 22:23
Book says it should be as below > say (1,234,567).WHAT (List) 22:24
Is book wrong or is Rakudo Star version 2018.01 wrong? 22:25
timotimo that's the book being wrong
nooninm Thanks
timotimo .WHAT is always supposed to give you the type object, and those will output as the name of the type in parenthesis if you "say" it
nooninm Bye
timotimo have a good one!
nooninm Whoa, wait a sec. Then the book is right. say (1,234,567).WHAT should output "(List)" because List is the type, right? 22:27
But instead it outputs the number 1234567
timotimo oh!
i got it the wrong way around
sorry, now i see it
you need to put a space after the say
that is the difference between calling say with the numbers and the ncalling WHAT on what say returns vs calling WHAT no the list and saying what WHAT returns 22:28
excuse me, it's past midnight here :)
nooninm The space did the trick.
Thanks
Did not think of the say return value. Thanks
timotimo feel free to come back at any time for a wrong answer followed immediately by a right answer
nooninm Bye 22:29
Zoffix ZOFFLOP: t/spec/S12-methods/calling_sets.t 23:58