»ö« 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.
moritz_ good morning 08:10
tadzik good morning 08:30
jnthn drops a pin 11:55
moritz_ puts a haystack over the pin 11:58
kanu helo ppl 12:15
I have few question about p6 12:16
jnthn hi kanu 12:17
Feel free to ask. :_)
kanu emm.. is it true with perl6 we can translate our code to another languages? C for example? 12:18
jnthn There's no active work on this that I'm aware of. 12:20
That said, generally compilers turn the Perl 6 syntax into an AST of some kind. 12:21
Which is a good starting point for then transforming code to another language. But then there's the issue of runtime support.
What's more happening is that there's compilers targetting different VMs. 12:22
kanu jnthn: ok.. can you tell me how can a volunteer participate? I know few veteran C/Perl programmers.. 12:23
jnthn kanu: There's lots of different Perl 6-y projects going on, so it's mostly finding something that's interesting and talking to the people who're working on that area for ideas of what to do. :-) For example, there's various compiler projects, plenty to do on the test suite, documentation efforts, writing modules, and no doubt more. 12:27
www.perl6.org/ has some overview of various things going on.
jnthn I work on Rakudo and a meta-model / backends project called 6model, if either of those are interesting to you. :-) 12:28
www.perl6.org/getting-started/involved has some other ideas too
kanu great, one more note.. why is it currently too slow to run most our converted perl5 -> Perl6 programs? 12:29
rjbs Rakudo is still very slow, because it is being implemented only to be correct, not fast. 12:30
Once everything works, it can be made faster later. 12:31
jnthn kanu: I guess you're talking about Rakudo. The focus, as rjbs said, has been on actually getting stuff implemented at all.
Juerd How likely is it to become as speedy as Perl 5?
jnthn There's active efforts to make things faster now.
kanu jnthn: I guess I can ask my friends to help in that area then :)
jnthn: speed is our main concern at moment.. 12:32
sjn kanu: a good way to start is to recommend your friends to drop by here :)
kanu sjn: I surely will do. 12:33
jnthn: as jured asked.. Do you think it is going to be faster than perl5 once optimized? 12:34
jnthn That's an almost impossible question to answer without it being a bit more specific.
The answer is probably "yes" and "no". 12:35
I expect there's things we can do faster in Perl 6.
I suspect there's some things we may not be able to compete on.
The more interesting question is, "is this fast enough for me to do what I need to do in it" 12:36
jnthn And I'm confident that with enough work we'll get to that point. 12:36
kanu jnthn: I understand.. hats off for you guys.. :) Good luck 12:37
jnthn Thanks. :-)
jnthn walk & 12:42
masak oh hai! 12:45
moritz_ is in a twisted maze of IRC channels, all unlike each other 12:46
Kodi rakudo: grammar G { token TOP { a } }; class C { method TOP($/) { make (1, 2) } }; my $x = G.parse("a", actions => C.new); say ?$x; my ($a, $b) = $x.ast; say "$a;$b"; 12:49
p6eval rakudo 064702: OUTPUT«Bool::True␤1 2;Any()␤» 12:50
masak rakudo: grammar G { token TOP { a } }; class C { method TOP($/) { make 1, 2 } }; my $x = G.parse("a", actions => C.new); say ?$x; my ($a, $b) = $x.ast; say "$a;$b"; 12:52
p6eval rakudo 064702: OUTPUT«Too many positional parameters passed; got 2 but expected 1␤ in 'make' at line 5587:CORE.setting␤ in 'C::TOP' at line 22:/tmp/fbSihbDckq␤ in 'G::TOP' at line 22:/tmp/fbSihbDckq␤ in 'Grammar::parse' at line 6034:CORE.setting␤ in main program body at line
..22:/tmp/fbSihbDckq␤»
masak hm :)
moritz_ rakudo: grammar G { token TOP { a } }; class C { method TOP($/) { make (1, 2) } }; my $x = G.parse("a", actions => C.new); say ?$x; my ($a, $b) = $x.ast.list; say "$a;$b"; 12:52
p6eval rakudo 064702: OUTPUT«Bool::True␤1 2;Any()␤»
moritz_ rakudo: grammar G { token TOP { a } }; class C { method TOP($/) { make (1, 2) } }; my $x = G.parse("a", actions => C.new); say ?$x; my ($a, $b) = $x.ast.flat; say "$a;$b"; 12:53
Kodi Not long ago, that list assignment made $a == 1 and $b == 2, at least if you did @($x.ast) or so. I think it's the PARROT_REVISION bump that caused the change.
p6eval rakudo 064702: OUTPUT«Bool::True␤1 2;Any()␤»
moritz_ Kodi: I'd guess it was 5ce8fcfe541b6eb2426ea64247bf01998b0d5208 12:54
Kodi moritz_: I think you're right. 12:55
masak hm. I've hit what I think is the first real blocker in my weekend experiment. 12:58
moritz_ do tell 12:59
masak I've successfully altered the grammar and the actions, but I've no clue what to do with the PAST generation.
here it is, by the way: github.com/masak/rakudo-with-diagram-syntax
moritz_ what are you doing?
masak I'm introducing a DSL, as it were.
the hard way :)
oh well, I'll focus on making it parse, and tackle the PAST later. 13:00
moritz_ so, a custom metaclass with custom syntax?
masak yup. 13:01
masak that's all in place. well, except for the syntax within the 'element' curlies. 13:01
working on that now.
moritz_ would have started with smaller deviations from the standard language 13:02
masak I have this to say so far: there's no way to go about this *except* by small incremental changes. 13:03
moritz_ that's what I'd expected too 13:03
masak you think Rakudo at the user level is obtuse? try modifying the internals. :)
on the other hand, it's not much more complicated in practice than it would seem in theory. which is a good sign. 13:04
moritz_ the internals are .... delicated
s/d$//
masak .oO( "delectable" )
moritz_ actually I found the internals quite approachable, as long as one doesn't mess with stuff too close to parrot 13:09
masak aye. the Grammar.pm and Actions.pm have been very nice to work with so far. 13:10
except that one has to take small steps, or something unknown blows up somewhere. 13:11
mfollett++ # mfollett.com/15-minutes-of-fame
moritz_++
moritz_ I also find PAST not too bad
masak PAST seems very nice. 13:12
flussence If I wanted to go reading/writing/doing-stuff-with binary files, what's the best tool for that in rakudo? 13:15
moritz_ flussence: there's a Buf type
flussence: and a read(Int $bytes) methodin src/core/IO.pm 13:16
moritz_ and werite(Buf) too 13:16
moritz_ rakudo: say (<a b> >>~<< <a b c d e f g>) 13:21
p6eval rakudo 064702: OUTPUT«Sorry, sides are of uneven length and not dwimmy.␤ in 'hyper' at line 184:CORE.setting␤ in main program body at line 1␤»
moritz_ rakudo: say (<a b> <<~>> <a b c d e f g>)
p6eval rakudo 064702: OUTPUT«aabbacbdaebfag␤»
moritz_ rakudo: say (<a b> <<~>> <a b c d e f g>).perl
p6eval rakudo 064702: OUTPUT«["aa", "bb", "ac", "bd", "ae", "bf", "ag"]␤»
moritz_ github.com/moritz/perlgeek.de/blob/...ssages.txt # any comments before I publish it? 13:47
masak looks 13:49
Kodi moritz_: You may want to warn 'em about how a * at the end of an argument will complicate finding its length. 13:50
masak aye. 13:51
moritz_ Kodi: does that really matter? in the case of a * there won't be an error message
Kodi Then again, * isn't treated specially on the *non-dwimmy* side of a hyper.
Kodi I guess not, then. 13:52
LoRe moritz_: Please submit your patch to the
masak re "(probably named) parameter": I think I'd use a dynamically scoped variable for that; but there are pros and cons.
LoRe moritz_: just a typo ;)
masak ss/lack quite a bit/lags quite a bit/ 13:52
<p><strong>Update:</strong> There have been two submissions so far, challenge 13:53
closed.</p>
say what?
moritz_ ups
masak :)
moritz_ copied from the previous one 13:54
rakudo: say $*foo
p6eval rakudo 064702: ( no output )
masak well-known "internal error during 'say' call disappears" thing. contextuals in general work.
rakudo: my $*i = 0; sub foo { say "\\o/"; foo if ++$*i < 5 }; foo 13:56
p6eval rakudo 064702: OUTPUT«\o/␤\o/␤\o/␤\o/␤\o/␤»
masak rakudo: my $*i = 0; sub foo { say ++$*i; foo if $*i < 5; say --$*i }; foo 13:57
p6eval rakudo 064702: OUTPUT«1␤2␤3␤4␤5␤4␤3␤2␤1␤0␤»
masak rakudo: my $*i = 0; sub foo { say ++$*i; callsame if $*i < 5; say --$*i }; foo 13:57
p6eval rakudo 064702: OUTPUT«1␤Null PMC access in clone()␤ in 'foo' at line 1␤ in main program body at line 22:/tmp/VACBlcU230␤»
masak :( 13:58
rakudo: my $*i = 0; sub foo { say ++$*i; &*ROUTINE() if $*i < 5; say --$*i }; foo
p6eval rakudo 064702: OUTPUT«1␤Contextual &*ROUTINE not found␤ in 'foo' at line 1␤ in main program body at line 22:/tmp/s0e2RrX2wi␤»
masak rakudo: my $*i = 0; sub foo { say ++$*i; &?ROUTINE() if $*i < 5; say --$*i }; foo
p6eval rakudo 064702: OUTPUT«1␤Could not find sub &?ROUTINE␤ in 'foo' at line 22:/tmp/JuQAfo3hqx␤ in main program body at line 22:/tmp/JuQAfo3hqx␤»
masak ENEEDMOREDEVS 13:58
moritz_ blog post udpated... any objections to publishing? 14:03
masak all systems go.
moritz_ all systems gone :-) 14:04
jnthn moritz_: Ooh, nice idea for a task. :-)
moritz_ uhm, syntax error :( 14:04
fix pushed 14:07
perlgeek.de/blog-en/perl-6/contribu...sages.html
masak rakudo: grammar G is HLL::Grammar {}; G.parse("foo") 14:22
p6eval rakudo 064702: OUTPUT«No such attribute '$!hides'␤ in 'Grammar::parse' at line 1␤ in main program body at line 22:/tmp/FPMhP5vP89␤»
masak hardly a feature; is it a bug?
I have no idea what the $!hides attribute refers to.
jnthn Meta-model inconsistencies I suspect... 14:23
$!hides is related to the implementation of class Foo hides Base { ... }
masak right. 14:24
jnthn ClasHOW has it, but P6metaclass lacks it.
masak ah.
jnthn Something is making a bad assumption somewhere I guess.
It's probably something in the method dispatcher.
masak submits rakudobug
jnthn Anyway, it goes on the pile of "stuff that hopefully gets sorted out when the new meta-model lands"
jnthn (And yes, +1 on ticket to track it...though HLL::Grammar is not standard Perl 6 I guess.) 14:25
masak right.
but it's not supposed to happen.
moritz_ std: STD 14:29
p6eval std 263c207: OUTPUT«===SORRY!===␤Undeclared name:␤ 'STD' used at line 1␤Check failed␤FAILED 00:01 114m␤»
moritz_ so it's not self aware yet :-)
masak std: SKYNET 14:32
p6eval std 263c207: OUTPUT«===SORRY!===␤Undeclared name:␤ 'SKYNET' used at line 1␤Check failed␤FAILED 00:01 114m␤»
masak wipes brow
moritz_ rakudo: say (1, 2, 3) >>+<< [100, 200, 300] 14:43
p6eval rakudo 064702: OUTPUT«101202303␤»
dalek ast: e821049 | KodiB++ | S05-grammar/action-stubs.t:
Added tests for calling &make on lists.
15:43
kudo: d357695 | KodiB++ | src/core/Grammar.pm:
Made &make a list operator.
masak hm. seems a lot of spiders really want a robots.txt on my site. 15:47
any suggestions on what to put in such a file?
Juerd They don't want it
Typically they check for it, but prefer it not to be there.
masak they've been requesting it 416 times :)
Juerd Because absence of robots.txt will be interpreted as "I can do anything here"
masak what if I just create an empty file?
Juerd An empty file is semantically equivalent to a 404 15:48
for robots.txt, that is
masak but with fewer actual 404s.
Juerd Yes. If your boss wants you to keep the error count low, this helps.
Other than that I don't see the point.
masak it's my blog domain, so I'm my boss.
Juerd Why do the 404s bother you?
masak I'd like them to be signal, not noise. 15:49
Kodi I added a favicon to my site only because I got tired of seeing 404s in my Apache error log.
Juerd What's the obsession with logs?
Juerd I begin to read them when something's wrong 15:50
masak I like log statistics. they give a sort of feedback. 15:50
Juerd If I'd use them to *find out* that something is wrong, I would never sleep again. 15:51
Kodi Maybe because they're clogged with 404s for robots.txt. :P 15:51
Juerd 404s will continue to happen anyway. If not for robots.txt, then for bots that try to detect if you have vulnerable web software installed.
masak whee
I think I'll do something like this: thenextweb.com/shareables/2010/07/2...file-ever/ 15:52
:)
Juerd knows someone who reads whole syslogs, minus previously manually whitelisted lines.
lucas_ hi developers! I have some basic questions... 16:11
how pugs executes perl 6 code? directly executing the AST tree? 16:12
lucas_ is there any other implementations that execute de the AST tree directly, instead of generating bytecode? 16:12
is is possible to make perl 6 run on top of perl 5 vm? 16:13
*Is it possible...
tadzik I think pugs generates some internal bytecode too, but not sure 16:16
masak Pugs has a number of backends. 16:17
but ISTR that it could run directly off its AST.
lucas_ I will check out, thanks 16:21
masak about making Perl 6 run on top of the Perl 5 VM... I guess it's possible, but I know of no-one working on it.
it's an interesting idea. generating Perl 5 bytecode from Perl 6 source. 16:22
isBEKaml does p5 have a VM? I thought everything was internal to it and never exposed. Even the compiler and the interpreter are enmeshed that it's just convenient to call it interpreter. :) 16:23
yeah, it's an interesting idea, though.
tadzik I know of no language that does not have the VM. Maybe bash, as some tend to call this a language 16:24
lucas_ well, I was just refering to Perl 6 implementations... 16:25
but I recall ruby 1.8.6 was executing the AST directly
tadzik oh
isBEKaml In my understanding, all languages that claim to be portable does tend to have a backend that can run on their own target platforms. But that doesn't necessarily make it true enough to call them a VM. 16:26
lucas_: I was exactly thinking of it. Emitting some form of internal representation that p5 can execute.
(and I don't know anything more than that - ;) 16:27
isBEKaml phenny: tell phenny to go round the park. 16:35
phenny Hey, I'm not as stupid as Monty you know!
isBEKaml moritz_: ping 17:12
xivix What's the difference between evaluating with rakudo and std here? 17:18
Is std more complete?
masak STD is just a parser. Rakudo runs things. 17:19
as a parser, STD is slightly more complete.
xivix Yeah, I should have checked the FRONT PAGE OF THE WEBSITE before asking that.
But thanks.
masak happy to help.
xivix So rakudo doesn't use viv? 17:20
jnthn Rakudo has its own bootstrapped grammar engine. 17:21
And uses an AST called PAST.
xivix Oh, by the way, the the link on perl6.org to STD.pm is broken.
jnthn (so no, doesn't use viv)
masak xivix: thanks. STD.pm is now STD.pm6, so that's probably why it's broken. 17:24
xivix Okay. It seems it's also been moved from mu to std as well. 17:25
Unless it's in both.
masak you're right; the link needs updating in that way as well. 17:26
lots of repository-related changes lately :)
xivix Spring cleaning in the Fall.
masak just so.
isBEKaml masak: moritz_++ doesn't seem available and I'm about to fall off anytime soon.- so maybe, you could help me here. Str.flip is now significantly faster now that String reverse is available as a parrot call. I have been working on a benchmark to compare different approaches to Str.chomp. I'll soon publish the results. Can you see if there are any more that I missed? 17:37
masak isBEKaml: sure.
isBEKaml masak: colomon++ mentioned something along the lines of using substr for chomp very tricky particularly that TimToady apparently ranted against this usage. Still, I'm inclined to go with Str.flip. ;) 17:38
thanks.
masak I think what TimToady might have ranted against was the use of -1 as string indexing (like Rakudo does) rather than *-1 (as with arrays, like real Perl 6 should). 17:39
isBEKaml masak: yes, that one. 17:40
masak: gist.github.com/619356 17:41
that is somewhat old and the tests are not very accurate due to lesser runs between cycles.
masak looks
isBEKaml I ncreased it by a tenth for a better result - not on the gist. 17:42
jnthn: if you're on windows, can you run this to see what you get?
isBEKaml rakudo: my $str = "hello \r\n"; my $string= $str.flip.substr(0).flip; say $str.bytes ~ $str; say $string.bytes ~ $str; 17:43
p6eval rakudo d35769: OUTPUT«8hello
isBEKaml rakudo: my $str = "hello \r\n"; my $string= $str.flip.substr(0).flip; say $str.bytes ~ $str; say $string.bytes ~ $string;
p6eval rakudo d35769: OUTPUT«8hello 17:44
jnthn isBEKaml: I guess I need a latest Rakudo and the Benchmark module? 17:45
isBEKaml jnthn: not teh benchmark module. Rakudo atleast 2 days older would do fine.
you can run the p6eval code above. 17:46
I'm just interested in seeing how windows treats CRLF - a single or two bytes.
jnthn > my $str = "hello \r\n"; my $string = $str.flip.substr(0).flip; say $str.bytes 17:47
~ $str; say $string.bytes ~ $string;
8hello
oh, there's a blank line between the two
isBEKaml :(
jnthn My Rakudo is a little old though 17:48
Let me czech on latest...
isBEKaml czech czech it...
isBEKaml even then, that's not good. the substr must have been faulty. It doesn't seem to be 1 byte. 17:49
($it-CRLF) 17:50
isBEKaml Oh, bloody hell.. 17:52
sorry, replace substr(0) with substr(1).
rakudo: my $str = "hello \r\n"; my $string= $str.flip.substr(1).flip; say $str.bytes ~ $str; say $string.bytes ~ $string;
p6eval rakudo d35769: OUTPUT«8hello
isBEKaml jnthn: ^^
xivix Did the right guillemot not show up for you guys? 17:53
jnthn > my $str = "hello \r\n"; my $string = $str.flip.substr(1).flip; say $str.bytes 17:54
~ $str; say $string.bytes ~ $string;
8hello
7hello
isBEKaml: ^^
isBEKaml that's good. a newline inbetween?
jnthn Yes
xivix: Was missing for me too
isBEKaml blank line? the byte count reads fine.
jnthn isBEKaml: There was a blank line between the 8hello and 7hello
isBEKaml jnthn: so it isn't 1 byte as I thought. Danke. 17:55
masak: gist.github.com/631068 -- Results. it's just getting more weird. 17:57
masak looks 17:58
isBEKaml masak: I distinctly recall chomp and flip hovering at 10 and 59 earlier with runs reduced by a tenth. 17:58
masak what does the rightmost column contain? 17:59
isBEKaml masak: the average count of runs.
masak ah. now I see. 17:59
isBEKaml that's just (time taken in secs)/(number of runs) 18:00
masak it's just 1/10000... right.
.chop seems to be faster. I like that one best anyway.
isBEKaml you ran them too? 18:01
masak no. I'm looking at your results.
isBEKaml still .chomp with PIR implementations outruns them all. 18:02
masak aye. 18:10
masak lol, I blogged: strangelyconsistent.org/blog/extend...x-of-perl6 18:37
that concludes this weekend's little haxperiment.
nom & 18:38
sorear good * #perl6 18:59
dalek rixel: a4a483a | diakopter++ | sprixel/ (9 files):
begin compiling class definitions
20:00
diakopter um, oops 20:15
diakopter github.com/perl6/std/commit/ca5feb3...2878513f59 needs to be reverted I think 20:16
(would someone please help me revert it?) 20:17
flussence diakopter: try `git revert ca5feb368e44`? 20:18
diakopter hm, I'm using TortoiseGit
diakopter looks around for the msys shortcut 20:20
flussence just guessing, but it should have a log viewer somewhere with an option to revert somehow
at least, if it works like qgit...
(which doesn't actually have a revert option, but then it's only a viewer) 20:21
diakopter I tried it through the tortoisegit gui; it said it failed b/c it was a merge and I was missing a -m option 20:22
flussence I'm looking at the manpage thing for -m and even I'm lost now... :S 20:24
diakopter then I tried the command line once I found it and got fatal: Cannot find 'ca5feb368e44'
hrm 20:25
flussence does that merge show up in your log locally?
flussence could be on the wrong branch there... 20:26
diakopter oh, sry yes
wrong checkout entirely
flussence gets me all the time :)
diakopter same error message 20:27
commit blah is a merge but no -m was given
ok I think I see 20:28
www.kernel.org/pub/software/scm/git...-merge.txt
diakopter urgh 20:32
diakopter someone feel free to fix it for me :/ if it needs fixing. 20:54
colomon diakopter: ? 21:01
diakopter hm, I wonder why dalek didn't report those last two commits to perl6/std
colomon: I'm a gitnewb
colomon: my local merge (pull?) got pushed needlessly. I don't get it. 21:02
github.com/perl6/std/commits/master/ I meant to push only 4865b4779a 21:03
sigh
BinGOs the so called diamond commit.
I always 'git pull --rebase' 21:04
diakopter BinGOs: git pull --rebase in order to do what? 21:10
BinGOs avoid the
Merge branch 'master'
commit
diakopter BinGOs: cool, thank you 21:43
BinGOs I have it aliased to 'git purl'
lue ohai o/ 23:05