»ö« 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:02 MayDaniel left 00:16 am0c left 00:24 leprevost left 00:27 am0c joined 00:29 raiph joined 00:44 benabik joined 00:47 yarp joined 01:04 fgomez left 01:10 anuby joined 01:29 Psyche^ joined, Psyche^ is now known as Patterner 01:30 hypolin joined 01:33 Chillance left 01:38 leont left 01:42 FROGGS_ joined 01:43 leprevost joined 01:44 flightrecorder left, whiteknight left 01:46 flightrecorder joined, FROGGS left 01:49 MikeFair_ left 01:57 MikeFair_ joined 01:59 gootle joined 02:09 MikeFair_ left 02:10 MikeFair_ joined, fgomez joined 02:13 Patterner left 02:14 colomon_ joined, colomon left, colomon_ is now known as colomon
[Coke] pushed another set of updates for QAST on partcl-nqp/nqp2, and is now getting this error: 02:14
Error while compiling block : Error while compiling op : hash: can't use null as key 02:15
02:43 thou joined 02:50 odoacre joined 02:56 orafu left, orafu joined 02:57 raiph left 03:02 yarp left 03:20 Psyche^ joined, Psyche^ is now known as Patterner 03:31 erkan left
MikeFair_ [Coke]: how's that error coming? 03:34
03:48 leprevost left 03:53 s1n left 04:00 Traceur joined 04:08 thou left 04:23 Traceur left, Traceur joined, wk left, jaldhar left, sftp left, snarkyboojum left, PerlJam left, bbkr left 04:24 Traceur left, Traceur joined 04:26 telex left 04:28 wk joined, jaldhar joined, sftp joined, snarkyboojum joined, PerlJam joined, bbkr joined 04:29 Traceur left 04:32 telex joined 04:37 fm__ joined 04:47 kaleem joined 04:58 wk left 05:19 FROGGS_ left 05:20 flightrecorder left 05:37 skids left
sorear random, certainly unoriginal, thought on number theory: 05:42
05:44 fm__ left
TimToady ... 05:45
sorear given a putative number p of the form 4k+1, for all x, let y = x^2, z = y^2, now z^((p+1)/4) = x^(p+1) = y mod p, so square roots are easy iff p is prime (Blum-Goldwasser) 05:47
now imagine turning this into a primality test: take a random number, try to take a square root, fail if the putative root is wrong 05:48
if this test gives a false positive, it has found a square root of a random number modulo a composite
but we know (Rabin) that that is exactly as hard as factoring.
so a single iteration of this test will only give the wrong answer, if the test could have factored the number 05:49
if factoring is hard on average for classical algorithms, this algorithm fails with neglible probability on random inputs
I've seen a lot of primality testers using the generalized Riemann hypothesis 05:55
I can't be the first one to think of primality testing connected to standard cryptographic assumptions
MikeFair_ you're not, but those who are interested in the field tend to flock together or not talk about their work. :) In fact I think several movies even make references to such things (sneakers comes to mind, not that many people actually understood what the match the professor was explaining that chip actually did) 06:29
Anyone here aware of Java's JSR223 Scripting Engine Framework API? 06:30
I just got made aware of it today, and think it could be relevant to the Perl6 on Java / Parrot on Java discussion 06:32
06:33 birdwindupbird joined
sorear MikeFair_: nah, what's really interesting here is the faint glimmer of a connection between the GRH and P vs NP. Pity I'm nowhere near good enough to follow up on it. 06:34
MikeFair_ sorear: I hear that pain. :) 06:35
Man, some people have done a lot of very cool stuff out there 06:38
06:45 flightrecorder joined 06:46 FROGGS joined
sorear o/ 06:47
FROGGS good morning 06:48
06:50 MayDaniel joined
jnthn o/ 06:50
wow, short backlog
diakopter :) 06:51
sorear o/ 06:52
06:55 wamba joined, GlitchMr joined 06:58 fhelmberger joined
jnthn commuts 07:01
FROGGS jnthn: latest rakudo complains about the \ in \$arr here: multi method at_pos(::?CLASS:D \$arr: $pos) is rw { # NativeCall.pm#L149 07:03
should the \ be removed?
"Obsolete use of | or \ with sigil on param $arr"
just a warning though
07:05 odoacre left 07:09 brrt joined
tadzik good morning #perl6 07:14
FROGGS morning tadzik 07:15
07:17 odoacre_ joined 07:22 odoacre_ left 07:25 odoacre_ joined
GlitchMr FROGGS: it is \arr if I remember correctly 07:31
FROGGS: perlcabal.org/syn/S06.html#Parcel_binding 07:32
07:34 Psyche^ joined, wk joined, Patterner left, Psyche^ is now known as Patterner
GlitchMr perl6: class Mumbler { method mumble { say "Mumble!" } };(-> \_ = OUTER::<_> { _.mumble })(Mumbler.new()) 07:35
p6eval rakudo ef228d: OUTPUT«Mumble!␤»
..niecza v21-15-gf226bf6: OUTPUT«===SORRY!===␤␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/cTelw01ND9 line 1:␤------> { say "Mumble!" } };(-> \_ = OUTER::<_> ⏏{ _.mumble })(Mumbler.new())␤␤P…
GlitchMr std: class Mumbler { method mumble { say "Mumble!" } };(-> \_ = OUTER::<_> { _.mumble })(Mumbler.new())
p6eval std 77327a4: OUTPUT«Use of uninitialized value $first in string eq at STD.pm line 65741.␤Use of uninitialized value $first in string lt at STD.pm line 65746.␤===SORRY!===␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) … 07:36
GlitchMr std: class Mumbler { method mumble { say "Mumble!" } }; (-> \$_ = OUTER::<$_> { $_.mumble })(Mumbler.new())
p6eval std 77327a4: OUTPUT«===SORRY!===␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/mEPr__Wf87 line 1:␤------> ay "Mumble!" } }; (-> \$_ = OUTER::<$_> ⏏{ $_.mumble })(Mumbler.new())␤ expecting…
07:53 wtw joined 07:56 kurahaupo left 07:59 MayDaniel left 08:30 kresike joined
kresike hello all you happy perl6 people 08:30
08:31 wtw left
sorear FROGGS: what GlitchMr says, you're actually supposed to remove the sigil and leave the \ 08:36
sleep&
08:36 Khisanth left 08:42 Khisanth joined
GlitchMr Interesting how sleep program on my PC requires time argument 08:43
08:43 wtw joined
masak morning, #perl6 08:47
08:58 erkan joined, erkan left, erkan joined 09:00 GlitchMr left 09:11 gootle left 09:13 gootle joined 09:15 wamba left 09:19 leont joined 09:24 wamba joined 09:28 wamba left 09:30 wamba joined 09:44 wamba left 10:03 hypolin left 10:14 anuby left 10:43 Chillance joined 10:53 Chillance_ joined 10:54 Chillance left 10:57 Chillance_ is now known as Chillance 10:59 cognominal joined 11:04 gootle left 11:05 Su-Shee_ joined 11:06 wamba joined 11:07 kurahaupo joined 11:08 Su-Shee left 11:09 Su-Shee_ is now known as Su-Shee 11:11 cognominal left 11:17 cognominal joined 11:27 am0c left 11:36 mucker joined 11:40 wk_ joined 11:41 wk left 11:43 MissingSemicolon joined
masak MissingSemicolon: welcome :) 11:45
JavaScript programmer? :P
MissingSemicolon lol, no, just tried to think of the cleverest screen name I could. Didn't get very far with that, obviously. :-) 11:46
masak it's a fine name.
MissingSemicolon Thanks. :-) So is this the place to bring my Perl 6 programming questions, or is it more geared for p6 developers? 11:47
masak rn: say "Hey $_, Rakudo and Niecza greet you!" given <Missing Semicolon>.join
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«Hey MissingSemicolon, Rakudo and Niecza greet you!␤» 11:48
masak MissingSemicolon: right now it's a place for both.
MissingSemicolon: Perl 6 is still small-and-cozy enough to have all conversations in the same cahnnel ;)
MissingSemicolon yes, I'm hoping it'll become big-and-cozy sometime soon. 11:49
masak working on that.
MissingSemicolon I've been a Perl programmer since the stone age, and I like a lot of things about Perl 6. I'm now very embarrassingly stumped on an extremely simple problem, though. 11:50
masak bring it.
11:50 drbean left 11:51 cognominal left
MissingSemicolon To get the index of a substring, is it supposed to be $haystack.index(' needle ')? 11:51
I'm trying to skip over lines that contain a substring, and I'm doing that with: next if $line.index('thing_i_do_not_want') == -1; 11:52
11:52 wamba left
MissingSemicolon But with that I get: Parameter '' requires an instance, but a type object was passed 11:53
in method Bridge at src/gen/CORE.setting:2786
in sub infix:<==> at src/gen/CORE.setting:2709
in block at ./exercise1a.p6:10
Su-Shee MissingSemicolon: why not use grep?
masak MissingSemicolon: probably $line was never assigned to.
MissingSemicolon: seems it is undefined, whatever the reason.
r: my $line; say $line.index('thing_i_do_not_want') == -1
p6eval rakudo ef228d: OUTPUT«No such method 'index' for invocant of type 'Any'␤ in block at /tmp/szPuwtVKy5:1␤␤»
masak r: my $line = Str; say $line.index('thing_i_do_not_want') == -1
p6eval rakudo ef228d: OUTPUT«use of uninitialized value of type Str in string context in block at /tmp/jLzGprxlTz:1␤␤Parameter '' requires an instance, but a type object was passed␤ in method Bridge at src/gen/CORE.setting:2814␤ in sub infix:<==> at src/gen/CORE.setting:2737␤ in block at…
masak that's the error, I think. 11:54
MissingSemicolon OK, but if I use 11:55
11:55 GlitchMr joined
MissingSemicolon … hang on a sec. Something strange :-) 11:56
11:57 drbean joined, cognominal joined 12:05 leont left 12:17 gongyiliao joined
MissingSemicolon rakudo: my $s = 'foobar'; say "OK" if $s.index('baz') == -1; 12:19
p6eval rakudo ef228d: OUTPUT«Parameter '' requires an instance, but a type object was passed␤ in method Bridge at src/gen/CORE.setting:2814␤ in sub infix:<==> at src/gen/CORE.setting:2737␤ in block at /tmp/Rysur7bGGQ:1␤␤»
MissingSemicolon There's a minimal example of what I'm seeing.
Am I doing something fundamentally stupid? (quite possible!) 12:20
12:22 brrt left
jnthn r: my $s = 'foobar'; say $s.index('baz).perl 12:29
p6eval rakudo ef228d: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2, near "'baz).perl"␤»
jnthn grr
r: my $s = 'foobar'; say $s.index('baz').perl
p6eval rakudo ef228d: OUTPUT«Int␤»
jnthn Yeah, so I think index in Perl 6 doesn't return -1
Instead it returns an undefiend value
So you probably want 12:30
rakudo: my $s = 'foobar'; say "OK" unless defined $s.index('baz')
p6eval rakudo ef228d: OUTPUT«OK␤»
jnthn Like that
MissingSemicolon Ok, that makes sense. 12:33
Thanks! 12:34
12:37 cognominal left 12:39 cognominal joined 12:40 birdwindupbird left 12:41 MissingSemicolon left 12:42 birdwindupbird joined 12:43 cognominal left
[Coke] MikeFair_: I went to bed right after posting, so it's still there. ;) 12:46
12:51 brrt joined 12:55 cognominal joined
[Coke] finds a bunch of :pasttypes that should be :ops 12:56
it would be helpful tracking this down if it gave me a line number on the Actions.pm when it died rather than saying only: "Error while compiling block" 12:58
jnthn if it says that, you're way past the actions
12:59 jerome left
PerlJam "past the actions" ... that's almost punny :) 13:02
masak you're way qast the actions. 13:04
[Coke] jnthn: ah, excellent. where am I? ;)
jnthn You're compiling the QAST down to PIR
What *is* the error you get?
[Coke] Error while compiling block : Error while compiling op : hash: can't use null as key 13:05
(that after running "./partcl" and entering any command.
jnthn ah
you maybe didn't set the op
nqp: use QAST; QAST::Op.new( :pasttype('list') ) 13:06
p6eval nqp: OUTPUT«Method 'pasttype' not found for invocant of class 'QAST::Op'␤current instr.: '' pc 1053 (src/stage2/QASTNode.pir:464) (src/stage2/QASTNode.nqp:54)␤»
jnthn It should do that though
Like, as soon as you instantiate it
So I'm surprised you're getting as far as you are
13:07 fhelmberger left
[Coke] found a few more :pirops... 13:08
13:08 cognominal left
[Coke] changed, same error. 13:08
13:10 jerome joined 13:12 flightrecorder left, FROGGS left
[Coke] gist.github.com/3761375 - jnthn: various types of ops I'm using. 13:12
I didn't see docs on the actual ops available, these are leftover or updated (incorrectly?) from the past version 13:13
masak oh! closures are moving code at runtime. macros are moving code at compile time. 13:20
PerlJam "moving code"? 13:21
[Coke] jnthn: so, there are some Ops that don't have an :op() - is that legal? 13:22
(some have only a :name() - should those have :op<call> also?
masak PerlJam: closures are first-class function values. so you can put it in your bag and steal away with it in the night. 13:24
sirrobert Can I export an enum? 13:25
how do I reference it in the outer namespace?
outer=remote 13:26
13:26 xinming_ is now known as xinming
sirrobert figured it out... enum Foo is export <X Y Z>; elsewhere: Foo::X 13:28
13:29 jaldhar left
colomon phenny: tell TimToady I'm having a hard time getting comfortable with the name is-prime, because it feels like it promises something it cannot deliver. Should it be is-likely-prime? is-known-composite? 13:29
phenny colomon: I'll pass that on when TimToady is around.
flussence reading the backscroll gave me an idea: a lot of cryptic errors/warnings come from unexpected undefinedness - maybe it'd be useful to show datatypes (Mu, Any) in the backtrace 13:30
arnsholt Sounds like a good idea to me 13:31
masak sirrobert: um. I think X should also be visible as-is. 13:32
PerlJam colomon: ha! irclog.perlgeek.de/perl6/2012-09-20#i_6004806
masak sirrobert: dunno if implemented, though.
colomon PerlJam: glad to see I'm not alone. :)
PerlJam colomon: however, later ... irclog.perlgeek.de/perl6/2012-09-20#i_6004983 13:33
sirrobert masak: X wasn't visible, but it was visible scoped
err namespaced
masak sirrobert: yeah. I'm thinking of Bool::True and True as an example. 13:34
sirrobert I wonder why that works and this doesn't?
13:35 leprevost joined
masak because Bool isn't a real enum? 13:37
as implemented, I mean.
colomon PerlJam: I guess I'm guilty as charged as being wary of probabilistic algorithms. but citing 4 ** -100 is cheating -- default error rate is 4 ** -10, no?
sirrobert fair enough =)
masak I dunno how close Niecza got with this, but I know Rakudo didn't get all the way there, and neither of the main implementors were happy about Bool being an enum. 13:38
r: say (class A {}).HOW.WHAT
p6eval rakudo ef228d: OUTPUT«Perl6::Metamodel::ClassHOW()␤»
masak r: say (enum E <a b>).HOW.WHAT
p6eval rakudo ef228d: OUTPUT«Perl6::Metamodel::EnumHOW()␤»
masak r: say Bool.HOW.WHAT 13:39
p6eval rakudo ef228d: OUTPUT«Perl6::Metamodel::ClassHOW()␤»
masak yeah.
sirrobert masak: I still haven't gotten a feel for how I should think about "HOW" 13:43
masak hehe.
I don't blame you. :) 13:44
I remember staring dumbfounded at au++'s MOP diagram back in the day, thinking "this is all very nice, but do I really need a metaphysics for my objects?"
sirrobert heh
arnsholt That'd be a great title for a Perl 6 parallel to The art of meta-object protocol. "The metaphysics of objects" =D 13:45
masak well, think of it this way: somewhere in Rakudo there is code to tell Perl 6 how to lay out attributes, how to do method lookup, how inheritance works.
having a MOP in the first place means you expose those details to a greater or smaller extent. 13:46
jnthn [Coke]: er, that sounds bad
[Coke]: yes, they totaly should have :op<call>
sirrobert masak: makes sense
masak the .HOW (and .^) is how you start talking about that API.
sirrobert: turns out OO is a great fit for implementing a MOP :) 13:47
which is when you get into the whole metacircularity whirlpool. 13:48
r: say (class A {}).WHAT
p6eval rakudo ef228d: OUTPUT«A()␤»
masak r: say (class A {}).HOW.WHAT
p6eval rakudo ef228d: OUTPUT«Perl6::Metamodel::ClassHOW()␤»
masak r: say (class A {}).HOW.HOW.WHAT
p6eval rakudo ef228d: OUTPUT«No such method 'gist' for invocant of type 'NQPClassHOW'␤ in sub say at src/gen/CORE.setting:7173␤ in block at /tmp/flhmjZl_D7:1␤␤»
masak r: say (class A {}).HOW.HOW.HOW.WHAT
p6eval rakudo ef228d: OUTPUT«No such method 'gist' for invocant of type 'KnowHOW'␤ in sub say at src/gen/CORE.setting:7173␤ in block at /tmp/k5Nhxk5MbJ:1␤␤»
masak r: say (class A {}).HOW.HOW.HOW.HOW.WHAT
p6eval rakudo ef228d: OUTPUT«No such method 'gist' for invocant of type 'KnowHOW'␤ in sub say at src/gen/CORE.setting:7173␤ in block at /tmp/RFQnPolDpx:1␤␤»
masak it's KnowHOW's all the way down from there.
arnsholt These bits are relevant to what makes Zavolaj tick, incidentally
13:48 bluescreen10 joined
masak arnsholt: because of reprs, I presume. 13:49
arnsholt Because repr, yeah
[Coke] nqp: use QAST; new QAST::Op( :name<eek> ); 13:50
p6eval nqp: OUTPUT«Confused at line 2, near "new QAST::"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
[Coke] nqp: use QAST; QAST::Op.new( :name<eek> );
p6eval nqp: ( no output )
jnthn Maybe we should make that complain somehow. 13:51
[Coke] jnthn: so, should that barf, then?
barfing sooner than later is boss.
jnthn [Coke]: It'd certainly be more helpful if it did
13:53 mucker left 13:54 Guest29702 joined
[Coke] jnthn: now I'm getting Error while compiling block : Error while compiling op call: Can only use get_how on a SixModelObject 13:55
so, a naive translation is not working. I'll have to do more than a global search and replace, so that means: the weekend.
(unless someone beats me to it. ;)
13:55 mtk left
jnthn [Coke]: That may mean there's a PAST node in the tree 13:56
Or an undef or a literal
Note that literals must be an IVal, NVal or SVal now
Not put directly as a child
13:58 imarcusthis left 14:00 brrt left 14:01 imarcusthis joined 14:02 brrt joined 14:04 stopbit joined 14:06 FROGGS joined, flightrecorder joined 14:10 PacoAir joined 14:23 fm_ joined 14:26 muu joined 14:28 wk_ left 14:35 muu left 14:36 kaleem left 14:46 wtw left
sirrobert is there an operator (or method?) to compare if two hashes have the same keys and values? 14:47
I only need shallow comparison, but deep is cool too
tadzik Test.pm does that in is_deeply 14:48
sirrobert great, thanks (using it in a test) 14:49
masak eqv should do that.
rn: say { foo => 1, bar => 2 } eqv { bar => 2, foo => 1 }
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«True␤»
sirrobert rn: say { foo => 1, bar => 2 } eqv { bar => 2, foo => 5 }
p6eval rakudo ef228d: OUTPUT«False␤»
..niecza v21-15-gf226bf6: OUTPUT«True␤»
14:50 leprevost left
masak submits nieczaissue 14:50
sirrobert sad path =)
masak sirrobert++
colomon rn: say { foo => 1, bar => 2 } cmp { bar => 2, foo => 5 } 14:55
p6eval niecza v21-15-gf226bf6: OUTPUT«Same␤»
..rakudo ef228d: OUTPUT«Decrease␤»
colomon actual bug is in cmp, I think
masak adds that to the issue 14:56
colomon wishes he had TextMate on Linux.
14:57 jerome left
colomon .... errr, how does one determine Hash cmp Hash? does the question even make sense? 15:01
jnthn
.oO( maybe if you've had enough hash... )
15:02
I'm not sure increase vs decrease does though
15:03 skids joined
sirrobert if: class A { method foo {"Hallo!"} }; my $mtd = 'foo'; 15:06
arnsholt I'd argue that Hash cmp Hash doesn't really make sense
sirrobert how do I do: say A.new.$mtd;
masak I don't really see the problem.
at the first differing key (sorted lexographically), there's bound to be a well-defined ordering.
15:06 brrt left
masak sirrobert: A.new."$mtd"() 15:06
sirrobert ah, thanks (was missing the () in my tries) 15:07
arnsholt Hmm. masak's idea might work
masak++ # More cleverer than me =)
I'm not sure if it'd be a useful ordering over hashes, but it's workable 15:08
It depends on there being an ordering over the keys though, which might not hold for non-Str keys
15:09 sisar joined
sisar masak++ #release 15:09
15:11 marmay left
masak arnsholt: troo. it feels a little weird to base any feature of a hash on ordering of its keys. 15:12
15:12 fm_ left 15:18 sisar left
arnsholt I guess. I'm not sure we'd really want to make two hashes comparable just for the sake of making them comparable 15:19
kresike bye folks 15:20
15:20 kresike left
flussence I can't say I've ever wanted a built in feature for that in any language 15:22
GlitchMr rn: say { bar => 2, foo => 5} cmp { foo => 1, bar => 2 }
p6eval rakudo ef228d: OUTPUT«Increase␤»
..niecza v21-15-gf226bf6: OUTPUT«Same␤»
GlitchMr Wait... why those hashes can be compared? Let me guess, string conversion? 15:23
Hmmm...
rn: say { bar => 2, foo => 5} cmp { foo => '5', bar => 5.0 }
p6eval rakudo ef228d: OUTPUT«Increase␤»
..niecza v21-15-gf226bf6: OUTPUT«Same␤»
GlitchMr rn: say { bar => 2, foo => 5} cmp { foo => '5', bar => 2.0 }
p6eval rakudo ef228d: OUTPUT«Increase␤» 15:24
..niecza v21-15-gf226bf6: OUTPUT«Same␤»
GlitchMr rn: say { bar => 2, foo => 5} cmp { bar => 2.0, foo => '5'}
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«Same␤»
GlitchMr rn: say { bar => 2, foo => 5} eqv { bar => 2.0, foo => '5'}
p6eval rakudo ef228d: OUTPUT«False␤»
..niecza v21-15-gf226bf6: OUTPUT«True␤»
TimToady colomon: wikipedia claims: If n is composite then the Miller–Rabin primality test declares n probably prime with a probability at most 4 ** -k. On the other hand, the Solovay–Strassen primality test declares n probably prime with a probability at most 2 ** -k. 15:25
phenny TimToady: 13:29Z <colomon> tell TimToady I'm having a hard time getting comfortable with the name is-prime, because it feels like it promises something it cannot deliver. Should it be is-likely-prime? is-known-composite?
TimToady and we're defaulting to 100 tests
so maybe you're thinking of SS instead of MR?
colomon no, I'm just not comfortable with naming the "is very likely prime" function is-prime. :) 15:26
GlitchMr When it makes invalid results anyways?
TimToady anyway, as for the name, if the probability is much larger that a cosmic ray is going to flip a bit in your memory, then all our functions should have "likely" in the name 15:27
15:27 fhelmberger joined
GlitchMr Also, low primes could be hardcoded? 15:28
TimToady and are, in libtommath
so I'd feel uncomfortable saying "is likely prime" when we know for sure :) 15:29
modulo cosmic rays 15:30
TimToady has been running his longest left truncating prime program in niecza again for more than 24 clock hours (4500 cpu minutes) just to see if it blows up again in the same place, of if the first blowup was a cosmic ray :) 15:33
15:33 sisar joined
GlitchMr That's waste of CPU, but whatever 15:33
TimToady hopes that when is-prime gets into rakudo it can run this faster, and maybe more correctly, since my last rakudo run with a Perl 6 MR test was producing some incorrect results 15:34
GlitchMr Using IRC is waste of CPU too
TimToady GlitchMr: not a waste at all, it heats up my house quite efficiently
GlitchMr oh, ok
huf small house or huuuuge irc?
TimToady with 100% efficiency, in fact
not the irc, that wastes some heat outside the house
the ltp algo 15:35
colomon back when I was single (and in Michigan, mind you), I didn't notice that my heat wasn't working one winter for about a month because my computers were generating enough heat to keep me comfortable. 15:36
huf ... what 15:37
i cant even imagine that
15:37 araujo left
benabik I can. In my college dorms in upstate NY, we regularly had the window open in the middle of winter to handle computer heat. 15:37
huf i've already had a morning when i considered turning the heat on 15:38
and it's only september
TimToady a 1 in one novemdecillion, six hundred six octodecillion, nine hundred thirty eight septendecillion, forty four sexdecillion, two hundred fifty eight quindecillion, nine hundred ninety quattuordecillion, two hundred seventy five tredecillion, five hundred forty one duodecillion, nine hundred sixty two undecillion, ninety two decillion, three hundred forty one nonillion, one hundred sixty two octillion, six hundred two septillion, five hundred twenty two sexti
colomon benabik: of course, one of my buddies had the same issue in his dorm back in the mid-80s. they just kept the dorm's heat way too high. :) 15:39
sirrobert I often kept a box fan blowing cold (snowy-cold) air into my dorm
15:40 brrt joined
sirrobert I had hot-water pipes running through three of my walls in the dorm =) (well, two walls and the floor) 15:40
15:41 kurahaupo left
arnsholt TimToady: Do you happen to know what pieces are missing to get is-prime from tommath in Rakudo? 15:41
TimToady moritz++ already has a patch, I believe
arnsholt Ah, cool. Then I won't duplicate his efforts
TimToady didn't apply it before release though, sanely enough... 15:42
arnsholt Probably not a bad idea
TimToady is not always in favor of sanity :)
colomon rn: my $a = set 4, 5, 6; say $a.keys.sort 15:43
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«4 5 6␤»
skids pfeh. Obviously we need to develop CPUs that have a heating CoP over 1. But then we'd have to find a way to connect them to the outdoor air or groundwater.. 15:44
15:44 araujo joined, araujo left, araujo joined
TimToady we should invent CPUs that run faster when you put a blowtorch on them... 15:44
sirrobert in HS I had a DX2-66mhz. The fan fell off the CPU, so it kept slowing and stopping after (fairly short) intervals. my brother and I ended up keeping ice cube trays in the freezer and putting ice in zip-lock bags to lay on the CPU to keep it cool =) 15:47
colomon rn: my $a = set <a b c>; say $a.keys.sort 15:48
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«a b c␤»
15:48 brrt left
GlitchMr sirrobert: makes sense :-) 15:49
But isn't "ice cube" water?
15:49 leprevost joined
sirrobert that's why we used the plastic bags =) 15:49
(and put a paper-towel around the bag, but that was just an implementation detail... I don't think they ever got wet
15:51 jerome joined, jerome left 15:57 jevin joined
colomon 's happily productive morning has been derailed by trying to figure out how to make Niecza's cmp handle hashes. 16:00
16:02 birdwindupbird left 16:03 mucker joined
prammer 16:11
16:17 kaare_ joined, estrabd_afk is now known as estrabd 16:20 jerome joined, MayDaniel joined 16:25 zby_home joined 16:37 sisar left 16:38 birdwindupbird joined 16:39 jerome left 16:59 jerome joined 17:06 jerome left 17:14 xinming_ joined 17:17 xinming left 17:18 cognominal joined 17:22 wamba joined 17:48 gongyiliao left 17:50 tgt joined 18:01 orafu left, sirrobert left 18:04 fhelmberger left
TimToady yup, mono crashed again at about the same place. apparently arbitrary precision integers are not so arbitrary. or it's just a bug that shows up when integers start to get arbitrary... 18:05
TimToady now waits patiently(?) for is-prime to show up in rakudo 18:07
18:09 Guest29702 left 18:13 mucker left 18:19 fm_ joined 18:22 sirrobert joined, gongyiliao joined
diakopter TimToady: it might need some refactoring har har 18:26
18:28 cognominal left
diakopter TimToady: incorrect results are incorrect 18:28
TimToady well, one reason I'm waiting is that the current is-prime written in Perl 6 may not work right under rakudo; my program is consistently getting the wrong answer for every base 8 or higher
on rakudo, that is
niecza works up till the blowup at base 18 18:29
so if I replace is-prime, that might show where the bug is
as a first divide and conquer step
TimToady wonders what is different between base 7 and base 8 18:30
in every case it stops too soon, so it must be calling something composite that is actually prime, or it's not generating all the possibilities to begin with 18:31
diakopter maybe it's related to one of the integer overflow bugs 18:33
TimToady could well be 18:34
I could probably match against the correct answers and see which pass loses the truncated substring of the correct answer 18:38
18:38 cognominal joined
diakopter how do you know the correct answers? 18:38
TimToady and in fact that technique might isolate to a single calculation
rosettacode.org/wiki/Talk:Find_larg...given_base 18:39
those answer check for all the cases I've been able to check under niecza
*swers
diakopter Microsoft's MS-PL BigInteger.cs++ 18:40
TimToady which is everything up to base 23 except for 18
TimToady is just a bit chagrined that ruby can calculate the base 18 case and Perl 6 can't yet 18:41
the bug could also be that correct answer is in the finalists but the sort isn't sorting it to the front correctly 18:42
[Coke] sees that java calls is-prime isProbablePrime(). 18:43
TimToady the finalists do not contain the correct answer, so it's not being generated 18:45
18:45 fm_ left
TimToady [Coke]: and we should take our design decisions from Java because they got it all right, eh? :) 18:45
[Coke] refuses to respond to the trollbait. 18:48
diakopter but it's so enticing 18:50
18:50 cognominal left 18:59 cognominal joined 19:00 kaare_ left 19:13 wk joined 19:15 gongyiliao left 19:18 wk left 19:26 kurahaupo joined
masak evenin', #perl6 19:26
colomon \o
19:35 fgomez left 19:36 birdwindupbird left 19:42 wk joined
sorear good * #perl6 19:42
[Coke] hio. 19:44
19:47 fgomez joined
colomon o/ 19:53
19:54 wk left
colomon sorear: any idea why adding gist.github.com/3763534 to infix:<cmp> makes it blow sky-high when you try to compare two hashes? error message is "System.InvalidOperationException: Comparison threw an exception. ---> Numeric failed to return core numeric type" 19:55
[Coke] n: my %hash; say +%hash; 19:59
p6eval niecza v21-15-gf226bf6: OUTPUT«0␤»
[Coke] I presume cmp is cheating. :)
colomon [Coke]: if you look at the gist, you'll see my attempt to support comparing hashes. but it doesn't work. :( 20:00
sorear n: say 1 cmp 3
p6eval niecza v21-15-gf226bf6: OUTPUT«Increase␤»
20:01 tgt left
colomon I think the error is happening in the sort call, but I've no clue why. 20:01
sorear colomon: if you get to the end of the for loop in the gist, what does cmp return?
colomon errr.... good question
adding a return and trying again. 20:02
sorear a return Same; I hope
colomon based on the full error message I don't think that's the issue, but it certainly was wrong the way I had it.
sorear n: say Nil.Numeric 20:03
p6eval niecza v21-15-gf226bf6: OUTPUT«0␤»
20:03 estrabd left
colomon n: say set("foo", "bar").keys.sort 20:03
p6eval niecza v21-15-gf226bf6: OUTPUT«bar foo␤»
colomon if I do that with my cmp-hash patch in, I get the error
sorear n: say set("foo","bar").keys.WHAT 20:04
p6eval niecza v21-15-gf226bf6: OUTPUT«List()␤»
sorear n: say set("foo","bar").keys>>.WHAT
p6eval niecza v21-15-gf226bf6: OUTPUT«Str() Str()␤»
sorear out of curiousity could you gist the output of "git diff"? I'd like to see your addition in context 20:05
20:05 GlitchMr left
sorear n: say 0 + Nil 20:05
p6eval niecza v21-15-gf226bf6: OUTPUT«0␤»
sorear n: say 0 + any("foo","bar") 20:06
p6eval niecza v21-15-gf226bf6: OUTPUT«Unhandled exception: Cannot parse number: foo␤ at /home/p6eval/niecza/lib/CORE.setting line 1435 (die @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3525 (ANON @ 11) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3527 (NumSyntax.str2num @ 5) ␤ at …
sorear n: say 0 + set("foo","bar")
p6eval niecza v21-15-gf226bf6: OUTPUT«2␤»
colomon gist.github.com/3763594 20:07
masak rn: say 0 + set("foo", "foo") 20:08
p6eval rakudo ef228d, niecza v21-15-gf226bf6: OUTPUT«1␤»
sorear n: say set(<foo bar>).sort 20:10
p6eval niecza v21-15-gf226bf6: OUTPUT«bar foo␤»
sorear n: say set(<foo bar>).keys.sort
p6eval niecza v21-15-gf226bf6: OUTPUT«bar foo␤»
sorear n: say set(<1 2>).keys.sort 20:11
p6eval niecza v21-15-gf226bf6: OUTPUT«1 2␤»
sorear n: say "foo" ~~ Hash
p6eval niecza v21-15-gf226bf6: OUTPUT«False␤»
moritz \o 20:14
sorear o/ moritz
colomon: I just applied this loc ally and it breaks for me 20:15
... and it just stopped breaking 20:16
colomon ? 20:18
sorear colomon: it's consistant. THe "Numeric failed to return core numeric type" occurs if and only if the setting was recompiled in the same run of niecza
if you rerun your test without changing the setting, it will work. 20:19
20:25 cognominal left
sorear colomon: I can reproduce this without your patch: 20:26
$ echo >> lib/CORE.setting
$ mono run/Niecza.exe --obj-dir=obj -e 'say ["foo", "bar"].sort'
[auto-compiling setting]
[done]
Unhandled exception: System.InvalidOperationException: Comparison threw an exception. ---> Numeric failed to return core numeric type
colomon it's not my fault! \o/ 20:27
unless, of course, it's because of something I did earlier. ;)
moritz bisect can tell, no? 20:29
btw I have a local rakudo path for expmod and is-prime, haven't gotten around to test it 20:32
will do tomorrow, and then push
20:34 cognominal joined
jnthn moritz: yay :) 20:36
[Coke] I bet if you stick it somewhere, larry will test it. he seems pretty eager. 20:37
... almost hyper
moritz oh well, it's after the release, I can afford to break nom for half a day :-)
jnthn but racing for it would be out of order :P
dalek p: c458a08 | moritz++ | src/ (2 files):
make Rabin-Miller prime check available as nqp::isprime_I

also special-case 1 not to be a prime
20:38
jnthn moritz: I can run a spectest
jnthn has the next two weeks off o/ 20:39
sorear moritz: bisect requires a good revision
20:39 Circlepuller joined
sorear this has been broken for much longer than I thought and I'm having trouble finding a revision where it worked 20:39
20:39 popl joined
dalek kudo/nom: 2e33656 | moritz++ | / (3 files):
add expmod and is-prime
20:40
masak moritz++
20:41 Circlepuller_ left
masak moritz: is it because of libtommath that mp_prime_is_prime reports 1 as prime? 20:41
moritz: would they consider it a bug if we told them?
moritz masak: I don't know, which is why I haven't done it yet 20:42
masak: it claims to implement the rabin-miller prime test, not to check if something is a prime 20:43
jnthn has kicked of a build/spectest
sorear found a good rev. kicking off a bisect 20:44
masak \o/ 20:45
manual or with a script?
sorear script 20:46
20:49 fgomez left
sorear remarkably, this is the first time I have used git bisect 20:50
moritz you usually just don't regress stuff :-)
$ ./perl6 -e 'say (1..100).grep: *.is-prime' 20:56
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
looks better than before :-)
Tene why .is-prime instead of just .prime I wonder ?
sorear .prime-p
moritz Tene: maybe to not confuse it with "find the $nth prime"? 20:57
Tene Hmm.
moritz PrimeQ # in Mathematica
sorear my $funky = 42 but Prime;
std: 1 =< 2 21:00
p6eval std 77327a4: OUTPUT«===SORRY!===␤Unable to parse quote words at /tmp/0GmRNw2zTA line 1:␤------> 1 =⏏< 2␤Couldn't find final '>'; gave up at /tmp/0GmRNw2zTA line 1 (EOF):␤------> 1 =< 2⏏<EOL>␤Parse failed␤FAILED 00:00 42m␤»…
moritz sorear: I was about to do that too :-)
eval: 1 =< 2
buubot_backup moritz: ERROR: Unterminated <> operator at (eval 20) line 1.
sorear 13:58 <@LeoNerd> Whomever is responsible for eval: 2 =< 4 giving Reversed <= operator at (eval 1830) line 1. ERROR: Unterminated <> operator at (eval 1830) line 1. I will buy you a beer :) 21:01
moritz -> sleep
[Coke] moritz++ 21:02
"sleep well, and dream of large numbers."
sorear bisect blames 3d9f4b463b37ad13de9addc6e793bc3372af846b 21:03
21:03 spider-mario joined
masak smiles at the "sleep well and dream of X" meme being picked up 21:04
sorear I'll poke more at this later
dayjob&
masak .oO( sorear has a *job* now!? ) 21:05
clearly I haven't been keeping up.
colomon me neither!
21:08 wamba left
jnthn moritz: spectest looks good :) 21:08
[Coke] O_o 21:10
21:10 zby_home left
[Coke] Meme? Why didn't you list among our assets in the first place? 21:13
21:14 tgt joined
masak ducks "why didn't you list among our assets" and gets the weirdest webcomic 21:16
21:16 HarryS left
[Coke] list *that 21:17
21:18 bluescreen10 left
[Coke] masak: it's from the princess bride. 21:19
masak oh, princ... right.
I need to re-watch that movie :)
[Coke] masak: which is also where your meme is from, btw. :P 21:20
at least in my version of your meme.
21:23 wamba joined
masak so it seems. 21:24
I can honestly say that I wasn't thinking of the movie when I started using the meme on the channel. 21:25
sorear
.oO( "my name is S.J.Gould" )
masak but I'm not too disappointed of it containing prior art -- it contains a lot of nice stuff :)
PerlJam does that mean that people are going to start saying "as you wish" rather than give hugs?
[Coke] Good night, #perl6. I'll most likely kill you in the morning. 21:26
masak PerlJam: ;)
anybody want a peanut? 21:27
popl This is how the world ends.
PerlJam popl: But I haven't been Dread Pirate Roberts yet 21:28
popl s/r/w/g 21:29
PerlJam: I always hear it in Andre's voice.
Excuse me, Mr. the Giant. 21:30
PerlJam :-)
21:31 HarryS joined, wamba left, tgt left 21:33 skids left 21:36 HarryS left 21:37 atrodo left 21:44 wamba joined 21:46 raiph joined, MayDaniel left
raiph phenny, tell moritz: there's a typo in github.com/moritz/ilbot/blob/maste...e/day.tmpl -- "<TMPL_UNLESS NAME=IS_SUMAMRY>" tried to fix and pull request via github but there's something going on that seems to break when i try. 22:05
phenny raiph: I'll pass that on when moritz is around.
22:07 spider-mario left 22:19 fgomez joined 22:21 stopbit left 22:23 wamba left 22:29 HarryS joined 22:42 fgomez left
masak 'night, #perl6 22:45
22:49 fgomez joined 22:55 Guest29702 joined 23:09 whiteknight joined 23:18 snearch joined 23:20 leprevost left
timotimo i made a code to calculate the intersection of two lines and i failed horribly :\ 23:28
shachaf timotimo: ? 23:30
timotimo i dunno what went wrong, but the coordinates of the intersections are on neither of the lines 23:33
and i didn't come up with proper tooling to see in what way it went wrong :|
23:34 skids joined
raiph timotimo: are you using jnthn's debugger yet? 23:41
timotimo oh! OH! 23:43
should have totally done that
still doesn't help me see what's happened ;) 23:48
it's probably my formula that's wrong or something
23:48 fgomez left 23:49 mdupont joined