pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
pugs_svnbot r20729 | diakopter++ | [yap6] works again. CPS and all. 00:11
nothingmuch @tell ruoso ping me when you are back online, I have an interesting idea for perl 5 <-> SMOP 04:28
lambdabot Consider it noted.
bacek perl6: my Int $a; say (try{$a='a'}) eq undef; 05:25
p6eval kp6 r20729: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤ 05:26
..pugs: OUTPUT[␤]
..rakudo r28192: OUTPUT[Null PMC access in type()␤current instr.: '_block11' pc 131 (EVAL_11:54)␤
..elf r20729: OUTPUT[Use of uninitialized value in string eq at (eval 14) line 4.␤␤]
drbean I think bicycle riders are going to have trouble with the idea that ratcheting means no backtracking. 09:33
See the bicycle explanation at www.sheldonbrown.com/gloss_ra-e.html. 09:34
lambdabot Title: Sheldon Brown's Bicycle Glossary Ra-Re
drbean The perl6 idea of ratcheting however is recognized there. 09:35
Which is probably the idea that will be familiar to drawers of water from wells.
drbean Hewers of wood and drawers of water: Apparently a biblical term of abuse: www.google.com/search?num=100&h...tnG=Search 09:40
lambdabot Title: "hewers of wood and drawers of water" - Google Search, tinyurl.com/69s8mr
moritz_ rakudo: class A { has $.a, $.b }; my $x = A.new(:a(3), :b(4)); say $x.perl 11:36
pmichaud moritz_: perhaps has $.a; has $.b; 11:50
moritz_ pmichaud: yes, that works
has ($.a, $.b) leads to segfaults 11:51
pmichaud (I don't know about that -- haven't dealt with the class code yet
moritz_ and other very weird behaviour
pmichaud that would be a good rakudobug ticket, though. 11:52
moritz_ ok, I'll write one
pmichaud pugs: say sign(undef); 11:56
p6eval OUTPUT[*** use of uninitialized value␤ at /tmp/29IoGCdZOo line 1, column 5-16␤]
pmichaud pugs: say abs(undef);
p6eval OUTPUT[0␤]
pmichaud pugs: say sin(undef);
p6eval OUTPUT[0␤]
pmichaud ummmmm...... 11:57
pmichaud t/spec/S29-num/sign.t has 11:59
dies_ok { sign(undef) }, 'sign on undefined value fails';
...why?
moritz_ that's weird 11:59
IMHO it should return 0 + optional warning
bacek rakudo: my $a=[]; say $a.elems
p6eval rakudo r28197 OUTPUT[0␤]
moritz_ rakudo: say undef ~~ Num 12:00
p6eval rakudo r28197 OUTPUT[0␤]
bacek rakudo: my $a=[]; say $a.sort; 12:03
p6eval rakudo r28197 OUTPUT[␤]
moritz_ pmichaud: ticket sent 12:04
pmichaud moritz_: many thanks
moritz_ pmichaud: you're welcome. I'm happy to help in any way that doesn't involve learning PIR ;-) 12:05
test suite, testing infrastructure and spamming rakudobug with tickets seem a good way ;)
bacek moritz_, PIR is nice language :) 12:06
moritz_ bacek: for an assembly language, yes 12:07
bacek moritz_, indeed. My first computer had 16K of memory. And I program directly in octet codes :) 12:08
masak let's see, LTM concerns only the tokenizing step of parsing, right? 12:10
moritz_ masak: I don't think that Perl 6 rules have a clear definition of what the tokenizing is 12:11
masak: the grammar engine has to figure that out for itself
masak hm
so what you're saying is that the model imposed on p6 grammars does not necessarily decompose into a step called 'tokenizing'? 12:12
couldn't all the limits between rule matches be said to delimit tokens?
moritz_ don't think that's efficient 12:13
masak I don't mean from an implemenation viewpoint
moritz_ I think that some form of closures and backtracking control *do* stop LTM 12:14
masak I'm just trying to argue that there's tokenizing in there somewhere 12:14
is there LTM code committed somewhere that one can look at?
moritz_ I think that gimme5 + Curso5.pm do a bit LTM
kolibrie it is possible to modify the grammar mid-parse, so tokenizing must be tied pretty closely to the rest of the compilation 12:15
masak yes, I see that
and it fits in with the rest of Perl, in a way 12:16
moritz_ kolibrie: actually "mid-parse" is quite well defined
masak but in some situations it might still be useful to talk about tokenizing as if it was a step in the process
moritz_ the parsers parses a BEGIN block or use; statement
then executes it
then resumes parsing
masak moritz_: still, that means that you cannot tokenize everything and then do the other steps 12:17
or, if you do, you might have to throw a lot away
moritz_ masak: right. The tokenizer needs to be iterator-like
masak is there LTM code committed somewhere that one can look at? 12:37
moritz_ lol 12:38
masak no?
moritz_ if gimme5+cursor5 isn't readable, then not 12:39
at least not in perl 6 land
masak gimme5+cursor5? 12:40
kolibrie masak: pugs/src/perl6 12:40
kolibrie those are TimToady's experimentations 12:41
masak oki
masak well, taking a look at Cursor5, I see that it's well written but very high-density 12:56
maybe I would follow better if I understood the problem domain better 12:57
I saw a couple of unrelated idioms in there that I liked, though
moritz_ I wish I could tell you more, but my own understanding doesn't go far beyond my article 12:58
anyway, gotta run & 12:59
pmurias masak: the approach i use with Cursor5 is to view the output of small snippets fed into gimme5
masak ok
do these two work together?
ah, I see now 13:01
the latter generates the former
pmurias no
masak ok :) 13:02
pmurias what do you mean by those two?
masak Cursor5 and gimme5
bacek rakudo: multi sub foo($a){say $a}; foo(undef)
p6eval rakudo r28197 OUTPUT[␤]
pmurias Cursor5 is used by the code which is generated from gimme5
masak ah, ok
pmurias gimme5 is broken in the svn HEAD
bacek rakudo: multi sub foo($a){say $a}; multi sub foo($a,$b) {say "2"}; foo(undef) 13:03
p6eval rakudo r28197 OUTPUT[␤]
pmurias gimme5 is a hackish way of translating STD.pm into perl5 code
bacek rakudo: multi sub foo($a){say $a}; multi sub foo($a,$b) {say "2"}; foo(try{die})
p6eval rakudo r28197 OUTPUT[Null PMC access in type()␤current instr.: '_block11' pc 59 (EVAL_13:27)␤ 13:03
pmurias masak: revision 20656 seemed to work 13:09
masak pmurias: ok, great
pmurias @tell TimToady add mangle.pl to the repo 13:10
lambdabot Consider it noted.
bacek perl6: (try{die}) ~~ undef 13:16
p6eval kp6 r20730: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤
..pugs: RESULT[Bool::True]
..rakudo r28197: OUTPUT[Method 'ACCEPTS' not found for invocant of class 'Failure'␤current instr.: 'infix:~~' pc 8870 (src/gen_builtins.pir:5963)␤
..elf r20730: OUTPUT[syntax error at (eval 14) line 3, near ") ~"␤ at ./elf_f_faster line 4492␤]
bacek perl6: defined(try{die}) 13:17
p6eval kp6 r20730: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤
..pugs: RESULT[Bool::False]
..rakudo r28197: RESULT[0]
..elf r20730: RESULT[␤]
diakopter masak: yes; in yap6 there's really only 1 tokenizer/parser. well, the tokenizer just split(//) 13:35
masak diakopter: ok 13:36
does that mean that it parses $a+$b as one token?
diakopter no; 5 tokens
masak ah
I see
diakopter and in fact, the ast generated by the yapc parser is really a somewhat-hierarchical token stream 13:38
yap6
why do I keep saying yapc
probably b/c the pronounciation is too similar in my ind
mind
masak diakopter: how far along is yap6? 13:38
diakopter well; I've refactored it around 4 times now :D 13:39
you could say it's still stuck in constant-refactoring 13:40
masak why is that?
moritz_ because design is hard ;)
diakopter and addictive 13:41
masak :)
diakopter why didn't I know about graphical perl debuggers before this month.... 13:42
masak seems to me that Pugs showed that design needn't be up-front to go quite a bit
masak diakopter: URL? 13:42
diakopter masak: the Perl Dev Kit/Komodo from ActiveState, as well as EPIC for Eclipse 13:43
masak ok, thanks
diakopter masak: my belief is that there was *plenty* of design up-front while audreyt was preparing the beginnings of pugs 13:44
masak diakopter: ok 13:45
moritz_ ... and still some refactoring necessary ;)
pmichaud there was at least five years of up-front design before pugs got started. 13:53
(okay, we'll say four on the conservative side.)
and also a couple of aborted attempts at a perl 6 translator.
diakopter things with which to experiment in yap6 today: parse-time swapping of parser objects; parsing unit stoppers "fateing" particular branches; ast structure formulation/display 13:55
masak pmichaud: I had the impression that Pugs just started from nothing, implementing a side-effect-free subset of Perl 6
though that of course doesn't contradict what you said
diakopter imagines audreyt reading type-theory books/papers and thinking about a Perl 6 compiler design the whole time... and then deciding to learn Haskell by writing pugs. 13:57
masak :)
she already knew a bit of Haskell, through the Darcs project
diakopter ok; I thought I read somewhere that was one of the motivations. 13:58
moritz_ too
masak it probably was, too 13:59
diakopter you know what; I think I'm actually significantly more productive developing on win32/strawberry than on my macbook 14:01
than on mac os on my macbook
masak diakopter: why is that, you think? 14:07
diakopter perhaps I like the pointer control/movement in windows better. I do use the mouse. 14:11
pmurias rats--
masak pmurias: try doing CAD or vector drawing without them :) 14:13
possible, but very frustrating, I'd guess
pmurias masak: i use the rat for browsing the web ;) 14:17
masak also useful
pmurias but i use ratpoison as my wm 14:18
masak pmurias: I could almost tell from your jargon 14:21
pmurias ;) 14:22
pugs_svnbot r20731 | lwall++ | [STD5] add mangle.pl 15:20
ruoso TimToady, if you have some time, could you please take a look at the 'Foo.HOW.metamethod × Foo.^metamethod' message I posted on p6-language? 15:47
lambdabot ruoso: You have 3 new messages. '/msg lambdabot @messages' to read them.
ruoso @message
oops
lambdabot Maybe you meant: messages messages?
ruoso nothingmuch, I'm back online... I couldn't read carefully the article you pointed yet... but I think I kinda understand what it's saying... 15:53
nothingmuch ruoso: please do 16:23
it's very easy to follow through
basically it's how to compile your exact frame based setup
nothingmuch into exception based stuff 16:24
ruoso nothingmuch, ok... I just had a more carefull read... 16:32
SLIME basically works the same way, but it's much lower-level... for instance... there isn't an exception model yet.. 16:33
my idea is to get the exception model on top of that
but the main point of comparision is that nothing stops some code to go through without being part of a series of eval calls... 16:34
for instance..
ruoso some frame might go executing without getting back 16:34
ruoso and only returning when need to recurse into the SLIME stack 16:34
nothingmuch ruoso: this is on how to compile SLIME to efficient C code 16:35
slime frames get linearized
ruoso oh... instead of reinitializing everytime...
nothingmuch yes
it does this by using administrative normal form
nothingmuch and I actually came to the realization that perl 5 code can also be compiled to ANF at least in the abstract 16:36
actually getting it to run is something different though
either the opcode code has to be refactored
ruoso ok... and that with llvm allows that to be made in runtime
nothingmuch to use internal functions for the logic without caring about the stack
or they need wrappers
to set up the stack from normal parameters 16:37
and then we can actually get a CPS and from there an ANF form for perl 5
so continuations are potentially sane there too
nothingmuch so that got me thinking 16:37
maybe I can compile perl 5 optrees to SMOP
SV *, opcodes etc are just an RI 16:38
ruoso that would need to be implemented at some point anyway
nothingmuch yes
but it's probably easier than I initially thought
at least for a certain subset of perl5's operational semantics
so basically we use perl 5 to parse perl 5 16:39
it's kinda like PONIE
but not at the representation layer
B::Simple is key here
ruoso well.. in theory... if I get it correctly... we could just replace the runops from p5 to smop
nothingmuch well, that would work for simple things
i mean something that can actually give perl 5 continuations too =)
ruoso we would still initialize the p5 interpreter 16:41
to have GC working and etc
as well as to have current XS code working as well
but instead of cooperating the two runloops, we simply reimplement the p5 runloop inside SMOP
the good thing is that we just need to reimplement the OP dispatch, not the OP themselves
that would be a nice challenge...
well.. I might be missing something... 16:42
but as long as we're off p5 runops stacking (one runops calling another), there's not reason for not having continuation for any p5 code...
nothingmuch that's pretty much it, yes
but what I would like to alter the calling convention for p5 ops 16:43
ruoso but once that we're reimplementing the runloop
nothingmuch instead of using the perl value stack, etc
ruoso we can override the ops that recurse
nothingmuch that is retained only for compat
ruoso to avoid recursing
nothingmuch anymoose, i need to finish something worky
ruoso ok... me too..
but that's a scary plan
that could work
;)
nothingmuch it's going to require a lot of work before I can actually get something remotely similar
ruoso we need to toss this idea into #p5p after we mature it a little... 16:44
nothingmuch a lot ;-)
ruoso :) 16:45
moritz_ the general sentiment against low-level improvements seems to be "it would be *so* cool to have something better than we have now, but it's aint gonna work"
ruoso the key is making something outside (assuming moritz_ were talking about p5+smop runloop merge) 16:49
moritz_ ruoso: I was, and I think that you're right 16:49
ruoso I now realise that after getting the OO bootstrapped in SMOP, the most important milestone is embedding a full-feature p5 16:50
and getting a Moose metainstance on top of that immediatly afterwards... 16:51
nothingmuch embedding an unaware perl 5 shouldn't be too tricky
the thing is calling back to SMOP and then back to perl 5
ruoso yes... that's the "full-featured" part
;)
nothingmuch tso the problem with that
is if you try to take a continuation in SMOP space 16:52
while part of the stack is perl 5
ruoso which wouldn't be a problem if p5 was completely stackless 16:53
I mean...
nothingmuch so yes
that's exactly what I'm talking about
making a stackless perl 5 =)
ruoso that's a interesting project... :)
#p5p people think it is not possible in the current interpreter 16:54
nothingmuch in it's own right too
it isn't
this is a big change
it won't be easy
but i think there is a lot more we can reuse than people previously suspected
i realized the optree might actually be good enough for this
well, B::Simple would 16:55
ruoso ok... maybe we could get the "stackless p5 project" to #p5p even before we think on how that would work with SMOP
ruoso although I also realised it should be possible to implement it by delegating everything to p5 16:55
and allowing p5 to recurse as it wishes 16:56
as long as it starts another SMOP interpreter instance for each runops call
in theory... that should work, as long as p5 works..
the good thing is that starting a SMOP interpreter instance is very cheap 16:58
mofino *CHEER* *CHEER* PERL SIX IS COMING *CHEER* *CHEER* 17:48
TimToady ...when there's good cheer 'mong the guests, he cocks an ear at all the jests, and laughs until he chokes 17:50
SubStack it'll be the best christmas present ever I suspect
although I usually get pretty lousy gifts 17:51
smtms SubStack, are you sure this won't be a lousy gift too? :-)
SubStack it'll probably say "CPAN not included" in small print on the box someplace 17:52
Auzon That would be disappointing.
pmurias TimToady: got my || is always ratchety bug report? 17:54
ruoso more and more sees Perl 6 as a different language and project, and more and more accepts that /usr/bin/perl will be pointing to p5 still for a long time... but that is far from a bad thing... 17:57
pmurias SubStack: it hardly reasonable to expect cpan to be included in the default distribution ;)
diakopter TimToady: how fast/slow is STD5.pm these days; i'm curious 17:58
perl6: use v6; say 2; 17:59
p6eval kp6 r20731: OUTPUT[2␤]
..pugs: OUTPUT[2␤]
..rakudo r28205: OUTPUT[2␤]
..elf r20731: OUTPUT[2␤]
diakopter moritz_: how about adding execution times to p6eval's output..? maybe just when it's privmsg? 18:01
or would they not be meaningful? 18:02
pmichaud I'm guessing not very meaningful 18:03
since these tend to be short scripts
one-liners, even.
ruoso and the environment is not that predictable AFAIK
diakopter pmichaud: but rakudo would always win :P 18:06
pmichaud oh, I'm not at all sure about that -- at least not until I get a chance to re-do the parser. 18:07
diakopter yap6's parser takes 280x longer with full trace output enabled on a half KB file compared to tracing disabled 18:08
(and generates a 60MB tracelog file)
in case anybody cared :)
pmichaud and, rakudo tends to be running on unoptimized parrot. 18:09
diakopter I thought it fails to run on optimized parrot?
pmichaud I think chromatic had it running. I could try very quickly. 18:10
diakopter wonders if you could have a rakudo-specific optimization setting for parrot
pmichaud and it may be that rakudo doesn't run under optimized parrot under specific architectures. 18:11
(given that optimized parrot has difficulty under specific architectures.)
TimToady pmurias: yes, got that--eventually we'll have to solve token backtrack for non-ratchet, but it'll be easier once we have lazy lists, so that we don't have to generate all possible token matches on every token 18:25
diakopter: don't know how fast except once when I turn off all logging, and it was doing roughly 2000 chars/sec 18:26
but nothing is really optimized for speed except the LTM itself
and a lot of the overhead is from assuming non-ratchet where ratchet would have only one possibility 18:27
commuting & # back in about 2 hr 18:28
pmichaud rakudo spectest_regression on optimized parrot: 3m37 (1 failure) unoptimized: 4m21 (0 failures) 19:02
pmurias moritz_: how do you run elf under debian? 19:45
Auzon pmurias: I compiled Ruby 1.9 from source 19:46
pmurias no luck with apt?
Auzon evalbot
evalbot is running debian stable 19:47
spinclad lenny has ruby-1.9
right
Auzon I think there was an issue in the past with Debian's ruby-1.9 being not recent enough since 1.9 was the development branch for a long time
Still isn't the stable one
diakopter <- lightbulb circuit closes 19:49
moritz_ pmurias: which distribution? 19:56
pmurias moritz_: stable upgraded to lenny 20:05
moritz_ pmurias: aptitude install ruby1.9
pmurias: it's a separate package in lenny 20:06
pmurias is apt-get install any different?
moritz_ not rreally
pmurias moritz_: should i remove ruby 1.8?
pmurias i get a no readline error 20:06
moritz_ ruby1.9-readline or something
libruby...
pmurias: ruby1.8 and 1.9 can coexist - don't know if you need 1.8 for anything 20:07
pmurias i guess i don't 20:08
pugs_svnbot r20732 | pmurias++ | [Cursor5] replaced a 2 with DEBUG::lexer 20:42
r20733 | lwall++ | [STD5] switch debugging output to ::deb function 20:54
Auzon rakudo: class Foo {multi bar() {say "hi"}}; Foo.new.bar; 22:48
p6eval rakudo r28205 No output (you need to produce output to STDOUT)
Auzon rakudo: class Foo {multi method bar() {say "hi"}}; Foo.new.bar;
p6eval rakudo r28205 No output (you need to produce output to STDOUT)
Auzon rakudo: class Foo {multi method bar() {say "hi"}}; say Foo.new.bar;
p6eval rakudo r28205 No output (you need to produce output to STDOUT)
Auzon rakudo: class Foo {method bar {say "hi"}}; say Foo.new.bar;
p6eval rakudo r28205 No output (you need to produce output to STDOUT)
Auzon pugs: class Foo {method bar {say "hi"}}; Foo.new.bar;
p6eval OUTPUT[hi␤]
Auzon pugs: class Foo {multi bar {say "hi"}}; Foo.new.bar;
p6eval OUTPUT[hi␤]
Auzon pugs: class Foo {multi method bar {say "hi"}}; Foo.new.bar; 22:49
p6eval OUTPUT[hi␤]
Auzon pugs: class Foo {multi sub bar {say "hi"}}; Foo.new.bar;
p6eval OUTPUT[hi␤]
pugs_svnbot r20734 | diakopter++ | [yap6] lots of fixes/improvements
ruoso trying hard to stress the fact that there's no way to avoid side effects in a method call... 23:01
even if that method call is part of a subset definition... 23:02
Limbic_Region ruoso - did you see my reply to your PerlMonk's post? 23:02
ruoso which one? 23:03
Limbic_Region pregnancy weeks
ruoso Limbic_Region, :) thansk 23:04