»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
Timbus n: sub ispow2 (int i) { !( i +& i-1 ) }; say ispow2(7); say ispow2(8); 00:04
p6eval niecza v17-12-g8b5d5e7: OUTPUT«===SORRY!===␤␤In parameter declaration, typename 'int' must be predeclared (or marked as declarative with :: prefix) at /tmp/PmWmFI6b4q line 1:␤------> sub ispow2 (int⏏ i) { !( i +& i-1 ) }; say ispow2(7); sa␤␤Parse fai…
Timbus oh
n: sub ispow2 (Int i) { !( i +& i-1 ) }; say ispow2(7); say ispow2(8);
p6eval niecza v17-12-g8b5d5e7: OUTPUT«===SORRY!===␤␤Lexical i is not a package at /tmp/rM4m6siIlR line 1:␤------> sub ispow2 (Int i⏏) { !( i +& i-1 ) }; say ispow2(7); say ␤␤A type must be provided at /tmp/rM4m6siIlR line 1:␤------> sub ispow2 (Int i[…
Timbus man i have Not bee programming in perl lately 00:05
it shows
n: sub ispow2 (Int $i) { !( $i +& $i-1 ) }; say ispow2(7); say ispow2(8);
p6eval niecza v17-12-g8b5d5e7: OUTPUT«False␤False␤»
Timbus rude
gfldex n: sub ispow2 (Int $i) { !( $i +& ($i-1) ) }; say ispow2(7); say
p6eval niecza v17-12-g8b5d5e7: OUTPUT«===SORRY!===␤␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/rNrFA90XlF line 1 (EOF):␤------> !( $i +& ($i-1) ) }; say ispow2(7); say⏏<EOL>␤␤Un…
Timbus are you sure thats a bitwise op
gfldex n: sub ispow2 (Int $i) { !( $i +& ($i-1) ) }; say ispow2(7); say ispow2(8);
Timbus oh 00:06
p6eval niecza v17-12-g8b5d5e7: OUTPUT«False␤True␤»
Timbus ooh it needed a bracket
gfldex n: sub ispow2 ($i) { !( $i +& ($i-1) ) }; say ispow2(7); say ispow2(8); say ispow2(4.0);
p6eval niecza v17-12-g8b5d5e7: OUTPUT«False␤True␤True␤»
gfldex n: sub ispow2 ($i) { !( $i +& ($i-1) ) }; say ispow2(7); say ispow2(8); say ispow2(4.4);
p6eval niecza v17-12-g8b5d5e7: OUTPUT«False␤True␤True␤»
Timbus ewwww
put the int back. put it baaack! 00:07
gfldex :)
r: sub ispow2 (int $i) { !( $i +& ($i-1) ) }; say ispow2(7); say ispow2(8);
p6eval rakudo 5f7d68: OUTPUT«False␤True␤»
Timbus oh yeah i forgot int works now 00:08
gfldex r: my $i = 4; my $f = 4.4; say $i.WHAT, $f.WHAT, ($i +& $f).WHAT; 00:19
p6eval rakudo 5f7d68: OUTPUT«Int()Rat()Int()␤»
gfldex i think that type cast is wrong and should a) blow up the programmer involed or b) give a warning/fail 00:20
actually i will speel over it 00:21
good night
colomon n: my $i = 4; my $f = 4.4; say $i.WHAT, $f.WHAT, ($i +& $f).WHAT;
p6eval niecza v17-12-g8b5d5e7: OUTPUT«Int()Rat()Int()␤»
colomon n: my $i = 4; my $f = 4.4; say $i.WHAT, $f.WHAT, $i +& $f; 00:24
p6eval niecza v17-12-g8b5d5e7: OUTPUT«Int()Rat()4␤»
colomon gfldex: the spec is very specific that both arguments to +& are converted to Int 00:26
sorear gfldex: I love that typo(?)
gfldex that's why i need sleep i suppose
anyway, even if the spec is specific, i still don't like that type cast because it's very easy to do it wrong/by exident. 00:27
i prefere compilers that hold my hand while i speel
gfldex is gone for real
colomon sorear: so far my ABC changes make the code much nicer, but not one lick faster 00:28
sorear 16:11 < colomon> errr, no, that didn't help at all. darn it, parses are fast in niecza.
by 'parses', do you mean Grammar.parse?
colomon ABC::Grammar.parse, in particular 00:29
gack, I'm glad I made the changes I made tonight, but I need to figure out some sort of profiling I can use, instead of just randomly trying stuff. 00:35
sorear maybe play with times() 00:38
colomon: fwiw, my plan for the coming month is to try to move the entire compiler into C# and do away with the bootstrap system 00:43
colomon sorear: I'm not sure what you mean by that? What would the advantage be? 00:44
colomon is almost out of laptop battery
colomon but can always backlog when he gets home... 00:45
Huh. My last change seems very unreasonably slow... 00:49
sorear: is there a .NET profiler that might work?
sorear There is a Mono profiler, but it is minimally useful with Niecza 00:50
mono --profile .... ; mprof-report output.mlpd
colomon huh. somehow my last change seems to have utterly killed my speed. 00:51
I would have thought it was trivial...
thanks for the profile info.
sorear What was the last change?
colomon switch from using log(2).Int to see if a number was a power-of-two to doing a hash lookup on a list of "reasonably" powers of two 00:52
was getting worried that log(2).Int might well glitch occasionally. 00:53
huh, even reverting that still seems slow.
2 mins battery, doubt it's going to finish before I run out.
sorear do you know the $a +& ($a - 1) trick?
colomon if it == 0 it's a power of two 00:54
?
sorear hash lookup sounds slow - converting a number to a string will be much slower than a single FLOG instruction
yes
colomon brill
I certainly learned that once, but had completely forgotten it. sorear++
sorear I'm fed up with the restrictions that the bootstrap system imposes. I'll talk more later if you want
colomon cool. 00:55
araujo in a type like: "Array:D $arr" , what does the ":D" mean? 01:00
geekosaur must be defined, I think
araujo aah I see, thanks geekosaur 01:05
dalek blets: 0380e8c | (Herbert Breunung)++ | docs/tablet-2-basic-syntax.txt:
enrich tablet 2 with links and some simpler wordings
01:29
araujo Placeholder variable cannot override existing signature 01:33
araujo when trying to define a multi, don't know what's wrong 01:34
sorear you're trying to use a placeholder in a sub with a signature
this won't work.
std: sub foo($bar) { return $^quux } 01:35
p6eval std 8632387: OUTPUT«===SORRY!===␤Placeholder variable $^quux cannot override existing signature ($bar) at /tmp/DmCRcrMEPM line 1:␤------> sub foo($bar) { return ⏏$^quux }␤Potential difficulties:␤ $bar is declared but not used at /tmp/DmCRcrMEPM line…
araujo mm i see 01:42
thanks sorear
araujo rakudo: 1 + 1 02:07
p6eval rakudo 5f7d68: ( no output )
araujo rakudo: say 1 + 1 02:08
p6eval rakudo 5f7d68: OUTPUT«2␤»
araujo rakudo: my @arr = [1,2,3] ; say "-> $_" for @arr
p6eval rakudo 5f7d68: OUTPUT«-> 1 2 3␤»
araujo mm..
is that actually iterating over each of the array elements? 02:09
colomon o/ 02:23
sorear o/ colomon 02:24
colomon back home and plugged in now. :) 02:25
sorear araujo: Yes. There's only one of them.
r: my @arr = [1,2,3] ; say @arr.perl
p6eval rakudo 5f7d68: OUTPUT«Array.new([1, 2, 3])␤»
sorear r: my @arr = [1,2,3] ; say @arr.elems
p6eval rakudo 5f7d68: OUTPUT«1␤»
sorear r: my @arr = (1,2,3) ; say @arr.elems # I think you may have wanted this
p6eval rakudo 5f7d68: OUTPUT«3␤»
araujo mmm... 02:26
sorear [] boxes up the list into an item-like array reference
araujo r: [1,2,3].elems
p6eval rakudo 5f7d68: ( no output )
sorear you then assign a single item to @arr
araujo r: say [1,2,3].elems 02:27
p6eval rakudo 5f7d68: OUTPUT«3␤»
sorear my @arr = [1,2,3] is like my @arr = "123". the = doesn't look inside either one
araujo I see
sorear, well, the thing is that I already have this array reference 02:29
what is the proper way to iterate over each element there?
r: my $arr = [1,2,3] ; .say for $arr.Array 02:31
p6eval rakudo 5f7d68: OUTPUT«1␤2␤3␤»
araujo I guess that is it ...
sorear, other way to get similar result? ^^
sorear araujo: for @$arr
araujo thanks sorear 02:32
sorear I don't think $arr.Array should necessarily have that effect, btw
seems to me 'coerce to array' and 'mark reference as unpackable' are orthogonal ideas
colomon sorear: BTW, switching to your suggestion for is-power-of-two has the speed back up to where it was before. 02:39
colomon 'night 03:13
moritz \o 04:48
adu hey
so I noticed something 04:49
PGE errors when you try to use {*} 04:50
moritz it predates that syntax 04:51
[Coke] mentions _the auror's tale_ video for those that like HP fanfic. 05:02
PGE is super old, and probably should not be used. 05:03
PGE has been replaced by nqp which was replaced by nqp-rx which was replaced (in theory but not in parrot) by nqp (which is not the same as the old nqp)
this whole "organic growth" thing really makes things confusing. 05:04
adu [Coke]: interesting 05:18
I'm tempted to rewrite PCT 05:19
[Coke] adu: pretty sure someone in #parrot is working on that. 05:29
so, just check for what's in progress before jumping in.
also, WHY AM I NOT ASLEEP. 05:30
adu lol
indeed
sorear phenny: tell masak erikdemaine.org/papers/NCL_TCS/paper.pdf - §4.2, the rectangular version of t4 ("Rush Hour") is PSPACE-complete. 06:47
phenny sorear: I'll pass that on when masak is around.
sorear phenny: tell masak Call a t4-puzzle /restricted/ if it has no blocks in the (say) left-right orientation. 06:48
phenny sorear: I'll pass that on when masak is around.
sorear phenny: tell masak Restricted t4-puzzles are in one to one correspondence with Rush Hour puzzles, and are solvable iff the corresponding Rush Hour puzzle is. Proof left as an exercise to the reader 06:49
phenny sorear: I'll pass that on when masak is around.
sorear phenny: tell masak ergo, t4 (with the usual size generalization caveat) is PSPACE-complete
phenny sorear: I'll pass that on when masak is around.
araujo hello 09:24
sorear o/ araujo 09:27
araujo hi sorear o/ :)
sorear, do you know if/where there is a perl6 mode for emacs ... or probably vim? ... 09:31
sorear alester has one on github
it doesn't work very well though... nothing can parse Perl 6 but perl6 09:32
even moreso than Perl 5
also really slow
araujo will have to write a perl6 text editor then 09:33
sorear that would be even slower. (it has been done, btw) 09:35
oh, and: have fun with error recovery.
I might try writing a Perl 6 syntax highlighter sometime. I think it's impossible, but I'm open to trying it :D 09:36
araujo hehe 09:39
it doesn't look like an easy thing to do ... 09:40
moritz github.com/petdance/vim-perl fwiw 09:43
araujo hey moritz o/ 09:44
nice
sorear oh right, the other andy
...or maybe it is the same one 09:45
o/ moritz
moritz the same one, unless you're talking about a different andy :-) 09:48
dalek ecza: 2de0e52 | sorear++ | src/NieczaActions.pm6:
Make $¢ available to ** closures (fixes #123)
09:49
sorear dougherty(sp) ? 09:54
sleep& 09:55
sergot hi o/ 10:17
jaffa4 hi 12:41
Is there a Perl 6 code formatter?
JimmyZ thinks there will be 12:55
moritz uses vims auto-indenting to format Perl 6 code 13:08
colomon sorear: woah, turns out my most efficient optimization so far was switching to mono 2.10.9 (previously 2.10.2) -- that shaved about 25% off my running time 13:36
sorear good * #perl6 14:50
moritz \o sorear
sorear colomon: ping 14:52
colomon ponf
errr, pong
colomon was just studying www.mono-project.com/Performance_Tips
sorear colomon: the 'Allocation' numbers are not max-residency; they are simply the number _allocated_ without regard for garbage collection 14:54
colomon sorear: yes, I was figuring that out.
sorear the idea is that, if you have 80% of time spent in the GC, they are more useful than the 'real' time profile, because they tell you _who to blame for the GC runs_ 14:55
nice, it looks like ABC is almost entirely non-recursive 14:56
this makes things much easier
colomon sorear: ah 14:59
colomon may be in and out a bit here, have a bored 3-year-old that needs entertaining 15:00
sorear colomon: why do you need to use .eval in abc2ly.pl?
colomon it's for converting rational strings to Rats, I think
strings like "4/4" and "1/8" 15:01
I'm never clear on exactly what is needed to do that. 15:02
sorear unless your evals are recursing and screwing up the counts, it looks like 107 s out of 129 total are being spent within eval calls
colomon !!!!!!!
sorear n: say "2/8".Numeric.perl
p6eval niecza v17-13-g2de0e52: OUTPUT«<1/4>␤»
moritz r: say '2/8'.Numeric.perl
p6eval rakudo 5f7d68: OUTPUT«1/4␤»
colomon sorear: I find it really hard to believe that's the problem, but it's easy enough to test! 15:03
holy crap, that was it! 15:04
moritz suddenly fast?
colomon let me make sure it actually worked
moritz r: gist.github.com/2134734 15:06
p6eval rakudo 5f7d68: OUTPUT«Just another Perl»
colomon sorear, moritz: That run was literally 10x faster than my best time from yesterday
and appears to have worked perfectly.
moritz n: gist.github.com/2134734
p6eval niecza v17-13-g2de0e52: OUTPUT«Just another Perl»
moritz takes about 5.5s on niecza and 4s on rakudo locally 15:07
and yes, uses a few eval calls 15:08
colomon And mind you, with the new version, more than half of the time is the niecza start-up. 15:09
colomon so, that bigger ABC file that was running for 15+ minutes and then dying? Just fully executed in 33 seconds. 15:14
sorear++ sorear++ sorear++ moritz++
moritz didn't do anything 15:18
colomon moritz: was hanging around #perl6 at just the right time to get caught up in the joy 15:19
colomon That was 50 pages of (dense) printed sheet music. 15:19
seriously, that just went from nearly unusably slow except for very small projects to perfectly fine for hard core real world use. 15:21
now I just need to implement more features.
:)
sorear deletes the profile. 15:22
colomon sorear: do you normally expect .eval to be so slow? it wasn't even in the inner loop of my program, it was happening three times per bar of music, and only just on strings of the form "N/M". 15:27
sorear colomon: It's even slower than I thought, but not by enough to make me suspect bugs 15:51
moritz eval(few-char strings) takes about 0.2s on my machine (with niecza) 16:00
moritz n: say 'a' ~~ /<.wb>/ 16:21
p6eval niecza v17-13-g2de0e52: OUTPUT«Unhandled exception: Unable to resolve method wb in class Cursor␤ at /tmp/tTSjthtnT9 line 1 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2818 (Regex.ACCEPTS @ 4) ␤ at /tmp/tTSjthtnT9 line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.…
moritz n: say 'a' ~~ /<|w>/
p6eval niecza v17-13-g2de0e52: OUTPUT«===SORRY!===␤␤Action method assertion:sym<|> not yet implemented at /tmp/WSsQBLiW6o line 1:␤------> say 'a' ~~ /<|w⏏>/␤␤Unhandled exception: Unable to resolve method oplift in class Any␤ at /home/p6eval/niecza/src/RxOp…
TimToady sorear: maybe the GC is clearing out stuff you'll need for the next eval? 16:29
sorear TimToady: niecza has no garbage-collectable caches 16:39
eval does a lot of high-overhead stuff internally, like loading code into the clr 16:41
buubot_backup sorear: ERROR: Can't locate object method "the" via package "clr" (perhaps you forgot to load "clr"?) at (eval 20) line 1.
pmurias sorear: hi 16:55
sorear: why do you plan on rewriting niecza to C#? performance? 16:56
sorear: and what do you intend to use for parsing? 17:02
geekosaur [19 20:54] <sorear> I'm fed up with the restrictions that the bootstrap system imposes. I'll talk more later if you want 17:05
fwiw
[hds] @*INC specified where to look for modules, doesn't it? 17:06
moritz yes
r: say @*INC.perl;
p6eval rakudo 5f7d68: OUTPUT«Array.new("/home/p6eval/.perl6/lib", "/home/p6eval/nom-inst2/lib/parrot/4.4.0-devel/languages/perl6/lib")␤»
moritz r: use lib 'somewhere else'; say @*INC.perl; 17:07
p6eval rakudo 5f7d68: OUTPUT«Array.new("somewhere else", "/home/p6eval/.perl6/lib", "/home/p6eval/nom-inst2/lib/parrot/4.4.0-devel/languages/perl6/lib")␤»
[hds] ahhh, I can just do that!
I'd forgotten about that.
moritz it's pretty new in rakudo :-)
you can also call perl6 -Iotherdir yourscript.pl 17:08
[hds] ahh, cool.
jaffa4 hi
[hds] moritz++ cheers.
jaffa4 Di you know a formatter for Perl 6?
moritz jaffa4: I use vim for indenting 17:09
jaffa4 ok 17:11
dalek p: 770e9f2 | moritz++ | src/Regex/P6Regex/ (2 files):
implement <|w> and <|c> regex assertions
17:12
p: 31fdcee | moritz++ | / (3 files):
oops, should have implemented <|w> in qregex right away. With basic tests this time
sorear pmurias: performance (build), performance (startup), performance (compiling), performance (memory load), simplify build, simplify release, increase options for metaprogramming 17:13
moritz sorear: I'm curious if/how you can avoid the downsides of not bootstrapping 17:15
things like non-Perl 6 values leaking out, different calling conventions etc. 17:16
(not saying you shouldn't do it, just curious, because rakudo moves in the opposite dirction)
sorear moritz: right now, the compiler in effect uses 'non-Perl 6 values' - they are Perl 6 values, but from different instantiations of the types, because the compiler needs to have Str et al up before it can parse a single line of code 17:21
there is a horrendously complex glue layer that maps compiler versions of types to runtime versions and vice versa. Metaprogramming requires expanding the glue layer, which is a large part of why things like $class.^methods don't work in niecza
moritz ah, I already wondered 17:22
because for role composition you need that info somewhere
sorear removing the bootstrap would not make the situation *worse*
as for parsing, that's the detail I have least figured out 17:24
I think it will involve a C# mini-parser that can parse a simplified version of STD 17:25
by 'simplified', I mean 'to the point where it doesn't need anything in CORE to run'
so the build procedure would look something like this: 17:26
1. build the C# components
2. mono run/Niecza.exe -C CORE
2a) the bootstrap classes and methods (e.g. Sub, Str, Regex, Grammar) are installed 17:27
2b) the mini-parser parses and loads STD
2c) the loaded STD is used to parse and compile CORE 17:28
2d) CORE and STD are saved into CORE.dll, CORE.ser
3. mono run/Niecza.exe -e 'say "Hello, world"'
3a) CORE.ser/CORE.dll is loaded
3b) STD, which is now in memory, is used to parse your code
moritz so there will still be a fair amount of stuff written in Perl 6 17:29
sergot hi :) 17:34
moritz hi sergot
sorear hi.
moritz sorear: which parts that are now written in Perl 6 will then be written in C#? 17:35
sorear moritz: src/*.pm6 except src/STD.pm6 17:35
moritz so, about 8k lines of p6 code 17:37
dalek kudo/nom: e8480cd | moritz++ | / (2 files):
bump NQP revision to get <|w>, <|c>

also remove those assertions from ROADMAP
17:50
colomon "so, about 8k lines of p6 code" !!! 17:51
moritz I've silently dropped <|g>, because it doesn't make much sense on our current Unicode abstraction level
[hds] Where's the best place to read about the current state of date/time manipulation and (especially) formatting at the moment? 18:15
moritz [hds]: github.com/rakudo/rakudo/blob/nom/...emporal.pm 18:16
[hds] ahhh, it's called Termporal, that's why I couldn't find it. Thanks!
moritz and perlcabal.org/syn/S32/Temporal.html for the specs 18:17
sorear colomon: !!! in what sense? 18:18
colomon sorear: big change to make 18:19
moritz should probably learn C# at some point 18:20
colomon moritz: it's pretty much exactly what you would expect, except more powerful and more annoying. :) 18:28
pmurias sorear: nam will no longer be serialized as json after the change? 18:31
sorear I'm hoping nam can be killed off entirely. 18:34
pmurias the change appears to make sense 18:35
but it seems a lot of boring work ;)
jaffa4 What is alpha class exactly? 18:48
moritz I just hope it can be done incrementally, not in a single huge step 18:49
jaffa4: all characters of classification 'L' (Letter), plus the underscore
jaffa4 ok 18:50
tadzik 'evening 18:57
moritz \o tadzik
tadzik moritz: o/
moritz tadzik: it seems that panda bootstrap is agian a bit broken :(
tadzik ah, yeah, heard about it
will get to it once I fix myself a bit 18:58
moritz ok :-)
araujo greets around 21:18
sorear o/ araujo 22:02
araujo hello sorear o/ 22:03
how that goes?
what exactly does the '.=' assignment operator? .... I see it mainly in classes generations
Juerd $foo += $bar; # same as $foo = $foo + $bar; 22:04
$foo.=bar; # same as $foo = $foo.bar;
Possibly optimized.
tadzik does 'curl feather.perl6.nl:3000/list' work for you? 22:05
Juerd Curl succesfully reports that it couldn't connect to the host. 22:06
tadzik oh, reboot
araujo mmm...
Juerd tadzik: crontab -e, add a line beginning with @reboot
tadzik I shall, thanks 22:07
Juerd Make sure that the program can run without a login environment. For example, by writing a shell script that exports things like your preferred PATH, and then does an exec. 22:07
tadzik is @reboot perl /home/tjs/modules/bin/app.pl fine? 22:08
araujo I see, thanks Juerd
rakudo: my $d ; $d.new
p6eval rakudo e8480c: ( no output )
araujo rakudo: my $d ; say $d.new
Juerd tadzik: If it's executable and can run under a relatively clean environment
p6eval rakudo e8480c: OUTPUT«Any.new()␤»
Juerd For example, you may want to chdir explicitly.
tadzik hm 22:09
I'll see if it'll break on the next reboot ;P
ha 22:15
I like how installing Term::ANSIColor takes roughly 10 seconds
dalek nda: 1d88346 | tadzik++ | ext/JSON/Tiny (3 files):
Update JSON in ext/
araujo multi's are private by default inside a class? ... I mean, they can/should only be accessed through methods? 22:22
sorear multi means multi sub 22:23
you can also write multi method
multi/only and sub/method are orthogonal
araujo sorear, I see .... 22:25
sergot good night! o/ 22:29
araujo sorear, I see, ... I was actually using the single 'multi'keyword inside the class, that didn't work ... it works with 'multi method' though 22:30
tadzik yay, Config::INI now works 22:37
dalek mentaler: a3995a9 | tadzik++ | template.tt:
Include some more statistics
22:56
tadzik new results on tjs.azalayah.net/new.html 22:57
we have more modules working than not working :)
jnthn evening, #perl6 23:02
jnthn safely back from $event 23:03
tadzik hello jnthn
felher o/ 23:04
sorear o/ jnthn
seen masak lattely?
aloha masak lattely was last seen in 15480 days 23 hours ago .
jnthn sorear: I've seen masak more recenlty than aloha ;) 23:06
sorear: I waved masak goodbye from the train about 20 minutes ago :)
araujo mmm... 23:26
how can I use the 'self' variable?, can't find an example in the wiki ....
basically I just want to invoke a method 23:27
jnthn self.the_method() ? 23:30
araujo jnthn, I still get confused with 'omitting' the () for method invocation :P 23:34
thanks
dalek kudo: d7f45ff | moritz++ | src/core/Cool.pm:
Cool.eval
kudo/nom: dca0fa6 | jnthn++ | docs/ROADMAP:
Remove a dupe entry, remove a completed entry and a couple of tweaks.
23:36