»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by moritz_ on 25 June 2010.
cono tadzik: in p6 I wanted to take lazy list with results, not a cb 00:00
00:00 Patterner left, Psyche^ is now known as Patterner
tadzik hmm. That might be even better. wiki.github.com/rakudo/rakudo/perl-...-to-perl-6 lists File::Find as one of the wanted modules, and I wonder what did the author of this have in mind: an almost verbatim port (from API side), or something new giving the same functionalities 00:02
cono I guess functionality 00:03
new perl = new functionality :)
tadzik that sounds sane :) 00:04
cono why you need to make backport functionality?
tadzik Maybe that's what people are expecting? I don't know, hence my questions
cono tadzik: are you a author of p5's File::Find ? 00:05
tadzik cono: nope
cono ic
tylercurtis tadzik: could the callback delete files that would otherwise later be found? If so, including a way to do the callback approach might be nice even though the list approach would probably be nicer most of the time.
tadzik I've never written any Perl 5 module actually
00:05 Limbic_Region joined
tadzik tylercurtis: I think that's possible 00:06
cono if cycle iterate it before deleting :)
tylercurtis then again, if the list is lazy, I guess that wouldn't be a problem.
jnthn pmichaud: Tests were fine. \o/ 00:07
00:08 skids joined
cono tadzik: pay attention on OS detection at the end of file: cpansearch.perl.org/src/JESSE/perl-...le/Find.pm 00:09
tadzik wklej.org/id/367460/ -- what does it want? Both arguments fit, don't they?
cono: oh, right, windows 00:10
well, that'd only change the directory separator in my case. Windows uses \, yep?
tylercurtis tadzik: find(&foo, 'lib')
cono tadzik: and others and others :)
tadzik tylercurtis: yep, that's it. Where's the mistake? 00:11
cono tadzik: elsif ($^O eq 'MacOS') { ...
tadzik (I guess it's some ridicolous typo)
dalek kudo: c633afc | jonathan++ | src/cheats/parrot/Sub.pir:
Make sure that if the static sub had its $!do changed, all the dynamics also

immediately makes Zavolaj work again.
tadzik cono: MacOS uses \ too?
for now, the directory separator is the only thing that would make the code not portable (I hope) 00:12
cono tadzik: look at the Find.pm, it skips ^Icon\015\z at macos ... and so on
tadzik hmm. I've never used MacOS, so I don't really know the case. Well, that has to be taken into consideration though 00:13
tylercurtis tadzik: that parses as a call to find with "(&foo, 'lib') as an argument.
tadzik: You want "find(&foo, 'lib')"
cono tadzik: perldoc File::Find /dont_use_nlink
tadzik oh this damn whitespace 00:14
thanks tylercurtis++
00:15 perlygatekeeper1 left
tadzik cono: well, I don't use nlink either :) 00:15
tylercurtis tadzik: at least it is visible significant whitespace. :)
00:16 perlygatekeeper joined
tylercurtis (assuming no one is evil enough to use a Unicode thin space...) 00:16
tadzik being whitespace sensitive smells python to me, but my coding style was to always omit space here anyway
cono tadzik: I guess you need read File/Find.pm more carefully :)
tadzik cono: I see that File::Find does some fancy magic: nlink, stat, I just recursively travel across directories :)
cono :) 00:17
tadzik still, I wonder how bad it is :)
cono What are you doing if you found symlink to a directoru?
tylercurtis tadzik: like I said, at least you can see the whitespace or lack thereof, unlike in Python.
tadzik cono: good question, it should be checked
cono :) 00:18
PerlJam tadzik: I have a dinky little File::Find like thing I did at github.com/perlpilot/file-find-p6 (It doesn't handle anything but ordinary files and directories )
tylercurtis And they don't even get the ease of defining new operators in exchange. :)
tadzik PerlJam: yep, that's similar to mine
PerlJam: wklej.org/id/367461/ 00:19
I also implemented finddepth and stuff, but the algorithm is basically the same
cono tadzik: look at File::Spec implementation search.cpan.org/~smueller/PathTools-3.31/ it have different class for different OS. Nice idea imho 00:21
tadzik cono: yep, nice. Yet I think File::Spec has more platform specific things to do -- if not everything it does it platform specific 00:22
cono I think all modules in File::* have platform specific stuff 00:23
tadzik probably
cxreg yay, now i can get back to making Pg pass all the tests
jnthn++ pmichaud++
00:23 lest_away is now known as lestrrat 00:25 azert0x left 00:28 oha joined 00:30 masonkramer joined, justatheory joined 00:33 justatheory left 00:34 oha left
lue rakudo: sub circumfix:<[ )>(@a) { @a[0] ..^ @a[1] }; say [0,10) 00:35
p6eval rakudo 1d4ba4: OUTPUT«0123456789␤»
00:41 ash_ left
TimToady rakudo: sub circumfix:<[ )>(@a) { @a[0] ..^ @a[1] }; say [1,2,3] 00:44
p6eval rakudo 1d4ba4: OUTPUT«1 2 3␤»
sorear TimToady: oh, beautiful. 00:46
lue I need to see if there's a way to say something like (@a where .elems = 2) 00:47
sorear ==, surely? 00:48
TimToady: What is the relationship between .HOW and .WHO?
lue oh, yes of course :) 00:49
jnthn lue: That's disgusting. :P
circumfixes with non-matching endpieces 00:50
:-)
lue but it's mathematics!
[ISO did much worse, (more)]
rakudo: sub circumfix:<[ [>(@a) { @a[0] ..^ @a[1] }; say [0,10[
p6eval rakudo c633af: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<[ ]>, couldn't find final ']' at line 22␤»
lue it won't even work! :) 00:51
jnthn Heh
00:51 patspam left
jnthn Yeah, circumfixes are very picky about what chars you can use as starters and stoppers. 00:51
lue [0,10[ is the ISO way of saying [0,10) # see wikipedia on interval notation
rakudo: sub circumfix:<] [>(@a) { @a[0] ^..^ @a[1] }; say ]0,10[ # ISO way for (0,10) 00:52
p6eval rakudo c633af: OUTPUT«===SORRY!===␤Confused at line 22, near "]0,10[ # I"␤»
00:52 patspam joined
tylercurtis lue: I think that should be valid, but isn't implemented in Rakudo yet. 00:52
lue
.oO(IMO, ISO hit their heads when deciding that one)
tylercurtis std: sub circumfix:<] [>(@a) { @a[0] ^..^ @a[1] }; say ]0,10[ # ISO way for (0,10) 00:53
p6eval std 31784: OUTPUT«===SORRY!===␤Confused at /tmp/cvcPCa7GiU line 1:␤------> fix:<] [>(@a) { @a[0] ^..^ @a[1] }; say ⏏]0,10[ # ISO way for (0,10)␤ expecting any of:␤ argument list␤ statement modifier loop␤Other potential difficulties:␤ Unsupported use
..of bare '…
tylercurtis Maybe not.
jnthn tylercurtis: Custom circumfixes are implemented.
tylercurtis: But chars you get away with for doing them is a whole other matter. 00:54
lue .oO[ The GNU Octave language is plain confusing, and possessing the Virtues of a Programmer doesn't help :) ]
TimToady sorear: WHO has nothing to do with HOW, really. HOW is the metaobject. WHO is supposed to uniquely identify the library module that supplies the definition of the object, including all the :ver and :auth info 00:55
WHO is sort of the original "from" of the use 00:56
lue [ matrices being the basic data type is a mistake. ]
00:57 macroron left 00:59 au|zzz is now known as au|irc 01:04 timbunce left
sorear TimToady: I see 01:08
TimToady: I'm vaguely trying to understand the connection between Foo and Foo::, if there is one at all. jnthn talked about (class { our $x = 42 }).WHO<$x> earlier 01:09
01:11 colomon joined 01:17 rurban left 01:24 Schwern left 01:28 ash_ joined 01:31 tadzik left 01:39 ashleydev left
dalek kudo: 82b1b78 | (Solomon Foster)++ | src/core/operators.pm:
Allow Int factors in geometric series if possible.
01:44
01:45 plobsing joined 01:47 skids left
plobsing ping ash_ 01:50
ash_ hi
i am on #parrot also
plobsing oops, wrong channel
02:01 jferrero left 02:16 xabbu42_ joined 02:17 timbunce joined 02:19 xabbu42 left, xabbu42_ is now known as xabbu42 02:21 snarkyboojum left 02:37 snarkyboojum joined 02:44 ashleydev joined 02:52 patspam left, felliott joined 02:55 Daenyth joined
Daenyth Hi, I'm trying to compile rakudo 2010.06, and I get this compile error: 02:56
/usr/bin/parrot src/gen/perl6.pbc --target=pir \ src/gen/core.pm > src/gen/core.pir
/usr/bin/parrot: symbol lookup error: dynext/perl6_ops.so: undefined symbol: Parrot_find_global_n
make: *** [perl6.pbc] Error 127
I'm on arch linux 32 bit with parrot 2.6.0
pmichaud rakudo 2010.06 might not run with parrot 2.6.0 02:57
Daenyth pmichaud: what versions should I try things with?
pmichaud normally each version of rakudo "knows" what version of parrot to use
see build/PARROT_REVISION if you're not using the --gen-parrot option
Daenyth yeah, I'm not. I maintain the rakudo package for arch, which typically uses the system's parrot package
pmichaud tomorrow's release of Rakudo will work with Parrot 2.6.0 02:58
Daenyth sounds good enough then :)
I'm really looking forward to it
Once rakudo * comes out I'll be adding it to pacman's community repository 02:59
er
s/pacman/arch/
jnthn Pacman! \o/
pmichaud that will be a week from tomorrow.
Daenyth yup
looking forward to hacking at project euler in p6 too, just decided I'd start 03:00
jnthn pmichaud: If you missed it in the backscroll - the Zavolaj fix caused no new fails and got committed.
Daenyth been doing it in python but now I'll be doing it in py, p6 and haskell
pmichaud \o/
03:01 astrojp joined
tylercurtis Daenyth: It'll probably be slow, but it'll be lovely. 03:04
Daenyth indeed 03:06
jnthn -> sleep o/ 03:07
pmichaud jnthn: ping 03:08
(hoping to catch before sleep)
03:09 Limbic_Region left
pmichaud gist.github.com/485512 # this program takes 33 seconds under kiev; takes 75 seconds under current trunk :-( 03:09
03:10 skids joined 03:12 hatseflats left, PerlJam left 03:13 hugme left 03:15 dukeleto left, dalek left, Juerd left, pmichaud left, dukeleto joined 03:16 Juerd joined, pmichaud joined 03:17 pugssvn left
snarkyboojum takes exactly 33 seconds on master here (not that that's useful for comparison purposes :)) 03:19
03:20 Juerd left, pmichaud left
sorear Daenyth: Welcome! 03:20
03:21 dukeleto left, hatseflats joined, pmichaud joined, dukeleto joined
Daenyth o/ 03:25
03:26 hatseflats left, ash_ left, knewt2 left, rgrau left, sftp left, Lorn left, cognominal left, pjcj left, c1sung left, Tene left, sukria left, dimid_ left 03:27 pugssvn joined 03:29 meppel joined, c1sung joined, sorear sets mode: +voo pugssvn pmichaud dukeleto 03:30 sorear sets mode: +v p6eval, hatseflats joined 03:31 sftp joined, ash_ joined, knewt2 joined, Lorn joined, cognominal joined, pjcj joined, Tene joined, sukria joined, dimid_ joined
cxreg o_O 03:33
"state" not yet implemented at line 308, near "ment =>"
03:33 meppl left
cxreg line is: statement => $statement, 03:33
pmichaud oooops.
file bug, plz?
Daenyth hrm 03:34
Haskell confuses me :(
03:34 PerlJam joined
cxreg rakudo: my %hash = (statement => "foobar") 03:34
pmichaud right
p6eval rakudo 82b1b7: OUTPUT«===SORRY!===␤"state" not yet implemented at line 22, near "ment => \"f"␤»
cxreg ok, filing
pmichaud looks like the "NYI" message is a little over-eager.
cxreg heh
pmichaud I might be able to fix locally.
cxreg rakudo: my %hash = ("statement" => "foobar") 03:37
p6eval rakudo 82b1b7: ( no output ) 03:38
cxreg rakudo: my %hash = (somestatement => "foobar")
p6eval rakudo 82b1b7: ( no output )
cxreg so just bareword hash keys that start with "state"
pmichaud it's only a problem because it's seeing the "state" part of "statement" as a potential declarator, and carping immediately (before noting that it's not really a declarator) 03:39
cxreg heh
pmichaud rakudo: my %hash = ( supersederfoo => 'xyz' ); # same problem
p6eval rakudo 82b1b7: OUTPUT«===SORRY!===␤"supersede" not yet implemented at line 22, near "rfoo => 'x"␤»
pmichaud I have a local fix, I think -- compiling now.
tylercurtis github.com/ekiru/p6-html4 Yay! I'm done translating the HTML 4.01 Strict DTD to Perl 6! Now to make it actually work in Rakudo. :)
cxreg rt 76644 filed
pmichaud cxreg++ 03:40
tylercurtis And then to actually make it capable of emitting HTML. I suppose that would be a useful feature. 03:41
pmichaud pmichaud@plum:~/rakudo$ ./perl6 03:42
> my %hash = (statement => 'xyz');
statementxyz
cxreg yay
pmichaud quicktesting now
cxreg is trying to grok p6rules enough to see where this breaks 03:45
is it in termish?
pmichaud cxreg: gist.github.com/485540 03:46
tylercurtis cxreg: my guess is that the check for 'state' and 'supersede' that panics doesn't check for a word boundary.
snarkyboojum pmichaud: wow - fwiw, on my lappy that program runs in 14 seconds on kiev and 33 on master
pmichaud snarkyboojum: nice laptop. :)
I'm running it on my slow desktop righ tnow
anyway, the problem is the 200%+ slowdown 03:47
snarkyboojum pmichaud: :P - thought I'd check the 2+ times speed reduction
yeah
pmichaud I'm bisecting now to find where the problem might be. 03:48
Daenyth Yay, my first haskell program compiled! 03:51
(Boo, it didn't work right! :( )
snarkyboojum Daenyth: hey - satisfying the type system is still something! :) 03:52
Daenyth yeah, that broke me for a bit
I'm still letting my brain ferment enough to learn this language
gist.github.com/485549 I'm trying to figure out what I did wrong... 03:55
should probably head to #haskell too..
tylercurtis Daenyth: does the problem say to include numbers which are divisible by both 3 and 5? 03:56
sorear used to be a regular there
Daenyth tylercurtis: yeah
"Add all the natural numbers below 1000 that are multiples of 3 or 5."
actually my limit should be 999, but still 03:57
9 is just way off
sorear Daenyth: you should be using ghci for this 03:58
load the file
1. check if wanted returns the right values for stuff
Daenyth hrm
sorear 2. check problem1 3 - it's not 3? problem solved
etc
Daenyth if if :l file, I get "Not in scope: `wanted'" when I try to use that 03:59
(First day with haskell)
sorear module Euler1 (wanted, problem1, main) where
Daenyth aha
sorear perhaps an export list will help
it's been about two years since I used haskell 04:00
Daenyth that did it
sorear hmm, ISTR you can leave off the export list entirely to mean "everything' as long as the module / where is there
exporting functions made it give the right answer??
Daenyth er no
made it in scope
:)
aha 04:01
so yeah, not giving the right value somewhere
wanted 10 -> False
04:01 snarkyboojum left
Daenyth oh 04:01
had the mod arguments in the wrong order
should really have used infix there >.>
yay, it works now! 04:02
sorear: many thanks :D
Now to figure out how to golf this fucker down a notch ;) 04:03
04:05 snarkyboojum joined 04:06 cognominal left 04:07 cognominal joined
sorear rakudo: my $x = (); say $x.perl; say $x.WHAT; 04:09
p6eval rakudo 82b1b7: OUTPUT«Any␤Any()␤»
snarkyboojum Daenyth: try mod x 3 and mod x 5 04:11
Daenyth yeah, I got it now :) 04:12
snarkyboojum oops - nevermind.. just looked at the log
Daenyth github.com/Daenyth/Project-Euler/bl.../euler1.hs
<3
pmichaud RT #76644 fix pushed ... cxreg++ 04:15
04:16 Juerd joined
cxreg pmichaud++ # no thank *YOU* :) 04:16
colomon rakudo: say [+] (1 ... 999).grep(* %% 3 || * %% 5) 04:21
p6eval rakudo 82b1b7: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in <anon> at line 2:/tmp/hwbVhWFQpF␤ in 'Block::ACCEPTS' at line 5405:CORE.setting␤ in 'infix:<~~>' at line 397:CORE.setting␤ in <anon> at line 1383:CORE.setting␤ in 'List::Bool' at line 1␤ in 'prefix:<!>' at
..line…
colomon rakudo: say [+] (1 ... 999).grep(* %% any(3, 5))
p6eval rakudo 82b1b7: ( no output )
colomon > say [+] (1 ... 999).grep(* %% any(3, 5)) 04:23
233168
snarkyboojum colomon: v. nice :)
04:24 sftp left, ash_ left, knewt2 left, Lorn left, pjcj left, Tene left, sukria left, dimid_ left
snarkyboojum > say [+](1 .. 999).grep: * %% (3|5) 04:27
233168
Daenyth that's beautiful 04:28
%% is modulo? 04:29
tylercurtis %% is divisible IIRC. % is modulo.
04:29 sftp joined, ash_ joined, knewt2 joined, Lorn joined, pjcj joined, Tene joined, sukria joined, dimid_ joined
pmichaud %% is "evenly divisible by" 04:30
say 9 %% 3
rakudo: say 9 %% 3
snarkyboojum divisible by or some such.. % is modulo
pmichaud p6eval still doesn't like me. :-|
p6eval rakudo 82b1b7: OUTPUT«1␤»
lue rakudo: play "nice"
p6eval rakudo 82b1b7: OUTPUT«Could not find sub &play␤ in main program body at line 22:/tmp/ReRPsa86Cc␤»
snarkyboojum "evenly divisible by" - that's what I mean 04:31
meant ;)
Daenyth nice
04:31 [synth] joined
tylercurtis rakudo: sub play {}; play nice; 04:31
p6eval rakudo 82b1b7: OUTPUT«Could not find sub &nice␤ in main program body at line 22:/tmp/mi4EXHWHLC␤»
pmichaud rakudo: for 1..20 { .say if $_ %% 4; }
p6eval rakudo 82b1b7: OUTPUT«4␤8␤12␤16␤20␤»
tylercurtis rakudo: sub eat () {...}; eat sandwich; 04:32
p6eval rakudo 82b1b7: OUTPUT«Could not find sub &sandwich␤ in main program body at line 22:/tmp/SOeZ2Y2FZj␤»
lue
.oO(Everyone stand back. I'm into P6 and have just regained my interest in High Level Math™)
04:33 quietfanatic joined
quietfanatic Eck 04:34
rakudo: class X {has @.things}; X.new(things => [3, 4, 5]).things.map({say $_})
p6eval rakudo 82b1b7: ( no output )
quietfanatic rakudo: class X {has @.things}; X.new(things => [3, 4, 5]).things[].map({say $_})
pmichaud X is an evil class name.
p6eval rakudo 82b1b7: ( no output )
04:34 synth left
pmichaud so is Z 04:34
quietfanatic That's not the problem
pmichaud oh.
(they're still evil :-)
quietfanatic rakudo: class Xbox {has @.things}; Xbox.new(things => [3, 4, 5]).things[].map({say $_})
p6eval rakudo 82b1b7: ( no output )
quietfanatic The problem is map doesn't work on @.attributes.
lue
.oO(funny how a 'box' suffix can turn something even more evil...)
quietfanatic lue: :) 04:35
tylercurtis rakudo: class Foo {has @.things}; Foo.new(things => [3, 4, 5]).things[].map({say $_}) # just checking
p6eval rakudo 82b1b7: ( no output )
quietfanatic I pity the Foo
pmichaud rakudo: class Foo { has @.things }; Foo.new( things => [3,4,5]).things.perl.say
p6eval rakudo 82b1b7: OUTPUT«[[3, 4, 5]]␤»
tylercurtis rakudo: class Foo {has @.things}; Foo.new(things => [3, 4, 5]).things.WHAT.say 04:36
p6eval rakudo 82b1b7: OUTPUT«Array()␤»
pmichaud rakudo: class Foo { has @.things }; Foo.new( things => [3,4,5]).things[].perl.say
p6eval rakudo 82b1b7: OUTPUT«[[3, 4, 5]]␤»
tylercurtis rakudo: class Foo {has @.things}; Foo.new(things => [3, 4, 5]).things.[0].say
p6eval rakudo 82b1b7: OUTPUT«3 4 5␤»
colomon the problem is masp is lazy
quietfanatic rakudo: class Foo {has @.things}; Foo.new(things => (3, 4, 5)).things[].map({say $_})
p6eval rakudo 82b1b7: ( no output )
quietfanatic Too lazy then?
pmichaud rakudo: class Foo { has @.things }; Foo.new( things => [3,4,5]).things[].map( .say ).eager
p6eval rakudo 82b1b7: OUTPUT«Any()␤No candidates found to invoke for method 'map' on object of type 'Array'; available candidates have signatures:␤:(Mu : &block;; *%_)␤␤ in main program body at line 22:/tmp/j2AzdW1bDi␤»
colomon rakudo: class X {has @.things}; X.new(things => [3, 4, 5]).things.map({say $_}).eager
pmichaud rakudo: class Foo { has @.things }; Foo.new( things => [3,4,5]).things[].map( {.say} ).eager
p6eval rakudo 82b1b7: OUTPUT«3 4 5␤» 04:37
quietfanatic rakudo: class Foo {has @.things}; .say for Foo.new(things => (3, 4, 5)).things.map({'Foo' ~ $_})
pmichaud there.
p6eval rakudo 82b1b7: OUTPUT«Foo3␤Foo4␤Foo5␤»
quietfanatic Huh.
lue rakudo: my $a = 3; say $_ # should this work ?
pmichaud currently 'for' is eager in Rakudo.
p6eval rakudo 82b1b7: OUTPUT«Any()␤»
lue s/work/DWIM/
quietfanatic Then I'm having a different problem that looks similar. 04:38
lue rakudo: my $a = 3; $a; say $_ 04:40
p6eval rakudo 82b1b7: OUTPUT«Any()␤»
tylercurtis lue: well, if you don't ask for map to be evaluated, you aren't going to get it evaluated.
lue … /me looks up pronouns 04:41
tylercurtis lue: if you want something to be in $_, either set it, or, even better, use given. 04:42
rakudo: my $a = 3; given $a { .say; }
colomon pmichaud: what's the status of your series overhaul?
p6eval rakudo 82b1b7: OUTPUT«3␤»
quietfanatic rakudo: say '1' ~ ($_ for 2..4) ~ '5'
p6eval rakudo 82b1b7: OUTPUT«15␤»
quietfanatic rakudo: say '1' ~ (2..4.map({$_})) ~ '5'
p6eval rakudo 82b1b7: OUTPUT«12 3 45␤»
quietfanatic rakudo: say '1' ~ ((2..4).map({$_})) ~ '5'
p6eval rakudo 82b1b7: OUTPUT«12 3 45␤»
tylercurtis rakudo: say ~(2, 3, 4) 04:43
p6eval rakudo 82b1b7: OUTPUT«2 3 4␤»
snarkyboojum Daenyth: your website title here (daenyth.github.com/) is surprisingly close to my mutteringmadman.com idea :D
Daenyth :)
tylercurtis quietfanatic: lists stringify with spaces between the elements.
pmichaud bbl
quietfanatic Yeah, that wasn't what I was testing 04:44
Okay I think I may have isolated it.
colomon does for not return values yet? 04:45
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say (2..4).map(&s)
p6eval rakudo 82b1b7: ( no output )
lue well, having to use .map is counterintuitive to me [says one who has not read the spec]
quietfanatic It seems for does not return values yet.
but 04:46
rakudo: sub s2 ($x) { s($x) }; multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say (2..4).map(&s2)
p6eval rakudo 82b1b7: OUTPUT«234␤»
quietfanatic rakudo: my sub s2 ($x) { s($x) }; multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say (2..4).map(&s2)
p6eval rakudo 82b1b7: OUTPUT«234␤» 04:47
quietfanatic Okay, locally, the former (with .map(&s)) gives an error
(method 'count' not found for Perl6MultiSub)
and the latter, with .map(&s2) returns nothing, or so it seems
rakudo: my sub s2 ($x) { s($x) }; multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say 1 ~ (2..4).map(&s2) ~ 5 04:48
lue
.oO(that's wizard [the error message] )
p6eval rakudo 82b1b7: OUTPUT«12 3 45␤»
04:48 astrojp left
quietfanatic The error may be just that I have an old version 04:48
Wait 04:49
no, locally the former returns nothing, without error too.
It's just the code I have that's acting weird
colomon > sub s2 ($x) { s($x) }; multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say (2..4).map(&s2)
234
that's latest locally 04:50
quietfanatic Yeah, me too...
lue .rnd(Cake is an interesting food to attempt consumption of near a computer)
quietfanatic I mean, not latest but that's what it does
colomon oh, it's map(&s) which gives the error? 04:51
quietfanatic I don't get why my code is doing different things
It's not that one-liner that gives the error, but a similar longer situation I have
colomon try equiv of map({ s($_) }) instead? 04:53
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say (2..4).map({s($_)}) 04:54
p6eval rakudo 31d41e: OUTPUT«234␤»
quietfanatic That works with the code I have too...
the strange thing being that if I declared a my-sub that had exactly the same contents 's($_)', it returned nothing 04:55
colomon the reason approximately is that rakudo is getting confused because it doesn't know which s to dispatch to the other way/
04:55 lestrrat is now known as lest_away 04:56 Util joined
quietfanatic Yeah, I guess 04:56
The problem though is that these examples do not show the same behavior as what I have in my larger code. I'll have to investigate.
04:57 skids left, ash_ left
tylercurtis multis and map sounds scary. How does it know how many parameters to pass to the mapped multi? 04:57
s/how does/how could/
quietfanatic Oh well, I'll figure that out later. For now I have a workaround
colomon exactly
04:58 lest_away is now known as lestrrat
quietfanatic That's what I figured the problem was with it not finding the 'count' method 04:59
where &sub.count tells you how many arguments it takes
colomon it might should work
but it's definitely scary.
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say &s.count 05:00
p6eval rakudo 31d41e: OUTPUT«Method 'count' not found for invocant of class 'Perl6MultiSub'␤ in main program body at line 22:/tmp/5Y56FdtFB0␤»
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say &s:(Int).count
p6eval rakudo 31d41e: OUTPUT«Could not find sub &s:(Int)␤ in main program body at line 22:/tmp/Upya_8JMEX␤»
quietfanatic rakudo: multi s (Int $x) { ~$x }; my &s2 = multi s (Str $x) { $x }; say &s2.count
p6eval rakudo 31d41e: OUTPUT«1␤» 05:01
05:01 macdaddy joined, macdaddy left
quietfanatic I think it's unambiguous what .count should be though, because it includes optional parameters 05:01
05:01 _macdaddy joined
quietfanatic it should be equal to the largest .count in all its candidates. 05:01
And .arity should be the smallest .arity 05:02
05:02 snarkyboojum_ joined
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say &s.arity 05:02
p6eval rakudo 31d41e: OUTPUT«Method 'arity' not found for invocant of class 'Perl6MultiSub'␤ in main program body at line 22:/tmp/iCLjYkQl5A␤»
quietfanatic rakudo: multi s (Int $x) { ~$x }; multi s (Str $x) { $x }; say &s2.arity
p6eval rakudo 31d41e: OUTPUT«Could not find sub &s2␤ in main program body at line 22:/tmp/2HvLHYYp0i␤»
quietfanatic rakudo: multi s (Int $x) { ~$x }; my &s2 = multi s (Str $x) { $x }; say &s2.arity
p6eval rakudo 31d41e: OUTPUT«1␤»
05:03 snarkyboojum left, snarkyboojum_ is now known as snarkyboojum
quietfanatic I'm gonna submit that as a bug report. 05:03
(the count/arity thing)
tylercurtis rakudo: sub factorial($n, $accum?) { if $n < 2 { 1 } else { factorial($n - 1, $n * $accum); } }; say (1...3).map(&factorial); 05:04
p6eval rakudo 31d41e: OUTPUT«1Use of uninitialized value in numeric context␤1␤»
tylercurtis rakudo: sub factorial($n, $accum? = 1) { if $n < 2 { 1 } else { factorial($n - 1, $n * $accum); } }; say (1...3).map(&factorial);
p6eval rakudo 31d41e: OUTPUT«11␤»
tylercurtis rakudo: sub factorial($n, $accum? = 1) { if $n < 2 { $accum } else { factorial($n - 1, $n * $accum); } }; say (1...3).map(&factorial);
p6eval rakudo 31d41e: OUTPUT«26␤» 05:05
tylercurtis rakudo: sub factorial($n, $accum? = 1) { if $n < 2 { $accum } else { factorial($n - 1, $n * $accum); } }; say (^6).map(&factorial);
p6eval rakudo 31d41e: OUTPUT«16120␤»
tylercurtis rakudo: sub factorial($n, $accum? = 1) { say("n $n, acc $accum"; if $n < 2 { $accum } else { factorial($n - 1, $n * $accum); } }; say (^6).map(&factorial); 05:06
Daenyth What sort of support is there for currying in perl6?
p6eval rakudo 31d41e: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
quietfanatic sub s (Int $x) | (Str $x) { say $x }; say &s.arity;
You use .assuming for currying.
my &say3 = &say.assuming(3); say3(4); 05:07
tylercurtis Daenyth: perlcabal.org/syn/S06.html#Currying
Daenyth <3
quietfanatic rakudo: my &say3 = &say.assuming(3); say3(4);
p6eval rakudo 31d41e: OUTPUT«34␤»
Daenyth nifty
tylercurtis O.o '(use IO::Logging).assuming(logfile => ".log");' this is somewhere between awesome and terrifying. 05:08
Daenyth :O
former
quietfanatic rakudo: sub s (Int $x) | (Str $x) { say $x }; say &s.arity; 05:09
tylercurtis Definitely the latter if you supply a positional parameter.
p6eval rakudo 31d41e: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
Daenyth tylercurtis: true
colomon std: sub s (Int $x) | (Str $x) { say $x }; say &s.arity
p6eval std 31784: OUTPUT«ok 00:01 123m␤»
quietfanatic rakudo: sub s ($x, $y?) { say $x }; say &s.arity;
p6eval rakudo 31d41e: OUTPUT«1␤» 05:10
quietfanatic rakudo: sub s ($x, $y?) { say $x }; say &s.count;
p6eval rakudo 31d41e: OUTPUT«2␤»
tylercurtis quietfanatic: iirc, Rakudo doesn't support the (Int $x) | (Str $x) part of your example.
Daenyth would be nice if the evalbot had a mode to pm back the AST it got
quietfanatic tylercurtis: Yeah, no multisigs. 05:11
tylercurtis Daenyth: no, it would not. 05:13
$ "viv foo.p6|wc -l"
47
foo.p6 being "say 1;"
Daenyth ah true >.>
ouch
lol
tylercurtis Daenyth: note that viv uses its "concise" format by default, too. 05:15
Daenyth heh :(
sorear the concise format could be made more concise 05:17
viv concise is designed mostly for hacking on viv - knowing the node types and all the various derived fields is necessary
an evalbot parser could probably do something more like -MO=Deparse,-p 05:19
cxreg mberends: ping 05:20
Daenyth that's more like what I had in mind
sorear or even -MO=Deparse,-p,-P,-q,-x9
tylercurtis sorear: Does viv --p6 work? 05:23
05:27 jedai left
sorear tylercurtis: degenerately, yes 05:27
it fully parses your source code, and then reassembles it with no changes 05:28
I'm not sure what it was ever intended to do
tylercurtis sorear: all I ever seem to get from it is a blank line.
sorear I probably broke it with the recent $*ORIG cleanups. It never used to do anything useful.
05:29 jedai joined
tylercurtis sorear: perhaps it was intended to do eventually do something like Deparse? 05:29
05:30 stepnem left
tylercurtis has no idea, but can't think of another reason for a --p6 option. 05:30
05:30 colomon left
sorear bear in mind that the first version of gimme5 was actually gimme6 05:31
it removed regexes and produced Pugs-compatible output
lue rakudo: my @a = 1,2,3; my @b = 2,3,4; my Set @c = @a, @b; say @c
tylercurtis Ah.
p6eval rakudo 31d41e: OUTPUT«123234␤» 05:32
tylercurtis rakudo: my @a = 1,2,3; my @b = 2,3,4; my @c is Set = @a, @b; say @c
p6eval rakudo 31d41e: OUTPUT«Modifications to classes are not allowed after instantiation.␤ in 'trait_mod:<is>' at line 61:CORE.setting␤ in main program body at line 22:/tmp/J8JFELqOoL␤»
tylercurtis rakudo: my @a = 1,2,3; my @b = 2,3,4; my Set $c = @a, @b; say @c
p6eval rakudo 31d41e: OUTPUT«===SORRY!===␤Symbol '@c' not predeclared in <anonymous> (/tmp/s_dci7aOwC:22)␤»
tylercurtis rakudo: my @a = 1,2,3; my @b = 2,3,4; my Set $c = @a, @b; say $c 05:33
p6eval rakudo 31d41e: OUTPUT«Type check failed for assignment␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/rFnsEUIwcM␤»
lue rakudo: my Set @a = 1,2,3,2,3,4; say @a
p6eval rakudo 31d41e: OUTPUT«123234␤»
05:33 stepnem joined
tylercurtis lue: "my Set @a" is similar to "my $a is Positional of Set" 05:34
lue And I thought Set worked right (or is Set not a container of unique values?)
tylercurtis lue: You're getting a list of Sets, not a Set.
lue rakudo: my Set @a = 1,2,3,2,3,4; say @a.perl 05:35
p6eval rakudo 31d41e: OUTPUT«[1, 2, 3, 2, 3, 4]␤»
lue rakudo: my Set @a = {1,2,3,2,3,4}; say @a.perl # oh pls let {} define a Set 05:36
p6eval rakudo 31d41e: OUTPUT«[{ ... }]␤»
sorear rakudo: my Set $a = Set(1,2,3,2,3,4); say $a.perl 05:37
p6eval rakudo 31d41e: OUTPUT«Could not find sub &Set␤ in main program body at line 22:/tmp/lyOI7N18LR␤»
sorear you cannot define Set @a
ever
@a requires an object which can be indexed
sets are not ordered
unless, of course, you meant to define an array of Set 05:38
(which is, as tylercurtis++ pointed out, what Set @a actually means)
lue ah. So I just used the wrong sigil.
rakudo: my Set $a = 1,2,3,2,3,4; say $a 05:39
p6eval rakudo 31d41e: OUTPUT«Type check failed for assignment␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/DVGFuRjTZb␤»
lue
.oO(To The Spec!)
tylercurtis lue: "my Set $a = 1;" will never type-check. You want "my Set $a .= new(1,2,3,2,3,4);"
snarkyboojum rakudo: my Set $a .= new(1,3,2,4); say $a 05:40
p6eval rakudo 31d41e: OUTPUT«Set()<0x83cc910>␤»
tylercurtis rakudo: my Set $a .= new(1,3,2,4); say $a.perl;
p6eval rakudo 31d41e: OUTPUT«Set.new(1, 3, 2, 4)␤»
snarkyboojum rakudo: my Set $a .=new(1,3,2,4); say $a.^methods(:local).join(' ') 05:41
p6eval rakudo 31d41e: OUTPUT«elems subset intersection equal superset keys at_key exists union new difference Bool subsetorequal values Num perl supersetorequal of␤»
sorear lue: assignments don't coerce. my Set $a = #`(whatever goes here has to already be a Set) 05:42
tylercurtis sorear: not to mention that "my Set $a = 1,2,3,2,3,4" parses as "(my Set $a = 1),2,3,2,3,4". 05:43
right? Item assignment is tighter than infix:<,>, no? 05:44
lue
.oO(hmm... Set isn't being very friendly :/)
sorear std: my Set $a = 1,2,3,2,3,4
p6eval std 31784: OUTPUT«ok 00:01 118m␤»
sorear there used to be a warning for this
ah, no, it's only a special case in name lookup 05:45
std: my $x, $y;
p6eval std 31784: OUTPUT«===SORRY!===␤Variable $y is not predeclared (declarators are tighter than comma, so maybe your 'my' signature needs parens?) at /tmp/jR_HqEaTjT line 1:␤------> my $x, $y⏏;␤Check failed␤FAILED 00:01 117m␤»
lue rakudo: my $a = Set.new(1,2,3,2,3,4); say $a 05:47
p6eval rakudo 31d41e: OUTPUT«Set()<0x84b0fb0>␤»
lue I wonder, should there be a say method for Set? 05:48
05:52 snarkyboojum left 05:53 uniejo joined
szabgab rakudo: for 1,3 ... 11 { say $_ } 05:59
p6eval rakudo 31d41e: OUTPUT«1␤3␤5␤7␤9␤11␤»
szabgab rakudo: for 1,3 ...^ 11 { say $_ }
p6eval rakudo 31d41e: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
szabgab I wonder why is the latter? 06:00
06:03 justatheory joined 06:04 snarkyboojum joined
tylercurtis Daenyth: if you want to golf that further, "print $ problem1 1000". 06:05
06:08 meppel is now known as meppl 06:15 justatheory left 06:19 eternaleye left 06:32 _macdaddy left
pugssvn r31785 | moritz++ | [t/spec] test for RT #71846, and refudge a bit 06:37
moritz_ szabgab: ...^ is NYI, I think 06:39
06:41 [particle] left 06:42 [particle] joined, xinming left 06:48 dalek joined, sorear sets mode: +v dalek 06:49 Mowah joined 06:52 baest joined 06:54 colomon joined 06:59 sorear sets mode: +o colomon
sorear hello! 06:59
au|irc o/
07:00 xinming joined 07:01 mberends left
mathw Good morning 07:04
sorear Good morning mathw
07:05 stepnem left
moritz_ \o 07:05
pugssvn r31786 | moritz++ | [t/spec] unfudge a series test, colomon++ 07:06
07:07 plobsing left, tylercurtis left 07:08 tylercurtis joined, tylercurtis left
sorear au|irc: dalek ate the first batch of commits, but I'm in the middle of the refactor that will enable the regex compiler 07:09
au|irc \o/
so sleeping on it did help? :)
07:09 daxim joined
sorear Maybe 07:10
au|irc Either :)
07:10 stepnem joined
sorear (,) 07:11
au|irc (->) :) 07:13
mathw (>>=) 07:18
07:18 rgrau joined
mathw always liked the Monad operators 07:21
cognominal I have trouble composing monads, that my main grief with haskell 07:22
au|irc (>=##) :)
mathw composing monads is quite difficult
although I think I'm behind on some of the latest thinking there
07:22 cjk101010 joined
mathw But last time I looked at it, you had to jump through hoops to design composable monads 07:22
and then worse hoops to actually compose them properly
this always seemed a weakness :( 07:23
sorear I am *so* glad I wrote that testsuite last week
mathw I'm seeing blog posts lately about quite effective monad transformers, but I think more than a level or so of those would probably drive you nuts
sorear: I'm so glad I wrote a testsuite for Form.pm along with its features. They're awesome!
cxreg aaiieeee 07:24
cognominal monads being the heart of handling state in haskell, this is quite a hurdle. I don't know if it is a real one or just a lack of proficiency from me.
cxreg i've got a situation where sometimes 'foo' eq any($bar.^methods) is true, and sometimes false. seemingly random.
mathw cognominal: no, it's a real hurdle. You can still do cool stuff, but it hurts composability of functions which use monads. 07:26
cognominal I have a "ceiling theory". Most language have some necessary feature that many people can't seem to master. A university teacher said he lose half of his class when he teach pointers in C.
mathw cxreg: that's... odd. Have you checked if the return of $bar.^methods is the same between the two cases?
cognominal: It took me a long time to grok pointers. Then it was quite sudden and seemed very obvious.
cognominal I remember pointers were difficult for me. But at that time, circa 1987, I had only the K&R and no access to Internet or source code. 07:27
no irc either :) 07:28
sorear I think a lot of people would benefit from a few months spent implementing a toy toolchain
cxreg mathw: it varies each time i run the program
sorear cxreg: tried --hash-seed? 07:29
cxreg mathw: i ran it 4 times, got 4 different results
although it /seems/ to be just ordering
not sure why that would affect any(
mathw the ordering is likely to vary
Certainly, it's not promised to be the same
sorear parrot --hash-seed=deadbeef /path/to/perl6.pbc program.pl
mathw that shouldn't affect the way it turns into an any() though
cognominal: They were difficult for me largely because I could see the concept but I had no good explanation of what they were useful for. 07:30
cognominal: Realising what they were good for also allowed me to move on a level and write far more sophisticated software, because I suddenly had pass-by-reference and malloc() available to me 07:31
cxreg the ordering definitely plays a role here 07:32
snarkyboojum cxreg: code? 07:33
cognominal syntax is also a hurdle when you deal with pointers to functions returning pointer to functions (like signals handler in unix). Damian Conway has a paper about how that could have been done right. I guess Perl 6 benefited from it. 07:34
s/functions/function/g
I don't dare to imagine with the plural...
mathw Oh yes, function pointer syntax in C is hideous. 07:37
cxreg rakudo: class Foo { has $.bar; has $.baz; has $.biff }; say ("biff" eq any(Foo.^methods) ?? "yay" !! "nay")
p6eval rakudo 31d41e: OUTPUT«nay␤»
cxreg rakudo: class Foo { has $.bar; has $.baz; has $.biff }; say ("biff" eq any(Foo.^methods) ?? "yay" !! "nay")
p6eval rakudo 31d41e: OUTPUT«nay␤»
cxreg rakudo: class Foo { has $.bar; has $.baz; has $.biff }; say ("biff" eq any(Foo.^methods) ?? "yay" !! "nay")
p6eval rakudo 31d41e: OUTPUT«yay␤»
cxreg there ya go
:( 07:38
sorear is very glad that in Perl 6 @( @foo ) has been redefined to do something sensible 07:39
mathw cxreg: I think you should file a rakudobug 07:40
cxreg i agree. my second today. 07:41
mathw Yes unfortunately there are still many bugs
But it's good to find them
cxreg i'm not actually complaining ;) 07:45
07:45 zulon joined
mathw \o/ 07:45
cxreg filed RT 76648 07:46
moritz_ cxreg++ # breaking stuff 07:49
cognominal sorear, what it does? @$foo still does not work in rakudo last time I checked
07:49 ashleydev left
moritz_ but @($foo) works 07:50
sorear I said @( @foo )
not @( $foo )
I don't explicitly write that, but it sometimes happens if I return an array from one function, then try to dereference it elsewhere 07:51
cognominal yes that's different indeed.
sorear Perl 6 does the sensible thing and ignores the redundant deref
Perl 5 will attempt to access the global array whose name is the decimal encoding of the number of elements in @foo
cxreg assuming strict refs is off
sorear even if strict refs is on, the error is caught too late 07:52
and it doesn't DWIM in any case
07:52 PZt left 07:54 PZt joined
dalek ecza: e337510 | sorear++ | (2 files):
Push automatic is Any down and out of the parser
07:55
ecza: b08dd5f | sorear++ | (2 files):
Op::*, not the parser, should construct Decls
ecza: 4da1598 | sorear++ | (3 files):
Move state completely to the new model
ecza: 87b12f0 | sorear++ | (3 files):
Move class traits to new model
ecza: 4998f99 | sorear++ | (2 files):
Move methods to new model
ecza: 0067ab2 | sorear++ | (2 files):
Move YOU_ARE_HERE & remove vestiges of !decls hack.
08:02 mberends joined
cxreg is there some way of checking if a variable is declared in your current scope? 08:03
might seem like an odd question, but it's relevant to something that's being run by 'eval slurp'
moritz_ eval '$x'; if $! { say '$x is not defined' } 08:04
mberends rakudo: my $a; my $b=1; say defined($a); say defined($b) 08:05
p6eval rakudo 31d41e: OUTPUT«0␤1␤»
mberends (morning cxreg moritz_)
moritz_ I should have said s/defined/declared/
cxreg hm
compilation fails, on the line i try to use the as-it-happens-undeclared variable 08:06
i guess it's gotta be in eval
moritz_ rakudo: my $x; eval 'say "in eval"; eval q[$x]; say $! ?? "not declared" !! "declared";' 08:07
p6eval rakudo 31d41e: OUTPUT«in eval␤declared␤»
moritz_ eval 'say "in eval"; eval q[$x]; say $! ?? "not declared" !! "declared";'
rakudo: eval 'say "in eval"; eval q[$x]; say $! ?? "not declared" !! "declared";'
p6eval rakudo 31d41e: OUTPUT«in eval␤not declared␤»
moritz_ seems to work fine
cxreg mberends: hiya. have a number of commits for MiniDBI 08:08
mberends \o/
jnthn++ # fixed Zavolaj!
cxreg indeed!
mberends: one odd thing i saw and couldn't yet solve, if MiniDBD::mysql cannot connect, you get a "Null PMC access in isa_pmc" 08:12
szabgab is for lines 'file' -> $line {} lazy or does it read all the file in memory? 08:13
or rather "will it be lazy?"
mberends cxreg: ouch. It ought to be possible to catch that and handle it better. I guess those are the sort of code paths that are tested less often. I'll look into it. 08:14
08:14 colomon left, colomon joined
cxreg mberends: i also made a number of improvements to 99-common.pl6 08:14
mberends: i can push to my fork first if you'd like to code review
mberends cxreg: just go ahead and commit. I'm busy with $work today, and I trust the anarchy :) 08:15
08:15 colomon left
cxreg oke doke 08:15
i got all common tests passing in both mysql and pg, so i'm happy 08:16
mberends w00t!
mberends is happier
08:16 colomon joined
moritz_ hey, git makes it really easy to revert commits if something's wrong :-) 08:16
cxreg true
git++
08:17 colomon left
moritz_ I think there's a high emotional barrier against reverting stuff, but IMHO it's ok to break that barrier, and just talk to the committer 08:17
cxreg ok, pushing 08:18
szabgab moritz_: is for lines 'file' -> $line {} lazy ?
or I need to call open and then use $fh.lines to get lazyness? 08:19
moritz_ szabgab: it should. If not, it's a bug
szabgab I have no idea how to test that, but for now it is not that important :) 08:20
moritz_ just take a huge file, and abort after the first line
if it's much slower than with a short file, it's not lazy
sorear szabgab: it's lazy - try for lines $*IN -> $line { say $line } 08:21
moritz_ seems lazy, yes
sorear it will, however, store copies of all lines read
moritz_ time ./perl6 -e 'for lines("README") { .say; last }' 08:22
=head1 Rakudo Perl 6
real 0m1.164s
szabgab: it should not
erm, meant sorear, sorry
cat README README README README README README > big
time ./perl6 -e 'for lines("big") { .say; last }'
=head1 Rakudo Perl 6
real 0m1.181s
sorear moritz_: O(1) space lazy list processing is NYI in Parrot 08:23
moritz_ sorear: afaict pmichaud implemented it in rakudo on top of parrot
except that it might leak :( 08:24
sorear: at least that was one of the explicit design goals of the 'list' branch
sorear Yes, 'list' is a much better foundation for moving forward.
szabgab what is interesting with the screencasts is the the number of viewers drop a lot for the second part 08:25
sorear screencasts?
moritz_ :(
szabgab right now it is 805 for the first part and 176 for the second
moritz_ sorear: you should really follow planetsix :-)
szabgab and 18 for the 3rd
but the first one got some 500 hits on the first day 08:26
I wish I understood why is that drop for the second part 08:27
moritz_ szabgab: do you have a small page linking to all the screen casts?
szabgab szabgab.com/perl6.html
moritz_ szabgab: care to add an id="screencasts" to the <h2>? 08:28
szabgab no problem but why?
moritz_ wants to reddit it 08:29
szabgab and why does the id help in that?
moritz_ because I can link to the correct section, helping with the low attention span of the audience :-) 08:30
szabgab try now
moritz_ thanks, szabgab++
sorear wonders if anyone here has noticed the niecza termcast feed 08:31
dalek ecza: a5170a7 | sorear++ | (3 files):
Implement the REGEX COMPILER!
moritz_ sorear: if you have a niecza blog, please contact [Coke] about adding it to the planetsix feed
mberends sorear: wow!
sorear right now it's capable of handling any regex matching [\w\*?]* 08:32
szabgab I did not know you can link to an id :)
moritz_ www.reddit.com/r/programming/commen...t_started/
szabgab: with #id 08:33
szabgab moritz_++ thanks
sorear ok, screencasts are not *quite* what I thought they were
szabgab on two terms :)
sorear: what were you expecting?
sorear szabgab: not a video file 08:34
szabgab moritz_: oh in r/programming :) 08:35
moritz_ szabgab: yes; I try to break out the echo chamber
szabgab: in the end, somebody typically also posts to r/perl, but it's on the ironman feed anyway
daxim we'll arrange a screen -x just for you, sorear
szabgab so I go back to prepare the 4th entry
moritz_ szabgab++ 08:37
szabgab the padre screencast was averaging 15.6 view / day 08:38
I wonder how will these do
moritz_ wonders if rakudo.org can stand a slashdot citation, once R* is released 08:39
08:39 xabbu42 left
frettled If it's running Apache, enabling mod_cache with mod_mem_cache ought to help a lot for that eventuality. 08:41
moritz_ otoh my stupid blosxom blog also handled ~10k visitors in 4 hours, which is about what the advent calendar got when slashdotted 08:43
08:44 dakkar joined
szabgab I was wondering if there is any real world use for R* ? 08:44
frettled szabgab: it got ingy excited :)
szabgab I mean the operator 08:45
frettled oh
szabgab rakudo: 2 r* 4
rakudo: 2 R* 4
p6eval rakudo 31d41e: OUTPUT«===SORRY!===␤Confused at line 22, near "2 r* 4"␤»
rakudo 31d41e: ( no output )
szabgab rakudo: say 2 R* 4
au|irc sorear: congrats :)
p6eval rakudo 31d41e: OUTPUT«8␤»
au|irc sub _rxopt($C) { _rxdisj( _rxone($C), $rxnone ); }
# correct?
moritz_ szabgab: not really. Unless you overload it to work with matrices, which are not commutative 08:46
08:46 thebird joined
frettled Then the remaining use is to confuse people. \o/ 08:47
szabgab so now someone needs to create a phylosophy around R* :)
moritz_ well, it's just an abbreviation 08:50
which happens to be an infix operator
au|irc sorear: oh, nvm, I misread the code. :) 08:54
perigrin phenny: tell masak his post on the 10 year history of p6 has proven invaluable. I rattled most of it off at someone today in 10min. 08:56
phenny perigrin: I'll pass that on when masak is around.
sorear au|irc: msread? that ought to work
(also, my network is acting up)^H.)
au|irc well, implemented that way 'abc' won't match /abc/ 08:57
er, /ab?c/
only 'ac' matches
sorear oh, right, oops 08:59
08:59 Raynes joined
sorear that rxopt is <?> | <!> 08:59
au|irc yeah
09:00 timbunce left 09:04 au|irc is now known as au|afk|dinner
cxreg perigrin: indeed; that post has done a lot to stir people up 09:06
09:09 mj41 joined 09:12 [bjoern] left
perigrin cxreg: yeah but I have a vested interest. I've been manning the TPF booth at OSCON this week. 09:12
Juerd
.oO( one week )
09:21
.oO( * )
09:36 snarkyboojum left
sorear std: { our $x; }; { our $x; } 09:39
p6eval std 31786: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/05HHY2YfWZ line 1:␤------> { our $x⏏; }; { our $x; }␤ok 00:01 115m␤»
sorear hmm. I don't have commoning
09:42 redicaps joined, redicaps left 09:44 pmurias joined
pmurias where can i get the list of options i can pass to Configure (more specificaly how do i enable MULTIPLICITY?) 09:45
moritz_ which project are you talking about?
sorear ./Configure -des -DMULTIPLICITY
./Configure -h 09:46
moritz_: perl 5
09:47 cognominal left
sorear INSTALL 09:48
Configure's own sources
man Config
moritz_ NO
Configure is generated code
you don't want to read that
09:48 cognominal joined
moritz_ it, like, hurts :-) 09:49
sorear I /have/ read it, and it's where most of what I know about the configure options comes from
pmurias moritz_: re which project, meant to ask on #perl 09:54
moritz_ oh :-) 09:55
szabgab: fwiw, somebody did submit your first p6 screencast to reddit - which might explain the relatively high visitor stats 09:56
sorear out. 09:57
pmurias moritz_: but i want to know to build a perl with multiplicity to work on packaging up smop's p5 interop so it's slightly OT
moritz_ where O stands for "on" and not "off" :-)
rakudo: my $x = -2; say ($x max 0) min 10 10:05
p6eval rakudo 925a9b: OUTPUT«0␤»
moritz_ rakudo: my $x = 12; say ($x max 0) min 10
p6eval rakudo 925a9b: OUTPUT«10␤»
moritz_ rakudo: my $x = 5; say ($x max 0) min 10
10:05 lestrrat is now known as lest_away
p6eval rakudo 925a9b: OUTPUT«5␤» 10:05
10:06 smash__ joined, Schwern joined
smash__ hello everyone 10:06
moritz_ rakudo: my $x = 5; say $x max 0 min 10
hi smash__
p6eval rakudo 925a9b: OUTPUT«5␤»
szabgab moritz_: yeah, and nice comments too :)
moritz_ well, it's reddit. You get 20 upvotes and 5 snarky comments
10:08 xabbu42 joined
moritz_ rakudo: my $x = (1, 2, 3); say :$x.perl 10:09
p6eval rakudo 925a9b: OUTPUT«"x" => (1, 2, 3)␤»
moritz_ TheDamian++
10:14 tadzik joined
moritz_ rakudo: my %h = "a=b\nc=d".split("\n")>>.split('='); say %h.perl 10:16
p6eval rakudo 925a9b: OUTPUT«{"a" => "b", "c" => "d"}␤»
moritz_ rakudo: my %h = "a=b\nc=d\n".split("\n")>>.split('='); say %h.perl
p6eval rakudo 925a9b: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/FrsCKl37Rs␤»
moritz_ rakudo: my %h = "a=b\nc=d\n".split("\n")>>.split('=').flat; say %h.perl
p6eval rakudo 925a9b: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/ZwuqIKq0Od␤»
moritz_ rakudo: my %h = "a=b\nc=d\n".split("\n")>>.grep(*).split('='); say %h.perl 10:17
p6eval rakudo 925a9b: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/AD5JVD6yV0␤»
moritz_ rakudo: my %h = "a=b\nc=d\n".split("\n")>>.grep({$_}).split('='); say %h.perl
p6eval rakudo 925a9b: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/lZtGCAYIZi␤»
moritz_ rakudo: my %h = "a=b\nc=d\n".split("\n")>>.grep(*.chars).split('='); say %h.perl 10:18
p6eval rakudo 925a9b: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/6SPg1oTZu8␤»
moritz_ rakudo: "a=b\nc=d\n".split("\n")>>.grep(*.chars).split('=').perl.say
p6eval rakudo 925a9b: OUTPUT«("a", "b c", "d")␤»
moritz_ rakudo: "a=b\nc=d\n".split("\n")>>.split('=').perl.say 10:19
p6eval rakudo 925a9b: OUTPUT«(("a", "b"), ("c", "d"), (""))␤»
10:19 zulon left
moritz_ rakudo: "a=b\nc=d\n".split("\n")>>.split('=').grep(* == 2).perl.say 10:19
p6eval rakudo 925a9b: OUTPUT«()␤»
10:20 snarkyboojum joined 10:22 masak joined
masak o/ 10:23
phenny masak: 21 Jul 20:48Z <moritz_> tell masak tadzik++ noticed a lack of license in proto... care to add the AL2?
masak: 21 Jul 21:55Z <Kodi> tell masak I implemented immutability for DateTimes and edited the spec and tests appropriately, and then, since I was on a roll, I did the same for leap-second validation. All that remains is some cleanup, and then I'll have a gist for you to look at.
masak: 08:56Z <perigrin> tell masak his post on the 10 year history of p6 has proven invaluable. I rattled most of it off at someone today in 10min.
10:23 snarkyboojum left
masak perigrin: yay 10:23
Kodi: you rock.
moritz_: sure, will do. 10:24
ok, so I have a blog post draft for you to look at.
hold on, I'll post it as a gist.
gist.github.com/485816 -- comments are encouraged. :) 10:26
tadzik szabgab++ # screencast are awesome 10:27
masak aye, szabgab++
tadzik method attack-with-camelia { say "flap flap RAWWR!" } 10:28
oh wow
masak :) 10:29
10:31 snarkyboojum joined 10:32 xabbu42 left
masak oh, and in thinking about my Parsea talk for YAPC::EU, I now have a new sekkrit project. it's not too ambitious, but it's a really nice example of something I think we'll see a lot of. come to the talk and be the first to see it :) 10:33
10:43 zulon joined
masak updated gist.github.com/485816 -- check out the example at the bottom :) 10:44
masak backlogs 10:45
tadzik 1, 2, 4 ... * # powers of two 10:49
serious question, how does rakudo know that?
masak tadzik: it detects arithmetic and geometric sequences through a few simple rules. 10:50
tadzik: S03 has the details.
tadzik I'll take a look, thanks
TiMBuS im writing a 'tell' module for my perl6 irc bot but I keep running into regex bugs. anyone know something better than this: /tell <.ws> $<name>=[.+?] <.ws> $<msg>=[.+]/ 10:51
thats the best i can do without bugs, but its a bit simple.. 10:54
masak TiMBuS: please be more specific. 10:56
TiMBuS i guess i'll narrow it down a little: i want to put <.ws>+ in there in place of the <.ws>'s but it freezes. 10:57
masak I haven't experienced any bugs in that area.
TiMBuS: it should be just <.ws>
TiMBuS: <.ws>+ does freeze, but it's not a bug.
TiMBuS oh?
masak it's just a think on your part.
if you look up what <.ws> does, and what + does, and then think about it... :)
s/a think/a thinko/
TiMBuS i didn't know <ws> matched more than one. 10:58
masak in English, "whitespace" is a mass noun. 11:00
it can refer to any number of whitespace characters.
there should probably be a compiler error on <.ws>+ eventually, though.
TiMBuS that would be handy
mayybe its because I was using <-ws> and it only matches one character 11:01
the wrong character :/
rakudo: my $a = "test"~~ /<-ws>/; $a.say 11:02
p6eval rakudo 925a9b: OUTPUT«e␤»
masak I have a difficult time thinking what <-ws> even means... 11:06
TiMBuS: I'd still advise you to look up the exact semantics of <ws>
it's a bit magical.
TiMBuS yeah i did that after you said to :), and I knew -ws doesnt match the first letter because of the 'matching the start of a string' effect it has 11:10
masak ooh, that's why. yes, of course. TiMBuS++
TiMBuS well, matching the space "inbetween" the letter and the start of the string.. its still a bit complicated 11:11
11:12 meppel joined
cxreg say [+] (1..6).pick(3, :replace); # 3d6 <- cute 11:12
11:13 colomon joined
colomon o/ 11:15
11:16 meppl left
dalek ecza: 3bf633b | sorear++ | (3 files):
Implement package declarations
11:17
ecza: d4c0960 | sorear++ | (3 files):
Implement "our" variables
ecza: 260f408 | sorear++ | (4 files):
Implement $Foo::x referencing syntax
masak cxreg: catering to the role playing people out there. :)
tadzik :)
related to Perl6 MMORPG? :)
11:18 cogno joined
masak everything is related to Perl 6 MMORPG :) 11:18
cxreg .classify is a new one to me, that's interesting
tadzik masak: where are you going to publish this?
masak tadzik: before you asked, I was thinking use.perl.org
tadzik: but now I'm thinking I might make a special HTML page with a bit better formatting and syntax highlighting. 11:19
cxreg use.perl6.org :D
masak just a static page for this one :)
colomon only gurps players want 3d6 like that.
11:19 snarkyboojum left
masak colomon: I'm sorry? 11:19
tadzik prefers d20
masak but I have had a whole bunch of ideas for a blog engine for myself in the past few days. 11:20
colomon gurps system is based on rolling 3d6 for everything.
11:21 ab5tract left, cogno left
colomon for D&D stats, we'd have done something like 4d6 drop the lowest 11:21
masak colomon: should I perhaps choose something other than 3d6?
ok.
masak changes it 11:22
tadzik :)
colomon trying to think how to make a slick one-liner for that. :)
masak ooh, "drop the lowest", now I see what you mean.
cxreg masak: so, i previously read that sort memoizes
tadzik one day I'll mistake ~= with =~ :/ Any better thing for adding something to a string?
cxreg is there some way to do cache control? 11:23
masak colomon: pick four, sort descending, .[^3]
colomon masak: brill!
masak cxreg: what do you mean by cache control?
cxreg masak: what if you dont want to or can't afford to cache the computed value for each element
masak tadzik: you could always write it out :) $a = $a ~ "foo" 11:24
tadzik :)
masak cxreg: then probably roll your own.
cxreg masak: maybe unlikely but definitely possible
masak: i guess i dont grok which syntax incurs the magic memoize
just the star version? 11:25
masak cxreg: any unary code object.
hm, and nullary.
cxreg ok
colomon masak: btw, left a terrific one-line sitting in my repl from when I was rocking my boy late in the night, but my system rebooted while my wife was rocking him. :( 11:27
moritz_ has a nice idea for a Perl 6 module: produce Roman numerals
masak colomon: do you remember it?
colomon more or less
I think
cxreg moritz_: with ... overloading? :)
masak colomon, moritz_: do you have any suggestions for improvements of gist.github.com/485816 -- how to make it shine? 11:28
moritz_ cxreg: NOOOO
masak: I'll take a look
masak \o/
cxreg has damian produced any godawful perl 6 monstrosities yet? :) 11:29
moritz_ sure
the IO::Prompter thing
masak cxreg: he's written IO::Prompter, which looks way cool.
moritz_: I swear, we would make a fun twin act! :P
11:30 meppel is now known as meppl
colomon rakudo: say ((257, * div 2 ... 1) Z% (2 xx *)).perl 11:31
masak [Coke]: when's the release today? I'm pondering whether to spend time on enums or not.
moritz_ masak: we'd just have to work on the looks :-)
p6eval rakudo 925a9b: OUTPUT«(1, 0, 0, 0, 0, 0, 0, 0, 1)␤»
TiMBuS tadzik: sub infix:<`=> ($a is rw, $b){$a~=$b}
:p
colomon rakudo: say ((254, * div 2 ... 1) Z% (2 xx *)).perl
tadzik TiMBuS :)
p6eval rakudo 925a9b: OUTPUT«(0, 1, 1, 1, 1, 1, 1, 1)␤»
masak colomon: neat.
moritz_ rakudo: .say for 'Camelia', *.chop ... '' 11:32
p6eval rakudo 925a9b: OUTPUT«Camelia␤Cameli␤Camel␤Came␤Cam␤Ca␤C␤␤»
colomon that's just the warm up. :)
sweet!
cxreg you guys are sick 11:33
moritz_ masak: I likes it. I don't know what to contribute
colomon rakudo: say (((254, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).perl 11:34
p6eval rakudo 925a9b: OUTPUT«(0/1, 1/9, 1/81, 1/6561, 1/43046721, 5.39659527735429e-16, 2.91232405875626e-31, 8.48163142321055e-62)␤»
masak moritz_: ok. I'll let it sit there for a few hours, and then I'll publish.
anyone who thinks of more example, please get in touch :)
colomon rakudo: say (((19, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).perl 11:35
p6eval rakudo 925a9b: OUTPUT«(1/3, 1/9, 0/1, 0/1, 1/43046721)␤»
cxreg the X operator needs a 'where', like in SQL
masak after reading the p6l thread, I now realize that I don't give a damn about character ranges.
nom &
colomon rakudo: say( [+] (((19, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *))).perl
11:36 masak left
p6eval rakudo 925a9b: OUTPUT«0.444444467675018␤» 11:36
moritz_ masak: btw I'm working on a "common idioms translated to Perl 6" post
Juerd moritz_: Great!
colomon rakudo: say (1/3) ** 19
p6eval rakudo 925a9b: OUTPUT«8.60391597237732e-10␤»
Juerd removes that from his to do list :) 11:37
cxreg moritz_: i thought most perl 5 idioms were huffman encoded to an operator
colomon hmmmm :\
Juerd cxreg: Yes. Hello World is now just *;
I know it isn't, but it should be! ;)
rakudo: * 11:38
p6eval rakudo 925a9b: ( no output )
cxreg heh
colomon masak: $a cmp $b is not "lexicographic ordering"
moritz_ nopaste.snit.ch/22204 # it's what I have now
TiMBuS imo a bare *; should be a hq9+ repl
just so nobody makes one in it D: 11:39
Juerd I wonder if from within P6 one can make * do something like this.
moritz_ are we starting the "how many distinct meanings can you give a single character" game again?
Juerd moritz_: No, the "Which operator will be the hello-world-op?"
moritz_ Juerd: sub term:<*> { say "hello, world" }; # NYI, of course
Juerd moritz_: How about a two-column layout with P5 left and P6 right? 11:40
tadzik and python, just to point them with a finger and laugh :>
moritz_ Juerd: maybe. I plan to explain them a bit in the text that follows, don't know if they are needed then 11:41
Juerd moritz_: Without another language, it's not really a translation :) 11:43
And the improvement doesn't show
moritz_ Juerd: point taken. I should either compare, or change the title
pmurias don't we have a nicer way to create a required attribute? 11:48
moritz_ we have ways to enforce its presence in a constructor 11:51
tadzik rakudo: say 'ok' if "foo~ ~~ / \S+ / 11:53
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Unrecognized backslash sequence: '\S' at line 22, near "+ /"␤»
tadzik isn't it 'a non-whitespace character?'
11:53 dalek left
moritz_ you need to close your quote 11:53
tadzik oh
right, my bad 11:54
moritz_ rakudo: say 'ok' if "foo@ ~~ / \S+ /
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Unrecognized backslash sequence: '\S' at line 22, near "+ /"␤»
moritz_ rakudo: say 'ok' if "foo" ~~ / \S+ /
p6eval rakudo 925a9b: OUTPUT«ok␤» 11:55
moritz_ rakudo: say 'ok' if "foo" ~~ / \S+ /; say $/
p6eval rakudo 925a9b: OUTPUT«ok␤foo␤»
pmurias moritz_: you mean if i write my own constructor i can enforce the presense of the attribute 11:57
moritz_: but writing constructors is clumsy
11:57 dalek joined
moritz_ right 11:57
method new(*%h {:$required! }) { nextsame } 11:58
11:58 Util left
pmurias ugly 11:59
11:59 Util joined
moritz_ aye 11:59
11:59 envi^home joined 12:00 Kodi joined
pmurias would has Int:D $foo work? 12:00
moritz_ or method new(:$required, *%) { nextsame } # but still ugly
12:00 au|afk|dinner is now known as au|irc
moritz_ pmurias: it would, but it would produce a quite curious error message 12:00
tadzik The only thing worse than a typo in the code is a typo in the tests
Kodi moritz_: rosettacode.org/wiki/Roman_numerals#Perl_6
moritz_ Kodi: nice. Somebody should wrap it up in a module. 12:01
12:01 rml_ joined
pmurias moritz_: that's up to the compiler 12:01
moritz_ is there a license for code on rosettacode?
tadzik pmurias: how about has $.param = die "param is required"? 12:02
Kodi moritz_: rosettacode.org/wiki/Rosetta_Code:Copyrights
au|irc moritz_: GFDL 1.2
moritz_ pmurias: I'd be surprised to get a better error message than "type check failed for attribute 'foo', expected Int:D, got: Int:U"
12:02 masonkramer left
moritz_ huh. GFDL for code... :-) 12:02
Kodi moritz_: Yeah. That was a mistake, really.
12:02 masonkramer joined 12:03 azert0x joined
Kodi moritz_: But I wrote the code, so I could release it under a different license, too. 12:03
moritz_ Kodi: that would be cool 12:04
Kodi: just stuff it into a Roman.pm, and put an 'is export' on the sub
colomon masak: leg is lexicographic ordering
rakudo: say( [*] (((19, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *))).perl 12:05
p6eval rakudo 925a9b: OUTPUT«0␤»
colomon dang it, how did I make it work last night?!
rakudo: say( [*] (((19, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).grep(*>0)).perl 12:06
p6eval rakudo 925a9b: OUTPUT«8.60391597237732e-10␤»
colomon rakudo: say (1/3)**19
p6eval rakudo 925a9b: OUTPUT«8.60391597237732e-10␤» 12:07
colomon bingo
moritz_ what are you trying to achieve? power series?
btw alternating signs are easily created with (1, -1) xx *
colomon it's a (psuedo) efficient way to raise a number to an Int power by repeated multiplication 12:08
rakudo: say( [*] (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).grep(*>0)).perl
moritz_ ah, horner schema
p6eval rakudo 925a9b: OUTPUT«0.00411522633744856␤»
colomon except that should be a float. :\
s/float/Rat/ 12:09
moritz_ rakudo: say [+] ((1, -1) xx *) Z* (1, 3 ... 7).map(* ** 2 / [*] 1..*)
p6eval rakudo 925a9b: ( no output )
12:10 lest_away is now known as lestrrat
moritz_ rakudo: say [+] ((1, -1) xx *) Z* (1, 3 ... 7).map({$_ ** 2 / [*] 1..$_}) 12:10
colomon moritz_: if you're trying to get sine, you can't use * twice like that
p6eval rakudo 925a9b: OUTPUT«-0.301388888888889␤»
[Coke] oooh, I found out how GE is categorizing "perl6.org". - shareware/freeware.
moritz_ colomon: aye, just noticed 12:11
[Coke] (make of that what you will)
colomon made the same mistake yesterday. :)
moritz_ rakudo: say sin(1)
p6eval rakudo 925a9b: OUTPUT«0.841470984807897␤»
moritz_ [Coke]: it is "freeware", at some level :-)
rakudo: say [+] ((1, -1) xx *) Z* (1, 3 ... 7).map({2** $_ / [*] 1..$_}) 12:12
rakudo: say sin(2)
p6eval rakudo 925a9b: OUTPUT«0.907936507936508␤»
rakudo 925a9b: OUTPUT«0.909297426825682␤»
moritz_ much better
cxreg did you guys ever see the movie Pi?
i think that's where this is headed
12:12 xabbu42 joined
moritz_ not me 12:13
4 * arctan(1) is headed at pi :-)
cxreg heh
colomon Pi!!
that is one whacked out movie
tadzik rakudo: say 2 * atan(Inf) 12:14
p6eval rakudo 925a9b: OUTPUT«3.14159265358979␤»
moritz_ rakudo: say atan(Inf) - 2 * atan(0)
p6eval rakudo 925a9b: OUTPUT«1.5707963267949␤»
colomon masak: also, sorting students by number by grade is going to be confusing to Americans, who mostly have letter grades. maybe sort students by age instead? 12:15
moritz_ rakudo: say atan(0)
p6eval rakudo 925a9b: OUTPUT«0␤»
moritz_ must be confusing something
rakudo: say atan(1)
p6eval rakudo 925a9b: OUTPUT«0.785398163397448␤»
moritz_ rakudo: say atan(Inf) - 2 * atan(1)
p6eval rakudo 925a9b: OUTPUT«0␤»
moritz_ \o/
tadzik rakudo: say atan(Inf).WHAT 12:16
moritz_ getting a "real" 0 there is nice
p6eval rakudo 925a9b: OUTPUT«Num()␤»
12:17 takadonet joined
takadonet morning all 12:17
moritz_ \o 12:19
colomon o/ 12:20
12:21 snarkyboojum joined 12:23 macroron joined, macroron left 12:24 colomon left
baest masak: I like the factorial example for (gist.github.com/485816): subset Positive of Int where { $_ > 0 }; sub postfix:<!> (Positive $n) { [*] 1 .. $n } ; say 10!; 12:28
whoops ENOMASAK :) 12:30
cxreg i enjoy putting non-deterministic things in the conditional block of a subset 12:31
like, say, rand
12:33 colomon joined
moritz_ cxreg: also nice: my $x = 0; subset PositiveEnough of Int where { $_ > ++$x } 12:33
colomon nice?! # gonna have to backlog
moritz_ "nice" 12:34
cxreg moritz_: reminds me of when i set a constraint in postgres that was basd on now()
it passed the constraint when the value was set, but the row could never be updated
hilarity ensues
"where now() - column < '1 minute'::interval" or something 12:35
colomon that's "nice" for evil values of "nice". understood.
rakudo: say( [*] (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).grep(*>0)).perl
moritz_ cxreg: fun :-)
p6eval rakudo 925a9b: OUTPUT«0.00411522633744856␤»
12:38 rgrau_ joined
colomon rakudo: say( [*] (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl 12:40
p6eval rakudo 925a9b: OUTPUT«0.03125␤» 12:41
colomon rakudo: (1/2, { $_ * $_ } ... *).perl.say 12:44
whoops
p6eval rakudo 925a9b: ( no output )
colomon rakudo: (1/2, { $_ * $_ } ... *).munch(10).perl.say 12:45
p6eval rakudo 925a9b: OUTPUT«(1/2, 1/4, 1/16, 1/256, 1/65536, 2.3283064365387e-10, 5.42101086242752e-20, 2.93873587705572e-39, 8.63616855509444e-78, 7.45834073120021e-155)␤»
colomon that's right.
rakudo: ((5, * div 2 ... 1) Z% (2 xx *)).perl.say
p6eval rakudo 925a9b: OUTPUT«(1, 0, 1)␤» 12:46
colomon rakudo: say( (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl
p6eval rakudo 925a9b: OUTPUT«0.50.0625␤»
colomon and that's wrong
12:46 nadim left
colomon :\ 12:46
moritz_ rakudo: ((5, * div 2 ... 1) Z% (2 xx *))>>.WHAT.say 12:47
p6eval rakudo 925a9b: OUTPUT«Int()Int()Int()␤»
colomon moritz_++ 12:48
[Coke] masak - you have time. release is not for hours!
12:48 masak joined
moritz_ [Coke]: there's also one patch I want to bring in, that moves README to README.pod, and renders it with pod2text during 'make' 12:48
it's not crucial, but nice-to-have, IMHO 12:49
[Coke] begins to catch up. I have Pi on DVD. messed. up.
moritz_ (if other people think it's a stupid idea, please speak up now)
masak I think it's a nice idea.
[Coke] moritz_: then you have to know how to build rakudo to read the makefile. 12:50
er, to read the README.
masak baest: subset Positive of Int where { $_ > 0 }; sub postfix:<!> (Positive $n) { [*] 1 .. $n } ; say 10!;
[Coke] I think plain text is prolly best there.
masak baest: it does show the strengths of Perl 6, but it's hardly original, and it's one more builtin than the six I already have.
moritz_ [Coke]: it's in POD now, so it's not more complicated than ebfore
[Coke] (now, if you write it in POD and check in the generated file, well, that's the right kind of evil.
moritz_: OH. 12:51
moritz_ doesn't like checking in generated files
it just doesn't end with .pod :-)
[Coke] well then, it's a step in the right direction. :P
moritz_: EW!
colomon masak: I directed a bunch of comments to you in the backlog there. :)
takadonet masak: which 6 are you showing in your reddit post?
moritz_ s/reddit/blog/ :-)
masak takadonet: gist.github.com/485816 12:52
takadonet which I will link from reddit :P
[Coke] wonders if anyone else wants a "testj" target that will automagically do "TEST_JOBS=3".
moritz_ [Coke]: I just export TEST_JOBS=3 in my .bashrc
masak it's meant for reddit et al. I want to keep Perl 6 at the front of people's minds. 12:53
eventually, even the trolls might get tired :)
au|irc masak: nice gist :) isn't &infix:<...> the epitome of dwimmery. (btw maybe s/cmp/leg/ for symmetry as colomon++ points out, but "cmp" also works the same since .name is Str, plus it's more familiar...)
[Coke] moritz_: ya, that's probably less crazy.
jnthn o/ folks
au|irc \o jnthn
masak au|irc: oh, right. 'leg'
colomon \o 12:54
masak I always get those two mixed up. Perl 5 interference.
baest masak: fair enough
masak I'll change to 'leg' for correctness, and add a comment that 'cmp' also works.
au|irc masak++
12:54 mmcleric_ joined 12:55 mmcleric_ left, mmcleric left
jnthn Anyone had any luck with the Zavolaj fix, beyond me last night? 12:55
moritz_ jnthn: cxreg mentioned something in the backlog, iirc
baest masak: concerning the builtins
masak yes. 12:56
colomon rakudo: say( (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl 12:58
p6eval rakudo 925a9b: OUTPUT«0.50.0625␤»
colomon oh
rakudo: say ((((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl
p6eval rakudo 925a9b: OUTPUT«(1/2, 1/16)␤»
colomon rakudo: say ([*[ (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<[ ]>, couldn't find final ']' at line 22␤»
colomon rakudo: say ([*] (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/2, { $_ * $_ } ... *)).grep(*>0)).perl
p6eval rakudo 925a9b: OUTPUT«1/32␤»
colomon rakudo: say ([*] (((5, * div 2 ... 1) Z% (2 xx *)) Z* (1/3, { $_ * $_ } ... *)).grep(*>0)).perl 12:59
p6eval rakudo 925a9b: OUTPUT«1/243␤»
colomon and there is the magic one-liner from last night rebuilt!
jnthn moritz_: OK, bit tied up at the moment but will try and track it down
masak colomon: what... what does it do? :) 13:00
colomon it raises a number to the nth power by efficient repeated mulitplications
so you can take, say, 1/3 ** 5 (the above example) and get a Rat back
zulon is there a difference between >>%>> 2 and Z% (2 xx *) ? 13:01
it feels like it's the same thing
masak zulon: the former hyperthreads.
colomon zulon: Z% is lazy
zulon ok, thanks 13:02
colomon but hmmm, in this case >>%>> would be better, I think. zulon++
rakudo: say ([*] (((5, * div 2 ... 1) >>%>> 2) Z* (1/3, { $_ * $_ } ... *)).grep(*>0)).perl
p6eval rakudo 925a9b: OUTPUT«1/243␤»
colomon \o/
[Coke] colomon: that one liner doesn't make me love perl6. =-) 13:03
masak anyone mind if I apply this? rt.perl.org/rt3/Ticket/Display.html?id=76642 13:04
colomon [Coke]: not even ($n, * div 2 ... 1) >>%>> 2 to get the binary representation of an Int $n? :)
masak [Coke]: I was thinking the same thing...
colomon: that one is cooler.
but still slightly esoteric.
in the post, I'm aiming for things that "read well" in the sense of mapping a short program to an everyday situation. 13:05
moritz_ masak: go right ahead. I already removed the test file from t/spectest.data 13:06
masak moritz_: excellent. 13:07
I'll apply the patch and run spectests.
colomon masak: that certainly was not intended for your post! it was a one-liner I came up with at 2am to distract myself from the idea of writing a new infix:<**>(Numeric $a, Int $b) using a more efficient version of the same algorithm. 13:08
[Coke] reading the spec, shouldn't the rat just be <1/3> ? (which in rakudo seems to be the same as "1/3", which seems wrong.) 13:10
masak colomon: :)
colomon: make sure the algorithm is maintainable. :P
[Coke]: I thought the <1/3> form had gone away.
maybe that was wishful thinking... 13:11
[Coke] masak: it's still in S02.
colomon 1/3 is just two Ints divided, which is a Rat
moritz_ [Coke]: <1/3> is a Rat literal. 1/3 produces a Rat at run time
masak right.
[Coke] "Rational literals are indicated by separating two integer literals (in any radix) with a slash, and enclosing the whole in angles:"
masak if I were the optimizer, I'd have 1/3 as a Rat too.
[Coke] ok. rakudo doesn't seem to know that 1/3 is a rat. does it?
rakudo say 1/3.WHAT 13:12
moritz_ rakudo: say (1/3).WHAT
p6eval rakudo 925a9b: OUTPUT«Rat()␤»
masak [Coke]: parens.
[Coke]: methods calls bind pretty tight.
moritz_ [Coke]: that's the difference between a literal and an expression: the literal has tighter precedence than method calls
[Coke] ok. so if we have a rat, and a rat times a rat is a rat... what is that giant one liner for? =-) 13:13
seems like you just want to print out the rat at the end instead of default stringification through num. No?
moritz_ rakudo: say ((1/3) ** 2).WHAT 13:14
p6eval rakudo 925a9b: OUTPUT«Num()␤»
[Coke] yes, ** nums.
colomon moritz_++ has it
it's to do ** without converting to Num
[Coke] but there's more going on in that one liner just reducing that to multiplication, no?
masak [Coke]: colomon wants to change that.
moritz_ rakudo: printf '%.15f', 0.1 ** 3
p6eval rakudo 925a9b: OUTPUT«0.001000000000000»
colomon well, I don't know how badly I want to change that.
but I know people complained enough about 3 ** 4 power being a Num that a hack was worked into the code. 13:15
moritz_ [Coke]: the point of the one-liner is to have $a**$b doing O(log($b)) multiplications, instead of O($b)
colomon s/code/Rakudo/
moritz_ O($b) would be the naiive implementation [*] $a xx $b 13:16
colomon moritz_++ for explaining it much better than I would have. (very bad night for sleep in our household)
[Coke] ah. that was not entirely clear, especially in the context of the original set of one liners. =-)
rakudo: my $a = 1/3; $b = 1; $b *= $a for 1..5; say $b.perl 13:17
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/kOaoZFU9gI:22)␤»
[Coke] rakudo: my $a = 1/3; my $b = 1; $b *= $a for 1..5; say $b.perl
p6eval rakudo 925a9b: OUTPUT«1/243␤»
moritz_ 243?
ah, /me confused 13:18
masak by the way, I'm still getting errors when running POD2MAN during 'make install'. I think we reached the conclusion last time that it's because I've made my own install of Perl 5 etc. but the fact that it happens at all means something's wrong. I don't know how to fix it.
[Coke] that I think shows the Rats off, I think. (look, it's exact!)
PerlJam wonders if Perl 6 could get an I meta-op to turn $a/$b into $b/$a on-the-fly ;)
masak PerlJam: R/
[Coke] rakudo: (4 R/5).say 13:19
masak you think it, we haz it :P
p6eval rakudo 925a9b: OUTPUT«1.25␤»
colomon and if you mean so you can hyper or something...
rakudo: say ((1/3, 2/3, 32/33)>>R/>> 1).perl
PerlJam yeah, but I is so mnemonic for "invert" which is the op that I think I want. I don't ever think "I want to reverse the arguments here"
p6eval rakudo 925a9b: OUTPUT«[3/1, 3/2, 33/32]␤» 13:20
PerlJam anyway, Perl6++ :)
masak PerlJam: roll your own :)
PerlJam: Perl 6 is built to be forked.
mathw PerlJam: Make Rakudo so that you can fudge the grammar, and add the I metaop as a duplicate of R
PerlJam indeed.
mathw: I can't already fudge the grammar? :) 13:21
jnthn Mmmm...user-defiend meta-ops.
avar masak: what pod2man errors?
colomon rakudo: sub postfix:<I>($a) { 1 / $a; }; say ((1/3, 2/3, 32/33)>>I).perl
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Could not find sub &postfix:<I>␤»
colomon rakudo: our sub postfix:<I>($a) { 1 / $a; }; say ((1/3, 2/3, 32/33)>>I).perl
p6eval rakudo 925a9b: OUTPUT«[3/1, 3/2, 33/32]␤»
masak avar: in my Makefile, the variable 'POD2MAN' ends up being set to the empty string.
mathw PerlJam: I don't believe so - not without rebuilding Rakudo :)
PerlJam mathw: that's good enough ... I build my own rakudo all the time :) 13:22
masak avar: which means that during install when it's used, I get funky permission-denied errors because it tries to run non-commands.
mathw user-defined metaops would be awesome
avar ah, mine too
masak avar: we should form a union and go on strike.
:)
PerlJam in fact, I think I've built a rakudo, on average, once a day for the last few months.
avar yup
avar greps where POD2MAN comes from
masak avar++ # going one step further than complaining 13:23
jnthn mathw: It's probably just a smop to get 'em in Rakudo.
mathw: For some value of s
:-)
moritz_ avar: it comes from parrot's Configure
avar it's in Makefile.in..
aw, I can't patch that, it's in svn *hiss*
[Coke] ... did you build parrot as root? 13:24
why that should matter, I have no idea, but ISTR that affected pod.
avar anyway, you can fix it in the MAkefile.in too with ifndef ...
masak avar: if you prepare the patch, I'll apply it. 13:25
moritz_ avar: how portable is ifndef? 13:26
avar it'll fail on freebsd/solaris make, you need nmake and gmake respectively.
moritz_ what windows blah?
avar don't windows people get nmake?
[Coke] parrot's make tries to work in bsd make, fwiw.
moritz_ then we should try that too 13:27
13:27 baest left
[Coke] pastebot? 13:28
moritz_ none atm :(
PerlJam just use gist.github.com
avar wasn't parrot moving to git?
[Coke] nopaste.snit.ch/22205 - spectest failure
avar: eventually.
moritz_ avar: yes, but only after the GSOC projects
and after R*, for that matter
avar I guess git://repo.or.cz/parrot.git works in the meantime 13:29
moritz_ in order not cause disruptions
avar how about the pugs repository, like the spectests?
[Coke] moritz_: more after we have a working testbed with trac/git integration that preservers history.
13:29 rgrau_ left
[Coke] ;... but that will take at least that long, yes. =-) 13:29
13:29 tadzik left
[Coke] avar: SFAIK, no plans on migrating pugs 13:29
moritz_ avar: github.com/moritz/Mu/ is a git mirror of pugs
but migration would require TimToady++ to learn git first :-) 13:30
avar github has svn commit support now :)
I mainly want t/spec so I can watch it on github :)
moritz_ we also discussed splitting the repo 13:31
but I'm not sure that's good for the community
or the projects in there
PerlJam I'm fairly sure it's not.
[particle] masak: gist.github.com/485816 has a bug... for 1..10 X 1..10 X 1..10 -> $x, $y, $x { # loop in a cube should be $x, $y, $z 13:33
moritz_ hum, das that work with rakudo today?
masak [particle]: thank you.
moritz_ rakudo: say 1..2 X <a b> X <X Y>
p6eval rakudo 925a9b: OUTPUT«No applicable candidates found to dispatch to for 'infix:<X>'. Available candidates are:␤:(Any $lhs, Any $rhs)␤␤ in main program body at line 22:/tmp/bvMK9WS8xG␤»
moritz_ masak: maybe constrain yourself to running examples? :-)
masak rakudo: 1..10 X 1..10 -> $x, $y, $x { say $x, ' ', $y }
p6eval rakudo 925a9b: OUTPUT«===SORRY!===␤Confused at line 22, near "1..10 X 1."␤» 13:34
masak moritz_: oh, indeed.
moritz_: removing that one.
mathw aaah
masak I ran most of them.
mathw it does that with Z as well
that's a known bug?
or known NYU?
moritz_ yes
masak I just assumed that one worked :)
moritz_ it's in RT
and it needs multi-dim slices to work properly
masak rakudo: .say for <a b> Z <c d> Z <e f>
p6eval rakudo 925a9b: OUTPUT«No applicable candidates found to dispatch to for 'infix:<Z>'. Available candidates are:␤:()␤:(Any $lhs, Any $rhs)␤␤ in main program body at line 22:/tmp/XVCeEXUSJv␤»
masak this *used* to work. 13:35
au|irc masak: map { $_ * $_ }, 1 ... *
moritz_ yes. With some weird PIR magic
au|irc [...] is of lower prec than [,]
avar moritz_: what's your readlink $(which perl) ?
au|irc and so maybe need parens around ( 1 ... *)
moritz_ avar: my perl is /usr/bin/perl, and it works here. It's masak on OS X where it fails 13:36
au|irc (or "map: {$_ * $_}")
moritz_ or just use 1..*
au|irc (1 ... *).map, that is.
true, but well, that section is on infix:<...> ...
moritz_ oh.
au|irc =)
13:37 masak left
avar moritz_: does your osx use perlbrew? 13:37
moritz_ avar: I'm on Debian
13:37 masak joined
avar whatever, what's perl like on the system where pod2man isn't detected 13:37
mathw moritz_: good. Glad it's known. I wanted to do a three-way zip the other day and I was beaten by it :(
avar oh, masak is the one with the problem 13:38
stop having vaguely similar nicks guys!
masak: above question...
masak sorry...
avar: I don't know. it's pretty good, I guess.
avar ..
masak much faster than Rakudo :)
avar I mean how is it installed, what does readlink $(which perl) give you
masak avar: seriously, though
ok, checking. 13:39
$ readlink $(which perl)
(that's an empty line)
or rather, no output at all.
moritz_ what about 'which perl' directly? 13:40
masak /usr/bin/perl
moritz_ github.com/moritz/perlgeek.de/blob/...idioms.pod review welcome before I blog it
masak reads 13:41
frettled readlink only shows something if it was a link.
13:42 masonkramer left
[Coke] www.groklaw.net/article.php?story=2...0220611321 - "I have done some pearl scripting in Linux" 13:42
frettled perl=$(which perl); -l $perl && readlink $perl || echo $perl
13:43 tadzik joined
PerlJam moritz_: I think the Numbers section could use some more words to describe what it's doing, but I don't know what those words would be. 13:43
masak moritz_: there's an encoding artifact after "Perl" in "Perl 6", last paragraph under DESCRIPTION. probably an nbsp. is that just a consequence of the way you show the post right now, or a real encoding issue?
moritz_ masak: I hope it's a github POD issue 13:44
masak oki
[Coke] for a while, the nbsp was in a lot of the docs.
[particle] moritz_: case insensitively should be hyphenated
[Coke] [particle]: but don't capitalize it!!
moritz_ probably because I don't declare =encoding utf8
masak moritz_: you should probable mention min= and max= under Numbers, too.
s/ble/bly/ 13:45
moritz_: under "Debugging", ss/as good as possible/as faithfully as possible/. note, adverb.
moritz_ masak++ [particle]++ PerlJam++ 13:46
[particle] someone here knows british english... "zip fastener" is "zipper" in the usa
...just noting an idiom...
masak the italics of "colonpair" collides a bit with the quotes. maybe italicize quotes, or just ditch the italics.
PerlJam [particle]++ :)
13:47 daxim left
masak moritz_: the 'has ... die' idiom is cute. haven't seen that before. moritz_++ 13:47
moritz_ masak: I've seen it first from tadzik++ 13:48
masak tadzik++
moritz_ pushed an update
tadzik I've seen it first on the internets, on a blog yelling how unintuitive Perl6 is :)
moritz_ which hopefully incorporates all your feedback
jnthn Could write an "is required" trait to make that much neater...soonish.
au|irc moritz_: maybe .lc instead of .uc in sorting case insensitively 13:50
masak fans go crazy... gotta be S05-mass... :)
au|irc (historically, for the uc('ß') => 'SS' treatment on some locales)
masak tadzik: url? 13:51
moritz_ au|irc: german ß does sort like SS
tadzik masak: don't remeber I must say.
may want to find
and IIRC, he wrote that someone on #perl6 suggested this
au|irc moritz_: well, yes, but it's two characters :)
moritz_ au|irc: I remember that there was some Unicode oddity that made uc the safer comparsion, but I might be wrong
masak tadzik: if you do find it, do post it here.
tadzik will try
masak moritz_: I remember it the other way around. 13:52
moritz_ ok, will change
tadzik got it 13:53
„The Perl6 version is shorter, and arguably more elegant. TimToady helped me figure out the Perl6 equivalent to Moose's required => 1. You just set a default that will throw an exception when evaluated.”
Who would guess :)
chris.prather.org/what-stops-me-fro...today.html
masak ah, a Moose person. :)
avar masak: I fixed the stupid parrot configure
masak avar++ 13:54
I need more examples under infix:<X> ! it looks too meager now that the 'loop over cube' is gone.
[particle] how do you do an accent-insensitive search in p6?
masak maybe that's a sign that I should throw out infix:<X> and do operator overloading or something instead...
moritz_ [particle]: with the :m modifier, iirc 13:55
search in S05 for 'mark'
[particle] might be worth mentioning, if it's implemented
moritz_ it's not
tadzik there I still things Perl 6 could learn from Moose, IMHO
[particle] ah, well.
13:56 masak left
PerlJam tadzik: certainly. Moose is more mature at this point. Many people have lots of experience with it. 13:56
tadzik PerlJam: is it possible that Perl6 specs will change, learning from Moose experiences?
smash__ i'm getting an error with 'make spectest_smolder'
moritz_ which one?
13:56 masak joined
masak au|irc: did you know that some Japanese programmer named ^..^ the 'neko operator'? :) 13:56
au|irc masak: yeah :) still remember that :) 13:57
PerlJam tadzik: sure it's possible. But I think most of the lessons aren't in the spec as much as the implementation :)
masak oh, is it old? I thought it was new as of six months or so.
smash__ moritz_: 'curl: (26) failed creating formpost data' 13:58
PerlJam tadzik: and I think that there are some things that Moose does wrong (and they know it) that we should make it a point not to do :)
au|irc masak: 2001 Damian www.mail-archive.com/perl6-language...08317.html
[particle] ah, that's much closer to when Neko was a popular meme 13:59
tadzik PerlJam: I, e.g. will love to have [ 'a possibility to use' | 'an equivalent to' ] Moose-like BUILD submethod
masak oh! so *that's* the source. au++
au|irc :)
tadzik where parameters are alredy initialized, and I can just do my job
moritz_ tadzik: I still think that Perl 6 BUILD should behave much the same way
tadzik like, what's the easiest way to say "Object created" after the creation of object?
masak but different op, though.
it's from the time when we had ^ as 'hyper'.
au|irc moritz++ # 5-to-6 series is wonderful for me catching up syntax here, keep'em coming :) 14:00
masak ^..^ is the rightful owner of the name 'neko operator' :)
14:00 uniejo left
tadzik Either overloading new and parsing the params to constructor yourself, or overload BUILD and initialize params yourself 14:00
this is insane, IMHO
au|irc masak: right. in 2005 it's repurposed for ^..^ (also by damian in a conference somewhere iirc)
masak tadzik: how would you have it? 14:01
tadzik masak: Moose style is nice. You write your sub BUILD, in which the parameters are alredy parsed and initialized
moritz_ masak: point is that in rakudo the preseence of a BUILD submethod breaks automatic attribute initialization
masak: which I still think is a bug. It's a submethod after all, and shouldn't affect what the magic things in Mu do for you 14:02
masak moritz_: yes, now that sucks.
right.
BUILD shouldn't be magical at all, IMO.
smash__ moritz_: can't find the rakudo_test_run.tar.gz anywhere
moritz_ rakudo: class A { has $.b; submethod BUILD { say $.b } }; A.new(b => 23)
tadzik exactly
p6eval rakudo 925a9b: OUTPUT«Any()␤»
14:03 pmurias left
avar masak: posted in #parrot: github.com/avar/parrot/compare/conf...ersiononly 14:03
tadzik moritz_: pmichaud says it's intentional feature
moritz_ IMHO that should say 23, and both tadzik and me would be happy
tadzik and masak
moritz_ "intentional" implies a point of view that I don't share
tadzik and Perl5'ers
masak I really like chris.prather.org/what-stops-me-fro...today.html
it's honest, and well-researched.
tadzik: let's just say that the semantics around BUILD isn't quite ironed out yet. 14:04
what are the failures in t/spec/S29-context/die.rakudo and t/spec/S29-context/exit.rakudo about? 14:05
au|irc S12: "In fact, within submethods, use of the C<$.foo> form on attributes that are declared directly by this class is illegal"
14:05 felliott left
tadzik in specs or in rakudo? 14:05
pff
masak tadzik: a bit of both, I suspect.
tadzik I'd love it changed, and I see I'm not the only one
moritz_ :(
avar masak: can you try that patch and see if it detects your pod2man then? 14:06
masak I've never fully understood the $.b restriction in submethods.
avar: will do, as soon as spectest is done.
avar greeeeeeeeeeeeeeeeeeeeeeeeeeat 14:07
moritz_ masak: since rakudo works off an installed parrot, you can safely reconfigure parrot during the spectest run (as long as you don't "make install") 14:08
14:09 REPLeffect joined
au|irc tadzik: if it's some comfort, the spec would have "submethod BUILD ($!b) { say $!b }" work; that is, any params you might use in BUILD can be initialized for you 14:09
masak moritz_: right, but it's the Rakudo Makefile that contains the missing POD2MAN.
au|irc (and it's even implemented :))
tadzik :)
au|irc rakudo: class O { has $.b; submethod BUILD ($!b) { say $!b } }; O.new(b => 23)
p6eval rakudo 925a9b: OUTPUT«23␤» 14:10
moritz_ au++
masak: ah, right
tadzik hmm
that's sometin
so the things we put -- BUILD (<here>) -- will be initialized as if we never wrote our BUILD ourselves? 14:11
moritz_ seems like
au|irc right. then you also get to modify it
tadzik not too bad
masak tadzik: long as you use the $!b form, yes. 14:12
tadzik: good news is, it's not restricted to BUILD submethods.
did we punt on the $/-in-block-in-subst bug until after the release? 14:13
moritz_ masak: pmichaud had a patch for it, which caused other breakages 14:14
masak oh :/
moritz_ masak: I think the conclusion was "it's more complicated than that"
masak right.
14:14 lestrrat is now known as lest_away
masak one of my examples (the one with the balanced parentheses) works around that bug. 14:14
au|irc feels the all-too-familiar sleep-drifting dopamine pull and reluctantly waves g'nite :-) 14:16
14:16 au|irc is now known as au|zzz
PerlJam good night au 14:16
moritz_ good night
/o 14:17
Juerd I'm postponing the feather1 migration.
au|zzz o∀
Juerd For some reason, the target machine starts to act up when the transfer is around 95% 14:18
I don't have any time left to try and find a workaround.
moritz_ Juerd: do you have any numbers on much /home/ size was reduced? or file count?
masak 晚安, au
Juerd moritz_: File count: no, but at least the 1M files from that Maildir should help a lot.
moritz_ :-) 14:19
Juerd moritz_: Disk usage went from 59 GB to 34 GB
moritz_ that's decent :-)
Juerd That's /data, by the way
Which contains /home and /var
moritz_ makes sense
Juerd But I wanted to migrate feather[123] before I went away for a week 14:20
Now feather0 is still running, just for feather1
moritz_ :/
Juerd A waste of electricity
But I don't understand why the new dom0 acts so weird after the transfer has been going on for a while 14:21
It starts skipping clock ticks, messing up TCP checksums, and gets a very high load 14:22
Until I stop the transfer, after which everything returns to normal.
moritz_ remembers the broken RAM module in an old feather ...
Juerd RAM was tested on the new dom0 before we put it into production 14:23
moritz_ :-)
Juerd But I've used 4 different kernels before I found one that isn't severely buggy
(Stay away from 2.6.32 .. 2.6.34)
It's running on 2.6.31 now. Maybe it's broken too. 14:24
I could try, when I return after a week, to write the data from within a domU instead of directly on the dom0. Then at least it can't mess up the hardware very easily.
14:25 alester joined
masak rakudo: my @people = <huie dewey louie>; say (@people Z=> 1..*).perl 14:33
p6eval rakudo 925a9b: OUTPUT«("huie" => 1, "dewey" => 2, "louie" => 3)␤»
masak rakudo: my @people = <huie dewey louie>; say (@people Z=> (1 ... *)).perl
p6eval rakudo 925a9b: OUTPUT«("huie" => 1, "dewey" => 2, "louie" => 3)␤»
14:33 astrojp joined
masak goes with the former in the blog post draft 14:33
colomon rakudo: say (1 x *).munch(10).perl 14:35
p6eval rakudo 925a9b: OUTPUT«_block114␤»
moritz_ 1 xx * ? 14:36
Juerd Z=> is very nice but very ugly too 14:37
And hard to type, shiftwise
[particle] masak: huey
moritz_ likes it
masak [particle]: thanks. I'm not a native :) 14:38
ss/native/native speaker/ :)
[particle] it's not a CN
masak no, but it's a cultural, um, artifact.
14:39 _macdaddy joined
colomon rakudo: say (1 xx *).munch(10).perl 14:40
p6eval rakudo 925a9b: OUTPUT«(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)␤»
colomon moritz_: I knew 1 xx * worked. wondered what 1 x * did. Is x Str repetition?
moritz_ yes
and since you can't do it infinitely, it's better to curry it
dalek kudo: 220b678 | (Timothy Totten)++ | (2 files):
Removed DateTime::strftime, as it's moved to an external repo.
[particle] rakudo: say '1' x 10
p6eval rakudo 925a9b: OUTPUT«1111111111␤» 14:41
colomon you could do it infinitely if you returned a Cat... ;)
masak avar: ok, ready to apply your patch now.
moritz_ masak: btw it's good to style to apply patches with 'git am -s' (which add the signed-off line)
avar masak: to parrot?
masak moritz_: ok, good to know.
avar: locally first.
moritz_: I'll remember that till next time.
avar masak: ok then :) 14:42
masak avar: I'm thinking how I can easily go from github.com/avar/parrot/compare/conf...ersiononly to something I can apply.
[particle] moritz_: is that in a rakudo guide? that's a good hint
masak copy+paste is the easiest I can think of, but it's boring and error-prone.
avar masak: I'll produce it, wait a bit
masak \o/
moritz_ git clone the repo, git show the patch, pipe to patch -p1
tadzik in regexps, <foo> ** <bar>+ is <foo> separated by a positive number of <bar>s? 14:43
masak tadzik: yes.
Kodi masak: gist.github.com/486055
avar masak: gist.github.com/486058
moritz_ doesn't know the relative precedence of ** and +
masak tadzik: unless the priorities make it mean [<foo> ** <bar>]+
avar masak: or, use git svn, then cherry-pick :)
tadzik hmm 14:44
masak tadzik: that calls for a bit of empirical investigation :)
avar: thanks.
tadzik would be better to match it just in case :)
Kodi masak: I'll apply the changes to Pugs if it all looks good.
masak tadzik: I'd put in [<bar>+] for clarity anyway.
Kodi: haven't had a time to look yet.
*phew*
tadzik masak: yep, that's what I did
PerlJam tadzik: note thatll also match <foo> by itself (i.e., no <bar>) 14:45
masak Kodi: will look after I apply avar++'s patch. :)
tadzik yeah, that's ok for me
Kodi masak: Sure.
masak tadzik: note that `a ** foo` is a tricky one. it means `a ** [f] oo`
tadzik masak: neat 14:46
masak avar: I can't make `patch` work with that patch. :/ 14:47
avar: did I mention I'm running Parrot in its SVN repo? 14:48
TiMBuS masak, is 'map { $_ * $_ }, 1 ... * # squares' really an example of the ... operator?
tadzik wow, after refactoring grammars suprisingly many tests passed
TiMBuS or is that the map taking a normal range?
avar masak: patch -p1 < patch ?
masak TiMBuS: sort of and sort of not. 14:49
ah, -p1. I tried -p0
avar all git patches need -p1
that works?
14:51 tylercurtis joined
masak now it works. 14:52
testing it.
14:54 pmurias joined 14:56 skids joined 14:58 justatheory joined
tadzik rakudo: "\n" ~~ / \w / 15:00
p6eval rakudo 925a9b: ( no output )
tadzik rakudo: say 'ok' if "\n" ~~ / \w /
p6eval rakudo 925a9b: ( no output )
15:01 ashleydev joined 15:08 justatheory left 15:11 smash__ left, smash__ joined 15:12 quietfanatic left, patrickas joined
patrickas hello perl6, long time no see :-) 15:12
moritz_ \o/ patrickas 15:14
colomon \o 15:17
pmichaud good morning, #perl6 15:18
colomon o/
moritz_ good morning
masak \o
patrickas! \o/ 15:19
patrickas hello pmichaud
masak pmichaud! \o/
patrickas masak: o/
15:20 kcwu joined
tadzik is there something like whitespace-not-newline in regexes? 15:21
moritz_ tadzik: there's \h for a horizontal space
s/a /
so blank, tab, whatever (but not \n or vertical tab) 15:22
15:22 rgrau_ joined
tadzik great, thanks moritz_++ 15:23
15:25 jaldhar left 15:27 jaldhar joined
moritz_ rakudo: say [\+] 0..6 15:32
p6eval rakudo 925a9b: OUTPUT«0136101521␤»
moritz_ rakudo: say ~[\+] 0..6
p6eval rakudo 925a9b: OUTPUT«0 1 3 6 10 15 21␤»
colomon are there any tests for Str.lines yet? (LHF hunt)
moritz_ probably not
also lines() and slurp() without arguments are untested
colomon The implementation was trivial. :)
pmichaud rakudo: say [\*] 0..6 15:33
p6eval rakudo 925a9b: OUTPUT«0000000␤»
pmichaud rakudo: say [\*] 1..6
p6eval rakudo 925a9b: OUTPUT«12624120720␤»
pmichaud rakudo: say ~[\*] 1..6
p6eval rakudo 925a9b: OUTPUT«1 2 6 24 120 720␤»
moritz_ writes a reply to Jon Lang's p6l mail
pmichaud moritz_: I was about to do the same. 15:34
I'll let you reply :)
15:34 achromic joined
moritz_ ok :-) 15:34
masak avar: nope, still getting the same permission errors :/
pmichaud do you have an answer for square numbers?
15:34 ashleydev_ joined, ashleydev left, ashleydev_ is now known as ashleydev
moritz_ rakudo: say ~(1..10).map(* ** 2) 15:34
p6eval rakudo 925a9b: OUTPUT«1 4 9 16 25 36 49 64 81 100␤» 15:35
pmichaud that works.
avar masak: what errors?
masak avar: the original ones.
avar masak: does Configure.pl say it finds the pod2man program?
masak avar: as in, POD2MAN is still unset here.
avar: Rakudo's or Parrot's?
moritz_ rakudo: say ~(1, { $_ + 2 * .sqrt + 1} ... 100) 15:36
avar masak: parrot's
p6eval rakudo 925a9b: OUTPUT«1 4 9 16 25 36 49 64 81 100␤»
masak avar: auto::pod2man - Is pod2man installed.................................no.
rakudo: .say for 'ba', { $_ ~ 'na' } ... * 15:37
avar masak: set a $DB::single = 1; breakpoint in runstep in auto::pod2man
then check what $cmd is
p6eval rakudo 925a9b:
..OUTPUT«ba␤bana␤banana␤bananana␤banananana␤bananananana␤banananananana␤bananananananana␤banananananananana␤bananananananananana␤banananananananananana␤bananananananananananana␤banananananananananananana␤bananananananananananananana␤banananananananananananananana␤bananananananananananananan…
masak avar: where's auto::pod2man? 15:38
avar it's one of the files I patched
masak looks
avar: and by 'set a $DB::single = 1; breakpoint', you mean...? 15:39
masak isn't used to debugging Perl 5
ah, just add such a line there? 15:41
magic! :)
Rakudo should have something like that.
avar yeah
15:41 snarkyboojum left
avar then run perl -d Configure.pl 15:42
masak avar: once I've done that, what do I do? just run perl Configure.pl again, or with some special flag?
avar then press c
15:42 macroron joined
masak guesses -D 15:42
oki
this is awesome
moritz_ pmichaud: mail sent. Feel free to add anything that I omitted :-) 15:43
colomon moritz_++
masak avar: gist.github.com/486135 15:44
colomon rakudo: say ([\*] (1...*)).munch(10).perl
moritz_ pmichaud: we have a patch in RT that moves README to README.pod, and generates README at build time with pod2text - any objections?
p6eval rakudo 925a9b: OUTPUT«(1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800)␤»
colomon moritz_: triangle reduce is lazy, too, if he wants infinite series. :) 15:45
moritz_ :-)
pmichaud moritz_: patch +1
oh, wait
why do we need both README.pod and README? 15:46
avar masak: well, "permission denied" was a different error from what I got, mine couldn't find the path at all
moritz_ pmichaud: some people feel that reading pod is not nice. I don't care either way
masak avar: I have such a file, and it's not executable. 15:47
15:47 charsbar joined
pmichaud so, when I get a tarball, I have a README.pod but nothing else, yes? 15:47
moritz_ even if not, I'd rename it
[particle] would not like to see CREDITS.pod, README.pod, MANIFEST.pod etc
moritz_ pmichaud: right
masak it's an OS X wrapper of some kind.
pmichaud that seems not-so-good
avar masak: well, then your system is broken.
moritz_ pmichaud: unless 'make release' generates the README
[particle]: MANFIEST is not POD :-)
pmichaud well, git clone would be the same way.
masak avar: I know that. I was just hoping Rakudo/Parrot could compensate in this case.
avar: because many are running Mac OS X.
pmichaud I'm not sure I agree with the idea of generating README at build time. 15:48
moritz_ decommutes, but will backlog
15:48 Raynes left
pmichaud seems like README ought to be available pre-build 15:48
masak and it's not fun to see errors during 'make install'.
pmichaud: good point.
pmichaud does our README need to have pod at all? 15:50
[particle] no
15:51 felliott joined
masak Kodi: ok, I'm now ready to review gist.github.com/486055 -- but I think I need a break first. 15:51
others are welcome to take a look, though. 15:52
Kodi masak: By all means. :)
masak Kodi: I'm really happy to see spec and Rakudo change together, though. that's a good sign.
Kodi masak: I have to leave in about 40 minutes, but I should be able to get on IRC again this afternoon, at least briefly. 15:53
masak Kodi: things might be applied by then, if all goes well :)
Kodi I'm crossing my fingers.
pmichaud masak: gist 485816 is very nice
masak pmichaud: thank you. 15:54
pmichaud ooc, did you see my latest slides using .classify?
masak I'm having second thoughts about 'drool' in the title, though. :)
and now that I've verbalized it, of course I can't use it :/
pmichaud: nope, url?
"Six builtins that will make you want Perl 6 and Rakudo Star"? 15:55
"You know you want to: Six builtins from Perl 6 and Rakudo Star"?
15:56 pyrimidine joined
[particle] Perl 6 has six builtins you never knew you needed: try them in Rakudo Star 15:56
masak [particle]: I like. 15:57
15:58 eternaleye joined 15:59 Raynes joined
pmichaud url coming 16:01
the illustrative slide is www.pmichaud.com/2010/pres/oscon-pe...b.html#end 16:02
masak so, we're back where we started with the POD2MAN issue: "your system is broken" and no fix in sight.
avar++ for trying, though.
pmichaud but the the disucssion begins at www.pmichaud.com/2010/pres/oscon-pe...b.html#end
and I need to add a slide in there that has the result of "what will the following do?" 16:03
(in the presentation, I actually run the code live)
16:04 qwr joined
masak pmichaud: in a PAST::Op with :pasttype('call') and :name('!create_anon_enum'), if I change :name to '&some-sub', can I write some-sub in Perl 6? 16:04
does .comb have the Int second argument, like .split does? 16:05
masak checks specs
Tene masak: Should be.
16:05 rgrau_ left
Tene For the former about PAST, that is. 16:05
masak Tene: ok, cool. 16:06
Tene: and does that have to be a sub that pollutes the user namespace?
Tene: (I'm looking toward porting the enum creation code to Perl 6, and then doing scary things with it) 16:07
avar masak: how can you call perldoc in your shell if it doesn't have +x ?
tylercurtis What is the cause of the occasional spikes of fail on the spectest graph?
Tene masak: you can specify the namespace in PAST
:ns, I think.
masak avar: `which perldoc` doesn't point to where `which perl` is pointing. 16:08
avar: the former has +x
Tene: ok, cool. any prior art in Rakudo?
Tene: for Perl 6 subs, I mean.
Tene masak: no idea. :)
masak oki. thanks anyway.
tylercurtis: patches that fail the build right around when the statistics are collected, I guess. 16:09
pmichaud masak: yes, you can use &some-sub to call a perl 6 sub.
avar masak: perl doesn't have +x ?
pmichaud in fact, that's what PAST generates
16:09 xabbu42 left
masak avar: yes, but the perldoc in that dir doesn't. 16:09
16:11 justatheory joined
avar masak: You're not doing a very good job of explaining this to me :) 16:12
anyway, looks like you might have to call it as perl $(which perldoc), not $(which perldoc)
jnthn masak: prior art in type_declarator:sym<subset>'s action method
masak pmichaud: cute .classify example. I already have something a bit like that in my post. 16:13
avar: sorry. I think my setup is weird because I've installed my own Perl(s) over the system-default one.
avar: the result being that Parrot gets confused over where to look for my perldoc, and gets it wrong.
avar sounds like you've just fatally broken if it something isn't +x 16:14
masak avar: seems that instead of doing `which perldoc`, it assumes it's in the same dir as the 'perl' of `which perl`
avar does it work if you chmod +x it ?
yeah, that's what it does.
16:14 qwr left, lest_away is now known as lestrrat
masak avar: well, I hesitate to chmod a file containing a comment with all-caps saying "DON'T CHMOD +x!" 16:14
(paraphrased) 16:15
avar DO IT
16:15 ashleydev left
masak :) 16:15
tylercurtis masak: what's REALLY fun is when you install a new Perl in addition to the system one, but keep the system one installed, and you accidentally use the system cpan instead of cpan, and it decides to wipe the config of your new cpan executable. :)
masak tylercurtis: o.O 16:16
rakudo: my $foo = "cccc"; while $foo ~~ s/ ^^ (c) // { say "!" } 16:17
p6eval rakudo 925a9b: OUTPUT«!␤!␤!␤»
masak \o/ 16:18
16:19 lestrrat is now known as lest_away
tylercurtis masak: although to be fair, it's possible that I have accidentally deleted some modules I shouldn't have from my system Perl's @INC. 16:19
[particle] why 3 !'s? 16:20
masak [particle]: three 'c's.
[particle] i c 4
masak oh wait.
rakudo: my $foo = "cccc"; while $foo ~~ s/ ^^ (c) // { say $foo }; say "finally, $foo" 16:21
p6eval rakudo 925a9b: OUTPUT«ccc␤cc␤c␤finally, ␤»
masak ah.
[particle] ya
masak the last substitution evaluates to false.
tylercurtis rakudo: ("ccc" ~~ s/ ^^ (c) //).WHAT.say 16:22
p6eval rakudo 925a9b: OUTPUT«Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in 'Substitution::ACCEPTS' at line 5514:CORE.setting␤ in 'infix:<~~>' at line 411:CORE.setting␤ in main program body at line 22:/tmp/b5bxC5qyfZ␤»
masak does that mean that the value of ~~ s/// is the result of the substitution?
I'd have expected it to be $/.
tylercurtis rakudo: my $foo = "ccc"; ($foo ~~ s/ ^^ (c) //).WHAT.say
p6eval rakudo 925a9b: OUTPUT«Str()␤» 16:23
masak pmichaud: why is the result of ~~ s/// a Str and not a Match? 16:24
pmichaud masak: I don'tknow -- I didn't implement s///
masak hm, I guess it is kinda parallel to += et al...
pmichaud but I'm guesssing it returns $foo
tylercurtis Because the spec says so. 16:25
pmichaud (which remains a string)
tylercurtis "method Str subst(Str $self: Regex $search, Str $replacement);"
Or at least that the subst method returns a Str.
pmichaud tylercurtis: that explains .subst, but not necessarily the smartmatch form.
colomon masak: why the heck would it be a match?
pmichaud smartmatch tends to be sugar for .ACCEPTS
masak colomon: because of the above use case with the while loop, for example. 16:26
moritz_ masak: because it's supposed to return Str
16:26 Kodi left
masak colomon: a successful match would make more sense with while $foo ~~ s/// 16:26
ok, so "why is it supposed to return Str?" :)
moritz_ because s/// is an in-place modification 16:27
oh wait
hm
colomon scratches his head.
moritz_ in Perl 5, it returns the number of substitutions
masak in Perl 6, returning a Match would be very informative.
pmichaud one can successfully argue that s/// can do the modification and return whether or not it did one.
and what masak++ said 16:28
masak it's not like the resulting Str isn't in $foo anyway.
moritz_ right
colomon right
masak hence, without really having thought everything through, I vote for Match.
moritz_ so would s:g/// return all a list of all matches? 16:29
s/all//
pmichaud masak: is the match that gets returned the one that existed before the substitution?
masak pmichaud: yes, I think so. 16:30
16:30 ashleydev joined
pmichaud (because after the substitution, the match no longer applies :-) 16:30
masak which is yet another useful bit of info.
a bit like $foo++ in that sense.
tylercurtis But, wouldn't the Match be meaningless with the modified string?
16:31 cdarroch joined, cdarroch left, cdarroch joined
moritz_ it stores its own .org 16:31
cono rakudo: class A {method pack($format) { while $format ~~ s/ ^^ (c) // { say $1 }; }; }; A.new.pack("ccc")
pmichaud Match would still have .orig
moritz_ erm, orig
p6eval rakudo 925a9b: OUTPUT«Null PMC access in find_method('new')␤ in 'A::pack' at line 22:/tmp/KDrB7YL6Bo␤ in main program body at line 22:/tmp/KDrB7YL6Bo␤»
masak tylercurtis: the Match... what moritz_ and pmichaud said.
jnthn Note taht s/// almost certainly delegates to .subst at the moment 16:34
moritz_ and that it is an object, and should be a call
pmichaud colomon: ping
moritz_ ... which again requires ~~ to set $_ on the RHS
jnthn moritz_: right, which is why it's not done like that yet
moritz_: patches welcome.
moritz_ "lol" 16:35
speaking of patches...
I have a branch on github that add adverbs to s///
masak \o/
moritz_ but currenlty only s:g/// works
colomon pmichaud: pong
masak moritz_: ship it!
colomon moritz_++
moritz_: merge, baby, merge!
moritz_ wait
something as simple as :g(1) gives rather weird errors 16:36
pmichaud colomon: I could use some information about a commit... one moment
moritz_ rebuilds the branch to obtain it again
masak no, don't merge. you should all 'git pull --rebase'.
moritz_ masak: merging "real" branches is fine :-)
masak oh, indeed. 16:37
avar Yeah, but there are a lot of needless merge commits in the history, especially by pmichaud :)
pmichaud: you know, you can configure git pull to rebase by default
git config branch.master.rebase true 16:38
pmichaud github.com/rakudo/rakudo/commit/e29...9b5fc12e0b
jnthn pmichaud: BTW, is it bug or design that if you write an action method for, say, an infix operator, the match object that gets sent in there doesn't have the operands as matches?
pmichaud design
jnthn pmichaud: OK. Rationale?
pmichaud (think about it and it's obvious why :-)
when does the action method get invoked?
(answer: after parsing the infix operator token) 16:39
jnthn Oh.
masak wow, Kodi++ actually did leap second validation in gist.github.com/486055 !
jnthn Yes, thus reducecheck...
masak is impressed
pmichaud right.
jnthn It makes sense. It's just...not very sueful. :-)
*useful
pmichaud EXPR provides another action opportunity 16:40
16:40 timbunce joined
jnthn I know, but...then we end up with a fat EXPR. 16:40
:-)
pmichaud and it makes sense there, because then it occurs at the point of the reduction isntead of the point of the parse
jnthn *nod* 16:41
I know you've just been un-keen on EXPR accumulating stuff in the past
pmichaud it's often design smell.
jnthn And I look at, say, ~~ where we need to generate something different and think "ah...here goes another one..."
(there aren't many now. I'm just trying to not get EXPR to the point where you come and review it some day and say "OH NO!!!" :-)) 16:42
pmichaud colomon: github.com/rakudo/rakudo/commit/e29...9b5fc12e0b 16:43
what's really going on there?
colomon it's a check to see if any component of the Numeric is NaN
to see if they are both NaN
otherwise, just use == 16:44
pmichaud we need to find a much more efficient mechanism
colomon profiling issues?
pmichaud consider: gist.github.com/486216
prior to that commit, takes 33 seconds on my box
after that commit, takes 77 seconds on my box
colomon yowza!
moritz_ wow
masak moritz_: re proto and license. proto *does* have a license already. :/
colomon first obvious thought, overload Real.ACCEPTS as well 16:45
masak <tadzik> moritz_: TBH, I don't see any module on proto containing a licens
pmichaud keep in mind that Numeric.ACCEPTS gets called a *lot*
masak moritz_: seems tadzik was (erroneously) thinking that no Perl 6 project whatsoever had a license.
tylercurtis Isn't there a method for checking an array for containing something?
tadzik nope
moritz_ masak: ah, misread
tadzik masak: I meant a LICENSE file
colomon If there's a Real.ACCEPTS, it will only get called when there's a Complex involved, no?
oh, wait. bother. 16:46
masak tadzik: you're not sounding less confused today.
moritz_ tylercurtis: like any(@list) == 4
masak tadzik: proto has a LICENSE file.
tadzik proto has, yep
colomon pmichaud: why is it getting called in that program at all?
masak tadzik: as do *all* of my projects. I can't speak for others :)
pmichaud what's the signature for infix:<+> , etc?
tadzik But I remember checking few, some of the funnier ones, LWP::Simple, Math::Model
moritz_ Math::Model is pretty new
masak tadzik: if there's no LICENSE file, ordinary copyright rules and no particular licensing apply. 16:47
tylercurtis moritz_: wouldn't that be more efficient than grepping for all the elements that are NaN?
masak is not a lawyer
pmichaud doing things with arrays there is wrong wrong wrong
colomon pmichaud: errr... but that should be calling ~~ Numeric, not ~~ a number, no?
pmichaud and .elems too
moritz_ puts a license notice into Math-Model 16:48
masak moritz_++
heh, "Pirate Perl Hacker". oscon-- pirates++ 16:49
pmichaud colomon: gist.github.com/486225
or maybe not
hmmm
oh
colomon that's called the Numeric conversion method
*calling 16:50
16:50 envi^home left
tylercurtis What is the .reals method for? 16:50
TiMBuS hey masak, you should show some hyperoperators in this here 'builtins you never knew you needed' gist
pmichaud colomon: anything that has Numeric as a type constraint will call Numeric.ACCEPTS
colomon why?
pmichaud because that's how typeconstraints are implemented
masak TiMBuS: I'm leaning towards scrapping infix:<X> right now and going with user-defined operators. 16:51
TiMBuS: which isn't a builtin, but who's counting? :)
colomon pmichaud: I'm not trying to be dense here. As I understand it, that .ACCEPTS gets called when you say something like $x ~~ 10
it certainly is not doing anything useful for the $x ~~ Numeric case! 16:52
pmichaud colomon: it gets called far more often than that
.ACCEPTS gets called anytime you have a type constraint
moritz_ why?
TiMBuS the ability to define your own ops is builtin tho!
16:52 xabbu42 joined
moritz_ pmichaud: yes, but shouldn't that be the ACCEPT method on the type object? 16:52
pmichaud moritz_: yes.
Numeric is the type object here.
colomon pmichaud: he means, on the metaobject, I think. 16:53
pmichaud colomon: I don't know what you mean by metaobject. 16:54
TiMBuS oo heres a cool use of a hyperoperator i just found: @altnicks = $nick «~« ("_","__",^10); #Spare nicknames in the case of a nick collision
pmichaud rakudo: class Foo { method ACCEPTS($x) { say "Foo.ACCEPTS"; } }; my Foo $x; $x = 5;
p6eval rakudo 220b67: OUTPUT«Type check failed for assignment␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/VRzh0_eo9t␤»
moritz_ so, not called
pmichaud okay 16:55
masak rakudo: class A { method pack($_) { s/c// }}; A.new.pack("ccc") # discovered by cono++
pmichaud I understand now.
p6eval rakudo 220b67: OUTPUT«Null PMC access in find_method('new')␤ in 'A::pack' at line 22:/tmp/s19cKkLaRU␤ in main program body at line 22:/tmp/s19cKkLaRU␤»
masak submits rakudobug
pmichaud that said,
the commit I referenced slows that example program down by a factor of 2+
16:55 patspam joined
colomon pmichaud: sure, and I'd like to fix it ASAP. 16:55
I just don't understand why it would even be called in your example code.
16:55 zenog joined
TiMBuS rakudo: (1,4, {$^b*2 + 2 - $^a} ... 50).perl.say; #squares using '...' 16:56
colomon you're sure it's that particular commit and not just one near it?
p6eval rakudo 220b67: OUTPUT«(1, 4, 9, 16, 25, 36, 49)␤»
pmichaud I'll double check
but that's where git-bisect ended up
zenog Hi guys, how can I invoke functions via references in Perl 6? Like this: &$fun_ref(1); ?
moritz_ zenog: $fun.() 16:57
justatheory What's the shortcut for `my $foo is Foo::Bar = Foo::Bar.new`?
colomon is kind of hoping .ACCEPTS is getting called incorrectly there, and we can make things even faster by eliminating that call.
moritz_ zenog: or just $fun()
justatheory: my Foo::Bar $foo .= new
justatheory moritz_++ # that's right.
pmichaud even if we eliminate that call, I'm not comfortable with the ACCEPTS 16:58
moritz_ justatheory: my $x is type; is probably not what you want - it specifies the container type, not the type of the content
pmichaud again, it puts things into arrays that ought not to be arrayed
colomon pmichaud: it surely can be better.
zenog moritz_: Is this possibly not implemented yet?
moritz_: I mean in Rakudo.
justatheory moritz_: Right, I want to do both at once, without typing Foo::Bar twice. 16:59
tylercurtis rakudo: my $foo = sub ($s) { say $s; }; $foo("hey, zenog");
p6eval rakudo 220b67: OUTPUT«hey, zenog␤»
colomon hmmm... I guess while you check on the exact commit causing the trouble, I can try optimizing that against your code.
tylercurtis zenog: it appears to work.
moritz_ zenog: it's implemented for over a year now
tylercurtis justatheory: I don't think you do want to specify the container type. 17:00
17:00 Mowah left
justatheory tylercurtis: I'm in a ROb Pike talk at OSCON in which he thinks static typing is really important, but the syntax in C++ and Java sucks. 17:00
Was trying to remember how Perl 6 solved that problem.
colomon pmichaud: woah, there already is a Real.ACCEPTS. huh. 17:01
tylercurtis justatheory: my Foo::Bar $foo .= new;
justatheory But I agree, I often wouldn't specify the container type, myself.
tylercurtis justatheory: container type is not the variable type.
justatheory tylercurtis: Yeah, that's what moritz_ said.
moritz_ the 'is' syntax is for cases like my Foo $x is ORMMapped .= new()
17:02 Trashlord left
moritz_ where ORMMapped is a type that inherits from SCALAR or so 17:02
pmichaud colomon: confirmed, that's the commit that does the slowdown 17:03
jnthn pmichaud: got link to the commit to hand? 17:04
pmichaud github.com/rakudo/rakudo/commit/e29...9b5fc12e0b
jnthn (sorry if it was earlier - watching some seminar at $dayjob today so mostly distracted)
colomon pmichaud: I think something has to be seriously wrong someplace in there, because as I understand it, that code should only be called if you are calling ACCEPTS on a Complex number, and there are no Complex numbers in that code at all.
pmichaud as of the previous commit, that benchmarks runs in 33 sec on my box
17:04 dakkar left
pmichaud colomon: why only on a Complex? 17:04
wouldn't it be called on anything that "does Numeric"?
colomon because there's a Real.ACCEPTS that should be called on anything that does Real. 17:05
pmichaud what about Int?
moritz_ rakudo: say Int ~~ Numeric
colomon rakudo: say Int ~~ Real
p6eval rakudo 220b67: OUTPUT«1␤»
pmichaud Well, Real.ACCEPTS didn't get added until later, so let me try that commit. 17:06
moritz_ so, how is the .ACCEPTS method selected?
rakudo: say Real ~~ Numeric
p6eval rakudo 220b67: OUTPUT«1␤»
moritz_ every class that 'does Real' gets both 17:07
colomon it should be like any method, shouldn't it? you use the most specific one available
pmichaud oh, Real.ACCEPTS is slow also.
(if self eq NAN, I guess.)
but then it calls &infix:<==> 17:08
that looks evil
moritz_ rakudo: multi f(Real $) { say "real" }; multi f(Numeric $) { say "numeric" }; f(3)
jnthn moritz_: Real ~~ Numeric too
p6eval rakudo 220b67: OUTPUT«real␤»
jnthn So the Real one wins
colomon the self eq NaN stuff is how the old versions worked as well.
moritz_ jnthn: so they are all multi, and dispatch on the invocant, right?
pmichaud ACCEPTS isn't multi (yet) 17:09
colomon ACCEPTS can be multi
jnthn moritz_: No, just because Real's ACCEPTS masks the one from Numeric
ooh, back to the seminar...bbl
moritz_ jnthn: I thought all roles are composed flatly?
colomon but the multi gets all tangled up with the roles.
masak jnthn: I still hope to make enums a bit more awesome before the release. looking at it now. I could use some minimal hand-holding, if you're not too distracted. 17:10
colomon pmichaud: I switched Numeric.ACCEPTS to skip all the NaN stuff, and that didn't change the execution time at all.
I think the problem may have been that the old Int.ACCEPTS was cheating 17:11
17:11 zenog left
colomon rakudo: say NaN == NaN 17:11
p6eval rakudo 220b67: OUTPUT«0␤»
masak jnthn: basically, what I want to do is turn src/glue/enum.pir into Perl 6. or at least the !setup_named_enum sub.
17:11 ashleydev left
tylercurtis rakudo: say NaN ~~ Int 17:11
p6eval rakudo 220b67: OUTPUT«0␤»
colomon that is to say, Int.ACCEPTS(Int) just called == on its arguments, which means it would get the wrong answer for NaN 17:12
17:12 justatheory left
pmichaud fwiw, I don't think that Real.ACCEPTS should be calling &infix:<==> 17:12
tylercurtis colomon: that wouldn't be called on NaN, would it?
masak jnthn: I think I'll start by writing that out as Perl 6. but after that, where in src/ do I put the code? not src/core, right?
colomon tylercurtis: Int is supposed to have a NaN value
it currently doesn't because our current Int is crippled
17:13 Mowah joined
moritz_ pmichaud: Any Numeric numeric equality +$_ == X 17:13
colomon pmichaud: what do you think it should do? all the old numeric .ACCEPTS methods were done with infix:<==> at some point. (that is, possibly they would call another .ACCEPTS function that did it instead of doing it themselves.) 17:14
pmichaud normally I think that operators should be defined in terms of methods, not vice-versa.
anyway, I'll let it go for now.
what I do know is that we get a significant slowdown there, and it hurts. 17:15
the example code there comes from a reddit post where someone complained about how slow rakudo was
and they tested it against Kiev, which was *before* the additional slowdown introduced by this .ACCEPTS change
17:16 thebird left
pmichaud so if they go back and check it on current trunk, they'll see that Rakudo Atlanta is 200% slower than Kiev was. 17:16
colomon I suspect if you can figure out why it is calling Int.ACCEPTS, you'll have the answer.
cxreg lastlog biff 4
pmichaud ..."you"? ;-)
cxreg oops
colomon "we"...
pmichaud colomon: aren't you the numeric expert? ;-)
colomon yes, but I'm not the "why the hell is the type system doing THAT?!" expert. 17:17
pmichaud as you said, it's not the type system in this case.
at least, it shouldn't be.
colomon let me see if I can overload Int.ACCEPTS and speed things up.
tylercurtis colomon: where in the spec does it say NaN ~~ Int?
pmichaud sure, but I'd really like to know why it's slow.
oh, hmmmm.
colomon "it shouldn't be" is the key, I suspect.
pmichaud rakudo: role XYZ { method ACCEPTS($x) { say "XYZ.ACCEPTS"; } }; sub abc(XYZ $x) { say "abc $x"; }; abc(3); 17:18
p6eval rakudo 220b67: OUTPUT«Nominal type check failed for parameter '$x'; expected XYZ but got Int instead␤ in 'abc' at line 22:/tmp/Y1NvZS5OFE␤ in main program body at line 22:/tmp/Y1NvZS5OFE␤»
masak huh.
pmichaud sure, makes sense 17:19
I also need an "Int does XYZ"
masak oh, right.
moritz_ rakudo: role XYZ { method ACCEPTS($x) { say "XYZ.ACCEPTS"; }; class A does XYZ { }; A.new ~~ XYZ
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
moritz_ rakudo: role XYZ { method ACCEPTS($x) { say "XYZ.ACCEPTS" } }; class A does XYZ { }; A.new ~~ XYZ
pmichaud rakudo: role XYZ { method ACCEPTS($x) { say "XYZ.ACCEPTS"; } }; sub abc(XYZ $x) { say "abc $x"; }; class A does XYZ { }; abc(A.new);
p6eval rakudo 220b67: ( no output )
rakudo 220b67: OUTPUT«abc A()<0x7cb0960>␤»
pmichaud okay, I'm satisfied it's not the type constraints causing the ACCEPTS, at least not directly. 17:21
but *something* slows it down.
colomon would looking at the PIR help?
(my wife always says "have you tried looking at the picture?" when I have $work frustrations)
pmichaud it might. I have to go elsewhere in the conference now, though
moritz_ I have a weird idea... maybe some non-printable Unicode character sneaked in, and caused parsing slowness? 17:22
pmichaud it would be very nice if this gets fixed before the release. it's undoubtedly slowing us down immensely
colomon agreed.
pmichaud because, as we can see -- the example is pretty basic operations
masak aye.
colomon dang it, every thing I've tried so far has just made things slightly slower...
(47s, 48s, 49s ...) 17:23
moritz_ rakudo: printf '%x', 127
pmichaud afk for a bit
p6eval rakudo 220b67: OUTPUT«7f»
pmichaud exit
ww
colomon does say work in the CORE again yet? 17:24
tylercurtis moritz_: shouldn't "my %exists = @keys Z=> 1 xx *;" be "my %exists = @keys Z=> True xx *;" 17:25
moritz_: in perlgeek.de/blog-en/perl-5-to-6/27-...dioms.html
moritz_ colomon: no idea, I usually use pir::printerr__vS("string\n")
PerlJam tylercurtis: you don't like 1 as a true value?
moritz_ tylercurtis: doesn't really matter for the typical use case
colomon moritz_++
17:26 mberends left
PerlJam rakudo: say (?1).WHAT 17:27
p6eval rakudo 220b67: OUTPUT«Bool()␤»
masak (1) someone writes pie-in-the-sky proposals on p6l, (2) moritz_ points out "the tools are already there, you're just using the wrong one; leave well enough alone", (3) necro-equine flagellation continues unabated
tylercurtis It doesn't really matter, but a bit clearer, no, when the explanation is "create a hash from an array, with true value for each array item:"?
Mentally move the "no" to the end of the sentence in your mind, please. 17:28
moritz_ masak: I can understand the want for having an index, it's a very natural urge to make the tool you're currently looking at more powerful 17:29
masak moritz_: aye.
moritz_ masak: what it means for me is to ignore the remainder of thread, with the knowledge that I've tried, at least.
masak I've had the same thought, fwiw.
moritz_ thing is, infix:<...> is slow already
masak aye.
class Thread { has $!ignore-switch; } 17:30
moritz_ people will ask "why is this slower than loop (my $x = 0; $x <10; $x+=2) { ... }"
?
colomon rakudo: say (1, -> *@a { +@a * +@a } ... *).munch(10).perl
p6eval rakudo 220b67: OUTPUT«(1, 1, 4, 9, 16, 25, 36, 49, 64, 81)␤»
moritz_ "because we introspect the signature of the block to see if it accepts a named 'i' parameter
"
PerlJam colomon: cute 17:31
moritz_ btw, comming back to my s:g/// branch
tylercurtis masak: to be fair, Perl 6 is something of a pie-in-the-sky sort of language, itself.
moritz_ ./perl6 -e 's:g(1)/a/a/'
===SORRY!===
undefined identifier 'Capture'
let me just say "wtf?" 17:32
masak tylercurtis: right, in the sense that it promises people lots of futuristic, cool stuff.
moritz_ interestingly the PAST output doesn't contain any references to "Capture" at all 17:33
PerlJam colomon: though, looking at the result, that doubled 1 bothers me enough that I would have started with 0 rather than 1 :)
colomon rakudo: say (-> *@a { +@a * +@a } ... *).munch(10).perl
moritz_ neither after the POST stage
p6eval rakudo 220b67: OUTPUT«(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤»
masak tylercurtis: p6l will probably always be the place where abstraction astronauts, type theoreticians, and people who want to make every tool in the toolbox into a swiss army knife. that's probably the natural order of things.
colomon PerlJam: starting with zero wouldn't help.
PerlJam rakudo: say (0, -> *@a { +@a * +@a } ... *).munch(10).perl 17:34
p6eval rakudo 220b67: OUTPUT«(0, 1, 4, 9, 16, 25, 36, 49, 64, 81)␤»
moritz_ I think it does help
PerlJam sure it would!
moritz_ 1 element with value 0
masak src/glue/enum.pir turns out to be too hard for my poor little brain :/ I don't even know where to start.
and jnthn seems to be un-about.
colomon PerlJam: ah. the generated elements are exactly the same, you're just changing the first element so it doesn't stand out. 17:35
masak hacks a bit on sekkrit project in the meantime
moritz_ masak: your GSOC thing? :-)
pmichaud back again, briefly
masak moritz_: er. yes. absolutely.
that's what I meant. the GSoC thing.
colomon okay, Real.ACCEPTS is what is going slow, in the current code.
it's getting called a zillion times.
PerlJam colomon: right, same as say (0..* Z* 0..*).munch(10).perl 17:36
pmichaud as a general code review remark
PerlJam colomon: (i.e. start the squares at 0)
17:36 timbunce left, cono left
pmichaud the line 17:36
if @a.grep("NaN").elems > 0 {
is pretty bad
colomon could be any(@a) eq "NaN"
pmichaud best is 17:37
masak why string comparison?
colomon but it's totally not the source of the problem here
PerlJam um, why are stringifying NaN?
pmichaud if @a.grep("Nan") {
colomon masak: do you have a better way of detecting NaN?
pmichaud if @a.grep("NaN") {
.elems > 0 turns a boolean lazy operation into an eager one
masak colomon: there probably should be one.
colomon masak: agreed, actually
moritz_ rakudo: say pir::isnan__ip(NaN)
p6eval rakudo 220b67: OUTPUT«error:imcc:syntax error, unexpected IREG, expecting '(' ('$I114')␤ in file 'EVAL_8' line 79␤===SORRY!===␤syntax error ... somewhere␤» 17:38
masak colomon: .isNaN or sump'n
pmichaud ohhhhhhhhhh
masak pmichaud: right, .first would be enough here.
pmichaud keep in mind that .grep calls ACCEPTS :-)
and so does .first
colomon ?(@a).grep("NaN")
pmichaud even the ? is superfluous in an if statement
colomon pmichaud: don't know if you saw what I said back there, but I've added prints to the code, and Real.ACCEPTS is what is getting called a zillion times in the current version. 17:39
pmichaud colomon: sure, okay
colomon not that it is great
PerlJam I don't get it. Why doesn't if @a.grep(NaN) { ... } work?
pmichaud that might work as well 17:40
colomon PerlJam: it would, but it would be doing eq "NaN" internally
pmichaud I was simply commenting on the .elems>0 evilness
tylercurtis rakudo: say NaN ~~ NaN
p6eval rakudo 220b67: OUTPUT«1␤»
PerlJam colomon: are you sure? 17:41
rakudo: say NaN.WHAT
tylercurtis rakudo: (1, 2, NaN, 4, 5, NaN).grep(NaN).say
p6eval rakudo 220b67: OUTPUT«Num()␤»
rakudo 220b67: OUTPUT«NaNNaN␤»
colomon tylercurtis: right. that calls Num.ACCEPTS, which did in the old version self eq 'NaN'
pmichaud afk, in a talk
moritz_ PerlJam: I can confirm, NaN testing is done by string
PerlJam moritz_: okay, but that happens "under the covers", we should still treat NaN as NaN in Perl 17:42
colomon okay, taking the NaN check out of Real.ACCEPTS gets me my first speed up of this investigation
17:42 zulon left
PerlJam (and it works AFAICS) 17:42
moritz_ PerlJam: but the built-in ACCEPT methods count as "Under the cover"
colomon PerlJam: you're proposing I try to optimize the code by performing the exact same operation, only with an additional level of indirection. 17:43
tylercurtis rakudo: say NaN.defined 17:44
PerlJam colomon: No, I'm just reacting to an oddly stringified NaN. :-) I wasn't paying attention long enough to see that you were trying to optimize something. Sorry.
p6eval rakudo 220b67: OUTPUT«1␤»
colomon masak, moritz_: can one of you guys figure out the magic pir op to do a NaN check? that would be a big help here no matter what we do. 17:45
tylercurtis O.o
moritz_ colomon: just tried without success... will ask in #parrot
colomon moritz_++ 17:46
pmichaud I don't think there's a magic pir op for a nan check, fwiw
colomon also, someone think of a good name for a "is NaN" method. :)
pmichaud
.oO(methods are slow...)
moritz_ is there anything that's not slow?
except for pir:: stuff, maybe? 17:47
pmichaud moritz_: good point. :)
tylercurtis colomon: isNaN? :)
colomon calling Real.ACCEPTS unnecessarily thousands of times is really slow.
pmichaud colomon: prove it's unnecessary, first :)
masak colomon: .isNaN
pmichaud I'm not sure it should be a method. I feel that's a design flaw. 17:48
[Coke] wonders why "munch" and not "head".
pmichaud [Coke]: because it consumes
[Coke]: as opposed to simply producing the leading elements but leaving them in the list 17:49
sbp why is NaN a Num()?
that seems extremely confusing
moritz_ what should it be?
tylercurtis sbp: because a Num is a machine-precision floating-point number.
PerlJam moritz_: Not a Number :)
pmichaud afk
moritz_ tylercurtis++
tylercurtis sbp: and a NaN is the undefined value for machine-precision floating-point numbers.
colomon pmichaud: what, if not a method?
sbp why not Float() then? 17:50
moritz_ sbp: because our floats are called Num
colomon sbp: there is no such type
[Coke] pmichaud: I almost would prefer shift() then. =-)
sbp interesting divergent perspectives on the intent of my question... :-)
17:51 justatheory joined
rokoteko do you expect to pass a Not A Number to f.ex. a sub that expects a Num? 17:51
tylercurtis A question: if Num is machine-precision floating point, then what's the difference between Num and num?
moritz_ rokoteko: most subs that expect a number should acccept Real or Numeric in their signature 17:52
tylercurtis: for example Num can hold undefined value, can have mix-ins etc.
masak nom &
17:52 masak left
rokoteko so NaN can be a numeric value that is undefined? 17:52
colomon okay, this is interesting. If I comment out the /= and += lines, the script has only about 40 calls to Real.ACCEPTS (versus 20,000 for the full version) 17:53
tylercurtis moritz_: speaking of undefined values...
rakudo: say NaN.defined
p6eval rakudo 220b67: OUTPUT«1␤»
moritz_ colomon: that seems very odd
tylercurtis Should that be the case?
moritz_ tylercurtis: I haven't seen anything to counter-indicate that 17:54
colomon tylercurtis: yes
17:54 smash__ left
moritz_ tylercurtis: .defined is really more like "is this an object instance" (as opposed to type objects) 17:54
tylercurtis It seems like "Since num can support the value NaN but not the general concept of undefinedness, you can coerce an undefined value like this:" seems to me to imply that NaN is a specific concept of undefinedness.
moritz_ colomon: #parrot says string comparison is the way to test for NaN on parrot 17:55
colomon moritz_: aiiiiiiiiieeeeeee!
moritz_: it gets better. if I add in one of the /= lines, I get 237 calls to Real.ACCEPTS. If I add in the second, I get 16037. 17:56
[Coke] how is /= implemented? 17:57
colomon [Coke]: automatically generated from /, which in this case is Rat / (all but the first time you call it) 17:58
17:58 timbunce joined
colomon ($a.numerator * $b.denominator) / ($a.denominator * $b.numerator); 17:58
oh, wait
multi sub infix:<*>(Rat $a, Int $b) {
($a.numerator * $b) / $a.denominator;
}
is the one probably being called
tylercurtis Is there any reason why "$foo != $foo" won't work for NaN-checking of Reals in Perl 6? 17:59
moritz_ rakudo: say NaN != NaN
colomon tylercurtis: hmmmm.....
p6eval rakudo 220b67: OUTPUT«1␤»
moritz_ rakudo: say Inf == Inf 18:00
colomon oh, maybe I have it.
p6eval rakudo 220b67: OUTPUT«1␤»
tylercurtis colomon: that's what NotFound suggested in #parrot, and it's the definitive way in lower-level languages iirc.
moritz_ C has an isnan function 18:01
colomon every time we call Real.sign, we call ~~ NaN 18:02
might be the problem? 18:03
18:03 xabbu42 left
colomon boo-ya! 18:06
taking the ~~ NaN out of Real.sign eliminated all but 6 of the calls to Real.ACCEPTS 18:07
guess it's not the type system after all.
PerlJam colomon++
colomon okay, at this point the only thing stopping me from a patch is pmichaud's mysterious comment that he doesn't thing a method is the thing for detecting NaN. 18:08
jnthn phenny: tell masak often src/glue is a good place for such things. See e.g. src/glue/subset.pm
phenny jnthn: I'll pass that on when masak is around.
jnthn phenny: tell masak also see how it's handled in the makefile 18:09
phenny jnthn: I'll pass that on when masak is around.
PerlJam colomon: make a patch anyway. Better an incremental improvment than none at all :)
colomon aha! every time you construct a Rat, it calls div twice. Every time you call div, it calls .sign twice. Every time you call .sign, it smartmatches against ~~ NaN. 18:11
jnthn colomon: Whoa! 18:12
colomon: I can imagine that being un-fast.
colomon particularly when, every time you call ~~ NaN, it stringifies two numbers and does a string comparison. 18:13
PerlJam If parrot/rakudo had something like Devel::NYTProf, I bet that would have been spotted easier.
colomon PerlJam: agreed
for sure, I would think, as long as you had a rough call graph. 18:14
18:15 cono joined
tylercurtis Parrot has some sort of profiling stuff, I think, not sure how well it works, though. One of the Parrot GSoC students is doing profiling stuff, too. 18:16
jnthn afk again 18:17
colomon rakudo: say ?NaN 18:18
p6eval rakudo 220b67: OUTPUT«1␤»
PerlJam Hmm. is there an "unzip" operator yet? 18:20
colomon PerlJam: classify? (not an op, obviously...) 18:21
18:22 isBEKaml joined
PerlJam If this hypothetical unzip op were U, it would be such that after, (@a Z @b) U (@A,@B), @a and @A would be the same (@b and @B too) 18:26
and that leads me to wonder if there is any equivalent to fork or tee for feeds. 18:27
I guess fork would just be clone with the proper initialization of state 18:28
colomon PerlJam: you can stick "my @a" in the middle of a feed to copy the info at that point in the feed, I think.
18:30 timbunce left
tylercurtis rakudo: (1...100) ==> map: * ** 2 ==> my @a ==> grep: * %% 2 ==> my @b; @a ==> grep: * %% 3 ==> my @c; Set.new(@b).intersection(Set.new(@c)).perl.say 18:32
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Confused at line 22, near "(1...100) "␤»
tylercurtis rakudo: (1, 2 ... 100) ==> map: * ** 2 ==> my @a ==> grep: * %% 2 ==> my @b; @a ==> grep: * %% 3 ==> my @c; Set.new(@b).intersection(Set.new(@c)).perl.say
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Confused at line 22, near "(1, 2 ... "␤»
pmichaud colomon: where would .isNaN belong...?
colomon pmichaud: each type would have its own. 18:33
18:33 timbunce joined
Util I am trying to get the location of the configured&installed parrot from within Rakudo. Does Perl6 have some equivilant to Perl5 %Config from `use Config`, or somewhere else I might find Parrot's location? 18:33
pmichaud so, a method on Cool? Any?
colomon which would let us optimize the Int and Rat cases for now.
hmmm.... on Cool too, maybe. 18:34
pmichaud Util: $*VM<config>
colomon I think I've got an optimization worked out that doesn't need .isNaN.
pmichaud Util: (I think)
colomon (BTW)
pmichaud yes, checking for NaN sounds terribly inefficient in general.
colomon but it will be a compromise, isNaN is still needed for best efficiency.
pmichaud so we should avoid doing it
colomon pmichaud: it would require a spec change to do away with it. 18:35
and my inclination is that it is probably to have it.
[Coke] ENOPARSE
colomon ack, my inclination is that having .ACCEPTS check for NaN is a good thing. 18:36
pmichaud what type is NaN ?
colomon pmichaud: all numeric types have a NaN value, in theory
though TimToady and I discussed making it a numeric type of its own at one point. 18:37
PerlJam my $a = "hello"; say $a.isNaN; # :-)
Util pmichaud: Worked; thanks! 18:38
18:38 markjreed joined
[Coke] rakudo: say $*VM<config>.perl 18:39
p6eval rakudo 220b67: OUTPUT«Cannot substr on a null string␤ in 'Pair::perl' at line 1␤ in <anon> at line 4530:CORE.setting␤ in 'Any::join' at line 1␤ in 'EnumMap::perl' at line 4530:CORE.setting␤ in main program body at line 22:/tmp/hsc2BK1p5R␤»
markjreed rakudo: say (1,2,4,...*)[0..10].perl
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Comma found before apparent series operator; please remove comma (or put parens␤ around the ... listop, or use 'fail' instead of ...) at line 22, near "...*)[0..1"␤»
colomon making .isNaN a standard numeric method would get around all of the array nonsense, and also all us to detect NaN internally without using ACCEPTS.
markjreed rakudo: say (1,2,4...*)[0..10].perl
p6eval rakudo 220b67: OUTPUT«(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024)␤»
pmichaud considers ['parrot';'Hash';'perl'
colomon: make it a method for now.
[Coke] I'm thinking $*VM<config> shouldn't be a parrot hash. 18:40
at least not until HLL interop is more likely to work.
markjreed huh. locally I get n/1 for all the generated elements of the series..
pmichaud technically that is HLL interop working :-)
colomon pmichaud: okay.
[Coke] pmichaud: ... fair enough.
pmichaud [Coke]: since a parrot Hash doesn't have a .perl method :-) 18:41
[particle] ponders a visual cue on p6 error messages, like camelia with a broken wing
pmichaud (yes, it's a reasonable thing to say that Rakudo should wrap the parrot config hash with its own)
[Coke] »ö≤ 18:42
colomon pmichaud: I have a very simple patch that makes the execution time go from 48s to 27s locally. :) 18:44
pmichaud colomon: please apply if spectests pass. 18:45
I _really_ don't want a huge speed hit between kiev and atlanta.
18:47 markjreed left
[Coke] ... but I want to cut the release NOW! 18:50
. o O (kidding)
colomon just one spectest....
.oO(I hope)
patrickas rakudo: say ~(1, -2, 4 ... 1/2); 18:52
p6eval rakudo 220b67: ( no output )
patrickas rakudo and series.t seem to agree this is the correct behaviour, but I think that's not according to spec, it should be an infinite series right ? 18:53
colomon patrickas: nope 18:54
[Coke] phenny: U+263A
colomon errr... wait, unless that special rule comes into play. :\
moritz_ .u 263A 18:55
phenny U+263A WHITE SMILING FACE (☺)
18:55 justatheory left
patrickas shouldn't (1, -2, 4 ... 1/2) behave similarly to "1,-1/2,1/4 ... 0 # like 1,-1/2,1/4 ... *" <- from the spec 18:55
oh no it should not
silly me
colomon patrickas: are you sure? 18:56
PerlJam patrickas: should be Nil by my reading of the spec
colomon oh, yup, nill 18:57
Nil
"if a supplied limit value is on the "wrong" side of the first value of the full left list, Nil is returned, even though the limit value never matches, and never falls between two generated values."
and "For a geometric series with sign changes, the same criterion is used, but applied only to the absolute valu"
*value
patrickas ok i see 18:58
colomon rakudo: say ~(1, 2, 4 ... 1/2)
p6eval rakudo 220b67: OUTPUT«␤»
PerlJam rakudo: say ~(1, -2, 4 ... 2) 18:59
p6eval rakudo 220b67: ( no output )
lue ohai o/
PerlJam I don't think that one is correct.
colomon now that one is wrong, no?
someone add the test case... 19:00
moritz_ why?
rakudo: say ~(1, 2, 4 ... 2)
p6eval rakudo 220b67: ( no output ) 19:01
moritz_ same thing, just without the sign change
oh wait
this loops infinitely, no?
PerlJam that's wrong too :)
patrickas say ~(1, 2, 4 ... 2) this should return 1 ,2
colomon what patrickas said
19:01 justatheory joined
moritz_ and what should (1, -2, 4, ... 2) be? 19:02
PerlJam 1, -2
pugssvn r31787 | moritz++ | [t/spec] increasing geometric series, with and without sign change. colomon++, PerlJam++ 19:04
colomon moritz_++
PerlJam Hrm. 19:05
19:05 cono left
PerlJam rakudo: (1, -2, 4 ... *).[^10] 19:05
p6eval rakudo 220b67: ( no output )
PerlJam rakudo: (1, -2, 4 ... *).munch(10) 19:06
moritz_ rakudo: say (1, -2, 4 ... *).[^10]
p6eval rakudo 220b67: ( no output )
PerlJam oh yes, thanks
p6eval rakudo 220b67: OUTPUT«1-24-816-3264-128256-512␤»
patrickas rakudo: say ~(1, -2, 4 ... *).[^10]
p6eval rakudo 220b67: OUTPUT«1 -2 4 -8 16 -32 64 -128 256 -512␤»
[Coke] what is phenny using as source for the unicode chars?
19:06 cono joined
PerlJam now, here's the fun one that behaves badly on my local rakudo ... 19:07
19:07 sftp left
PerlJam rakudo: say ~(1, -2, 4 ... 25).[^10] 19:07
p6eval rakudo 220b67: OUTPUT«1 -2 4 -8 16 -32 64 -128 256 -512␤»
moritz_ ouch
pugssvn r31788 | moritz++ | [t/spec] another series test, PerlJam++ 19:08
PerlJam moritz++ indeed 19:09
pmichaud afk, lunch 19:10
dalek kudo: 6442956 | pmichaud++ | docs/announce/2010.07:
Some announcement updates for Atlanta release.
19:11
PerlJam moritz_: ah, by my reading of the spec 1, -2, 4 ... 25 should result in 1, -2, 4, -8, 16, -32
moritz_ rakudo: say (1, 3, 5 ... 10)
p6eval rakudo 220b67: OUTPUT«13579␤»
colomon I would say it ends at 16
moritz_ PerlJam: by analogy of the output above I'd also say 16 19:12
19:12 justatheory left
colomon moritz_: "which combines zip with Z=>" on your blog post -- should be "which combines zip with =>" 19:12
PerlJam -32 < 25, we haven't exceeded the limit
colomon PerlJam: absolute value test
(because it's a sign-switching geometric series) 19:13
19:14 timbunce left
PerlJam Hmm. Series have way too many special cases :) 19:14
moritz_ colomon: fixed, thanks
colomon PerlJam: you should try implementing them! ;)
moritz_ PerlJam: that's why p6l suggests to make it even more complicated :-)
colomon which is why I like to consider p6l a humor mailing list. 19:15
PerlJam moritz_: It's just another bikeshed :)
patrickas is trying :-) Amd pulling out his hair :-)
colomon "Don't you think this bikeshed should have an anti-aircraft gun?" 19:16
"for mosquitos, you know!"
19:16 sftp joined
PerlJam heh 19:16
19:18 Clinteger joined, kensanata joined 19:19 macroron left
PerlJam colomon++ and moritz++ just because I think you guys don't get enough :) 19:20
PerlJam wanders off again
cxreg wonders where ^methods is defined 19:21
oh git log, how you rock my world 19:22
src/parrot/ClassHOW.pir .sub 'methods'
moritz_ cxreg: and now think about how long it would have taken with svn log :-) 19:24
cxreg hahahahahaha
and 4 renames or so later, it lives in src/metamodel/ClassHOW.pir 19:25
<3 git
moritz_ indeed. It's quite awesome technology 19:27
cxreg ok, so ^methods just returns an array, and any() is supposed to convert an array to a junction? 19:28
cxreg is trying to fix his own bug report
19:29 hercynium left
Clinteger cries listening to a screencast of someone who doesn't speak English well 19:29
19:30 mberends joined, hugme joined
moritz_ hugme: hug Clinteger 19:30
hugme hugs Clinteger
Clinteger I don't like watching people struggling to speak English. Just speak a language you're better at :( 19:31
cxreg like perl 6? 19:32
Clinteger :p the problem is that perl6 is english too
moritz_ Clinteger: it's not that easy. When I write my blog posts in German, the audience is maybe 1/10 of the size, if at all
Clinteger moritz_, actually I don't mind text
lue
.oO($_ != 'matter';)
19:33
Clinteger mostly because "th" is usually difficult for non-native English speakers
19:34 Kodi joined
moritz_ and 'ch' is usually difficult for anybody except Germans and Scottsmen 19:34
Clinteger exactly.
lue is happy to be German&American :) 19:35
moritz_ lue: can you pronounce "Streichholzschächtelchen"? :-) 19:36
Clinteger that would be a disaster for me :)
patrickas can ! 19:37
unless correctness is a requirement :-)
lue I was only in Germany from birth till 5! I didn't learn a lot of spelling :(
I could certainly try though :)
moritz_ lue: should be enough to learn to speak most sounds
patrickas: recognizability is :-)
lue Due to my background, I can't help but snicker on the inside when someone can't say 'ch'. .oO[ Lock Ness Monster :) ] 19:38
patrickas ok I think I got a patch for series.
It's pretty ugly but hopefuly it'll do until someone refactors series. 19:39
colomon patrickas++
19:42 pmurias left
colomon dang it, two failures in the spectest. :( 19:44
moritz_ rakudo: say 'NaN' ~~ NaN 19:45
p6eval rakudo 220b67: OUTPUT«1␤»
moritz_ rakudo: say +'NaN'
p6eval rakudo 220b67: OUTPUT«NaN␤»
patrickas moritz_ I am getting a failure in th last test you added for series 19:46
is ~(1, -2, 4 ... 25).[^10], '1 -2 4 -8 16'
got: '1 -2 4 -8 16 Any() Any() Any() Any() Any()' # expected: '1 -2 4 -8 16'
moritz_ patrickas: oh, that might be a list indexing bug 19:47
rakudo: say ~<a b>.[^10]
p6eval rakudo 220b67: OUTPUT«a b Any() Any() Any() Any() Any() Any() Any() Any()␤»
moritz_ yes, it is 19:48
pmichaud ranges don't clip yet
I started to implement it but got sidetracked.
patrickas oh ok ...
moritz_ patrickas: feel free simplify the test (ie remove the .[^10])
pmichaud (so yes, it's a rakudo bug, plz file if you get a chance kthxbye)
moritz_ files rakudobug
19:50 xabbu42 joined, kensanata left 19:51 Schwern left
colomon spectesting again... 19:55
19:56 gaal joined
gaal }:) 19:56
moritz_: re: case in comparison, I'm just guessing but could it be related to Turkish dotless I? 19:57
szabgab woot gaal 19:58
long time not seen!
gaal hey :) 19:59
what's up szabgab?
szabgab will you come on monday to help me out?
moritz_ gaal: no idea. That thing screws up in all case conversions :-)
19:59 takadonet left
gaal szabgab: sorry, can't. Have fun though (I'm sure you will) 20:00
szabgab rakudo: my @keys <a b c>; my %exists = @keys Z=> 1 xx *; say %exists.perl 20:01
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Confused at line 22, near "my @keys <"␤»
szabgab rakudo: my @keys = <a b c>; my %exists = @keys Z=> 1 xx *; say %exists.perl
p6eval rakudo 220b67: OUTPUT«{"a" => 1, "b" => 1, "c" => 1}␤»
szabgab rakudo: my @keys = <a b c>; my %exists = @keys Z 1 xx *; say %exists.perl
p6eval rakudo 220b67: OUTPUT«{"a" => 1, "b" => 1, "c" => 1}␤»
moritz_
.oO( somebody reads my blog after all :-)
szabgab and I think you don't need the => in the first 2 examples :) 20:02
moritz_ szabgab: that's correct, as long as @keys doesn't contain Pair objects
szabgab hmm
moritz_ rakudo: my @keys = 'a', 'b => 2, 'c'; my %h = @keys Z=> 1 xx *; say %h.perl 20:03
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Confused at line 22, near "my @keys ="␤»
moritz_ rakudo: my @keys = (a', 'b' => 2, 'c'; my %h = @keys Z=> 1 xx *; say %h.perl
p6eval rakudo 220b67: OUTPUT«===SORRY!===␤Confused at line 22, near "my @keys ="␤»
moritz_ rakudo: my @keys = 'a', 'b' => 2, 'c'; my %h = @keys Z=> 1 xx *; say %h.perl
p6eval rakudo 220b67: OUTPUT«{"c" => 1, "b\t2" => 1, "a" => 1}␤»
moritz_ rakudo: my @keys = 'a', 'b' => 2, 'c'; my %h = @keys Z 1 xx *; say %h.perl
p6eval rakudo 220b67: OUTPUT«Odd number of elements found where hash expected␤ in '!STORE' at line 4600:CORE.setting␤ in main program body at line 22:/tmp/oV9yX2nA2x␤» 20:04
gaal where did that tab come from?
szabgab interesting
tab represents the pair :)
gaal ah, I see 20:05
Isn't .perl supposed to be reversible though?
szabgab I guess it is a buggy representation of a pair
gaal buggy\tpair 20:06
colomon actually, Hash keys are Str right now.
so when you use 'b' => 2 as a key, it stringifies it. 20:07
to "b\t2"
20:07 justatheory joined
colomon rakudo: my @keys = 'a', 'b' => 2, 'c'; my %h = @keys Z=> 1 xx *; say %h.keys>>.WHAT 20:09
p6eval rakudo 220b67: OUTPUT«Str()Str()Str()␤»
gaal d'oh right, that wasn't @keys.perl. I wonder if in the context of hash keys perl5-like $; isn't a better delimiter. (I've been far away from things, maybe something like that is specced) 20:10
huf maybe you guys know it, what's it called when a brand name gets expanded to mean the whole concept? (such as xerox) 20:11
pmichaud huf: trademark dilution
(or maybe just "dilution")
huf hum, is that the linguistic term?
pmichaud I think that's the legal term 20:12
wait, that's not it
(looking)
[Coke] genericized
pmichaud yeah, genericized
[Coke] I think there's an esoteric language-geek word for it, too. 20:13
gaal there is a related phenomenon called dilution though: en.wikipedia.org/wiki/Trademark#Dilution 20:14
20:14 lest_away is now known as lestrrat
[Coke] metonymy is not the geek work I was thinking of, but will do. 20:15
gaal were you thinking of synecdoche? 20:17
pmichaud yeah, I remembered "dilution" first because it's what came up when I trademarked my product :)
20:17 rindolf joined
rindolf Hi all. 20:17
pmichaud grrr, silly oscon schedule 20:18
at 13h40 I have to choose between mst and schwern 20:19
at 14h30 I have to choose between obra and Fenwick
20:19 lestrrat is now known as lest_away
pmichaud wanders off to choose :) 20:20
tadzik hmm 20:24
S03: If no closure is provided, and the sequence is numeric, and is obviously arithmetic or geometric (from examining its last 3 values), the appropriate function is deduced: 1, 2, 4 ... * # powers of 2
how does Rakudo know whether these are powers of two, or just even numbers? 20:25
ah, my bad
nevermind
colomon 1 isn't an even number. :)
tadzik yeah, I see :)
moritz_ you need at least three numbers to tell
tadzik yeah, I've read that
just mistaken :)
colomon and if 4/2 == 2/1 you have a geometric series
that's actually the easy part of series. :) 20:26
tadzik so, when is #31 coming out? 20:28
[Coke] about 10pm eastern.
tadzik oh, there alredy is an announcment in docs
[Coke] (perhaps sooner)
yes, it was helpfully pre-written for me. =)
moritz_ release rakudo generally isn't very hard 20:29
20:29 masak joined
masak ahoy! 20:29
phenny masak: 18:08Z <jnthn> tell masak often src/glue is a good place for such things. See e.g. src/glue/subset.pm
masak: 18:09Z <jnthn> tell masak also see how it's handled in the makefile
moritz_ I've done it about 2.5 times
masak jnthn: thanks. 20:30
tadzik + .perl on custom classes now dumps attributes 20:31
\o/
rakudo++
masak things *are* awfully nice nowadays, aren't they? 20:32
dalek kudo: 56b25a2 | moritz++ | tools/contributors.pl:
[tools/contributors.pl] avoid Mojibake
kudo: 9c90c2f | moritz++ | docs/announce/2010.07:
[docs] update contributor list in release announcement
szabgab I wonder what product did pmichaud trademakr? rakudo? 20:33
so will people use rakdo also as a verb?
so "to rakudo something" will mean to give it an elegant solution? 20:34
tadzik They alredy do, as in justrakudoit.wordpress.com :)
masak wow. corky.net/dotan/log/images/perl6-watchmen_a.jpg 20:35
dotan++
szabgab strange, the latest screencast I made is 6 min long in ogv but when I convert it to avi to upload it says it is 18 min long
20:36 timbunce joined
masak moritz_++ made Reddit: www.reddit.com/r/programming/commen...ng_idioms/ 20:37
20:37 justatheory left, justatheory joined
pmichaud szabgab: (trademark) "PmWiki" 20:38
szabgab so I was asked today what do I want to achieve by giving a perl 6 talk at the Python UG meeting
moritz_ szabgab: I'm curious what you answered
masak :)
szabgab I curious what would you say :) 20:39
pmichaud I've given Perl 6 talks at python conferences before
in fact, I gave a Perl 6 talk at Pycon :-)
szabgab oh the people who asked are some of the python ppl
pmichaud is brave
moritz_ raise awareness, give people ideas to steal from 20:40
pmichaud anyway, "Perl 6 has happily stolen ideas from many other languages, including Python. We'd like to give you an opportunity to steal from us..." :-)
(actually, my PyCon talk was about Perl 6 grammars and Parrot more than Perl 6 itself :)
cxreg is there any way to avoid a 5 minute compile when you change a line of code in rakudo? :/
i'm supposing not, the src/gen/core.pir bit takes a while
moritz_ cxreg: you can prototype core functions in normal Perl 6 scripts 20:41
and methods too
tylercurtis szabgab: that no one would be asking that question if you were giving a talk about Haskell.
cxreg hrm
pmichaud cxreg: alas, not reliably.
20:42 gaal left
szabgab likely I'll also concentrate on grammars 20:42
and I was just trying to learn them :) 20:43
cxreg i'm taking a stab at the perplexing any() bug i filed last night
tylercurtis szabgab: when is the talk?
szabgab monday
moritz_ cxreg: maybe there's a .flat missing somewhere
[Coke] Ok. anyone trying to slip anything else in today? 20:44
tylercurtis If it were further in the future, I have a project I'm working on that might be a nice example once it's further along were you to want to discuss the type system. 20:45
pmichaud did colomon's patch get committed?
szabgab tylercurtis: maybe another talk 20:46
moritz_ pmichaud: don't think so
pmichaud I'd want to wait for that patch (or hear more about why it's not in yet) 20:47
szabgab I hope to give a few of them, anywhere they would let me talk :)
patrickas rakudo: say ~(1, 2, 3 , 4... 3);
20:47 Schwern joined
p6eval rakudo 220b67: ( no output ) 20:47
20:47 patspam left
pmichaud [Coke]: We're currently passing around 23,000 tests. I have no idea how many tests are in the suite at the moment, because the scripts that I have that used to compute those numbers are obviously broken. 20:47
Kodi masak: Can we get my patch into release 31? 20:51
masak Kodi: I'm just about to spectest it.
lue hi again o/
Kodi masak: Great!
colomon pmichaud: not yet.
first spectest turned up problems.
second spectest just ended, should push in a minute or two. 20:52
[Coke] colomon++
Util Trying to get a patch in to fix `make test` on MinGW Win32; requesting eyes on the patch:
rt.perl.org/rt3/Public/Bug/Display.html?id=76680
[Coke] Gonna be another 2 hours, easy.
masak patch++
colomon unless someone has pushed another patch in the meantime. :\
Util Tiny patch here 20:53
pmichaud Util: looking
Util: +1 to your patch
patrickas wonders will it be faster to spectest now or wait for colomon's patch and spectest then :-? 20:54
[Coke] Util: looks good to me.
colomon wait a second, I'll push as soon as I've verified I have a compile here.
pmichaud Util: feel free to push/apply
patrickas colomon++'s patch is supposed to bring the spectest time down cosiderably right ?
[Coke] yes. 20:55
20:55 _pragma is now known as pragma_
colomon patrickas: probably not that much 20:55
[Coke] er, that one file. which was it?
colomon it mostly only affects Rat arithmetic
patrickas oh ok ... 20:56
Util pmichaud, [Coke]: Thanks! Will push now
pmichaud (mostly affects Rat arithmetic) yes, but a single / automatically puts you into the realm of Rat arithmetic. :-)
colomon sure, but lots of tests don't do any arithmetic at all
pushed
I'm just trying to say, just because it nearly halved the execution time of that one script doesn't mean it will do the same for the entire spectest. 20:57
pmichaud colomon: agreed. 20:58
jnthn back 21:01
masak: I'm about now if you need some help 21:02
masak \o/
masak grabs jnthn so he doesn't run away again :)
dalek kudo: 08809ca | (Solomon Foster)++ | src/core/Int.pm:
Add the notdef check to Int.sign.
kudo: 9c4bd55 | (Solomon Foster)++ | src/core/Int.pm:
Add Int.sign so that we can take advantage of the fact our current Int cannot be
kudo: 12c5229 | (Solomon Foster)++ | src/core/Cool-str.pm:
Tweak Cool.words, implement Cool.lines.
[Coke] is very glad the machine he's doing the release on today has 3g. 21:03
tadzik Tweak Cool.words, implement Cool.lines. Sounds like fun
[Coke] and... out. see folks in a few hours when I settle in to cut the release.
colomon [Coke]++ 21:04
sjohnson perl 6 eq
14:01 <@falzer> heh
oops
www.artofsmoking.com/motorcycle.jpg
tadzik moritz_: So note :$var.perl is quick way of obtaining the value of a variable for debugging; purposes, along with its name. This semicolon after debugging, a typo? 21:07
mberends jnthn: nice to have Zavolaj alive again. Through it, Rakudo can haz fork() on Linux ;)
21:07 eternaleye left
jnthn oh fork! 21:08
dalek kudo: ca32e3a | util++ | (2 files):
[t] Change PARROT from ENV var to calculated, to fix RT#76680
colomon pmichaud: I've marked .isNaN on my to-do list, I don't see a reason it needs to be done for the release today, I don't think it will speed up this case much. Once I've got that it will be easy to clean up Numeric.ACCEPTS and Real.ACCEPTS. 21:09
pmichaud: let me know if you want me to try to squeeze more speed out of that example code, I have a few more ideas. I just don't know that they're worth pursuing this close to release. 21:10
pmichaud colomon: I'm fine with that; I mainly wanted to avoid the expensive math :-)
21:10 perlygatekeeper left
colomon oooo, belay that. 21:10
!
I have another optimization that makes a noticeable difference in that example code. 21:11
pmichaud okay
colomon pretty simple, I'll spectest it now.
pmichaud again, this came from a reddit poster asking "why is rakudo so slow", so it's "in the wild."
colomon this one is just switching from $a.sign * $b.sign to ($a * $b).sign
pmichaud $a and $b are....? 21:12
rats?
colomon Ints
pmichaud okay 21:13
colomon I guess it might be slower if they were big enough to overflow to Nums when multiplied together.
pmichaud what's the whole line of code?
jnthn mberends: All other Zavolaj things are working again?
colomon if ($a * $b).sign < 0 && $result * $b != $a {
it's in infix:<div> in Int.pm 21:14
mberends jnthn: yes!
21:14 kjeldahl joined
jnthn mberends: yay! 21:14
pmichaud ..is that doing a truncation?
jnthn mberends: I think the pir::clone call maybe can be tossed now pmichaud++ fixed closures.
mberends: Feel free to try that. 21:15
pmichaud (or a floor?)
21:15 molecules joined
mberends jnthn: yes, can do soon 21:15
jnthn mberends++
colomon pmichaud: it's adjusting the result from parrot's div operator so that it has the Perl 6 semantics for negative numbers and div. I don't remember the exact details. 21:16
(but I'm pretty sure I added tests for it.)
pmichaud colomon: faster might be ($a < 0 ?^ $b < 0) && ... 21:17
avoids .sign altogether
21:17 Mowah left
colomon hmmm. 21:17
?^ is exclusive or? 21:18
pmichaud boolean exclusive or, yes.
colomon give me a minute... 21:19
pmichaud you can speed it up even further with 21:21
my $result = pir::div__III($a, $b) - (( $a < 0 ?^ $b < 0) ?& $b != $a); 21:22
and still further by eliminating the "my $result ="
colomon woah.
21:22 hercynium joined, hercynium left 21:23 rindolf left
colomon how does that handle the $result * $b != $a? 21:23
pmichaud oh, sorry
I missed that part
ummmm
shouldn't that be a mod, anyway?
why do a multiply?
tadzik rakudo: class A { has $.par }; my $foo = A.new(par => 7); say $foo.perl 21:24
p6eval rakudo 9c90c2: OUTPUT«A.new(par => 7)␤»
pmichaud what is that really checking for?
colomon is a mod any faster?
pmichaud it can be
tadzik rebuild time
pmichaud are you checking that $a is evenly divisible by $b ? 21:25
colomon actually, the ($a < 0 ?^ $b < 0) patch doesn't work either. :\
yes
pmichaud pir::div__III($a, $b) - (($a < 0 ?^ $b < 0) && ?($a % $b)); 21:26
probably need parens around the ($a < 0) and ($b < 0)
otherwise it parenthesizes wrong
could use ^^ instead of ?^
but I think ?^ will be faster
colomon okay, testing that one again. 21:27
21:27 Schwern left
pmichaud pir::div__III($a, $b) - (($a < 0 ?^ $b < 0) ?& ?($a % $b)); # my current best guess 21:27
no wait
colomon pir::div__III($a, $b) - (($a < 0 ?^ $b < 0) && ?($a % $b)); looks very tempting. that's a good reason to use %
pmichaud pir::div__III($a, $b) - ((($a < 0) ?^ ($b < 0)) ?& ?($a % $b)); # my current best guess
(but in some respects this code completely makes me say "...huh?" There really need to be some comments explaining why we need to be subtracting one.) 21:28
masak .oO( pir::div__III looks like some ancient Romans named it. "This is our third attempt at the division function" )
21:30 PZt left
colomon first version with parans works 21:31
21:32 d4rt joined
colomon errr... but it's actually slower? 21:32
pmichaud if it's slower, that indicates that $a < 0 is slower than .sign 21:33
and that could be.... concerning
(because $a < 0 is very common)
might try && instead of ?& -- that will short-circuit
21:34 nimiezko joined
colomon what the heck? 21:35
it went so fast that time it's hard to believe something wasn't broken 21:36
isn't broken
pmichaud++
pmichaud my version: avoids an extra subroutine call. avoids a method call. avoids allocating a lexical variable. avoids lexical lookups. avoids 2 extra assignments. :-) 21:37
colomon how much faster do you think? 21:38
pmichaud I have no idea, though :)
colomon your version: returns wrong type
:(
huh 21:39
pmichaud how would that be possible?
colomon possible has to do with doing math on a Bool, checking now
pmichaud math on a bool should either return 0 or 1
colomon yes, but of what type?
pmichaud int
colomon div__III returns an Integer rather than an Int. 21:40
rakudo: say (True).PARROT
p6eval rakudo 9c90c2: OUTPUT«Bool␤»
colomon rakudo: say (1 + True).PARROT
p6eval rakudo 9c90c2: OUTPUT«Num␤»
pmichaud go ahead and put the "my $result =" back in, then.
colomon no, no!
pmichaud that will at least cast it properly
colomon just needs a ?? with the bool bit 21:41
pmichaud no no
21:41 justatheory left
pmichaud say PARROT(1 - True) 21:41
rakudo: say PARROT(1 - True)
p6eval rakudo 9c90c2: OUTPUT«Num␤»
pmichaud rakudo: say PARROT(1 - 1) 21:42
p6eval rakudo 9c90c2: OUTPUT«Integer␤»
pmichaud aha
okay, True is being converted into a Num
more precisely, &infix:<-> is treating True as a Num 21:43
colomon Ummm... your version is leaving out a boxing as well.
pmichaud you don't need a box
that's really old style
you only need box with Q:PIR.
&infix:<=> will automatically end up boxing the int register 21:44
colomon so we're good returning Integers?
pmichaud well, that's what you had before (in the case wehre the 'if' was false) 21:45
rakudo: say PARROT(3/3);
p6eval rakudo 9c90c2: OUTPUT«Rat␤»
pmichaud rakudo: say PARROT(3 div 3);
p6eval rakudo 9c90c2: OUTPUT«Perl6Scalar->Integer␤»
pmichaud so it was okay before, it's probably okay now :) 21:46
21:47 nadim joined
colomon hokey smokes, adding ?? 1 !! 0 after the Bool just kills the speed. 21:47
hmmm... Int cast?
masak Kodi: ping 21:48
pmichaud I don't know why it would kill the speed
we should figure that out as well
jnthn How does ?? but it's LHS in boolean context?
*put
pmichaud jnthn: vtable get_bool 21:49
jnthn Are we going through one of those v-table overrides?
Ah
That may be to blame
pmichaud this is a good example of where a low-level subroutine really needs to be optimized and avoid unnecessary contexts, calls, assignments, etc.
colomon maybe the super fast speed was some weird fluke
pmichaud (there are quite a few that I've seen)
jnthn pmichaud: *nod*
colomon pmichaud: which is a good example of why we need a good profiler
pmichaud colomon: yes, that will help. 21:50
21:50 justatheory joined
pmichaud but it's also the case that we should avoid writing expensive code in the first place :) 21:50
masak Kodi: ah. un-ping.
pmichaud try using pir::sub instead of &infix:<->
Kodi masak: Un-pong.
masak Kodi: things look good on this end so far. 21:51
pmichaud that would probably correctly cast the bool into an int instead of a num
Kodi masak: Good.
pmichaud (and using pir::sub__III would guarantee that)
colomon using .Int worked.
pmichaud wfm
Kodi I'm leaving in a few minutes.
pmichaud rakudo: say PARROT(1-True); 21:52
p6eval rakudo 9c90c2: OUTPUT«Num␤»
pmichaud we really ought to figure out how to make that Int
21:52 Schwern joined
pmichaud rakudo: my @a; say PARROT(1 - @a); 21:52
colomon one thing at a time. :)
p6eval rakudo 9c90c2: OUTPUT«Num␤»
pmichaud that one also.
colomon pmichaud: ready for this?
"original" (start of today) speed: 48s 21:53
after Int.sign added: 27s
tylercurtis pmichaud: "use integer;" ;)
colomon after ($a * $b).sign: 22s
current: 4s
21:53 Clinteger left
tadzik :O 21:53
awesome
colomon pmichaud++ 21:54
tadzik pmichaud++ indeed
colomon still gotta spectest
pugssvn r31789 | masak++ | [S32] DateTime immutable, leap seconds validation
r31789 |
r31789 | The rest of this message is from Kodi++, who prepared the combined
r31789 | spec/Rakudo patch:
r31789 |
r31789 | There are two major changes here: DateTimes are now immutable and
r31789 | DateTime constructors now validate leap seconds.
r31789 |
r31789 | tai-utc should provide a hash, not a subroutine, but this doesn't
r31789 | work when Rakudo is compiled.
r31789 |
r31789 | It shouldn't be too hard to write a Perl 5 script, to be run as
r31789 | part of Rakudo's build process, that automatically updates the
r31789 | leap-second table in tai-utc.pm.
r31789 |
r31789 | I haven't run DateTime-strftime.t because ++supernovus is moving
r31789 | strftime out of Rakudo, and hence DateTime-strftime.t out of
r31789 | pugs.
frettled masak: I see room for improvement in pugssvn's spamming routines :)
pugssvn r31790 | masak++ | [t/spec] updated Date.t, calendar.t and DateTime.t to follow spec 21:55
masak Rakudo patch landing soon.
colomon spectesting
pmichaud colomon: can you nopaste the patch? 21:56
I want to run it locally and reply to the reddit poster to gave the original test
jnthn pmichaud++, colomon++
Kodi masak++!
colomon gist.github.com/486667
jnthn It's a good example that we *can* optimize stuff in quite a lot of places. :-)
pmichaud exactly
colomon that's not an actual patch, just the one routine that has changed. 21:57
pmichaud and the value of people saying "this looks weird... is something wrong?"
colomon in Int.pm
pmichaud colomon: that's all I need, if it's all that needs to be changed to get the improvement
colomon people++
pmichaud: should be
21:58 Kodi left
colomon is tempted to try creating a raw-div operator, as Rat should only be calling div in cases where the adjustment section isn't needed at all. 21:58
pmichaud from 48s to 4s isn't good enough for you? ;-) 21:59
21:59 nimiezko left, stepnem left
colomon well, I certainly like 48s to 4s -- but what if it could be 3s? 21:59
;)
21:59 tedv joined
colomon I hope we get to spend a good hunk of the next few months optimizing Rakudo. 22:00
cxreg a profiler, eh?
jnthn colomon: Optimizing some aspects of Rakudo is a big part for my next grant. So I sure intended to be doing so :-) 22:01
cxreg speaking of which, anyone have any formalized thoughts on debugging hooks?
colomon not least because I'd like to see it running about 100x faster in general. :)
masak 100x faster would be awesome. imagine doing the spectest suite in 18 seconds. :)
colomon pmichaud: have you been able to duplicate the speed increase on your end?
I'll feel better when someone else has it working.
22:01 nimiezko joined
colomon feels sort of mythical at the moment. 22:02
pmichaud building now
will take some time, as I have to get my build back up to present head instead of Jun 20 :-)
masak wow, people really care about DateTime and Temporal. I didn't notice when all these tests for them got added. :) 22:03
someone++
22:03 stepnem joined
tylercurtis colomon: my GSoC project might potentially be helpful for that to some extent (not optimizing Rakudo's standard libraries but optimizing its generated code), although no doubt it could use a lot of improvement. My really ambitious plan (not sure if I'll get to them in GSoC) is to transform PAST to some sort of either CPS or SSA form to make well-known optimizations easy to express. :) Not sure if that's something I'll be able to do during GSoC or not, 22:05
though.
colomon tylercurtis++
pmichaud finished building parrot...building rakudo now (with patch)
[particle] tylercurtis: have you seen treessa? 22:07
tylercurtis [particle]: I have not.
[particle] it's what gcc uses internally. google gcc gimple TreeSSA. worth a read 22:08
tylercurtis [particle]: have a link?
ah. alright.
22:09 lest_away is now known as lestrrat, tadzik left
[Coke] great. now we just one more test file to be 10x faster, and I can cut a release. 22:09
c'mon, you did one. let's go.
[particle] crack that whip! 22:10
masak [Coke]: just pushed Kodi++'s patch. 22:11
though you might like to know.
22:11 skids left
masak s/though/thought/ 22:11
pmichaud argggggggggh 22:12
PackFile_unpack: This Parrot cannot read bytecode files with version 8.0. 22:13
pmichaud starts his compile sequence over.
[Coke] pmichaud: is the reddit post the "20s for rakudo, but 8ms for p5"?
pmichaud colomon: yes.
er, Coke: yes
[Coke] I'
pmichaud (tab fail)
[Coke] m ... right.
dalek kudo: 00848d2 | (Kodi Arfer)++ | (3 files):
Immutability and leap-second validation for DateTimes.
[Coke] that takes nearly 55s with master pre-kodi's patch on my OS X box with 3G dual core. 22:14
pmichaud yeah
colomon is there a link to the post?
[Coke] so he has a fast box. =-)
www.reddit.com/r/programming/commen...y_porting/
(first comment) 22:15
pmichaud [Coke]: no, he was running Kiev
in Kiev, it's about 50% faster than master is today
on my system, Kiev took 33second, and master (as of this morning) took 77s
colomon you might also point out that Rakudo is doing it all exactly with Rats...
pmichaud yes, I thought about that as well. 22:17
but I didn't really want to say anything as long as Rakudo master was 2x slower than kiev :)
22:17 justatheory left 22:18 Schwern left 22:19 supernovus joined
supernovus Hurray for Kodi++'s Temporal changes making it in! 22:20
22:20 xabbu42 left
masak yay 22:21
supernovus I'm going to test DateTime::Utils against the new immutable DateTime.
masak supernovus++ 22:22
supernovus masak: btw, you and Kodi have commit rights to the temporal-utils project where DateTime::Utils now lives (having escaped from the 'lib' directory of the Rakudo tree...)
masak supernovus: thanks; good to know. 22:23
pmichaud argggggh 22:24
[Coke] is there a way to get a reddit rss feed based on a search?
pmichaud is having trouble doing a simple build.
[Coke] pmichaud: building using -gen-parrot?
22:25 navidaad joined
[Coke] that file in the comments drops from about 55 to about 4.5 s. 22:25
pmichaud [Coke]: it's mostly user error on this end, having to do with trying to do this, work on another task, and talk to people at the conference all simultaneously
supernovus Well 'make test' in temporal-utils shows no failing tests with the new immutable DateTime object, so all seems well :-)
[Coke] pmichaud: hokay.
22:25 navidaad left 22:26 chee joined
chee roar 22:26
pmichaud meow
[Coke] will wait for pmichaud to bless this patch. want to make sure it goes in the releas.
chee is it perl6 time yet
pmichaud oh, as long as it passes the spectests, I'm blessing it.
chee Perl6'clock
[Coke] it's always perl6 time.
chee damn wt 22:27
pmichaud I'm simply trying to run it so that I can see the performance improvement on my system.
chee Perl 6 o'clock
[Coke] release will be cut later this evening.
pmichaud (and I'm expecting colomon++ to push the patch and do the spectests, not me )
masak chee: I'm about to release a blog post about cool Perl 6 features. wanna read the draft? 22:28
chee masak: sure! 22:29
masak chee: gist.github.com/485816
if anything strikes you as odd/unclear while reading that, do let me know. 22:30
chee perl 6 is the only language worth programming in, and so I have had to tell the people I am working for that I cannot write anymore code until final release.
masak chee: :)
pmichaud colomon: 4s here
masak chee: you'll find very little of One True Language Syndrome in here...
pmichaud ..."final release?"
I don't know that term. :-) 22:31
masak chee: and the concept "Final Release" is quite alien to us (or anyone doing real software)
chee i mean, release D:
masak chee: you do realize that this is release #31?
pmichaud afk, snack, then reply to reddit post
colomon pmichaud: sorry, I decided to run a load of dishes while I was spectesting the patch. :) 22:33
4.5s, \o/
22:33 paul1234 joined
masak rakudo: my $foo = CREATE_SUBSET_TYPE(Int, { $_ < 5 }); say 3 ~~ $foo; say 7 ~~ $foo 22:35
p6eval rakudo 9c90c2: OUTPUT«1␤0␤»
colomon aiiii, all sorts of test fail 22:37
oh, no, bad feeling about why things sped up so much 22:38
masak colomon: fast-but-wrong?
colomon switching over to Num inappropriately?
rakudo: say (-1.0).WHAT 22:40
p6eval rakudo 9c90c2: OUTPUT«Rat()␤»
22:40 pyrimidine left
cxreg masak: still waiting to publish that? 22:40
masak: it's almost less than a week!
:D
colomon arrrrr
22:41 nimiezko left
masak cxreg: I thought I'd cut it just in time :) 22:41
colomon > say (-1.0).WHAT
Num()
cxreg it looked like it was a distilled version of the advent calendar to me?
in any case, very tasty
22:42 xabbu42 joined, xabbu42 left
masak cxreg: thanks. 22:43
22:43 xabbu42 joined
colomon type returned from div still isn't correct. :\ 22:45
22:46 nimiezko joined
colomon yeah, that's why it's so fast, it's switched over to Num at some point. 22:47
bother
22:48 hercynium joined 22:49 cdarroch left, ashleydev joined
cxreg masak: 1,1,*+*...* is oddly appealing 22:49
colomon rakudo: say True.Int.WHAT
cxreg can't say i grok the & forms which follow it though
p6eval rakudo 9c90c2: OUTPUT«Bool()␤»
masak cxreg: I seem to be the only one who likes the & forms better :)
jnthn Oh, &[+] ? 22:50
masak cxreg: &foo in general means 'the sub called foo'
jnthn &[+] is just sugar for &infix:<+> pretty much
22:50 supernovus left
masak cxreg: &infix:<+> means 'the sub which is an infix op with the name +' 22:50
cxreg: &[+] is just a short form of &infix:<+>
cxreg ah 22:51
masak maybe I should remove those, tho'
jnthn finds the short forms a tad cryptic
masak they don't really add anything for a newbie.
jnthn masak: No, and poor newbie probably is still getting their head around *+*
:-)
cxreg lol
masak poof -- gone. 22:52
cxreg ^*+*^ # a snowman with sunglasses?
tylercurtis I don't much like the &[op] form because it's too close to [op].
jnthn std: ^*+*^ 22:54
p6eval std 31790: OUTPUT«===SORRY!===␤Bogus term at /tmp/82XKs6I3fb line 1 (EOF):␤------> ^*+*^⏏<EOL>␤Parse failed␤FAILED 00:01 116m␤»
jnthn std: ^*+*
p6eval std 31790: OUTPUT«ok 00:01 116m␤»
jnthn Damm, so close.
std: multi postfix:<^>($n) { }; ^*+*^
p6eval std 31790: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/ebsVZ_zrQD line 1:␤------> multi postfix:<^>(⏏$n) { }; ^*+*^␤ok 00:01 122m␤»
jnthn \o/ 22:55
masak what is that, a bat with flashlight eyes? 22:56
colomon well, so much for that optimization.
jnthn I was just told a snowman with sunglasses.
tylercurtis suspects that it is possible to make a Unicode-art lolcat valid Perl 6.
jnthn I look forward to seeing it. :-) 22:57
timbunce After doing "perl6 --target=pir --output=dbdi.pir dbdi.pl6" I get a dbdi.pir but how to do I run it? I tried "parrot dbdi.pir" but that spits out a page of "error:imcc:syntax error, unexpected PREG, expecting '(' ('$P11238')" errors.
22:57 tadzik joined
colomon with the Bool expression properly converting to an Int, pmichaud's optimized version of div is actually much slower than my clunky one. :( 22:58
afk # dinner
tadzik timbunce: you can't currently. Compiling modules work, iirc
timbunce tadzik: :(
mberends timbunce: those .pir files are only usable as modules for 'use', unless you do extra Parrot work
tadzik timbunce: I remember my disappointment when I was told this on perl6-users few months ago :( 22:59
timbunce I'd like to demo the code running during my 5 minute lighting talk at OSCON. But spending 1 minute waiting for it to compile won't look good!
colomon is sad 23:00
tadzik make it a module, and the code would be 'Module::run' :)
huf how does 1, 2, 4, ... * work? 23:01
tadzik huf: it calculates the geometric series based on the first 3 elements
I remember reading it in S03 today, can supply a link
timbunce in rakudo, what's an easy/clean/short way to wait for the user to press return?
tadzik how about prompt()? 23:02
prompt ''
there are maybe more efficient ones, but this one is easy and short :)
masak prompt 'Press return'; # :) 23:03
tadzik $*IN.read: 1 #also works
timbunce prompt is perfect, thanks.
masak um, no; .read is a binary-read method.
tadzik but it's imperfect, if you put two chars they stay in the buffer
masak you mean $*IN.get
colomon pmichaud: optimization is broken
tadzik oh, maybe
23:04 xabbu42 left
jnthn prompt '$ perl6 run-demo.p6' # ;-) 23:04
masak I love it when a fake live demo comes together. 23:05
huf tadzik: thanks
tadzik huf: want a link?
huf got it now
23:10 lestrrat is now known as lest_away
tadzik szabgab++ # screencasts are great, keep up the good work! 23:11
23:16 jferrero joined 23:18 au|zzz is now known as au|irc
au|irc szabgab++ indeed ⟈⟉ 23:18
23:19 kid51 joined
masak is that a cyclop? 23:20
huf isnt that a teletubby? 23:21
tadzik it's just two rectangles in my font :( 23:22
pmichaud colomon: my version of <div> causes fails? 23:23
if so, that actually means that other things are broken as well.
because the optimized form should work if the original does.
anyway, go with the form you had that includes the 'if' statement for now. 23:24
if you can avoid the block-form of 'if', you'll save a bit of time
i.e., $result-- if ...
insetad of if ... { $result-- }
that way we can at least get back to the 22second form instead of the 48 second one
I'll deep dive into the various operators over the next couple of days and figure out why the type coercions are all being done wrong. 23:25
I still claim the problem is with &infix:<-> 23:27
23:27 ab5tract joined
pmichaud or with the dispatch to &infix:<-> 23:28
23:29 justatheory joined, kjeldahl left
masak [Coke]: still there? you're not releasing quite yet, are you? :P 23:30
pmichaud tries a different fix.
23:33 d4rt left
colomon pmichaud: yeah, definitely needs more analysis 23:33
at this point, I'll be happy for 22s and a working spectest
pmichaud I still don't completely understand what the $result-- is intended to correct, though. 23:34
Parrot gets the result off by one whenever one of the operands is negative?
anyway, the lesson I'm getting from all of this is that Rat arithmetic is really slow (likely slower than it needs to be) 23:38
jnthn pmichaud: Here's another reason it epicly sucks. 23:39
pmichaud: Rat often contains two Ints.
tylercurtis colomon: what is the desired division behavior? 23:40
jnthn That's 3 objects. Apart from an object is 2 PMCs really (Object PMC and attr storage).
And n Int also keeps a parrot Integer PMC instance around
Result: 1 Rat = 8 PMCs.
tylercurtis colomon: div does flooring division, right? 23:42
23:42 Schwern joined
masak no need for FatRat, Rat is fat all by itself... 23:42
23:42 mantovani left
jnthn ENEEDDIET 23:42
23:42 mantovani joined, justatheory left
tylercurtis colomon: if so, have you looked into the fdiv op? "Set $1 to the quotient of $2 divided by $3. The result is the floor() of the division i.e. the next whole integer towards -inf. If the denominator is zero, a 'Divide by zero' exception is thrown." 23:43
pmichaud timbunce++ 23:44
sjohnson heh 23:45
pmichaud (timbunce just demoed dbi in Perl 6 as a lightning talk :)
jnthn timbunce++
s1n masak: just curious, what was the reason for DateTime going back to being immutable? 23:46
colomon tylercurtis: is that as opposed to the (parrot) div op?
(not ignoring you, trying to eat dinner too.)
pmichaud rakudo: say pir::fdiv__NNN(-3, 4) 23:47
p6eval rakudo 00848d: OUTPUT«-1␤»
tylercurtis colomon: Right. the Parrot "div" op does truncating division. "fdiv" does flooring division.
23:47 jferrero left
pmichaud I think fdiv also expects num instead of int? 23:47
tylercurtis pmichaud: both work. 23:48
pmichaud rakudo: say pir::fdiv__III(-3, 4)
p6eval rakudo 00848d: OUTPUT«0␤»
pmichaud nope.
tylercurtis Well... there's a fdiv_i_i_i op, at least.
23:48 astrojp left
pmichaud odd that it gives a different result than fdiv_n_n_n 23:48
jnthn That feels...wrong. 23:49
pmichaud very wrong
23:50 felliott left
pmichaud gist.github.com/486811 # ouch! 23:51
23:51 felliott joined
jnthn wtf 23:51
masak [Coke]: my enum patch made it in! don't you dare release without it! :P
23:51 Raynes left
tylercurtis C integer division truncates or floors? 23:51
jnthn pmichaud: oh
pmichaud: read the op 23:52
src/ops/math.ops
masak whose op?
jnthn looks FAIL
masak: failz op!
masak oh nose!
dalek kudo: 0d0fd7e | masak++ | (4 files):
[src/glue] translated !setup_named_enum PIR->p6

enum semantics.
23:53
kudo: 5fe1939 | masak++ | src/glue/enum.pm:
[src/glue/enum.pm] return the right things

Previously, requesting Foo yielded an EnumMap, whereas it now yields an object of some kind whose .enums method returns an EnumMap. Similarly, requesting b yielded an Int, whereas now it returns an object that responds to a number of methods, as per S12.
masak \o/
tylercurtis In C, "double d = someInt / someOtherInt" does integer division, doesn't it?
jnthn masak++
masak finds the appropriate RT ticket to close
jnthn tylercurtis: Right.
masak *closes* masakbug! 23:54
er, rakudobug
:-)
masak some schmuck with far too many tickets on his name opened it some time ago...
sjohnson yo masak
23:54 skids joined
tylercurtis jnthn: And C integer division truncates? 23:54
masak sjohnson: hey, fella!
jnthn tylercurtis: Think so
tylercurtis: Passing it to floor looks kinda odd though
masak sjohnson: try the new enums! they're fresh! :)
jnthn Anyway, I'm pretty sure that code is br0ken.
sjohnson masak == perl 6 master 23:55
jnthn Sadly, Parrot went out yesterday, so we can nee fix it now.
tylercurtis jnthn: looks as though they thought they were getting a float division and flooring it.
jnthn tylercurtis: right
sjohnson all these new features are quite exciting
colomon nod
masak rakudo: enum A <a b c>; say A.enums.WHAT
colomon afk # skyping
sjohnson they will make text parsing tasks at work even more flexible
jnthn sjohnson: You see feeds too? :-)
p6eval rakudo 00848d: OUTPUT«Method 'enums' not found for invocant of class 'EnumMap'␤ in main program body at line 22:/tmp/CLQqPSQOKr␤»
jnthn masak: ETOOSOON
masak jnthn: right.
when's p6eval rakudo rebuild time?
rakudo: enum A <a b c>; say A.WHAT 23:56
p6eval rakudo 00848d: OUTPUT«EnumMap()␤»
masak it's the examples from rt.perl.org/rt3/Ticket/Display.html?id=75296
23:57 Psyche^ joined, Patterner left, Psyche^ is now known as Patterner
tadzik rakudo: "\e\e".split('\e').perl.say 23:59
p6eval rakudo 00848d: OUTPUT«("\x[1b]\x[1b]")␤»
tadzik why so weird? :\
masak tadzik: "\e" eq "\x[1b]"