»ö« 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.
00:04 molaf_ joined 00:08 molaf left, PacoLinux_ left 00:17 PacoLinux_ joined 00:23 PacoLinux_ left 00:24 Chillance left 00:31 smash left 00:32 ab5tract left 00:40 Eth4n joined 00:41 Guest8847 left 00:43 ethndbst left 00:47 ab5tract joined 00:48 bluescreen10 joined 00:55 risou is now known as risou_awy 01:01 whiteknight joined 01:02 whiteknight is now known as Guest68970 01:05 Eth4n left 01:07 tokuhirom left 01:13 am0c left 01:18 dorlamm joined 01:19 worr left 01:25 hypolin joined 01:26 ab5tract left 01:52 preflex left, ethndbst joined 01:53 preflex joined 01:54 am0c^ joined, kboga left 02:16 snearch left 02:20 bluescreen10 left, wolfman2000 joined 02:29 odoacre joined 02:42 replore_ joined 02:44 am0c joined 02:51 dorlamm left, am0c^ left 02:52 Guest68970 left 03:12 envi_ joined
odoacre text 03:50
sorear binary 03:52
Util :raw 03:59
04:02 worr joined 04:14 agentzh joined 04:17 PacoLinux_ joined 04:25 pyDude joined 04:41 woosley joined, wolfman2000 left 04:50 thou joined 05:29 alvis left 05:31 PacoLinux_ left 05:38 ethndbst left 05:43 thou left 05:49 PacoLinux_ joined 05:52 thou joined 05:59 donri joined 06:02 PacoLinux_ left
moritz good morning 06:03
06:05 packetknife joined, alvis joined 06:07 packetknife left
sorear good morning mortz 06:09
tadzik good morning #perl6 06:12
I'm going to write an open letter to this idiot who drills walls at 7 AM 06:13
argh. Disregard me
moritz drills for everone! Open Drill Foundation! 06:14
tadzik phenny: "wiertarka"? 06:15
phenny tadzik: "drill" (pl to en, translate.google.com)
tadzik ok, no faux pas ;)
sorear you live in a multiple-family-housing-structure, tadzik? 06:17
tadzik yeah, a block of flats 06:20
it's quite fine when some idiot is not drilling at 7 AM 06:21
06:21 packetknife joined 06:24 alvis left 06:25 alvis joined 06:41 PacoLinux_ joined 06:44 koban joined 06:56 birdwindupbird joined 06:59 hypolin left
dalek kudo/bigint: 71b0059 | moritz++ | src/Perl6/Actions.pm:
use better bigint -> num conversion in radcalc. Might fix the problem with the $Pi constant jnthn++ was seeing
07:00
07:06 agentzh left 07:08 wtw joined, nebuchadnezzar left 07:09 pyDude left 07:16 nebuchadnezzar joined
nebuchadnezzar yo 07:16
moritz jnthn: hah, found the problem 07:21
$ ./perl6 -e 'say 10000000000000000.Num' 07:22
1874919424
japhb moritz, What causes that? 07:33
moritz japhb: a bug in the bigint -> float converter that I wrote
japhb Right, I meant, what was the bug? 07:34
moritz japhb: "moritz being too silly to read the API docs of the library he is using"
japhb That'll get you every time. ;-) 07:35
moritz aye :-)
basically I missed a note that mp_get_int always cuts the result off to 32bit
japhb ouch.
moritz which is a nice idea if you want consistency, but not a nice idea if you want to use machine size ints
japhb NOD 07:36
moritz luckily easy to fix, it seems
.oO( by reading the API docs :-) )
07:37
japhb heh
BTW, did jnthn ever figure out why he was getting 32-bit INTVAL on a 64-bit arch?
moritz dunno
I'd guess it's a parrot Configure.pl hiccup, or a weird default in the compiler, or a mixture thereof 07:39
dalek p/bigint: d554f1d | moritz++ | / (2 files):
fix, simplify and test bigint -> float conversion for 32 < size < 64
07:40
japhb suspects "all of the above"
moritz if you read through that diff, the change from mp_get_int (32 bit) to DIGIT(a, 0) (full "digit" width, ususally 60 bit) is the interesting part
and it also explains why jnthn didn't see the erorrs, because on his platforms DIGIT is smaller than 32bit 07:41
japhb right.
That reminds me: might your problem with isbig be because of the upper 4 "reserved" bits left over from DIGIT are not necessarily all 0? 07:42
Meaning, do you need to mask them off before doing your isbig test? 07:43
(I'm not looking at the code at the moment, just something I thought of a while ago) 07:44
g'night, Perlwrights 07:46
TiMBuS moritz 07:56
moritz ... yes? 07:57
TiMBuS does the bigint implementation cause all ints to become.. big
had trouble phrasing that for some reason
does it box all ints
moritz well, the question is on what level 07:58
TiMBuS or does it use some overflow/upgrade magic
moritz an Int now always stores its data in an mp_int structure
but an int is still a machine-sized integer register
TiMBuS i see 07:59
i need to use my shift key more 08:00
moritz I'm surprised you don't, with that nick of yours :-)
TiMBuS about 11 years of using it and its sorta like a tattoo 08:01
i dont like it anymore but im stuck with it
08:02 TiMBuS is now known as Timbus
moritz doesn't have any tattoos he doesn't like 08:02
Timbus easier than i thought
moritz Timbus++ 08:05
dalek ast: df923e9 | moritz++ | S32-num/rat.t:
refudge rat.t for bigint usage
08:07 thou left
moritz jnthn: gist.github.com/1366434 current spectest status on bigint 08:07
jnthn: it seems the regex tests fail while compiling \x escapes, because I've overridden the hex -> int conversion method to return an Int 08:08
jnthn: I don't know what the best fix is, maybe you have an idea?
08:15 koban left 08:29 domidumont joined 08:34 mj41 joined 08:39 pochi left 08:48 PacoLinux_ left 08:52 mkramer joined 08:57 icwiener joined 08:58 flip214 joined 09:00 am0c left 09:01 flip214 left 09:05 huf joined 09:07 [particle] left, [particle] joined 09:09 jjore left, jjore joined 09:18 domidumont left 09:19 domidumont joined 09:21 cotto left 09:22 woosley left 09:29 snearch joined 09:40 jlaire left
jnthn morning, #perl6 09:40
moritz \o jnthn 09:41
jnthn Ugh. Caught a cold. 09:43
jnthn pulls the latest changes
moritz: OK, seems like I was having a bunch of those fail too 09:44
moritz rakudo doesn't yet declare the proper nqp/bigint dependency, it's just "the latest" :-)
$ ./perl6 --ll-exception -e '/\x12/' 2>&1|head 09:45
Null PMC access in invoke()
current instr.: 'nqp;QRegex;P6Regex;Actions;backslash:sym<x>' pc 76331 (src/stage2/QRegex.pir:26301) (src/stage2/QRegex.nqp:1300)
jnthn oh, is that the rx.t fail?
moritz yes
and another regex fail
I guess it's because the hex-to-int conversion now returns an Int 09:46
maybe I should revert that, and have it always return a parrot number in nqp, and override all action methods in rakudo
jnthn Is overriding backslash:sym<x> and friends in Rakudo not enough? 09:47
moritz dunno
jnthn ok 26 - bigint -> float, 1e16 09:48
moritz oh, it might be much simpler 09:49
jnthn however
not ok 1 - pi (using constant)
# got: 3.14159265
# expected: 0.552631241154582
moritz I've changed ints_to_string to a method, and QRegex still assumes it's a sub
:(
jnthn oh!
09:50 dakkar joined 09:51 replore_ left
jnthn hopes the :: to . fix does it 09:51
moritz jnthn: what does '3.14159265.perl' print on your machine?
it's 62831853/20000000 here 09:52
jnthn moritz: Seems it's something to do wiht length... gist.github.com/1366601 09:53
moritz: Note that it's not a Rat - it's a Num literal.
> 3.14159265.perl
62831853/20000000
moritz jnthn: then I need 3.141592653589.perl :-) 09:54
(radcalc deals with Num and Rat mostly the same way, so the output is still interesting) 09:55
jnthn > 3.141592653589.perl 09:56
3141592653589/1000000000000
moritz: I see we do this:
my num $result := nqp::mul_n(nqp::div_n(nqp::unbox_i($iresult), nqp::unbox_i($fdivide)), nqp::pow_n($base, $exponent));
return $*ST.add_numeric_constant('Num', $result);
moritz I thought I changed that from unbox_i to tonum_I
jnthn yeah, I was wondering why it wasn't tonum_I 09:57
Line 4317
moritz did I forget to push 71b0059ed1b7a54981de89fa932f077a4e70ac3f ?
jnthn oh wait
moritz jnthn: you forgot to pull :-)
jnthn Yeah...grr
sorry.
I thought I had :S 09:58
moritz no problem :-)
jnthn pi.t is happy again \o/
moritz++
moritz jnthn: if 3141592653589.Num seems sensible on your machine, the fix is likely to...
work
moritz too slow
jnthn t/spec/S02-types/infinity.rakudo - I suspect this one may need re-fudging; it doen't take kindly to Int.Inf failing. 09:59
moritz aye
I'm fine with fudging that one
09:59 GlitchMr joined
moritz it's todo()ed anyway 10:00
dalek ast: 82f7dc2 | moritz++ | S02-types/infinity.t:
s/todo/skip/ some Inf related tests which bigint branch will break completely
10:01
jnthn oh, heh, I just did it too
No changes -- Patch already applied.
Everything up-to-date
We did the exact same change ;)
moritz it's nice that git doesn't bother us with conflicts in that case
dalek p/bigint: 13943ae | moritz++ | src/ (2 files):
fix regexes again
10:02
p/bigint: feb1973 | moritz++ | src/stage0/ (6 files):
update bootstrap
jnthn nom: .say for :16<dead_beef> * 16**8, :16<dead_beef*16**8>
p6eval nom ef4702: OUTPUT«1.60456909810974e+19␤1.60456909810974e+19␤» 10:03
jnthn > .say for :16<dead_beef> * 16**8, :16<dead_beef*16**8>
16045690981097406464
1.60456909810974e+19
hmm...we accidentally the num somewhere :)
moritz src/Perl6/Actions.pm +4318 I'd guess 10:04
(ack'ing for pow_n)
hm, yes
we need to make radcalc smarter 10:05
to not always assume Num when an exponent is present
maybe just another flag to it
jnthn ah, yeah, I see what's going on
We conflate e123 with the **123 inside the rad
moritz right 10:06
maybe a :$num named param
then we can get rid of that exponent definedness check too
jnthn +1
10:07 daxim joined
jnthn nom: $x := 0; say 3 div $x; 10:08
p6eval nom ef4702: OUTPUT«===SORRY!===␤Variable $x is not predeclared at line 1, near " := 0; say"␤»
jnthn nom: my $x := 0; say 3 div $x;
p6eval nom ef4702: OUTPUT«Divide by zero␤ in sub infix:<div> at src/gen/CORE.setting:2324␤ in block <anon> at /tmp/SJaS0EAVb6:1␤ in <anon> at /tmp/SJaS0EAVb6:1␤»
jnthn > my $x := 0; say 3 div $x;
0
That's the arith.t one 10:09
moritz aye
should probably be fixed on the nqp_bigint_div op level 10:10
jnthn Yeah, looking at the op now :)
moritz nom: say nqp::box_I(1, 1)
p6eval nom ef4702: OUTPUT«===SORRY!===␤Unrecognized nqp:: opcode 'nqp::box_I' at line 1, near ""␤»
moritz nom: say nqp::box_i(1, 1)
p6eval nom ef4702: OUTPUT«1␤»
moritz maybe checking the return value of the mp_div call would be a good idea :-) 10:11
jnthn yeah, just making sure that it behaves :) 10:12
Testing it now 10:14
dalek p/bigint: 3bf3807 | jnthn++ | src/ops/nqp_bigint.ops:
Check return value of mp_div and throw exception. Fixes the arith.t regression.
10:20
moritz jnthn++ 10:21
jnthn nom: .say for +^0xdead +& 0xbeef, 0x2042 10:23
p6eval nom ef4702: OUTPUT«8258␤8258␤»
jnthn > +^0xdead +& 0xbeef, 0x2042 10:24
40622 8258
hmm..there's the bit.t one
jnthn digs a bit
nom: say +^0xdead 10:25
p6eval nom ef4702: OUTPUT«-57006␤»
moritz oh.
jnthn that matches
moritz not oh.
jnthn > say +^0xdead
-57006
moritz $ ./perl6 -e '.say for :16<dead_beef> * 16**8, :16<dead_beef*16**8>' 10:26
16045690981097406464
1.60456909810974e+19
meh, patch didn't work :/
jnthn aww
nom: say -1 +& 1 10:27
p6eval nom ef4702: OUTPUT«1␤»
jnthn nom: say -5 +& 2
p6eval nom ef4702: OUTPUT«2␤»
moritz ah, I see why my patch failed; trying to fix now
jnthn nom: say -57006 +& 0xbeef
p6eval nom ef4702: OUTPUT«8258␤»
jnthn nom: say +^0xdead +& 0xbeef 10:28
p6eval nom ef4702: OUTPUT«8258␤»
moritz jnthn: oh, it might be that bitwise ops from tommath do different things for negative numbers than perl 6 semantis
jnthn > say +^0xdead +& 0xbeef
40622
yeah
moritz I must admit I just wrapped the ops without thinking about possible semantic mismatches :/ 10:29
jnthn well, guess this is why we have tests :) 10:30
moritz nom: say (-3) +|
p6eval nom ef4702: OUTPUT«===SORRY!===␤Confused at line 1, near "say (-3) +"␤»
moritz nom: say (-3) +| 3
p6eval nom ef4702: OUTPUT«-1␤»
moritz that's 3 on bigint branch 10:31
because it just bit-ORs the magnitudes
jnthn ah, seems you fixed the rx.t \o/
moritz \o/
any ideas how the bit fiddling can be fixed? 10:32
jnthn t/spec/S10-packages/basic.rakudo also works for me now 10:33
As does t/spec/S10-packages/use-with-class.t
Thinking about the bit fiddling
moritz sorry, didn't spectest that one, takes too long here :/ 10:37
dalek kudo/bigint: 14baa3e | moritz++ | src/Perl6/Actions.pm:
make :16<dead_beef*16**8> return an Int
ast: 9eca146 | jnthn++ | S32-num/rat.t:
A couple of Inf related skips.
jnthn That last one sorts out rat.t 10:38
moritz: Are those S10 ones working for you again now?
moritz jnthn: will see in about 20min :/
jnthn k
moritz my laptop has the unhealthy tendency to overheat, and then turn itself off :/ 10:39
jnthn :(
Your radix fix works here \o/
jnthn crosses that test off the todo list
moritz and that's really bad if you use it remotely, and can't switch it on again
\o/
jnthn By my reckoning, we're now down to just needing to fix one test in bit.t, plus I should sort out big rats in pre-comp 10:40
moritz that sounds managable before the release :-)
jnthn :)
2011-11-17 Rakudo #46 -vacant- 10:41
Anybody who wants their moment of Rakudo release fame, step forward now ;)
arnsholt I've had mine, thanks =) 10:43
moritz: You're the Rat-man, no? 10:44
moritz arnsholt: I think colomon++ implemented them initially :-)
jnthn phenny: assk japhb if usage message in MAIN is up to the point where we can turn the MAIN entry green in perl6.org/compilers/features 10:45
phenny?
oh
phenny: ask japhb if usage message in MAIN is up to the point where we can turn the MAIN entry green in perl6.org/compilers/features
phenny jnthn: I'll pass that on when japhb is around.
arnsholt Ah, right 10:46
moritz anyway, I'm not up for a release this month (vacation in Oslo, unsure about internet access/computer usage at host family)
jnthn moritz: yes, I wasn't particularly thinking of you :) 10:47
ooh, Oslo vacation :)
enjoy it!
afk for a little bit...
moritz mostly wife's family
arnsholt I've been toying with an idea of trying to implement Rats with continued fraction representations, but figured it'd be a good idea to have a chat with people familiar with the present Rats
moritz arnsholt: well, there are two major questions to ask 10:48
1) how expensive is the storage and 2) how costly are operations
arnsholt Yeah, I agree 10:49
moritz and possibly 3) how easy/hard is it to detect overflow
arnsholt It'll be more expensive in terms of memory (obviously), but run-time I'm not sure
Which is why I wanna try
moritz arnsholt: just implement it in user space for a start
it offers everything you need, really
arnsholt Yeah, definitely. That's the nice thing with Perl 6: The code I want to compare with is in Perl 6 already, so it's easy to do 10:50
moritz what exactly would you need to store? a variable-sized list of integers?
arnsholt Yeah, it's a long array of ints 10:51
(The idea itself comes from reading MJD's blog, which talks about this a bit)
moritz you can use a ResizableIntegerArray from parrot for that, I gues
arnsholt There are some interesting properties to the representation. It's very easy to get good decimal approximations for example
But a priori I suspect the current way and continued fractions will be better at different things 10:52
moritz /home/moritz/p6/rakudo/install/bin/parrot: symbol lookup error: dynext/nqp_group.so/home/moritz/p6/rakudo/install/bin/parrot: symbol lookup error: dynext/nqp_group.so: undefined symbol: pmc_new
: undefined symbol: pmc_new
that's when trying to build nqp on newest parrot 10:53
10:54 xinming left 11:01 xinming joined
jnthn er, wtf :S 11:03
github.com/parrot/parrot/commit/df...b7d5f8951b 11:05
dalek p/bigint: 52cef6e | moritz++ | src/ (12 files):
track parrot name changes
jnthn aha, the regularly scheduled deckchair rearrangement...
11:09 ab5tract joined
jnthn ooh, though it was by bacek++...wonder if that means we get more awesome bacek hacking again :) 11:09
moritz jnthn: he just announced his intent to merge a branch (after parrot release), so seems like "yes" :-)
jnthn :D 11:10
OK, time to pretend I actually have a $dayjob for a while :) 11:11
11:31 PacoLinux_ joined
dalek p: 76e7d6e | bacek++ | src/6model/knowhow_bootstrapper.c:
Use PMCNULL instead of NULL to avoid triggering of assertions
11:32
p: 397dab4 | bacek++ | src/ (11 files):
Avoid using of deprecated parrot's functions

Replace pmc_new with Parrot_pmc_new, pmc_type with Parrot_pmc_get_type_str.
11:33
11:57 lestrrat left 11:58 lestrrat joined 12:05 am0c joined
colomon arnsholt: do you have a link to the relevant sections in MJD's blog? :) 12:13
12:14 am0c left 12:15 Patterner left, snearch left
arnsholt colomon: Just a 'sec 12:15
12:16 bluescreen10 joined, Psyche^ joined, Psyche^ is now known as Patterner
arnsholt colomon: perl.plover.com/yak/cftalk/ 12:16
Turns out it wasn't his blog =) 12:17
There's a reference to a website with a more technical presentation at the end 12:18
12:18 benabik left
colomon thanks! 12:23
arnsholt++
arnsholt You're welcome =)
As I mentioned to moritz, this is obviously more expensive in terms of memory, but it might offset the cost of gcd a bit 12:24
And they're very simple to make lazy
12:31 JimmyZ joined
JimmyZ ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็ 12:31
12:31 jql left, am0c joined
JimmyZ what's this? 12:31
tadzik mirrored n with an umbrella 12:32
JimmyZ ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็􏿽xE0
􏿽xB9􏿽x87็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็􏿽xE0􏿽xB9
􏿽x87็็็ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็
ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็􏿽xE0
􏿽xB9􏿽x87็็็็็็ส็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็็
.....
moritz that was not nice, JimmyZ 12:33
JimmyZ yes
I don't know it outputs this
flussence sometimes wishes there were a regex shorthand to match things like "% 10s" (multiple atoms adding up to a fixed string length) 12:34
tadzik hmm, you could maybe do that 12:35
/ $<foo>=[ <atom> <matom> <otam> ] <?{ $<foo>.chars == 10 }> / 12:36
moritz flussence: [. **10 & \s* \w*]
tadzik oh!
flussence wow. that was easy :D 12:37
tadzik & is like |?
12:37 PacoLinux_ left
arnsholt tadzik: Pretty much (in the sense I think you mean =) 12:37
tadzik (: 12:38
moritz nom: say '0045' ~~ / \d ** $ & 0+\d* /
p6eval nom ef4702: OUTPUT«=> <0>␤␤»
arnsholt Except it requires both branches to match, obviously
moritz nom: say '0045' ~~ / \d ** & & 0+\d* /
p6eval nom ef4702: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 1, near " & & 0+\\d*"␤»
moritz nom: say '0045' ~~ / \d ** 4 & 0+\d* /
p6eval nom ef4702: OUTPUT«=> <0045>␤␤»
moritz nom: say '0045' ~~ / ^[\d ** 3 & 0+\d*]$ /
p6eval nom ef4702: OUTPUT«#<failed match>␤»
moritz nom: say '0045' ~~ / ^[\d ** 4 & 0+\d*]$ /
p6eval nom ef4702: OUTPUT«=> <0045>␤␤»
moritz seems to even work :-)
12:42 benabik joined
dalek kudo/bigint: c3f6974 | moritz++ | src/ (5 files):
track parrot renames
12:42
12:47 wk joined 12:48 JimmyZ left
moritz $ echo 'class A { method x { say 3.1444444444444444447 } }' > A.pm 12:49
$ ./perl6 --target=pir A.pm > A.pir
$ ./perl6 -e 'use A; A.x'
0.645105813011996
the Rat serialization problme on 3 lines :-)
arnsholt Heehee =) 12:53
12:54 JimmyZ joined
moritz arnsholt: I've skimmed the slides on continuous fractions. Now I know why it's not used more widely :-) 12:56
it's just much more complicated than storing numerator and denominator
arnsholt Yeah, it looks a bit more fiddly 12:57
moritz and does seem to make + and * a lot more expensive
arnsholt Yeah, that's a distinct possibility 12:58
moritz (I'm not saying you shouldn't try, it sure is an interesting experiment)
arnsholt Yeah, I'm gonna try to find the tuits to tet it
s/tet/test
13:00 tokuhirom joined 13:01 Tamal joined
Tamal hello 13:01
moritz hi Tamal 13:02
Tamal how i can set up perl 6 ?
and where i can get its book ?
plz help
moritz Tamal: rakudo.org/how-to-get-rakudo/ 13:03
and the book from github.com/perl6/book/downloads
Tamal thanks 13:04
13:07 cooper left 13:08 Tamal left
moritz jnthn: t/spec/S03-operators/bit.t is now the only failing test in the bigint branch 13:11
on my machine
13:12 takadonet joined
takadonet hey all 13:13
moritz \o takadonet
jnthn moritz: Great, that matches what I have too 13:14
moritz: I'm trying to find the bit of the bitwise spec that covers the case we're seeing here 13:17
(looking in S03) 13:18
Or is it a "same as 5" thingy?
13:18 J__ joined 13:19 GlitchMr left, mishin joined
moritz +^$x 13:19
Coerces to Int and then does bitwise negation on the number, returning an Int. (In order not to have to represent an infinitude of 1's, represents that value as some negative in 2's complement form.)
so it is implied that int bitops work with 2's complement 13:20
jnthn aha, ok
Which is "fun" since our bigint library has a sign bit
moritz aye
(though honestly I'm fine with regressing on that bit for now, and worry about it later) 13:21
jnthn Only a bit later though ;)
13:22 jlaire joined
moritz hm 13:23
can't you emulate $a +| $b (2's complement) as $a +^ ($b + 1) (sign bit)? 13:24
nom: say 3 +| (-6) 13:25
p6eval nom ef4702: OUTPUT«-5␤»
jnthn Well, two's complement is flip all the bits (including an extra added MSB) and then add 1.
moritz yeah, I'm wrong here 13:26
13:28 J__ left
jnthn We could explicitly form the 2's complement of negative numbers 13:28
(before the anding and oring)
moritz sounds... inconvenient 13:30
like, growing the integer to the size of the other integer 13:31
manually inverting all the digits
clipping them to fit into DIGIT_BIT again
adding one
doing the bit operation
and all that only if exactly one of them is negative 13:32
jnthn yeah, not so efficient 13:36
13:37 JimmyZ left 13:40 am0c left
moritz should I try to implement it anyway? 13:41
jnthn Well, guess correctness is a good thing 13:43
And we provide native ints for people needing raw performance now :)
moritz nom: say (-1) +& 1 13:53
p6eval nom ef4702: OUTPUT«1␤»
moritz nom: say (-1) +& 3
p6eval nom ef4702: OUTPUT«3␤»
moritz nom: say (-1) +& (-3) 13:54
p6eval nom ef4702: OUTPUT«-3␤»
13:56 wk left 13:58 PacoLinux_ joined
moritz jnthn: moritz.faui2k3.org/tmp/bit_fiddling.patch is my current approach (compiles, not tested; doesn't produce the right sign yet) 14:04
oh, and it needs to negate back :/ 14:08
14:11 [particle] left
moritz (patch updated) 14:16
seems to work, modulo the sign
14:17 [particle] joined 14:18 wknight8111 joined
wknight8111 jnthn: ping 14:19
14:20 sayu joined 14:23 aloha left
jnthn wknight8111: pong 14:24
14:24 grondilu joined 14:25 kaleem joined
jnthn moritz: Looks like what I was expecting. 14:25
grondilu perl6: my $x; push @$x, 42; say @$x 14:26
p6eval niecza v11-23-g18f7db0: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/lib/CORE.setting line 773 (warn @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 168 (Mu.Str @ 9) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting …
..rakudo ef4702: OUTPUT«Use of uninitialized value in string context␤␤»
..pugs b927740: OUTPUT«42␤»
moritz I probably have to abort/interrupt my attempts right now; feel free to pick it up
14:26 risou_awy is now known as risou
jnthn moritz: ok, thanks...will see what time I get this evening 14:26
14:28 aloha joined 14:29 grondilu_ joined, grondilu left
grondilu_ pugs: say q{foo X bar foo Y bar} ~~ /foo [ .* !~~ X ] bar/;' 14:30
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected end of input␤ expecting "\\", variable name or "'"␤ at /tmp/bxmJlnFHI5 line 2, column 1␤»
wknight8111 jnthn: I was going to try to recruit you to help debug some parrot build errors on windows, but I seem to be making progress myself 14:32
jnthn wknight8111: I'm doing $dayjob bits but can certainly kick off a build and let you know what happens
wknight8111: Let me know what branch etc 14:33
14:39 Trashlord left 14:40 grondilu_ left 14:43 kaleem left 14:44 mkramer left, ab5tract left 14:52 PacoLinux_ left, Trashlord joined 15:02 cognominal_ left 15:07 thou joined 15:12 mishin left 15:18 wtw left
tadzik I get a few 'non zero exit status' spectests on the parrot/kill_constants, do you? 15:22
wknight8111 tadzik: Do you not see those errors on master? 15:27
tadzik: I heard rumors about those kinds of errors on master a while back, but never saw a ticket or anything. I assumed the issue disappeared 15:28
15:31 domidumont left 15:36 domidumont joined
tadzik wknight8111: I didn't check on master, I can rebuild the thing 15:42
wknight8111 tadzik: I'm just trying to narrow down between a problem specific to the branch or an endemic Parrot problem 15:48
tadzik sure thing
building rakudo now
jnthn I've had various such things 15:49
Got a couple at the moment
(On master)
wknight8111 I *suspect* it's an issue of inferior runloops coming up to bite us
sorear good * #perl6 15:51
colomon \o
15:51 ab5tract joined
colomon sorear: that reminds me, I wanted to ask you about MAIN. :) 15:51
tadzik rakudo doesn't build on plain parrot for me now
./perl6: symbol lookup error: dynext/perl6_ops.so: undefined symbol: pmc_type
funny, it built just a moment ago on kill_constants 15:52
wasn't the fix commited to bigint branch or such?
sorear colomon: not supported, and I don't _quite_ understand how it's supposed to work, mostly for want of research
colomon sorear: yeah, I was just wondering if you had a notion of how hard it would be to support it, even if just partially. 15:53
tadzik it was, mind me cherry-picking that into nom?
moritz, jnthn?
jnthn tadzik: Go ahead, though we should merge bigint soon anyway :) 15:55
I can handle losing 1 spectest for bigint support
And may be able to not do that
tadzik done
dalek kudo/nom: 0296f41 | moritz++ | src/ (5 files):
track parrot renames
tadzik suddenly, karma. Out of nowhere! :) 15:56
15:56 pochi joined
mux jnthn: is the bigint support for perl6 "homemade" or are you using libgmp or some other lib? 15:56
TimToady s/perl6/rakudo/
jnthn mux: libtommath 15:57
sorear colomon: eheh. discounting argument parsing, I think it would be not-too-hard to inject an ::Op::CallSub.new(|node($/), invocant => mklex($/, '&MAIN'), positionals => []) at the end of the mainline code if $*CURLEX<!sub>.has_lexical('&MAIN')
mux jnthn: I've heard many good things about this one
tadzik I've never heard about it, but everyone seems excited :) 15:58
mux same goes for libtomcrypt
jnthn mux: license and trivial to build on whatever platform are two good ones :)
mux nods violently
libtomcrypt seems to be a lot more complete than openssl
colomon sorear: I may take a look at doing that, then. assuming I get tuits, of course. :)
jnthn It's bad enough that Rakudo users have to go chase down ICU to get proper unicode support. I didn't want similar fun for bigint. 15:59
flussence (I've heard a few horror stories about openssl's internals...)
sorear colomon: otoh, this wouldn't work in the case of class Something; sub MAIN() { } # because now &MAIN is in class-Something rather than mainline
mux flussence: Don't. Ever. Read. It. :-)
flussence point taken
mux most people need to seek professional help after having read OpenSSL's code
sorear hmm, I wonder what would happen if I fed ICU4J into ikvm 16:00
flussence I get headaches just trying to *use* it :)
mux flussence: hah yeah, merely trying to use the openssl(1) CLI tool is a challenge - every damn time I need to, i fall in the same traps :-) the thing is, I rarely need to use it so I forget everything quickly 16:01
16:03 risou is now known as risou_awy
sorear colomon: you could also steal Rakudo's MAIN_HELPER, but you'd have to improve niecza's Sub introspection first 16:04
colomon sorear: that sounds like more of a project. :( 16:05
TimToady how far away is something like 6model for niecza? 16:06
16:06 packetkn_ joined, packetknife left 16:07 slavik1 left 16:08 slavik1 joined
sorear I would call finishing the 6model convergence a 2-week project 16:09
jnthn would call it an ongoing project, given even he doesn't consider 6model "complete" yet ;) 16:10
TimToady that would be 2 sorear-weeks, not 2 mere-mortal-weeks, I presume :)
sorear the biggest thing between Niecza-today and "6model" functionality is that HOWs aren't real P6 objects yet
TimToady: more to the point, 2-slow-weeks-at-school :)
TimToady nodnodnod 16:11
sorear these current weeks aren't slow
TimToady much as we are in favor of Perl 6, we are also in favor of people not blowing up their lives :)
sorear also it's a little hard to say what is meant by 6model
niecza is never going to quite look like 6model/clr because niecza made a few design decisions rather differently, like the one to use global "CPS" 16:12
jnthn Well, one of the points of "small core" was that the core could be implemented as best suits a platform. 16:13
16:25 birdwindupbird left
tadzik arr, 451 open 16:27
not on my watch
16:29 envi_ left 16:30 smash joined, ethndbst joined
smash hello everyone 16:30
tadzik hi smash 16:31
16:31 ab5tract left
tadzik rt.perl.org/rt3/Ticket/Display.html?id=100782 closable 16:32
16:34 packetkn_ left
masak closed it 16:35
(hi, #perl6)
jnthn evenin', masak 16:36
16:36 kaare_ joined
tadzik hello masak 16:38
wknight8111: same results on parrot master
16:39 wk joined
dalek ast: f362fbd | tadzik++ | S14-roles/mixin.t:
Tests for RT #100782
16:39
ast: 681e1e4 | tadzik++ | S02-lexical-conventions/sub-block-parsing.t:
Test for RT #85844
wknight8111 tadzik: okay, so it's a pervasive problem. Like I said, I suspect it's related to inferior runloops but don't know for certain
tadzik m'kay
rt.perl.org/rt3/Ticket/Display.html?id=85844 closable 16:40
and below 450 again :)
flussence
.oO( I'm having a productive week so far at $dayjob... 500 lines of code removed :)
tadzik testneeded in rt.perl.org/rt3/Ticket/Display.html?id=77112 16:43
masak tadzik: closed. 16:45
(the #85844, that is)
tadzik heh, I added a test for wrap.t, but we don't run wrap.t yet
never sure what to do in such situation :)
jnthn Implement .wrap? ;-) 16:46
tadzik :>
hehe
is meet('masak'), 'meet masak', 'wrapped meet() works';
jnthn
.oO( wrapped meat )
tadzik hrm 16:47
nom: use Test; eval_dies_ok 'nextsame' # what kind of error is that?
p6eval nom 0296f4: OUTPUT«not ok 1 - ␤»
tadzik it doesn't die, it's just the compiler failing 16:48
16:48 risou_awy is now known as risou, alester joined
mls Hi huys! 16:48
tadzik nom: use Test; dies_ok { nextsame }
hi mls!
mls guys
p6eval nom 0296f4: OUTPUT«not ok 1 - ␤»
jnthn gi mls!
mls ;)
tadzik oh, heh 16:49
mls jnthn: rakudo's closure creation code doesn't do a capture_lex
tadzik "huys" could sound offensive in Polish :>
jnthn mls: oh? It should do that at block entry... 16:50
mls: Example?
mls block entry doesn't work when recursion happens
we had an example last week, wait a sec
tadzik I have a feeling rt.perl.org/rt3/Ticket/Display.html?id=76328 is an alter ego of rt.perl.org/rt3/Ticket/Display.html?id=70267 and should be closed as well 16:52
mls gist.github.com/1367579
tadzik masak: your call ^ 16:53
16:53 KirG0FF joined
mls jnthn: my proposed fix is to add a perl6_capture_lex op that does a capture_lex on the $!do of the Code object and use it after "clone" is called 16:55
jnthn mls: will look in a moment
16:55 donri left
dalek ast: 43de0a9 | tadzik++ | S12-class/augment-supersede.t:
Test for RT #75432
16:56
tadzik rt.perl.org/rt3/Ticket/Display.html?id=75432 closable 16:57
nom: =pod ␤ die ␤ ␤ say 1 16:59
p6eval nom 0296f4: OUTPUT«1␤True␤ in block <anon> at /tmp/HV4njUElSg:4␤ in <anon> at /tmp/HV4njUElSg:1␤»
masak tadzik: I don't know about alter ego. they look distinct enough to me. 17:00
even though the error messages are now the same.
tadzik hrm
masak closes #75432 17:01
slavik1 would anyone advise against using perl6 for text processing? like reading a csv and dumping text after substituting some text?
tadzik I won't :) 17:02
masak slavik1: have you tried the Text::CSV module? :)
slavik1 masak: for perl6 or perl5?
masak for Perl 6.
tadzik masak: works on nom?
slavik1 not yet, I haven't really used perl6 yet :) 17:03
masak tadzik: unlikely.
slavik1 masak: the goal is to use perl6, not to parse csv files ;)
masak don't attempt to parse CSV on your own. it's tricky.
tadzik masak: may be worth adding to github.com/perl6/ecosystem/wiki/St...les-on-nom
masak secretgeek.net/csv_trouble.asp
slavik1 besides a simple while $*IN, split /\s*,\s*/ will be fine for this
masak tadzik: please feel free, I don't have tuits big enough right now :/
tadzik masak: okay 17:04
masak slavik1: it's your data. you do what you want.
17:04 sayu left
masak slavik1: just saying it's a common trap :) 17:04
slavik1 sounds good, thanks :)
17:04 ethndbst left
japhb o/ 17:04
phenny japhb: 10:45Z <jnthn> ask japhb if usage message in MAIN is up to the point where we can turn the MAIN entry green in perl6.org/compilers/features
slavik1 is rakudo still the most actively developed implementation? 17:05
masak slavik1: it has the highest bus number, if that's what you mean.
tadzik slavik1: niecza is actively developed too
masak slavik1: but sorear is pretty impressive in terms of output.
tadzik not sure about more-less active
slavik1 hmm, if I asked what implementation to use for perl6, what would be the recomendation?
17:06 ethndbst joined, ethndbst left, ethndbst joined
slavik1 and least broken in basic stuffs 17:06
tadzik Rakudo Star imho
masak slavik1: try Niecza if you're about to parse something.
fewer unpleasant surprises.
slavik1 I want to start using perl6 more and more
masak \o/
japhb jnthn, I haven't backlogged to see if you said anything else, but I'd say: We can turn it green as soon as the generation of the USAGE message is moved out of MAIN_HELPER so that it is available as $*USAGE for the user's &USAGE. We talked about that at one point, but I had not had tuits to make it happen.
slavik1 so niecza and rakudo* 17:07
jnthn japhb: ok
japhb jnthn, there is definitely more to do to improve src/core/Main.pm -- see the TODO list at the top of the file -- but I think we're good enough for green on MAIN with just that improvement.
er, I guess that was $?USAGE 17:08
I've been doing the Str.Numeric() work because I wanted to kill that top block of TODO items dead. ;-)
tadzik <?before> NYI in nom,? 17:09
jnthn tadzik: I think it's protoregexes that are the biggest blocker 17:10
tadzik right 17:11
jnthn tadzik: That's mostly been waiting on pmichaud++, though I've not had the tuits to really give us any other options over the last month
masak nom: say so "foo" /<?before foo> foo/
slavik1 so, what is "special" about nom?
p6eval nom 0296f4: OUTPUT«===SORRY!===␤Confused at line 1, near "say so \"fo"␤»
masak nom: say so "foo" ~~ /<?before foo> foo/
p6eval nom 0296f4: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in before at src/stage2/QRegex.nqp:612␤ in regex <anon> at /tmp/E0e8greiX0:1␤ in method ACCEPTS at src/gen/CORE.setting:6602␤ in block <anon> at /tmp/E0e8greiX0:1␤ in <anon> at /tmp/E0e8greiX0:1␤»…
tadzik jnthn: I understand 17:12
jnthn Now I have tuits and I'm tired of us being blocked on the ecosystem and so forth, so I'll probably see what I can do.
Plus we can't go on having a bus number of 1 on the regex engine.
Plus it will need its code-gen porting at some point.
masak slavik1: new, more p6ish object model, which in turn means a lot of doors open to other stuff.
17:14 MayDaniel joined
slavik1 I see, so rakudo* will eventually be nom* or something along those lines? 17:14
jnthn slavik1: No, we'll just do a Rakudo * release based on the "nom" development line.
tadzik once it's functional enough we'll just stop calling it "nom" :) 17:15
arnsholt slavik1: An optimiser and native types are some good highlights from nom 17:16
slavik1 ok, I see 17:17
so, we'll get bignum?
:P
nom: say 2**64
p6eval nom 0296f4: OUTPUT«-9223372036854775808␤»
slavik1 :(
jnthn slavik1: We have it in a branch
slavik1 rakudo: say 2**64
p6eval rakudo 0296f4: OUTPUT«-9223372036854775808␤»
jnthn slavik1: Expect to merge it tonight, all being well
locally 17:18
> say 2**64
18446744073709551616
:)
slavik1 nice, so tomorrow, it will output the right stuff :)
pugs: say 2**64
p6eval pugs b927740: OUTPUT«18446744073709551616␤»
jnthn slavik1: Yeah, moritz++ has been busily working away at it :)
slavik1 ^^
moritz: come to NYC, I buy you vodka and beer
:)
will there ever be a YAPC around NYC? 17:19
jnthn mls: Yes, see the issue 17:20
mls: oh, maybe 17:21
mls you maybe see the issue? ;)
jnthn :) 17:22
mls: It is doing capture_lex at the top
mls right
doesn't work when it recurses
as it doesn't get restored when it comes back
jnthn oh!
ok, now I get it :) 17:23
mls actually I plan a bigger change: I want to get rid at all of the capture_lex at the beginning of the subs
cause that can't work when we have multiple threads in the future
jnthn *nod*
17:24 Mowah_ joined
mls so I rewrote parrot's autoclosing so that it no longer uses that "ctx" element 17:24
(in fact, sub no longer has ctx in my branch)
autoclose now uses the call chain to find the correct outer ctx 17:25
wknight8111 mls: what's the status of that branch? Is it ready to merge?
mls not before you release parrot ;)
(and I want to merge my exception branch first) 17:26
anyway, today I got nqp and rakudo to work with the new autoclose semantics
17:26 mj41 left
wknight8111 mls: oh, that hasn't gotten merged either? We are running behind! 17:26
mls we'll have it in next months release
so nqp and rakudo works again, surprisingly few changes were needed but it took some time to find the correct spots ;) 17:27
jnthn mls: Would be interested to see what changed, fwiw 17:28
mls I'll paste the rakudo changes, just a sec
tadzik flussence: oh, btw. Did the Pod issues you've noticed eventually get to the RT? 17:29
wknight8111 hopefully this cycle I'll have enough time to get to work on my growing to-do list and help out with all this stuff
mls jnthn: gist.github.com/1367707 17:30
so it's just a couple of capture_lex added
;)
The difference is that immediate blocks no longer do a capture_lex 17:31
we still have it for sub and method definitions
17:31 wk left
mls (which is something we maybe want to change at somepoint in the future, I don't know the correct semantics tough) 17:31
benabik mls: Do immediate blocks have their :outer set correctly? 17:32
mls they always had
17:32 pyrimidine joined 17:35 orafu left
mls jnthn: proposed closure fix gist.github.com/1367725 17:35
(probably needs a comment in perl6.ops, though) 17:36
17:36 localhost joined 17:37 ethndbst left, orafu joined, Sarten-X left
jnthn mls: oh heh, I was just compiling almost exactly that patch locally :) 17:39
hm, segv :/
mls make clean
flussence tadzik: I think I forgot to do that... 17:40
17:41 pyrimidine left
tadzik flussence: no worries :) 17:41
flussence (I've been distracted by trying to get Text::Wrap usable lately)
tadzik not that I look forward to bugs and such 17:42
jnthn mls: Seems to work. Testing. 17:45
mls: ooh. It seems to fix some spectests too :) 17:50
17:52 MayDaniel left, ksi joined
mls \o/ 17:52
17:54 pyrimidine joined
jnthn Think I have a fix for the rat issue that's blocking bigint too :) 17:55
17:56 lichtkind joined
lichtkind perl6:my $a = [1..4] 17:56
perl6: my $a = [1..4]
p6eval niecza v11-23-g18f7db0: OUTPUT«Potential difficulties:␤ $a is declared but not used at /tmp/ZSyMYf_3st line 1:␤------> my ⏏$a = [1..4]␤␤»
..pugs b927740, rakudo 0296f4: ( no output )
lichtkind rakudo: my $a = [1..4] 17:57
p6eval rakudo 0296f4: ( no output )
lichtkind rakudo: my $a = [1..4]; say $a
p6eval rakudo 0296f4: OUTPUT«1 2 3 4␤»
lichtkind hm strange 17:58
colomon rakudo: my $a = [1..4]; say $a.perl 17:59
p6eval rakudo 0296f4: OUTPUT«[1, 2, 3, 4]␤»
lichtkind yes but that doesnt work in my lokal rakudo
colomon rakudo: say [1, 2, 3, 4]
p6eval rakudo 0296f4: OUTPUT«1 2 3 4␤»
colomon lichtkind: oh, okay, that is strange. :)
jnthn lichtkind: "doesn't work"? :) 18:00
dalek kudo/bigint: 768d3b9 | jnthn++ | src/ (2 files):
Apply patch from mls++ that fixes a lexical capturing and recursion interaction bug.
kudo/bigint: 9a4fc87 | jnthn++ | src/Perl6/SymbolTable.pm:
Fix handling of rats in pre-compiled code.
tadzik I'll try this bigint branch with you :)
jnthn mls: Your patch went into the bigint branch 'cus I was doing other stuff there...will be merging this into master soon though
tadzik: Testing welcome. Only one test in bit.t is regressed, all being well.
This goes for anyone else, btw.
mls no prob.
tadzik jnthn: do we have any bigint-specific (spec)tests? 18:01
jnthn tadzik: I suspect grepping through the test suite for "bigint" may get us some :)
tadzik: If not, we could do with some :)
colomon yes, we have bigint specific tests 18:04
they are either todo'd or skipped at the moment, obviously. :)
(in roast, I mean.) 18:05
jnthn OK, great :)
18:07 alvis left
tadzik I just love this university code. "///Coping constructor." I wonder what it's coping with, supposedly that other object passed into it :) 18:07
jnthn :) 18:08
Then there's those constructors commented "Initializes the object"
Wow, really?!?!
colomon mind you, that isn't to say that we have all the bigint tests we need -- just that there are quite a few already.
tadzik jnthn: I got better ones in this code:P "///const iterator.\nclass const_iterator {};" 18:09
jnthn nom: say -3 +& 1; say -3 +& 2; 18:10
p6eval nom 0296f4: OUTPUT«1␤0␤»
tadzik we are supposed to fill-in the code, so maybe this documentation is supposed to make us cry and fill it in as well ;)
jnthn
.oO( what is our children learning?! )
18:12
18:12 ethndbst joined, ethndbst left, ethndbst joined 18:13 wk joined
tadzik oh, I'm laughing at this code from the very beginning. "Your task is to fill in the code in aisdihashmap.h. It's not very nice to write all the code in .h, but, well, deal with it" 18:14
oh well, I should stop bothering with all this probably 18:15
jnthn moritz: Hmm. Bitwise patches don't quite work. There was a compile error that I fixed (missing &s). Will look for logic bugs now. 18:17
18:22 alvis joined
mls afk -> home 18:23
moritz jnthn: it needs to check the MSB, and grow_and_negate again if it's one 18:25
I think you can try DIGIT(that_int, USED(that_int)-1) & (MP_MASK > 1)
for that check 18:26
jnthn moritz: Where exactly?
moritz in the nqp_bigint_bor at the end of the if (SIGN(a) xor SIGN(b)) branch
s/at/opcode at/ 18:27
jnthn moritz: We already have a 18:28
grow_and_negate(&d, d.used, get_bigint(interp, $1));
moritz: We need to do it a second time?
hm, think I need dinner ;) 18:29
18:30 mj41 joined 18:32 Sarten-X joined, wk left
moritz jnthn: we need it once *only* if the MSB is 1 18:35
18:38 cotto joined, localhost left 18:42 dakkar left
japhb jnthn, when you're back: I'd like to try to get the MAIN feature green before this week's release. So IIRC you said I needed to do three things: 1. move MAIN_HELPER's private gen-usage() to be a Routine.usage method, 2. Create a $?USAGE variable per compilation unit, 3. Fill $?USAGE with &MAIN.usage if &MAIN exists in the comp unit after it is fully compiled. SO: A) Do those steps sound right? and B) How do I do #2 and #3? :-) 18:44
moritz, feel free to chime in if you know the answers, of course ...
moritz feels free, but not useful :-) 18:48
japhb awww
moritz japhb: I can only suggest to look at how tadzik++ did it with the POD variable(s)
slavik1 what is "MAIN" ?
moritz $pod2text.push(PAST::Var.new(:name<$=POD>, :node($/)))
that sounds promising, no?
slavik1: a routine that is automatically called on program start
slavik1 ahh 18:49
moritz nom: sub MAIN($x = 5) { say $x }
p6eval nom 0296f4: OUTPUT«5␤»
slavik1 like BEGIN{} ? :P
jnthn japhb: bit distracted making food but 2 and 3 will involve interaction with $*ST
slavik1 rakudo: sub MAIN($x = 5) { say $x }
p6eval rakudo 0296f4: OUTPUT«5␤»
slavik1 :D
moritz if you provide a command line argument to that script, it ends up being in $x
slavik1 moritz: is there a similar way to do what python users do: if __name__ == something, call main
jnthn japhb: You can create a variable in the top scope using that and give it a compile-time value
moritz slavik1: perl6advent.wordpress.com/2010/12/0...main-subs/
slavik1 to know whether a script was called as main or loaded as module 18:50
moritz jnthn: I might have a working bit twiddling patch, just a sec
slavik1: well, it does much more, it parses the command line for you
jnthn japhb: You can get hold of the MAIN routine and just call its usage method
slavik1 yeah, reading that, nice :)
jnthn japhb: You'll want to nqp::unbox_s($main.usage()) 18:51
masak slavik1: MAIN is meant to be called only if the file *wasn't* loaded as a module.
jnthn japhb: And then $*ST.add_constant to add a string constant to the SC
slavik1 masak: awesome!
so MAIN is good practice/style
jnthn japhb: Then after that you'll be able to take the returned value and set install it as a lexical
$*ST.install_lexical_symbol(...) 18:52
jnthn goes to keep an eye on food
japhb jnthn, OK, thank you so far.
slavik1 masak: how come last example has :$how, but previous examples have only the variable
japhb I'll look for similar expressions and see if I can figure it out.
dalek p/bigint: ed5e66c | bacek++ | src/6model/knowhow_bootstrapper.c:
Use PMCNULL instead of NULL to avoid triggering of assertions
18:53
p/bigint: 6dc4277 | moritz++ | src/ops/nqp_bigint.ops:
try to adopt bigint bitop semantics to 2s complement, which Perl 6 needs
moritz jnthn: I haven't tested that patch in detail yet, but in the one example that I tried it gave the right result :-)
18:55 wk joined
masak slavik1: not sure I understand the question. both nameds and positionals work. 18:56
jnthn masak: doing a make install and then will build Rakudo against it 18:57
er
moritz: ^^
masak tapes a note with the word "mis-tab" on jnthn and runs off tittering
slavik1 masak: what is the diff between sub MAIN(:$var) {} and sub MAIN ($var) {} ? 18:58
masak nom: sub foo($var) { say $var }; foo(5); foo( :var(5) )
p6eval nom 0296f4: OUTPUT«5␤Not enough positional parameters passed; got 0 but expected 1␤ in sub foo at /tmp/lYlHlbM5ng:1␤ in block <anon> at /tmp/lYlHlbM5ng:1␤ in <anon> at /tmp/lYlHlbM5ng:1␤»
masak nom: sub foo(:$var) { say $var }; foo( :var(5) ); foo(5) 18:59
p6eval nom 0296f4: OUTPUT«5␤Too many positional parameters passed; got 1 but expected 0␤ in sub foo at /tmp/QHxcMbZe0u:1␤ in block <anon> at /tmp/QHxcMbZe0u:1␤ in <anon> at /tmp/QHxcMbZe0u:1␤»
slavik1 lol
moritz slavik1: if the declaration says :$var, the command line expects --var=vars_value 19:00
slavik1 ahh, I see
getopt::long for free :)
would -v work? 19:01
jnthn moritz: bit.t passes \o/ 19:02
moritz: And I fixed the rat pre-comp bug earlier
moritz: Running a full spectest now...looks like we're on the verge of a merge \o/
tadzik wooo
19:03 snearch joined
japhb jnthn, OK, it looks like I need to add a new my variable $*USAGE to the list at the top of token comp_unit in Grammar.pm, and then around line 450 in the same token add a line: $*ST.install_lexical_symbols($*UNIT, '$?USAGE', $*USAGE); 19:04
Does that sound about right?
And then where do I set it's value?
In the block around 462-471?
jnthn japhb: oh, you could do it that way
japhb OK, what did I not understand? ;-) 19:05
japhb is going deep into new-to-him code here
jnthn japhb: I was thinking of just keeping track of the MAIN
japhb: And calling .usage() on that when we come to install $?USAGE
japhb: You could do it the way you have it too, though :) 19:06
19:06 benabik left
jnthn japhb: To set $*USAGE, you need to tkae the result of calling .usage(), unbox it (nqp::unbox_s) 19:06
And then do
19:07 benabik joined
jnthn $*USAGE := $*ST.add_string_constant($unboxed_result_of_usage)<compile_time_value>; 19:07
japhb So how do I find &MAIN (or track it, as you suggest) from within Grammar.pm? MAIN_HELPER uses callframe(1).my<&MAIN>, but I'm assuming that's as nonsensical as it appears in Grammar.pm 19:09
19:10 daxim left
japhb jnthn: ^^ 19:12
jnthn japhb: Oh, I was assuming you already tracked that in the grammar
japhb: Well, one way is in routine_def
if the name eq 'MAIN'...
And you have the code object there
Well, you do after create_code_object is called
japhb I've spent time some time learning the setting and STD.pm. I had not yet learned Rakudo's Grammer.pm and Actions.pm ... :-/ 19:13
No time like the present, I guess.
jnthn japhb: The main thing to keep in mind is that Rakudo keeps a 3-way distinction 19:14
Grammar for parsing, Actions for making AST, and SymbolTable which keeps track of all the declarational stuff, including meta-objects
jnthn noms, bbs 19:16
japhb enjoy!
19:18 wolfman2000 joined 19:19 localhost joined
moritz jnthn: I get a failure in t/spec/S11-modules/require.t 19:28
not ok 3 - can require with variable name
# Incorrect pre-compiled version of src/gen/Metamodel.pm loaded
(but I've seen that one before; a clean rebuild might fix it 19:29
19:29 envi_ joined
japhb jnthn, OK, if I'm reading method routine_def() properly, it looks like I need to track MAIN in two places, depending on whether it is a multi or not: 1) Around line 1455, at the end of the block that begins "if $*MULTINESS eq 'multi' {", I need to "$*MAIN := $proto", so that the &MAIN I call .usage on is actually the proto. and 2) in the block around line 1470 that begins "elsif $*SCOPE eq 'our', I need to set "$*MAIN := $code", because i 19:33
t's an only routine.
Is that about right?
19:33 wolfman2000 left
japhb Hmmmm, I guess &MAIN will still get called even if it has 'my' scope ... 19:33
moritz all subs are 'my' by default 19:34
japhb Ah, OK, good.
Now the question is ... the line at the top of MAIN_HELPER that says 'my $m = callframe(1).my<&MAIN>' ... will that be foiled if the programmer wrote 'our sub MAIN ...' ? 19:35
PerlJam japhb: probably. 19:37
japhb Yeah, that felt like an old bug. I didn't mess with it when I did the rewrite, but I think now's the time to fix it. What should it be, anyway? 19:38
jnthn back 19:41
moritz: require.t works fine here fwiw 19:42
moritz jnthn: trying again after a real clean
jnthn japhb: our installs a lexical alias
japhb: The bigger issue is if they write 19:43
module Foo { sub MAIN() { } }
japhb oh, eww.
Yeah.
PerlJam jnthn: shouldn't it be more like $*ST.find_symbol('&MAIN') ? 19:44
(note, I'm only barely paying attention here :)
jnthn PerlJam: If we're in the Actions, yes
PerlJam japhb: what's the problem you're trying to solve? 19:45
jnthn But MAIN_HELPER isn't - it's on the runtime side of the fence :)
moritz: I'm good for merging, if you are. I can do it
19:46 packetknife joined
moritz jnthn: go right ahead 19:46
I can confirm that the Rat precompilation problem is gone too
there are still two things that bother me
1) &radcalc is called twice for every Rat literal 19:47
and 2) since Rat serialization is specialized, the argument passing to $*ST.add_constant('Rat', ...) in &radcalc can probably be simplified
jnthn moritz: (1) is true for master too, I believe
moritz but nothing of that should hold off the merge
jnthn: any idea why?
jnthn moritz: Not off hand...seems like it's backtracking or something 19:48
PerlJam Isn't there supposed to be a Rakudo compiler release this week? (or are we going to skip it again like we did in Aug?)
jnthn PerlJam: We'll do it this week
PerlJam: Thus the work to get bigint into shape for it ;)
PerlJam yeah, sorry I haven't kept up with #perl6 or the bigint progress :) 19:49
jnthn++ moritz++
and tom++ whoever he is ;)
dalek p: ed5e66c | bacek++ | src/6model/knowhow_bootstrapper.c:
Use PMCNULL instead of NULL to avoid triggering of assertions
19:51
p: 6dc4277 | moritz++ | src/ops/nqp_bigint.ops:
try to adopt bigint bitop semantics to 2s complement, which Perl 6 needs
p: 0e7280c | jnthn++ | / (154 files):
Merge branch 'bigint'
19:53 benabik_ joined, mj41 left 19:54 molaf_ left 19:56 benabik left, benabik_ is now known as benabik
japhb Excellent, once nom merges rakudo/bigint, I can move my current snapshot of the Str.Numeric() over to use the bigint ops, and then it's mergeable, I think. (Far from finished, but sufficiently more capable than the existing that it'll be a decent win.) 19:57
After that, I'll try to get these MAIN/USAGE things nailed. 19:58
*snapshot of the Str.Numeric() rewrite
dalek kudo/nom: 768d3b9 | jnthn++ | src/ (2 files):
Apply patch from mls++ that fixes a lexical capturing and recursion interaction bug.
20:04
kudo/nom: 9a4fc87 | jnthn++ | src/Perl6/SymbolTable.pm:
Fix handling of rats in pre-compiled code.
kudo/nom: 7cd5def | jnthn++ | / (10 files):
Merge branch 'bigint' into nom
kudo/nom: 2926f27 | jnthn++ | tools/build/NQP_REVISION:
Bump to latest NQP_REVISION.
ast: eac8f06 | jnthn++ | S04-statements/for.t:
Untodo now passing test for 103332 (mls++ for the fix).
20:05
20:07 kfo_ joined 20:08 MayDaniel joined 20:11 kfo left, araujo left
japhb jnthn, everything ready to pull and rebuild nom at this point? 20:15
20:15 mikehh joined
jnthn japhb: yes 20:15
japhb: let me know if you run into any issues 20:16
dalek ast: 6ca8c15 | jnthn++ | S06-signature/unpack-array.t:
Unfudge a couple of tests we now pass.
ast: 987ade2 | jnthn++ | S0 (2 files):
Unfudge some bigint tests; remove a stray say.
jnthn wonders if today's Parrot release was cut yet
20:16 wk left
japhb OK, doing 'make realclean; rm -rf install/; perl Configure.pl --gen-parrot; make' 20:16
benabik jnthn: Not yet.
20:18 am0c joined
dalek kudo/nom: 0bd4922 | jnthn++ | docs/ChangeLog:
Update changelog a little.
20:18
masak not long ago, I received a nice email from a Mr Eugene Burmako, pertaining to my macro grant. 20:19
turns out Mr Burmako is the person behind scalamacros.org/
(which looks at least vaguely similar to Perl 6 macros) 20:20
20:21 envi_ left
masak I'm thinking I should study Scala macros a little bit. at least enough to make sure that they're not doing something we should clearly be doing too :) 20:21
dalek ast: 06ae20e | jnthn++ | S03-operators/ (2 files):
Two more sets of unfudges now we have bigint landed.
20:23
20:23 natureboy joined
dalek p: f1b02e1 | moritz++ | src/ops/nqp_bigint.ops:
save an allocation in nqp_bigint_div

the mp_div code allows NULL as remainder, so no need to allocate it
20:24
20:25 KirG0FF left
colomon bigint has landed! \o/ 20:25
jnthn moritz: Does git describe work for you in the Parrot repo? 20:26
moritz jnthn: needs git describe --tags
jnthn moritz: thanks!
jnthn tries a build against latest Parrot 20:28
masak wow. big Ints.
moritz and our rats are all Fat right now
colomon doh!
20:28 ethndbst left
colomon I was wondering if it's time to work on the Rational role 20:29
dalek atures: 834bed4 | jnthn++ | features.json:
Rakudo now has big integers.
jnthn moritz: Yeah
moritz: Realized that. :) 20:30
moritz I thought I had already done that patch days ago, turns out I was wrong
jnthn std: method addto (|args, $self: @x) { trace(args); $self += [+] @x } 20:34
p6eval std be1f10e: OUTPUT«===SORRY!===␤Malformed parameter at /tmp/Ms0bHxEqw8 line 1:␤------> method addto (⏏|args, $self: @x) { trace(args); $self +␤ expecting any of:␤ method_def␤ name␤ parameter␤ signature␤Parse failed␤FAILED 00:01 120m␤»…
jnthn ENOTYET
20:35 am0c left
dalek p: 2fcf054 | jnthn++ | tools/build/PARROT_REVISION:
Bump to latest Parrot (not quite release yet) in order to get more testing against it.
20:38
20:41 pyrimidine left
japhb jnthn, initial build and run of the old version of my Str.Numeric() stress test worked on the newly merged nom. 20:42
Now to figure out what to change to make it use the new bigint ops
20:43 pyrimidine joined
japhb BAH 20:44
ARGH 20:45
jnthn ?
benabik Grr, argh?
japhb messed up, and pulled and built the wrong thing. It looked like nom ... but it was not nom. 20:46
jnthn oops :(
japhb: nqp::radix_I is probably the op you're looking for
japhb jnthn, yep. And that's how I new I had somehow gotten the wrong thing. nqp::radix_I wasn't being used anywhere. :-/ 20:47
Ah well, just some wasted time.
jnthn phenny: tell mls I tried to bring in your directaccess patch to nqp again, but it breaks the Rakudo build.
phenny jnthn: I'll pass that on when mls is around.
benabik homebrew++ # libtommath 20:50
20:53 Lothar left, Lothbot joined
japhb lunch & 20:54
dalek Heuristic branch merge: pushed 229 commits to nqp/nfa by jnthn 21:04
21:05 mj41 joined 21:08 packetknife left
dalek kudo/nom: abc35ca | moritz++ | src/Perl6/Actions.pm:
simplify Rat codegen a bit
21:09
21:20 ethndbst joined, ethndbst left, ethndbst joined, benabik left
tadzik spectest is not slower (significantly) than before the merge 21:20
jnthn tadzik: Yeah, same result here 21:21
tadzik good
dalek p/nfa: 4e60875 | jnthn++ | src/NQPQ/Actions.pm:
Fix nqpq enough that it can at least run an nqp program with regexes in.
21:22
21:27 MayDaniel left, ksi left 21:30 wknight8111 left
dalek p/nfa: ffb5596 | jnthn++ | src/NQPQ/Actions.pm:
Catch NQPQ up with changes to NQP (just some actions twiddles).
21:33
21:36 rjbs- joined
rjbs- perl6: my $x = 5 || ...; say $x 21:37
p6eval pugs b927740, rakudo 0bd492, niecza v11-23-g18f7db0: OUTPUT«5␤»
rjbs- (Hi, I'm just here to harass the bot)
21:37 rjbs- is now known as rjbs, rjbs left, rjbs joined
masak interesting. :) 21:37
rjbs was just feeling sad that p5's ... can't be used as an expression. 21:38
I was 99% sure p6's could, and wanted to check.
jnthn It's just parsed as a term.
rjbs That's what I thought / hoped. Excellent.
21:43 Mowah_ left
dalek p/nfa: 0be2206 | jnthn++ | src/QRegex/Cursor.nqp:
Add missing .chars method to NQPMatch, getting us a bit further with 31-grammar.t.
21:49
p/nfa: 60b88d4 | jnthn++ | src/QRegex/Cursor.nqp:
Add a couple of missing vtable overrides to NQPMatch. Gets 31-grammar.t passing again.
rjbs niecza? 21:50
colomon niecza what? 21:51
rjbs What is it?
aha, CLR
colomon a separate implementation of Perl 6 21:52
rjbs Yeah, I figured that part (since p6eval mentioned it) but hadn't heard of it before. Should've googled, but I thought some infobot might just tell me :) 21:53
21:53 benabik joined 21:55 kaare_ left 21:57 ab5tract joined
masak rjbs: we haven't found the right balance between infobot and too chatty in here yet :) 21:59
22:00 Trashlord left
masak thankfully, single-word questions tend to cause non-bot players to proffer information too... 22:01
22:01 bluescreen10 left 22:03 Trashlord joined
rjbs masak: :) yeah, infobots can be a real pain, too 22:05
masak ss/can be/are/ # :)
*cough* purl *cough* 22:06
tadzik I liked that guy 22:07
masak tadzik: purl is (1) a girl, (2) not likeable. :)
rjbs still likes purl.
I get annoyed when purl *and* dispy are around.
masak haha 22:08
rjbs "what's up?" // "up is a pronoun, or your face, or a good REM album, or at example.com/~someguy/301-up.html // url title: 301 up at someguy // uh oh! long url! try this one: sho.rt/123 // url title: 301-up at someguy // ... 22:09
masak aaugh 22:11
rjbs will not further remind you of such nonsense. 22:12
masak :)
rjbs: by the way, congratulations on being the new Holder of the Perl 5 Pumkin. 22:14
'night, #perl6
rjbs Thanks! Here's hoping I come out of it unscathed.
masak -Ounscathing 22:15
dalek p/nfa: 71ec512 | jnthn++ | src/NQPQ/Actions.pm:
Get regex grammar related actions in nqpq switched over from PAST::Regex to QAST::Regex. Fixes various of the failing tests.
22:16
22:17 pyrimidine left 22:18 am0c joined 22:35 daniel-s joined 22:46 icwiener left 22:59 whiteknight joined 23:00 whiteknight is now known as Guest52379 23:08 addicted joined
addicted hi 23:08
i need some help with a small simple project
already have the program done, but i have to chance the website it uses
basicly it takes a list of domains in a .txt and passes it throught the www.websiteoutlook.com
and it gets the value of the website in the list and its daily views
but now the websiteoutlook.com closed..
so i need someone to "update" the progrm to use alexa.com
23:10 natureboy left 23:11 cooper joined 23:23 mj41 left 23:24 fsergot joined
dalek p/nfa: 9e0867d | jnthn++ | src/NQPQ/Grammar.pm:
Add missing contextual declaration to / / parsing, so QRegex nibbler won't explode.
23:27
p/nfa: 1427edb | jnthn++ | src/NQPQ/Grammar.pm:
Also toss now-unwanted #=open usage.
p/nfa: 6efeb3c | jnthn++ | src/ops/nqp.ops:
Fix is_invokable op.
p/nfa: 3611d39 | jnthn++ | src/QRegex/Cursor.nqp:
Make NQPCursor.parse able to handle being passed an invokable rule. Sketch in NQPRegexMethod and NQPRegex classes, as QRegexy replacements for Regex::Method and Regex::Regex.
japhb Unfortunately I've lost the earlier run back past the start of my scrollback buffer, but if my recollection of the orginal values is correct, my Str.Numeric() stress test perf test *WITHOUT* updating to newer bigint ops is 20-30% slower than pre-bigint-merges. 23:29
Now let's see what happens when I convert to bigint ops ...
23:32 ab5tract left
dalek p/nfa: 2da67f4 | jnthn++ | src/NQPQ/Actions.pm:
Update quote:sym</ /> actions. We can now do things like say('b33r' ~~ /\d+/) again.
23:32
p/nfa: 124f95e | jnthn++ | t/nqp/50-regex.t:
Update a test to use the new NQPCursor type.
23:33 cognominal joined 23:38 snearch left
dalek p/nfa: a915744 | jnthn++ | src/NQPQ/Actions.pm:
Make regex declartors work out of sink context and smartmatch correctly. Mostly fixes 45-smartmatch.t (if you remove the last test, which compile fails while building the NFA).
23:40
23:49 mikehh left 23:57 alester left 23:58 addicted left