»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
dalek odel: fe6b2b0 | diakopter++ | lua/runtime/ (3 files):
minor efficiency improvements
02:33
odel: 98852e3 | diakopter++ | lua/runtime/Try.lua:
_
02:39
mishin Hi perl 6, i try Gabor presentation www.youtube.com/watch?v=2M3f3uAqMWg...re=related abot perl 6 irc 04:32
rakudo:say 44*33 04:33
perl6: say 33*22
p6eval pugs b927740, rakudo 198513, niecza v11-22-gbebf7a0: OUTPUT«726␤»
japhb .u PLUS MINUS 05:23
phenny U+00B1 PLUS-MINUS SIGN (±)
diakopter . 05:43
sorear good * #perl6 05:45
diakopter o/
moritz \o 06:15
phenny moritz: 08 Nov 22:20Z <jnthn> tell moritz I created the bigint branch in Rakudo. It needs the bigint branch of NQP installed. It's ready to start switching to use the new ops and triaging.
sorear o/ moritz 06:26
dalek p/bigint: 6426a56 | moritz++ | src/ (2 files):
nqp_bigint_bool op (checks != 0)
07:14
jnthn moritz: Did the normal istrue not work? 07:38
morning, btw :)
moritz: I didn't expect us to need an nqp_bigint_bool style op 07:39
cognominal morning 07:40
tadzik morning 07:40
jnthn for example, this already Just Works: 07:41
> if 0 { say "lol" }
Nil
> if 1 { say "lol" }
lol
tadzik lol 07:45
jnthn commute time, bbs 07:51
moritz jnthn: it unboxes to int, which might fail when an Int is too big to unbox losslessly into an int 07:55
I mean, the bool test might fail
moritz perl6: say 2 ** 20 08:39
p6eval pugs b927740, rakudo 198513, niecza v11-22-gbebf7a0: OUTPUT«1048576␤»
moritz perl6: say 2 ** 20 * 1.8 08:42
p6eval pugs b927740, rakudo 198513: OUTPUT«1887436.8␤»
..niecza v11-22-gbebf7a0: OUTPUT«9437184/5␤»
moritz nqp: say(pir::lcm__Iii(50, 45)) 08:49
p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected IREG, expecting '(' ('$I102')␤ in file '(file unknown)' line 40␤␤»
moritz nqp: say(pir::lcmd__Iii(50, 45))
p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected IREG, expecting '(' ('$I102')␤ in file '(file unknown)' line 40␤␤»
dalek p/bigint: 1db0ea8 | moritz++ | src/ (2 files):
fix a few ops, moritz--
08:51
dalek kudo/bigint: fb5b1b9 | moritz++ | / (2 files):
start to switch to bigint ops

This breaks spectest horribly, and I do not understand the failure mode It says "get_boxed_ref could not unbox for the given representation" in sub infix:<->, but when I test infix:<-> in isoluation, I cannot reproduce that failure mode
10:22
jnthn Wow. Took me a couple of hours to get from the door of $dayjob to my keyboard today :) 10:41
moritz: Oh. I bet the failure you're seeing is due to scalar containers not being removed first. 10:42
moritz jnthn: that's what I thought first too, but I did write infix:<-> as nqp::sub_I(nqp::p6decont($a), nqp::p6decont($b)); 10:43
jnthn moritz: (too big to unbox losslessly) but 0 will always unbox to 0, and I assume everything else will unbox to non-zero even if it does overflow?
moritz: yeah, that should handle it 10:44
moritz I'm not sure what mp_get_int() does on overflow 10:45
jnthn guesses MAX_INT or so 10:47
Would have to check
moritz oh 10:49
it bit-ors all digits
jnthn ok
So
moritz erm
no
jnthn It's never going to be zero
moritz stupid
res = DIGIT(a,i);
while (--i >= 0) {
res = (res << DIGIT_BIT) | DIGIT(a,i);
}
jnthn suspects moritz isn't stupid, but sometimes he doesn't quite C so well ;)
moritz DIGIT_BIT is about 60
jnthn ah 10:50
moritz so it shifts it, ignores overflow, and bit-ors the least significant digit to it
jnthn *nod*
moritz so, could be 0
jnthn yeah :/
Will have to ponder this a bit. But it needs to be some kinda upgrade to the boolification protocol 10:52
Rather than an op
moritz: curious, does it only fail for infix:<->? 10:53
(in the spectest)
Or was that just an example?
moritz jnthn: that's how all the backtraces look like 10:54
seems to be triggered by a rather common operation
likely something in Test.pm
jnthn would be curious to see the full backtrace 10:58
moritz jnthn: gist.github.com/be33fed37436cab21d6c 10:59
jnthn is_runtime? 10:59
moritz oh, is_runtime is part of the backtrace printer, I think
jnthn hmm, meta-fail
yeah
jnthn Does @array.end actually work? 11:00
moritz oh, because I'm stupid
running with --ll-exception shows that it's from postfix:<++> 11:01
and that contains nqp::add_I(nqp::p6decont($a), 1)
and since add_I is a nqp_bigint_add__PPP, it boxes 1 to a parrot Integer, I supose
and can't unbox it to bigint
jnthn brb, lunch 11:02
jnthn back 12:11
moritz: I'm surprised if it's emitting a 1 there rather than the boxed object.
Would be worth checking the code to see... 12:13
shinobicl hi 12:47
dalek kudo/bigint: 88158ac | moritz++ | src/core/Int.pm:
a few fixes, still completely broken
13:23
jnthn moritz: Still the infix:<-> issue? 13:31
Those p6box_i should really not be needed...if they are, some code-gen thingy is busted. 13:33
Will investigate this evening, anyways.
moritz jnthn: gist.github.com/1351446 that's the current status 13:37
I've added a nqp::p6decont around the 'self' in Int.Bool (because I didn't know what else to try), no luck so far 13:38
maybe adding more diagnostics to the get_boxed_ref error would make things a bit clearer 13:39
jnthn well, self shouldn't ever be in a container though
moritz thought so, but wasn't sure
jnthn What does Int.Bool look like? 13:40
moritz multi method Bool(Int:D:) {
nqp::p6bool(nqp::bool_I(nqp::p6decont(self)));
}
thing is
$ ./perl6 -e 'say ?3'
Bool::True
works
jnthn say ?(my $x = 3) 13:41
?
moritz same
jnthn say 3.Bool ?
moritz also works
jnthn hm. wtf. :S
moritz it seems all the errors come from loading/using Test.pm
so it might be codegen thing
jnthn And...only in some cases? 13:42
Or use Test always fails?
moritz 'use Test;' fails
... if precompiled
otherwise it's dog slow, but at least 'use Test; plan 3' seems to work 13:43
jnthn oh!
It's only a pre-compilation bug, then?
moritz seems like
jnthn ah
OK, that's a really good hint. 13:44
moritz I've now manually deleted the Test.pir dependency from Makefile and running a spectest 13:46
much less epic failure :-)
jnthn aha 13:47
moritz (so far only 2 subtests failig in S02-literals/radix.rakudo, no surprise here)
literal handling isn't updated to bigints yet
jnthn yeah 13:47
moritz $ ./perl6 -e 'my $fac = 1; $fac *= $_ for 1..30; say $fac' 13:48
265252859812191058636308480000000
niecza: my $fac = 1; $fac *= $_ for 1..30; say $fac
p6eval niecza v11-22-gbebf7a0: OUTPUT«265252859812191058636308480000000␤»
moritz \o/
fsergot hi #perl6 o/ 13:49
jnthn moritz: yay! 13:50
[Coke] moritz: yay. 13:53
Does this need testing on windows ?
moritz [Coke]: it's not yet in a state where you can run 'make spectest' 13:54
[Coke] hokay. 13:55
moritz but when it is, we'll need the testing, yes 13:56
[Coke] if I checked out the branch in rakudo, would --gen-parrot DTRT? 14:00
moritz nope
hm, or maybe
[Coke] kicks off a regular windows build, it's been months. 14:01
jnthn Not yet. 14:01
moritz jnthn: I've bumped NQP_REVISION to something in the nqp/bigint branch 14:02
(in the rakudo/bigint branch)
so it should work after all
jnthn moritz: ah, ok, I missed that :) 14:05
moritz (wasn't in a commit message, I think) 14:05
[Coke] jnthn: I can't build on windows. whoops. 14:06
jnthn [Coke]: I do it every day ;) 14:07
jnthn [Coke]: What compiler? 14:07
What Perl?
[Coke] VS 2010 express, AS perl. 14:07
dies in nqp.
jnthn Ah. :/
That's normally a winning combination.
[Coke] (ugh. and remaking after the failure in nqp remakes /everything/)
jnthn On bigint branch?
[Coke] jnthn: yes, I switched to it on your advice. ;) 14:08
jnthn: nope.
jnthn Really odd
Oh
[Coke] nom on rakudo. 14:08
jnthn How does it explode?
moritz what's the error?
[Coke] getting there. ;)
jnthn And is there an old libparrot.dll in your nqp directory?
[Coke] gist.github.com/1351532 14:09
[Coke] nothing matching libparrot under nqp\ 14:10
I could probably stand to do a real clean of rakudo and try again.
jnthn [Coke]: Try
copy install\bin\libparrot.dll nqp
(from the Rakudo directory)
[Coke] jnthn: argh, too late. ;) 14:11
I'll let you know if it dies after a clean start.
[Coke] arggggh. can't use raw --gen-parrot when you're going over an http proxy. 14:12
dalek kudo/bigint: 513f055 | moritz++ | src/core/Int.pm:
switch more ops to bigint
14:17
moritz nom: say (-3.6).Int 14:18
p6eval nom 198513: OUTPUT«-3␤»
moritz nom: say (-3.6).perl 14:19
p6eval nom 198513: OUTPUT«-18/5␤»
moritz nom: say (-18 div 5) 14:19
p6eval nom 198513: OUTPUT«-3␤»
japhb Am I correct in assuming that nqp::substr(), because it produces a native string, creates a GCable, whereas nqp::ord(), because it produces a native int, does not? 14:21
jnthn japhb: yes 14:21
[Coke] jnthn: same failure on a clean build.
jnthn [Coke]: Try the copy I suggested
then nmake again in nqp directory 14:22
japhb jnthn, great, thanks.
japhb sees a few places to trade off a couple nqp:: ops against a GCable, which feels like a net win 14:22
japhb (of course, profiling will tell) 14:23
jnthn :) 14:23
Creating less garbage is generally good :)
[Coke] jnthn: that did it. evil; nqp should be linking against the install dir. 14:25
japhb jnthn, yeah, that was my thought. Especially because in these spots, the substring was only being used to compare against a single-character constant string, and then thrown away. 14:26
[Coke] jnthn++
[Coke] gist.github.com/1351578 # rakudo build failure 14:27
(making another copy of libparrot.dll...) 14:28
jnthn japhb: Yeah, that's a bit of a waste 14:29
[Coke] opens a ticket on the libparrot copying. 14:38
[Coke] jnthn: are you getting spectest failures? 14:38
(and/or hanging tests?)
jnthn [Coke]: No hangs on 64 bit. On 32 bit, yes... 14:39
jnthn [Coke]: Thus the bigint work ;) 14:39
pmurias awwaiid: hi 15:15
awwaiid hiya 15:16
I pulled your change last night and pushed up a new release :)
pmurias thanks 15:17
pmurias what namespace should the GDB backend go into Devel::ebug::GDB or Devel::ebug::Backend::GDB? 15:19
awwaiid Devel::ebug::Backend::GDB 15:23
tadzik I'd go for Devel::Debug :)
awwaiid tadzik, Devel::ebug already exists, and is cute bcause then it is perl -d:ebug
awwaiid pmurias, one thing that I haven't poked at yet are all of the plugins. Looks like there is a 1-to-1 correspondence between Devel::ebug::Plugin::* and Devel::ebug::Backend::Plugin::* . We'll probably have to make that more resiliant and modular for backends that don't support each plugin, is my guess. 15:26
pmurias awwaiid: printing an appropriate error message seems to be the best we can do 15:29
awwaiid yes, I think so. But not crash. 15:36
awwaiid bbiab, $work 15:36
moritz jnthn: I've traced at least one of the failures in arith.rakudo to bad literal -> number conversion, so that seems like the next area to work on after the codegen thing 15:40
jnthn moritz: ok 15:41
moritz: Thsoe may be related though
(since it's something to do with literals in the code gen that fails)
(or so it looks like)
sorear good * #perl6 15:43
moritz the fanciest number literal in Test.pm is 1_000_000 :-) 15:44
\o sorear
jnthn decommute & 15:54
jnthn home 16:31
dalek p/bigint: 302cc17 | jnthn++ | src/ (2 files):
Merge branch 'bigint' of github.com:/perl6/nqp into bigint
16:48
jnthn oops, rebase fail 16:51
jnthn moritz: Seems I forgot to push 71c9c2b last night 16:52
jnthn moritz: It may help with $weird-issue 16:52
(with Test.pm) 16:53
moritz: Yeah, seems to 16:54
japhb Man perlcabal.org/syn/S02.html#Literals is a lot of work ... 17:11
tadzik TimToady action figure: joindiaspora.s3.amazonaws.com/uplo...1165c.jpeg 17:12
colomon awesome! 17:13
tadzik indeed
I'd buy that
tadzik odd that I can link to an image, but can't link to a diaspora post 17:13
colomon I assume it's a custom one-off figure? 17:18
tadzik no idea 17:18
moritz it's #phaers time 17:30
jnthn hands moritz an s :) 17:31
moritz nom: '(a)' ~~ /'(' ~ ')' <alpha> / and say $<alpha> 17:39
p6eval nom 198513: OUTPUT«Any()␤»
moritz nom: '(a)' ~~ /'(' <alpha> ')' / and say $<alpha> 17:40
p6eval nom 198513: OUTPUT«=> <a>␤␤»
jnthn moritz: If you got chance to check - did my latest nqp patch help with the Test.pm issue for you? 17:41
jnthn nom: 'a,a,a' ~~ /<alpha> ** ','/ and say $<alpha> 17:41
p6eval nom 198513: OUTPUT«=> <a>␤ => <a>␤ => <a>␤␤» 17:42
moritz jnthn: haven't checked yet 17:43
jnthn k
moritz: Any idea why loads of trig tests fail? 17:44
moritz jnthn: probably because Rat literals with many digits don't work 17:45
moritz and Num too 17:45
jnthn nom: say -1.56079666010823
p6eval nom 198513: OUTPUT«-1.56079666010823␤»
moritz $ ./perl6 -e 'say -1.56079666010823'
-2.00571435998317
jnthn heh, yes
moritz on the bigint branch
jnthn wonders wtf causes that... 17:46
japhb Don't know if it applies to the main parse, but since I noticed it in Str.Numeric: Is nqp::radix() fixed to not just carry a FLOATVAL internally in the bigint branch? 17:47
jnthn nom: say 554474183 / 276447232 17:49
p6eval nom 198513: OUTPUT«2.00571435998317␤» 17:49
moritz jnthn: nqp::radix should be upgraded to use bigint, I think 17:52
moritz erm, meant japhb 17:52
jnthn nom: my $x = 1; $x +&= 2; say $x; 17:54
p6eval nom 198513: OUTPUT«0␤»
japhb moritz: yeah, a lot of stuff in Str.Numeric gets a lot slower if nqp::radix is unreliable. :-)
jnthn > my $x = 1; $x +&= 2; say $x;
jnthn Bool::False 17:54
wtf...
> my $x = 1; say $x +& 2; say $x;
grr
nom: my $x = 1; say $x +& 2
p6eval nom 198513: OUTPUT«0␤»
jnthn > my $x = 1; say $x +& 2 17:55
Bool::False
hm :)
moritz uhm
moritzfail, probably
jnthn nqp::p6bool(nqp::bitand_I(nqp::p6decont($a), nqp::p6decont($b)))
that shoudln't bool, right? :)
moritz right 17:56
just nqp::bitand(...)
bitand_I
jnthn fixing 17:56
moritz sorry 'bout that
jnthn: nqp patch helped
jnthn OK good 17:57
How does arith.t fail for you, occ?
Here it doesn't even compile
moritz iirc it failed two tests, one of them at least due to the literals 17:58
oh, and it seems to emit extra debug info (wtf?) 17:59
ok 125 - Inf**NaN
3
not ok 126 - Modulo zero dies and is catchable# TODO modulo by zero
0
the 3 and 0 shouldn't be there
dalek kudo/bigint: 7b75f75 | jnthn++ | src/core/Int.pm:
Remove accidental boolification.
18:02
jnthn ok, I have some dinner, then I'll look at literals. 18:06
masak evening, #perl6 19:36
masak missed #phasers bŭ some margin tonight
masak by* 19:37
jnthn o/ masak 19:46
dalek odel: a7073fd | diakopter++ | lua/ (15 files):
more minor optimizations
19:57
jnthn oh ffs 20:07
Parrot's ops2c parser can't handle case 'b':
that is, a case statement with a non-integer
tadzik eww 20:10
jnthn There's 15 minutes wasted. :/ 20:11
It can't handle a cast to unsigned char either :/ 20:12
jnthn oh huh 20:51
jnthn We handle <integer> using nqp_radix 20:51
Which...goes via a floating point conversion
jnthn How was this ever going to handle big integer literals :/ 20:53
benabik jnthn: Poorly.
jnthn Heck, I guess it doesn't even do sizable 64-bit integers properly. 20:58
jnthn didn't realize the "just float it" mentality had seeped this deep :(
[Coke] float it specifically as a data type, or more as a stylistic "just do whatever works for now" ? 21:03
jnthn [Coke]: The data type. 21:04
japhb: ping
japhb jnthn, pong 21:26
jnthn japhb: I'm currently looking at the number handling. I believe you're looking at similarish stuff. 21:27
japhb: Have you been looking at nqp::radix?
japhb: I'm currently working on a version that works with bigint rather than float...
I'm then planning to use it from the grammar too 21:28
Does this sound reasonable?
japhb jnthn, I noted that nqp::radix was likely wrong because of carrying things as FLOATVAL, which I mentioned earlier. I figured you or moritz would most likely need to rewrite it in that branch, so I've been hands-off. I'm working on Str.Numeric(), which uses nqp::radix() a lot, but I'm working around the lack of precision for now. 21:29
jnthn japhb: OK. I see it outputs three things 21:29
masak 'night, #perl6 21:30
jnthn japhb: Which of those do you use?
o/, masak
japhb It makes sense to me to use it in the grammar too; it looked like pretty tight code.
jnthn, all three.
And I'm using all the flags, too. :-)
japhb But I'm happy to refactor if it makes your life easier. 21:30
(That is, after all, half of what I'm doing anyway.) 21:31
jnthn OK, that means I need to hand the lot of them back :)
My idea is that you'll give in one extra argument
which is the target type
Int in our case.
japhb As opposed to?
jnthn So you'd get three (Perl 6) Int objects back
Today it hands back Parrot floats. 21:32
japhb I meant, as opposed to what else would you ask for after the rewrite?
Wow, English fail there. Hopefully you know what I meant.
When would you not ask for Int, in other words? 21:33
jnthn japhb: Well, it's more than I'm showing the op in nqp_bigint.ops 21:34
jnthn japhb: Which doesn't know about Perl 6's Int type. 21:35
er, shoving
not showing :)
jnthn Just a layer thing :) 21:36
japhb Ah, I get it.
nodnod
jnthn Anyway, from your perspective it should be pretty easy to switch, and you'll get better precision.
moritz \o
jnthn o/ moritz
japhb jnthn, excellent, thank you.
jnthn japhb: Thanks for the context on how the ops is being used 21:37
jnthn japhb: oh, one more thing... 21:37
The second output value...base
japhb yes ...?
jnthn If this was to be a Rat, would that be the denominator? 21:38
And the first thing the numerator?
Or am I mis-thinking?
jnthn oh hm 21:38
yeah, I think I am :)
japhb It is used when handling '123.456'
jnthn oh
Does the op parse the .?
jnthn doesn't see that
japhb The '456' would return 1000 as the base
jnthn oh, I see 21:39
japhb It tells you how much to divide the fractional part to make a num, or multiply the int part to make a Rat
Does that make sense?
jnthn Yes, very much so
So this can go a long way to replacing radcalc too 21:40
OK, seems good.
japhb goes to look at radcalc ...
jnthn Anyway, standardizing the grammar and .Numeric on such an op seems sane.
jnthn moritz: Feel free to review japhb++ and my discussion to make sure it makes sense to you too ;) 21:41
japhb It looks like radcalc does more than nqp::radix but less than Str.Numeric. :-) 21:42
moritz correct 21:42
moritz jnthn: will do the review tomorrow 21:43
japhb Oh, interesting way to calc the radix in a '0n' style prefix.
moritz note that the tommath string parsing function can handle different bases, but doesn't offer the same flexibility as nqp::radix 21:44
japhb I note in passing that radcalc allows uppercase (e.g. '0X') prefixes, but TimToady seemed to dislike that.
jnthn moritz: OK. I'm going to be a bit time-limited tomorrow; I may push what I have tomorrow and you can pick it up tomorrow if you like. 21:45
jnthn er, push tonight :) 21:45
moritz ok
moritz -> sleep
japhb 0/ 21:45
heh, I have a tall head today apparently 21:46
moritz jnthn: one more thing, the ops2c not liking (unsigned char) is probably fixed in newest parrot
jnthn moritz: ah, ok
moritz in 53994ea940f93311b57f28fc0964707bddf0b947 21:46
moritz -> really sleep
jnthn o/
dalek p/bigint: bb5f116 | jnthn++ | src/ops/nqp_bigint.ops:
bigint variant of the nqp radix op.
22:09
jnthn OK, that needs tests etc, but I don't have concentration for it tonight. 22:10
kboga hello jnthn, sorry to bother you. I was wondering if you were planning on making the slides that accompanied your latest talk on "optimizing Rakudo" available on the net?
jnthn kboga: yes, certainly
kboga awesome, thanks :)
jnthn I blug: 6guts.wordpress.com/2011/11/09/slid...rl-6-talk/ 22:42
jnthn kboga: ^^ 22:42
jnthn sleep & 22:51
kboga good night, and thanks again 22:52
sorear good * #perl6 23:07
japhb o/ sorear 23:16