»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
dalek ecza/cilbackend: 86933d1 | sorear++ | lib/CLRBackend.cs:
Add primitives for autovivification
01:14
ecza/cilbackend: e79c528 | sorear++ | lib/CLRBackend.cs:
More misc bindings
ecza/cilbackend: 5223934 | sorear++ | lib/CLRBackend.cs:
Add returnable handling, rudiments of exception handler tracking
flussence usually I'd consider messing around with code at 02:30 a bad idea, but I managed to fix a segfault *and* file a semi-coherent bug report about it this time... 02:42
flussence steps away from the keyboard before I jinx it :) 02:43
dalek ecza/cilbackend: 347dcb7 | sorear++ | lib/CLRBackend.cs:
Add gather_hack, fix my @foo
03:05
ecza/cilbackend: e060adb | sorear++ | lib/CLRBackend.cs:
Add cast, many more misc bindings
ecza/cilbackend: 5f19070 | sorear++ | lib/CLRBackend.cs:
&die, other misc bindings
tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....dex_tablet
colomon rakudo: say 2.rand 03:10
p6eval rakudo cae7f9: OUTPUT«1.22047050967279␤»
colomon rakudo: say (1, 2).rand
p6eval rakudo cae7f9: OUTPUT«0.721460723033431␤»
colomon rakudo: say (1, 2).pick
p6eval rakudo cae7f9: OUTPUT«1␤»
colomon rakudo: say (1, 2).pick
p6eval rakudo cae7f9: OUTPUT«1␤»
sorear perl6: my $wc = rand * *; say $wc(1); say $wc(2) 03:12
p6eval rakudo cae7f9: OUTPUT«0.706005393152253␤0.435747933650667␤»
..pugs: OUTPUT«*** ␤ Unexpected "$wc"␤ expecting "=", context, ":" or "("␤ at /tmp/nofD6WhPUX line 1, column 4␤»
sorear rakudo: my $wc = rand * *; say $wc(1) == $wc(1) 03:13
p6eval rakudo cae7f9: OUTPUT«Bool::False␤»
sorear alpha: my $wc = rand * *; say $wc(1) == $wc(1)
p6eval alpha : OUTPUT«1␤»
sorear alpha: my $wc = rand * *; say $wc(1); say $wc(2); 03:14
p6eval alpha : OUTPUT«0.254515018154965␤0.50903003630993␤»
colomon sorear: what are you looking for here? 03:21
sjn moritz_: should "RoleHOW.new" be "Role.HOW.new" in your advent calendar post for today? 03:23
sorear colomon: TimToady to declare that alpha was right, ideally 03:24
colomon by what logic? 03:25
oooo.... rand is evaluated before the closure is made? 03:26
sorear yes 03:27
colomon alpha: my $wc = { rand * $_ }; say $wc1(1) == $wc(2) 03:28
p6eval alpha : OUTPUT«Symbol '$wc1' not predeclared in <anonymous> (/tmp/qSqEn6Y0aI:10)␤in Main (file <unknown>, line <unknown>)␤»
colomon alpha: my $wc = { rand * $_ }; say $wc(1) == $wc(1)
p6eval alpha : OUTPUT«0␤»
colomon hmmm 03:29
dalek tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....dex_tablet 03:32
colomon alpha: sub frand() { rand }; my $wc = frand * *; say $wc(1) == $wc(1)
p6eval alpha : OUTPUT«Confused at line 10, near "*; say $wc"␤in Main (file <unknown>, line <unknown>)␤»
colomon alpha: sub frand() { rand }; my $wc = frand() * *; say $wc(1) == $wc(1)
p6eval alpha : OUTPUT«1␤»
dalek tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....dex_tablet 03:38
dalek ecza/cilbackend: b56f60d | sorear++ | lib/CLRBackend.cs:
indexes, array construction
07:18
ecza/cilbackend: 4076928 | sorear++ | / (4 files):
Bindings for basic regex function
ecza/cilbackend: aa2b8f9 | sorear++ | lib/CLRBackend.cs:
set_status and a module Foo; hack
masak morning, zebras. 08:18
moritz_++ # slot #22
cotto I liked that one.
masak also, contestants 11 and 12 have now signed up for strangelyconsistent.org/blog/masaks...ng-contest 08:20
remember that you can only sign up until the 24th!
masak I like this tweet: twitter.com/robreed/status/17354662386601984 08:29
sorear hello masak 08:37
masak hi sorear. how proceeds the refactor?
sorear ahead of schedule.
masak :) 08:38
sorear it could be ready by v1
masak that's great. 08:39
2010-12-29? 08:40
sorear 27
masak ok. 08:41
sorear think 29 would be better? I haven't published my schedule yet :)
masak I think a simple rule is good.
I saw v0 was 2010-11-29, so I took a guess :)
sorear Rakudo's rule is the somethingth thursday, so I took the last Monday 08:42
masak will the Perl 5 dependency go away with v1?
oh, last Monday is a good rule.
sorear *-*-29 will cause problems with v3
masak right.
sorear v1 will definitely still have Perl 5
v2 has a good chance of being bootstrapped 08:43
masak cool!
sorear after I sort out this mess of data storage formats
(redundandly storing module metadata using Storable and JSON::XS won't work very well in the Perl 6 world...) 08:44
masak no. 08:47
dalek ecza/cilbackend: 77f59fd | sorear++ | lib/CLRBackend.cs:
Start on SubInfo thawer generator
09:25
ch3ck morrn masak 09:25
masak hey 09:26
rakudo: say { foo => Bool } ~~ :!foo
p6eval rakudo cae7f9: OUTPUT«Bool::False␤» 09:27
masak I never got any second opinion from anyone about this.
shall I just (*gasp*) apply my own good judgement and declare this Wrong?
basically, I consider Bool a less fortunate version of False.
also, I'd like a third opinion on TimToady's statement that chaning Bool.Bool to just { self } might be bad for circularity-saw reasons. I don't see that it would. 09:29
sorear masak: under S13 doctrine, any method named .Bool ought to return a Bool 09:31
masak well, I agree with that.
sorear there may be stronger things than Liskov at work here 09:32
masak but a method Bool { self } declared in class Bool will, AFAICS, return a Bool.
even if Bool is subclassed.
sorear OTOH, defining method Bool { self ?? True !! False } in niecza will cause infinite recursion
masak right, so that's the converse of what TimToady said. all depends on where you apply the saw, of course. 09:33
sorear: what I discovered yesterday was that (a more complicated version of) the above was the only thing that failed when I chose the simpler definition of Bool.Bool.
and now I'm arguing that the above is wrong anyway.
sorear I think the above is wrong 09:34
masak goes ahead and fixes it 09:34
sorear { foo => Bool } ~~ :foo(False) should mean the same as Bool ~~ False
which should be the same as !Bool 09:35
masak aye.
rakudo: say Bool ~~ False
p6eval rakudo cae7f9: OUTPUT«===SORRY!===␤Smartmatch against False always fails; if you mean to test the topic for truthiness, use :!so or *.not or !* instead at line 22, near " False"␤»
sorear and type objects are always false unless the object has a Bool:U override, which no standard Perl 6 object does
masak oh, right.
sorear erp.
I'm confused
masak we put in an exception there :)
people were using smartmatch like 'if'.
rakudo: Bool ~~ :!so 09:36
p6eval rakudo cae7f9: ( no output )
masak rakudo: say Bool ~~ :!so
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
masak maybe we should tear up that exception, now that ~~ treats $_ differently.
sorear skimming S0[23], %hash ~~ :!key is always false 09:38
it's only $object ~~ :!key that makes sense
masak how come?
sorear Hash Pair test hash mapping $_{X.key} ~~ X.value 09:39
$_{X.key} ~~ False
masak assuming you could ~~ False
sorear you can 09:40
'tis only a warning
masak ah, right.
sorear oh, it's a sorry in Rakudo
std: 1 ~~ False
p6eval std 625303c: OUTPUT«Potential difficulties:␤ Smartmatch against False always fails; if you mean to test the topic for␤ truthiness, please use :!so or *.not or !* instead at /tmp/yjhtvkUc59 line 1:␤------> 1 ~~⏏ False␤ok 00:01 120m␤»
masak we mix up warnings and sorries a bit in Rakudo.
sorear not that I suspect many people will care
masak rakudo: { foo => 1 } ~~ :foo 09:41
p6eval rakudo cae7f9: ( no output )
masak rakudo: say { foo => 1 } ~~ :foo
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
masak rakudo: say { foo => 42 } ~~ :foo
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
sorear rakudo: say { foo => 1 } ~~ :bar
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
masak huh.
sorear it reduces to Any ~~ True
masak oh, I see what's you're saying.
hm, that means that my original line above is Right. 09:42
and that I need a new example :)
rakudo: say "non-existent-file-tests".IO ~~ :!f 09:43
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
masak this is correct.
but it flips as soon as I define Bool.Bool as { self }
sorear The Bool.ACCEPTS stuff is yucky imo
masak yeah 09:44
masak rakudo: class A { has Bool $.foo }; say A.new ~~ :!foo; say A.new(:foo) ~~ :!foo; say A.new(:foo(Bool)) ~~ :!foo 09:52
p6eval rakudo cae7f9: OUTPUT«Bool::True␤Bool::False␤Bool::True␤»
masak there you go. that's the bug.
oh wait, that's right :)
masak *locally*, it's wrong, because locally Bool.Bool is { self } 09:53
(locally, I get "Bool::True \n Bool::False \n Bool::False") 09:54
masak which must mean that ~~ :!f calls .Bool somewhere. fair enough. 09:54
rakudo: say Bool ~~ :!so 09:55
p6eval rakudo cae7f9: OUTPUT«Bool::True␤»
masak huh! I'm at a loss for how to expose the bug on an unmodified Rakudo :P
moritz_ sjn: nope, RoleHOW is the name of the meta class for roles
good morning zebras 10:01
masak moritz_: morning, koala. 10:04
moritz_ waves with his big, fluffy ears 10:05
masak moritz_: maybe you can help me find my way around the Rakudo source a bit. what part of the source is visited when I do $obj ~~ :!foo ?
moritz_ Pair.ACCEPTS 10:06
masak right. and in which file is it defined?
moritz_ $ ack -g Pair
src/core/Pair.pm
src/builtins/Pair.pir
I guess you checked both?
masak actually, I did 'ack ACCEPTS' and didn't get anything useful from that. 10:07
I'll check those; thanks.
moritz_ pairproto = p6meta.'new_class'('Pair', 'parent'=>'Enum')
masak src/core/Enum.pm -- bingo! 10:08
moritz_++
moritz_ src/core/Enum.pm has two ACCEPT multis
masak right. it's the second one I wanted. 10:09
masak it does prefix:<?> on both $topic and $.value 10:10
rakudo: class Foo; say Foo.new ~~ :methoddoesnotexist 10:11
p6eval rakudo cae7f9: OUTPUT«Method 'methoddoesnotexist' not found for invocant of class 'Foo'␤ in 'Enum::ACCEPTS' at line 5351:CORE.setting␤ in main program body at line 22:/tmp/XdLhdNG9dH␤»
masak rakudo: my $f = False; say Bool ~~ $f
p6eval rakudo cae7f9: OUTPUT«Bool::False␤» 10:12
masak there we go.
discuss. :)
my proof consists of two parts: (1) when a false value smartmatches against False, the result should be True; (2) Bool is a false value. 10:13
masak submits rakudobug
dalek ecza/cilbackend: ab0a22e | sorear++ | lib/CLRBackend.cs:
Implement generation of line number tables
10:14
ecza/cilbackend: 5484ab8 | sorear++ | lib/CLRBackend.cs:
Implement exception handler table generation
ecza/cilbackend: f5409ed | sorear++ | lib/CLRBackend.cs:
Implement constant pooling
10:31
ecza/cilbackend: 3a914b7 | sorear++ | lib/CLRBackend.cs:
Tweak box implementation a bit to break circularity
sorear calls it a night.
sorear poof
masak 'night, sorear. dream of pools of constants. :) 10:33
masak is this TODO comment out-of-date? github.com/rakudo/rakudo/blob/mast...num.pm#L10 11:44
colomon Has anyone tried building Rakudo with the released Parrot? We need to know if that works ASAP. (And I'm still a bit fuzzy on how to do it since the Parrot switch to git.) 12:44
takadonet hey all 12:54
gfldex colomon: you need to edit build/PARROT_REVISION 13:00
colomon yes, but what do you put there now? 13:01
It was easier when I just needed to figure out the right SVN revision.
afk # finally light enough to walk 13:05
gfldex colomon: setting build/PARROT_REVISION to RELEASE_2_11_0 seams to work 13:17
building now
colomon gfldex++ 13:17
(walk delayed because of small child waking. :)
moritz_ rakudo: say 1 ~~ False; 13:31
p6eval rakudo cae7f9: OUTPUT«===SORRY!===␤Smartmatch against False always fails; if you mean to test the topic for truthiness, use :!so or *.not or !* instead at line 22, near " False;"␤»
moritz_ off topic question: does ruby have a proper meta object model? 13:54
I've found some google hits for "ruby metaclass", but it seems the rubyist associate a certain kind of singleton with it, not the way think of a metaclass 13:55
frettled moritz_: According to mst: no. 14:10
frettled moritz_: he had a rant/talk in Oslo earlier this year, provoking Ruby people to come in and listen and object to what he said. 14:11
They objected to a few things, but just as before, nobody could really claim that Ruby's introspection was on level with Perl 5's.
That surprised me.
smash hello everyone 14:22
takadonet smash: hey 14:23
moritz_ hi smash 14:27
tadzik o/
alester Happy Wednesday with a non-broken rakudo.org 14:38
smash alester++ 14:42
alester Added a quarter gig of RAM
no more swapping
all goodness
smash great 14:43
colomon o/ 14:47
tadzik about the advent calendar, shouldn't 24 be merry christmas? 14:49
alester smash: See petdance.com/random/diskio.png 14:55
(force reload if you saw the old chart yesterday)
smash alester: ouch, nasty 15:01
alester that drop was when I upgraded my linode from 512 to 768 MB 15:03
takadonet alester: how many hits are we getting for rakudo.org? 15:04
alester What kind of answer do you want to hear? 15:05
takadonet alester: # of visitors per month? 15:08
are we increasing?
alester What would that tell you? 15:09
You can have the log files if you want.
actually
I could get you some Google Analytics
takadonet alester: just curious really.
alester If you want ready-made answers, I don't have them.
takadonet alester: don't put any effort into this
alester That was my plan. :-)
We get about 100-200 visits per day 15:10
except on 11/25 when we got 1,177 15:11
takadonet cool
alester There is no trend 15:13
it's all flat
gfldex colomon: new parrot build and runs rakudo, I did little tests tho 15:25
colomon gfldex++: I'm happy to duplicate your efforts and run spectest here. 15:25
smash just run fulltest with latest parrot: All tests successful. 15:26
takadonet sweet 15:30
tadzik how faster is that? 15:37
takadonet tadzik: the newest parrot build?
tadzik takadonet: yeah 15:41
tadzik nothing fancy on isparrotfastyet.com/ 15:42
takadonet one day I just want to see that graph have a huge decrease on runtime 15:47
tadzik hmm 15:49
„this entire project should be finished sometime in late 15:51
December.”
(the Meta-Model grant) 15:52
takadonet tadzik: jnthn grant? 15:53
tadzik takadonet: yeah 15:54
that'd be a hell of a speedup
colomon I'd think we'd know by now if jnthn was ready to finish the grant next week.
Though I did miss #phasers yesterday...
tadzik also we could start making some fun after the tree-optimizer is merged 15:55
smash no news on #pahsers yesterday on the topic
*phasers
colomon yes, just read the backlog. 15:56
no jnthn, either
tadzik > 01234 15:57
Leading 0 does not indicate octal in Perl 6; please use leading 0o if you mean that at line 1, near "\n"
could've been prettier (ideas?), but I have the promised "at least one patch" for ya :) 15:58
tadzik has a mixed feelings about #81146. Shouldn't smartmatching againt False be always false? It even is alredy 16:02
tadzik I feel as doing something for rakudo, it'd be good to have something to show off in a changelog 16:05
tadzik could anybody give me a hand with a patch? It's like this atm[1], but it does not show near what it warns. [1] paste.perldancer.org/P7y68YAxgHfO 16:13
anyone into nqp-rx here? I think I implemented .worry 16:26
PerlJam greetings 16:47
tadzik: you're not sure if you implemented worry? :) 16:48
huf .worry is specced? what's it do? 16:50
tadzik PerlJam: no, it just doesn't work fully :)
huf: it's like .panic, but does not die 16:51
weird 16:52
paste.perldancer.org/2zS3oA69v1A61 16:53
the worry method is basically panic with a few changes, I was planning to refactor them a bit after I'm sure worry works 16:54
moritz_ \o/ 1.1k views on the advent blog today 17:37
with still a few hours to go
colomon sweet! 17:39
moritz_ so, anybody up for the 24th? 17:40
thundergnat++ claimed the 23rd
takadonet moritz_: nice
moritz_: reddit is down
moritz_ takadonet: I know. We've slashdotted it! :-) 17:41
takadonet moritz_: we seems to got the attention of a troll which posted on every perl 6 advent posted saying it was spam.... 17:42
he was downvoted pretty good
Util Status of &?ROUTINE in Rakudo? 17:51
moritz_ Util: NYI 19:06
colomon build/PARROT_REVISION = RELEASE_2_11_0 passes all spec tests on OS X 19:21
what's the procedure for generating a proper PARROT_REVISION value now?
PerlJam colomon: git describe --tags
PerlJam colomon: it's in docs/release_guide.pod 19:23
colomon PerlJam: that just gets me the RELEASE_2_11_0 string, without the hash and all
PerlJam tries it 19:24
colomon of course, the release_guide.pod doesn't seem to indicate that the hash is necessary. Hmmm.
pushed 19:27
dalek kudo: b5c0165 | colomon++ | build/PARROT_REVISION:
Bump to Parrot 2.11. PerlJam++ for pointing out instructions to do this are in docs/release_guide.pod.
19:30
PerlJam That hardly warrants a ++ :) 19:33
colomon I'll be the judge of that in my commits. ;) 19:36
sorear good * #perl6 19:44
colomon \o 19:45
rokoteko colomon: mm.. as I remember you are the perl6 + math dude all in a single package.. how would you transform cartesian coordinates to polar coordinates using perl6? 19:48
colomon hmmmm... unpolar goes the other way. 19:49
polar
rakudo: say (2 + 3i).polar.perl 19:50
p6eval rakudo cae7f9: OUTPUT«(3.60555127546399, 0.982793723247329)␤»
colomon that's (magnitude, angle) 19:50
and then...
rokoteko colomon: ok. assuming I want X decimals?
colomon "X decimals"?
rokoteko that's pretty cool already. :)
colomon oh, you mean, N digits behind the .? 19:51
rokoteko nods
ie. lazily evaluated transformation.
colomon if you just... what?
rokoteko "N digits behing the .?" Yes, exactly.
I decide what the N is, how to do it with perl6? mainly curious. 19:52
colomon yes, but I'm not sure I see what lazily evaluated transformation has to do with that?
if you're just worried about printing it that way, I think fmt has the normal printf formats.
rakudo: say (2 + 3i).polar>>.fmt("%.5g") 19:53
p6eval rakudo cae7f9: OUTPUT«3.60560.98279␤»
colomon rakudo: say ~(2 + 3i).polar>>.fmt("%.5g")
p6eval rakudo cae7f9: OUTPUT«3.6056 0.98279␤»
rokoteko colomon: ok. so the answer is that it's in the core? so you should avoid using perl6 code to implement a better way? 19:53
colomon if you actually want the corresponding numbers, it's 19:54
rakudo: say ~(2 + 3i).polar>>.round(1/10000)
p6eval rakudo cae7f9: OUTPUT«3.6056 0.9828␤»
colomon rakudo: say ~(2 + 3i).polar>>.round(1/100000)
rokoteko ok, thanks. Im always bit puzzled about these things. :)
p6eval rakudo cae7f9: OUTPUT«3.60555 0.98279␤»
rokoteko colomon: I thought that you could "abuse" lazy evaluation to provide the N digits. not talking about how long it will take here. 19:55
Anyhow if it is built-in, then I (obviously) see the limits. :) 19:56
colomon Unless you're talking about crazy levels of precision that Rakudo can't even dream of yet, calling .polar is about as fast as any single operation you can do.
rokoteko I wasnt talking about being "fast". 19:58
just about "how would you do it in perl6"?
colomon rakudo: say 3.60555.unpolar(0.98279) 19:59
p6eval rakudo cae7f9: OUTPUT«2.00001046222405 + 2.99999149223699i␤»
rokoteko imagine e^(i*pi) - 1 = 0 == pi^(X) # where YOU define the X. currently it's not doable. but just curious what approach is perl6 taking to this. so it's implemented in core and it goes as far as what? 1/(64 bit integer) is the farthest the precision currently does? is this using Rats? 20:02
colomon: I was just curious about how would *you* approach the problem. I remember your power series blog entry which was an answer to one question I asked on irc. :) 20:04
colomon Hmmm... 20:13
Are you suggesting using conversion from cartesian to polar to compute pi to an arbitrary number of decimal places?
rakudo: say (-1i).polar 20:14
p6eval rakudo cae7f9: OUTPUT«1-1.5707963267949␤»
colomon or something like that?
colomon Actually, 1/(32 bit integer) is the best reliable Rat precision at the moment. 20:16
The spec calls for FatRats which can go as far down as you'd like, but we don't have them yet. 20:17
If you wanted to use a series approach for pi, you'd start with something like Pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... 20:18
sorear fatrats != computable reals
colomon: ick not that
PerlJam fatrats are what you find in grain storage areas 20:19
colomon fatrats are not the computable reals, but they can represent a computable real to an arbitrary precision.
sorear: You're right on PI/4 = atan(1) = 1 - 1/3 + 1/5 - 1/7 ... not being ideal, but as an example, it certainly simplifies the discussion. 20:22
rokoteko colomon: I was mainly curious how would you do it. :) I have no idea of the implementation. 20:23
PerlJam rokoteko: so ... you're cheating? :)
rokoteko ermm well. if you ask on the perl6 knowledge on the subject, then yes Im cheating by asking here how to do it. 20:24
(also related to the fact that I happen to know that colomon is good with this shit) :) 20:25
didnt I mention this yet? 20:26
Im just a curious fellow. 20:27
colomon rakudo: say (1...10).map({-1 ** $^n * - (1 / ($n * 2 + 1) ) }).perl
p6eval rakudo cae7f9: OUTPUT«(1/3, 1/5, 1/7, 1/9, 1/11, 1/13, 1/15, 1/17, 1/19, 1/21)␤»
colomon rakudo: say (1...10).map({(-1 ** $^n) * - (1 / ($n * 2 - 1) ) }).perl 20:28
p6eval rakudo cae7f9: OUTPUT«(1/1, 1/3, 1/5, 1/7, 1/9, 1/11, 1/13, 1/15, 1/17, 1/19)␤»
colomon dang it, one of these days I will learn
rakudo: say (1...10).map({((-1) ** $^n) * - (1 / ($n * 2 - 1) ) }).perl
p6eval rakudo cae7f9: OUTPUT«(1/1, -1/3, 1/5, -1/7, 1/9, -1/11, 1/13, -1/15, 1/17, -1/19)␤»
colomon rakudo: say [+] (1...10).map({((-1) ** $^n) * - (1 / ($n * 2 - 1) ) }) 20:29
p6eval rakudo cae7f9: OUTPUT«0.760459904732351␤»
PerlJam rokoteko: i don't know .. he seems to have problems with precedence :)
colomon rakudo: say pi / 4 20:30
p6eval rakudo cae7f9: OUTPUT«0.785398163397448␤»
colomon rakudo: say [+] (1...20).map({((-1) ** $^n) * - (1 / ($n * 2 - 1) ) })
p6eval rakudo cae7f9: OUTPUT«0.77290595166696␤»
colomon woah, that does indeed converge very, very slowly.
rokoteko rakudo: say (1...10).map({(-1 ** $^n) * - (1 / ($n * 2 - 1) and not $n / $n == int($n/$n) ) }).perl 20:32
p6eval rakudo cae7f9: OUTPUT«Could not find sub &int␤ in <anon> at line 22:/tmp/pcVWGU5F_E␤ in 'Any::join' at line 1␤ in 'List::perl' at line 2772:CORE.setting␤ in main program body at line 22:/tmp/pcVWGU5F_E␤»
rokoteko rakudo: say (1...10).map({(-1 ** $^n) * - (1 / ($n * 2 - 1) and not $n / $n == ($n/$n).Int ) }).perl 20:33
p6eval rakudo cae7f9: OUTPUT«(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤»
rokoteko afk. need to eat. :) 20:34
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say atan(1)[^10].perl 20:40
p6eval rakudo cae7f9: OUTPUT«(1/1, -1/3, 1/5, -1/7, 1/9, -1/11, 1/13, -1/15, 1/17, -1/19)␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ((4, 4 ... *) Z* atan(1/5) Z- atan(1/239))[^10].perl 20:41
p6eval rakudo cae7f9: OUTPUT«No applicable candidates found to dispatch to for 'zipwith'. Available candidates are:␤:(&op, Any $lhs, Any $rhs)␤␤ in main program body at line 1␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say (4, 4 ... *)[^10].perl 20:42
p6eval rakudo cae7f9: OUTPUT«(4, 4, 4, 4, 4, 4, 4, 4, 4, 4)␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ((4, 4 ... *) Z* atan(1/5))[^10].perl
p6eval rakudo cae7f9: OUTPUT«(4/5, -4/375, 4/15625, -4/546875, 4/17578125, -4/537109375, 2.52061538461538e-10, -8.73813333333333e-12, 3.08404705882353e-13, -1.10376421052632e-14)␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ((4, 4 ... *) Z* atan(1/5))[^10].perl; say atan(1/239)[^10].perl 20:43
p6eval rakudo cae7f9: OUTPUT«(4/5, -4/375, 4/15625, -4/546875, 4/17578125, -4/537109375, 2.52061538461538e-10, -8.73813333333333e-12, 3.08404705882353e-13, -1.10376421052632e-14)␤(1/239, -1/40955757, 2.56472314424647e-13, -3.20713065778469e-18, 4.36693152440392e-23, -6.25504450992156e-28,
..9.26582162415509e-33,…
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ((4, 4 ... *) Z* atan(1/5))[^5].perl; say atan(1/239)[^2].perl
p6eval rakudo cae7f9: OUTPUT«(4/5, -4/375, 4/15625, -4/546875, 4/17578125)␤(1/239, -1/40955757)␤» 20:44
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say [+]((4, 4 ... *) Z* atan(1/5))[^5] + [+] atan(1/239)[^2]
p6eval rakudo cae7f9: OUTPUT«5.00418407600182␤»
colomon that seems a little high
rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say [+]((4, 4 ... *) Z* atan(1/5))[^5] - [+] atan(1/239)[^2]
p6eval rakudo cae7f9: OUTPUT«4.99581592399818␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ([+] atan(1/5))[^5]) * 4 - [+] atan(1/239)[^2] 20:45
p6eval rakudo cae7f9: OUTPUT«===SORRY!===␤Confused at line 22, near ") * 4 - [+"␤»
colomon rakudo: sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; say ([+] atan(1/5)[^5]) * 4 - [+] atan(1/239)[^2] 20:46
p6eval rakudo cae7f9: OUTPUT«0.785398170601356␤»
colomon rakudo: say pi /4
p6eval rakudo cae7f9: OUTPUT«0.785398163397448␤»
colomon not bad
sjohnson WeeChat uptime: 113 days 11:22:42, started on Tue Aug 31 02:26:54 2010 20:50
always nice to see someone using the same client
sorear colomon: google is failing me atm but I saw a basic program to calculate partial sums of sum(i, 0, infty, (-1)^i * 1/(1+2*i)) once using a fiendish indirect algorithm 20:55
sorear colomon: he had the 10^15'th partial sum in a comment, it was accurate to not a whole lot of places :) 20:56
rokoteko colomon: "< colomon> The spec calls for FatRats which can go as far down as you'd like" ... uhhh. is everyone serious about implementing this spec? 20:56
colomon rokoteko: I was just thinking about doing it as a module for now. Or rather, doing a BigInt type as a module, and then implement a FatRat module on top of it. 20:58
colomon is still kind of geeked about sub atan($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; 20:59
errr, guess it should be called atan-series, or something like that.
rokoteko colomon: ok. might be a cool subject make a series of blog entries about, your proceedings with this. :)
PerlJam colomon: indeed. I was going to comment as much 21:00
rokoteko colomon: so the rest of us could also understand it. :) 21:00
PerlJam colomon: well, I was going to suggest atans or atang or something :)
(atang == atan generator) 21:01
if constructions such at those could be made fast, we'd already have a good chunk of PDL-ness in Perl 6. 21:02
rokoteko PerlJam: atans obviously stands then for: a tan, which is A TAN Simulator? kinda like solarium?
colomon rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { [+] atang($x) ...^ Num }; say atan(1/5).perl 21:03
p6eval rakudo cae7f9: OUTPUT«0.197395559788975␤»
colomon ah, the fly in the ointment.
rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { (([\+] atang($x)) ...^ Num)[*-1] }; say atan(1/5).perl 21:04
p6eval rakudo cae7f9: OUTPUT«24288907/123046875␤»
colomon rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { (([\+] atang($x)) ...^ Num)[*-1] }; say atan(1/5).perl; say atan(1/5)
p6eval rakudo cae7f9: OUTPUT«24288907/123046875␤0.197395561650794␤»
colomon rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { (([\+] atang($x)) ...^ Num)[*-1] }; say atan(1/5).perl; say atan(1/5); say atan(1/5.Num) 21:05
p6eval rakudo cae7f9: OUTPUT«24288907/123046875␤0.197395561650794␤Nominal type check failed for parameter '$x'; expected Rat but got Num instead␤ in 'atan' at line 22:/tmp/XLrjiVevxD␤ in main program body at line 22:/tmp/XLrjiVevxD␤»
colomon rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { (([\+] atang($x)) ...^ Num)[*-1] }; say atan(1/5).perl; say atan(1/5); say atan2(1/5)
p6eval rakudo cae7f9: OUTPUT«24288907/123046875␤0.197395561650794␤0.197395559849881␤»
colomon rakudo: sub atang($x) { (1..*).map(1 / (* * 2 - 1)) Z* ($x, * * $x * -$x ... *) }; sub atan(Rat $x) { (([\+] atang($x)) ...^ Num)[*-1] }; say atan(1/4).perl; say atan(1/4); say atan2(1/4) 21:11
p6eval rakudo cae7f9: OUTPUT«20229203/82575360␤0.244978683713883␤0.244978663126864␤»
rokoteko why not to just limit the maximum number perl6 can handle? Then it would atleast be a known limit. 21:13
no floating point errors, or anything. just a very well known fact. how large numbers does one need anyhow? 21:14
[Coke] "pick a size" "someone will need bigger"
if you want a limited size number, you already have that type.
(yes?)
rokoteko Ahh.. .oO( class Approximate extends FatRat ) 21:15
PerlJam rokoteko: mathematicians reason in a land where their numbers are free of implementation constraints.
rokoteko and most of perl6 programmers are not mathematicians, and the ones that happen to be would appreciate the point of knowing when they are moving to approximations..? 21:18
(approximiations by the implementation, of course) 21:19
rokoteko would't they? 21:22
+n
colomon suspects he'd be able to hear his recording more clearly if he actually had speakers attached to the computer playing it. 21:25
moritz_ mathematicians model their number types as subsets and supersets 21:27
not as classes in the CS sense
moritz_ but subset types or superset types don't map well to machine registers 21:29
sorear I have a mathematical background, and I would rather my numbers be 1. fast 2. free of obvious pitfalls than "fancy"
moritz_ fully agreed 21:30
sorear we call it the waterbed theory - using a complex system internally but forcing it under a seemingly-simple facade just forces the complexity to well up elsewhere
moritz_ thinks that defaulting to Rat with decimal literals is a nice balance on that bed 21:31
[Coke] and Rat is not arbitrary precision, yes? It's limited to whatever can fit in the Num/Denom ? 21:33
moritz_ [Coke]: yes, it degrades to Num (aka floating point numbers) if either gets too big 21:35
which prevents excessively slow computations 21:36
TimToady it's limited to Int/Int64 21:37
or probablu uint64, and keep the sign on the numeriator
but there's no limit on the Int part 21:38
(according to spec, not according to rakudo)
so the Rat type already has an arbitrary precision limit on the low end 21:39
the assumption here is that most future CPUs will support efficient 64-bit integer ops 21:40
sorear wonders about efficient gcs
gcd 21:41
TimToady which is why the spec allows it to be done lazily
rokoteko TimToady: heh. yes. as far as they extend the precision by ALUs. 21:42
but why not to make the programmer know when she's switching to approximations?
TimToady it's not often that she will run into it, when the threshold is 1/2**64 21:43
rokoteko yes, but by the current spec, if or when that happens, how is ones supposed to know?
TimToady if you want to be sure, do your calculations in FatRats instead 21:44
rokoteko earlier I was thinking about class Approximate extends FatRats. when FatRats fall out of scope, the programmer would know.
TimToady that sounds non-liskovian 21:45
sorear TimToady: what happens when a trancedental function is called on (Fat)Rat?
TimToady then the type model is transcended :) 21:46
rokoteko wtf is liskonian?
TimToady it doesn't sound like Approximate is actually extending FatRat 21:47
PerlJam rokoteko: google Barbara Liskov 21:48
colomon rokoteko: If Rat math results in an approximation, the result is a Num. That works now, and it's easy to check and see if you have a Num instead of a Rat.
rokoteko Int, Rat, Float etc are all Nums, right? 21:53
TimToady no
they're all Numeric
rokoteko ah. what exactly is a Num then?
TimToady floater
likely double 21:54
rokoteko "floater" as in "more than a float" ?
TimToady when I say "flaoter" I mean generic floating-point as opposed to single precision
s/ao/oa/
rokoteko ok, but you'd never know if it actually is an exact result or honestly just an approximation? 21:55
TimToady see S02:683 21:56
rokoteko I will, thanks.
TimToady and this is different from the entire world of fp calculations today how?
rokoteko no there's no difference compared to the current implementations. 21:57
PerlJam TimToady: there are no exact results in floating point calculations today ;)
moritz_ there are, actually
if you use them as integers in the range where the mantissa is enough
TimToady there's no easy way of telling if you've gotten into approximations, is the point 21:58
PerlJam moritz_: sure, but in the general case, you have to pretend that isn't true to maintain the proper skeptical view of the numbers you get
TimToady you can't even look at an integer floater and know that it was exact
it might have really been 42.00000000000000000000000000000000000000000000000001 21:59
rokoteko TimToady: if you got 1/(2**64-1) as your smallest number you got. then wouldnt be falling out of that precision being an approximate?
TimToady yes, what of it?
rokoteko TimToady: what? I was referring to: 22:00
23:58 < TimToady> there's no easy way of telling if you've gotten into approximations, is the point
TimToady life is hard
rokoteko isnt that an easy way, limit your maximum and what is falling outside that is an approximation? 22:01
TimToady I don't think this is a killer feature that would be a disruptive technology
there is no maximum precision; Int is arbitrarily big
rokoteko Ok. Im just throwing out ideas here, I thought that's all perl6 was all about. not nailing the spec to a wall and every one kneeling at front of it. 22:02
TimToady I haven't seen that happening lately :P
sorear the spec isn't important, users are 22:03
TimToady but it's absolutely not true that perl6 is just about throwing ideas around
sorear show me a legitimate use case for a super-rich numeric hierarchy and I'll consider implementing it
TimToady we'll never get anywhere that way
and the point of the current design is that looks close to practical for users 22:04
PerlJam rokoteko: read the last paragraph of perl6advent.wordpress.com/2010/12/2...-synopses/ :-)
rokoteko I was trying to participate in the discussion. 22:05
TimToady well, that also involves dealing with any pushback :) 22:06
you wanted an easy way to tell if you have an approximation, and ~~ Num is currently that way, and we're not sure what more you want 22:08
so you'll need to clarify
PerlJam actually, I thought he wanted an "automated" method to let the programmer know when they've strayed into the dangerous land of approximation. 22:09
rokoteko my maint point is that I think floats are pretty much bad design.
moritz_ they aren't. They are just bad design for certain applications
rokoteko if building a new language why not to get rid of them, as far as you can go.
1/64 should be small enough for the regular users. 22:10
rokoteko if you need to go smaller fall to Approximate. 22:10
erm. 1/64**2
TimToady but if you want smaller, you're going for Exact
== FatRat
rokoteko 1/65**2 is a FatRat? 22:11
TimToady and very likely slow, if there's any multiplication
FatRat can hold 2 ** -65
moritz_ can't it hold arbitrary fractions? 22:12
TimToady it can hold any Int / Int
or maybe Int / Uint
sjohnson cute datatypes
flussence
.oO( I sense "is native('libgmp')" appearing somewhere in the future )
rokoteko TimToady: and, as you wasnt here follow, I wasnt curious about the performance. about getting the actual result or knowing that it actually is an approximation. 22:13
PerlJam flussence: actually, I'd like that to be as invisible as possible for the most part.
rokoteko .. weren't here earlier to follow the discussion.. # pardon my hectic typing
TimToady I backlogged 22:14
and we already answered the knowing question
that's Num vs (FatRat)
(Fat)Rat
flussence rakudo: use FatRat; # will this explode? 22:15
p6eval rakudo cae7f9: OUTPUT«===SORRY!===␤Unable to find module 'FatRat' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval/p1/lib/parrot/2.10.1-devel/languages/perl6/lib␤ .)␤»
TimToady nyi
rokoteko ok. I hear you.
what is actually Num then?
sorear ah, the innocence of youth.
moritz_ rokoteko: Num is a floating point
double precision, iirc
flussence rakudo: use Int; # just curious 22:16
p6eval rakudo cae7f9: OUTPUT«===SORRY!===␤Unable to find module 'Int' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval/p1/lib/parrot/2.10.1-devel/languages/perl6/lib␤ .)␤»
rokoteko Num is a class and Numeric is a role? 22:17
PerlJam Now that the pugs repo is split up, it seems it takes me about 2-3 tries to locate the appropriate repo for whatever it is I wanted to lookup.
sbp rakudo: sub postfix:<!> { [*] 1..$^n }; say 27**(86!) > (27**86)!
p6eval rakudo cae7f9: OUTPUT«(timeout)» 22:18
sbp what's the fastest factorial implementation in perl6?
PerlJam sbp: fastest by what measure?
moritz_ sbp: probably calling a C library through NCI
TimToady probably an array lookup :) 22:19
PerlJam sbp: the quickest to type is probably sub fact($n) { [+] 1..$n }
sbp PerlJam: least likely to timeout in the above calculation
[+]?
PerlJam oops
looks like I can't type what I'm thinking
TimToady well, it's faster than [*] :)
PerlJam heh 22:20
sbp hehe
cf. mrob.com/pub/perl/hypercalc.txt
# But no other calculator can tell you that
# (27 ^ 86) ! = 10 ^ (1.534607.. x 10 ^ 125)
# or that
# 27 ^ (86!) = 10 ^ (3.467778.. x 10 ^ 130)
it uses Logarithmic Number Systems to store large numbers 22:21
TimToady pugs: sub postfix:<!> { [*] 1..$^n }; say 27**(86!) > (27**86)!
p6eval pugs: OUTPUT«*** ␤ Unexpected "!)"␤ expecting "_", fraction, exponent, term postfix, operator or ")"␤ at /tmp/YEzSH8g6dJ line 1, column 44␤»
TimToady pugs: sub postfix:<!> ($n) { [*] 1..$n }; say 27**(86!) > (27**86)! 22:22
flussence am I right in assuming the "use Int;" I did above should've been a no-op?
p6eval pugs: OUTPUT«(timeout)»
moritz_ is 'use Int' specced?
flussence or "use $anybuiltintype", really 22:23
moritz_ hrm
moritz_ wonders how that's going to be implemented, if at all
moritz_ starts a spectest run and goes off to sleep
sbp if you called Block "Perl" instead, you... you can see where I'm going 22:25
why doesn't this exist? perlcabal.org/syn/S26.html 22:39
rokoteko isnt 'use Int' implied? when would you need to re-use it?
sbp all the other synopses have HTML counterparts
Tene sbp: S26 is written in the language it describes, instead of Perl 5 POD, iirc. 22:40
rokoteko Anyhow. need to work tomorrow. Thanks to all of you for a very interesting chat and see you around. :)
Sleep tight, don't let the bed bugs bite!
Tene Since there aren't tools to work with the language described in S26, there's nothing to use to produce an html version, etc. 22:41
github.com/perl6/specs/blob/master...tation.pod for example
tries to render as p5 pod, but fails badly
sbp so the Rosetta Stone turns out to be a manual for reading hieroglyphics?
Champollion would be amused
"'=begin' only takes one parameter, not several" — oh, how wrong thou art my noble githubby friend, welcome to the future. so I'm sure somebody's written some p6 pod gear somewhere? 22:43
22:44
> 3. Can I just rename S26.pod to perl6pod.pod and be done with it? :)
S26.pod is intended as a reference (but quite readable, if I remember
correctly). It's certainly a good start, maybe at some later point we
might want to have something more tutorial-style.
Moritz in www.nntp.perl.org/group/perl.perl6....34065.html
well I didn't find any p6 pod stuff 22:46
but I did find this, which is rather nifty:
search.cpan.org/~lichtkind/Perl6-Do...rl6/Doc.pm
lue ohai world o/ 23:21
sbp hi lue 23:22
Tene sbp: there's been a huge amount of bikeshedding over it on the list
sbp imagines a gaggle of lizards with bicycles for tails 23:23
any results? 23:24
sorear Tene: all of the synopses are written in pod6; S26 just uses more advanced features (semantic tables, iirc) 23:25
Tene sorear: 'k 23:27
sbp sorear: all the other synopses use a subset of pod6 syntax which is backwards compatible with pod5 I assume?
sorear looks like it 23:29
sorear I know 'grok' works fine on the other synopses; I might just be getting fooled by a failover 23:29
hi masak!
masak ahoy, #perl6.
TimToady: do you want to write something for Advent slot #24? 23:30
something on the topic of community hacking, for example.
rakudo: say "nonexistent".IO.f 23:33
p6eval rakudo cae7f9: OUTPUT«Bool()␤»
masak moritz_++ was right to reject my last bug report.
but I think this is a bug.
should be Bool::False. 23:34
...that would fix the spectest that fails with the simpler Bool.Bool method which would allow me to put that simplifying patch in.
sbp rakudo: say "nonexistent".IO ~~ :e 23:35
p6eval rakudo cae7f9: OUTPUT«Bool::False␤»
flussence so... is anyone currently working on a pod6tohtml?
masak flussence: there's one on CPAN. TheDamian wrote it.
it's pretty good.
not altogether up-to-date, but good enough. 23:36
sbp does it work on S26?
masak probably not without some tweaks, no.
but try it and see.
masak I still plan to submit a grant application for some S26/Rakudo work. I have the grant application draft gist somewhere if anyone's interested. 23:37
sorear std: my $f = { last LOOP; }; LOOP: loop { $f() }
p6eval std 625303c: OUTPUT«===SORRY!===␤Illegally post-declared type:␤ 'LOOP' used at line 1␤Check failed␤FAILED 00:01 121m␤»
sorear std: my $f = { last lOOP; }; lOOP: loop { $f() } 23:38
p6eval std 625303c: OUTPUT«===SORRY!===␤Illegally post-declared type:␤ 'lOOP' used at line 1␤Check failed␤FAILED 00:01 121m␤»
masak sorear: read the error message. :)
sorear I thought that error message was influeced by case for some reason
masak no, it's influenced by the programmer illegaly post-declaring a type. :P 23:39
masak stops being a smart-aleck 23:40
flussence does Pod6 specify a default charset? The S26 on github has some �s appearing in the source, and my browser thinks it's utf8. 23:41
masak hm, Pod6 ought to abide by the same encoding rules as the rest of Perl 6. 23:42
flussence oh, shows up as «» with iso8859-1 encoding...
“By default, Pod assumes that documents are Unicode“
masak yeah, just found that too.
flussence guess the file itself needs fixing :) 23:43
masak not surprised
I probably touched it last, so might have been me mucking it up.
masak sleep & 23:46
sbp =encoding punycode 23:47
flussence that's just evil :)
sbp heh, heh
lue happens to be starting to create a Unicode font. Let's see how long that dream lasts :) 23:54