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.
00:08 justatheory joined 00:15 pbuetow left 00:19 Auzon joined 00:28 rindolf left 00:31 r0bby joined 00:33 sri_work left 00:37 bsb joined 00:38 lmg joined
lmg hello perls 00:38
lmg bows gracefully
Auzon Hi.
lmg hi Auzon 00:39
sup?
Auzon Not much. Just getting caught up with life :)
lmg heh. daytime at yours? 00:40
00:40 mncharity joined
lmg <- GMT+1 00:40
Auzon GMT-6 here.
lmg nods
still some hours then for you
Auzon I had a rather busy week, and another one to come. This is one of my few days that I have somewhat free 00:41
Yes, true.
lmg was looking for help in #perl, but the folks are busy flaming.
00:41 eternaleye_ joined, eternaleye left
Auzon Interesting, but ultimately not too useful :) 00:41
lmg pardon me. come again 00:42
lmg is not a native english speaker
oh, the flames you mean?
Auzon Yes 00:43
lmg well yeah. if I was bored, it would be a nice read
Auzon They are interesting. But it won't help you.
lmg not too helpfull tho if one's looking for hellp
s/hell/hel
Auzon Yep
lmg agrees with Auzon
my problem is of noob type _and_ has nothing todo with perl6 a t a l l 00:44
lmg blushes
Auzon it's OK, we were all new once. I still am new compared to many others here :)
lmg I'd ask scott, but he's not on the mud. 00:45
oh man, tell me.
I write 10 lines with indenting and all... just works..
perlmonks do -e 00:46
00:51 jferrero left 00:52 alester joined 00:55 justatheory left 00:56 nipotaway is now known as nipotan 01:08 alester left 01:12 rindolf joined 01:13 Zygo left, Zygo joined 01:14 Zygo left 01:15 Zygo joined 01:40 rindolf left 01:44 Auzon left
meppl good night 01:44
lmg you guys have karma here?
meppl say good night to me!
lmg Auzon++
good night, sir. 01:45
meppl ;)
lmg quit finally so I can say mean things behind your back...
meppl haha 01:46
lmg ;) nighty night meppl
meppl ;) 01:47
01:47 meppl left
mncharity TimToady: in STD.pm, does regex_quantifier need to be declared a token category? 02:04
(err, that was intended more as an fyi) 02:05
02:05 TimToady left 02:07 diakopter left 02:08 zakame joined 02:19 Limbic_Region left 02:25 diakopter joined 02:26 ChanServ sets mode: +o diakopter, TimToady joined, diakopter sets mode: +o TimToady 02:28 justatheory joined 02:31 diakopter sets mode: +oo Juerd moritz_
diakopter (just in case the floods of 2007 recur) 02:32
02:35 Lorn__ joined 02:38 bsb left 02:41 lmg left, zakame_ joined 03:05 zakame left 03:06 alester joined 03:09 zakame__ joined 03:10 zakame_ left, zakame__ is now known as zakame
mncharity svn: PROPFIND of '/pugs/misc/red_STD': could not connect to server (svn.pugscode.org) 03:23
feather ill?
TimToady looks like 03:26
mncharity Juerd: fyi, ^^ 03:29
03:29 zakame left
mncharity slog, slog. this is one looong grammar. I'm about half way through first pass. I didn't fully appreciate the impressive amount of work that has gone into STD.pm. sigh. 03:32
anyone should feel free to contribute. :) It's all in the same order as STD. I'd much rather check and fix mistakes then code from scratch. More collaborative and social that way. :) so if anyone is bored... 03:34
wknight8111 i'm bored. what do you need? 03:35
lambdabot wknight8111: You have 1 new message. '/msg lambdabot @messages' to read it.
03:35 zakame joined
mncharity perhaps I should slap an ast and backend onto it, to make it more interesting, and provide more nitches for folks to contribute. 03:35
wknight8111: let's see... 03:36
wknight8111 why do i feel like this is going to be a huge list?
mncharity (I was just checking to see if svn was back:) not :/
which kind of puts a crimp in it, at least short/instant term 03:37
my current exercise is going through src/perl6/STD.pm, which is the closest thing we have to an official grammar to perl6, and hand translating it into misc/red_STD/std.rb, which is 03:38
wknight8111 oh, is svn down? I just started an update
red_STD, isn't that a ruby thing? 03:39
mncharity a runnable ruby version of STD. current task is slogging through all of the STD, generating rough ruby (generally not worrying about generating Match()s).
wknight8111 (i'm not in on all the lingo)
ok
where are those two files? I don't seem to have a src/perl6/STD.pm 03:40
i don't appear to have that folder at all, unless I'm looking in the wrong place
is this still in the parrot svn at languages/perl6? 03:41
mncharity vision is to slog out the rest of STD into ruby, then step back and clean up the infrastructure a bit, do some spot checking that the right things are happening, and then do a second pass adding Match() generation. At that point... (re, oh
not parrot. all pugs. 03:42
wknight8111 oh, okay. that's why I don't have it here
mncharity svn.pugscode.org except... not at the moment.
wknight8111 well, then I'm SOL 03:43
the whole pugscode.org website appears to be down 03:44
mncharity At that point would have a real p6 parser. A first most-real fast one, for some values of first and most real, depending on how far/fast TimToady's p5 version gets.
I'll be tempted to start slapping on an ast and backend (derived from kp6 and redsix) at some point, just because I don't know any way to really shake down the grammar without running it against pugs t/ . 03:46
*any other way
ah well, no hurry. any future contributions most welcome. 03:47
wknight8111: thanks for the interest! :) 03:48
wknight8111 no problem, more where that came from 03:49
03:49 lambdabot left 03:50 lambdabot joined 04:10 Lorn__ left 04:11 jjore joined
mncharity end of day. g'night all & 04:16
04:16 mncharity left 04:17 RayMagini left 04:20 RayMagini joined 04:25 eternaleye_ left 04:44 Auzon joined 05:07 quaternary joined 05:09 quaternary left 05:10 quaternary joined 05:15 njbartlett left 05:24 lidden left 05:34 zakame_ joined, wknight8111 is now known as wknight-away 05:35 zakame left, zakame_ is now known as zakame, monomorph joined 05:43 zakame_ joined 05:50 stevan__ joined, stevan_ left 05:52 monomorph left 05:56 zakame left 06:01 justatheory left 06:15 quaternary left 06:38 zakame__ joined 06:39 zakame__ is now known as zakame 06:54 reZo left, reZo joined 06:59 zakame_ left 07:05 nothingmuch left 07:33 zakame_ joined 07:36 penk left 07:38 penk joined 07:45 IllvilJa joined, zakame left 07:49 alester left 07:50 qmole left 07:53 iblechbot joined 07:57 zakame_ left, qmole joined, zakame_ joined
moritz_ good morning 08:03
08:03 penk left 08:25 zakame__ joined 08:29 zakame joined 08:31 meppl joined 08:41 zakame_ left 08:47 zakame__ left 08:50 penk joined 08:52 baest left 08:53 baest joined
rakudo_svn r25728 | jonathan++ | [rakudo] Fix parsing of undef and make undef.WHAT return Failure. Bug report thanks to congnominal++. 08:53
08:55 dduncan joined 08:56 damianc joined 09:06 zakame left, zakame joined 09:14 araujo left 09:17 araujo joined
moritz_ Juerd: I restarted apache2, now the svn problems seems to be gone ;-) 09:18
09:34 drbean joined 09:35 zakame left
rakudo_svn r25731 | jonathan++ | [rakudo] Make it so that if you say if $foo ~~ /pattern/ { ... }, then $/ is available inside the block. 09:40
09:40 zakame joined 09:46 dduncan left 09:48 rindolf joined 09:56 meppl left 10:00 d4l3k_ joined 10:01 shachaf_ joined, r0bby left, Patterner left, Lunchy left, nnunley left, pmichaud left, peepsalot left, yahooooo left, shachaf left, GeJ left, shlomif joined 10:02 Lunchy joined, kolibrie left, kolibrie joined 10:04 shlomif left 10:06 yahooooo joined 10:07 r0bby joined, Patterner joined, GeJ joined, pmichaud joined, peepsalot joined, nnunley joined, shachaf joined 10:08 peepsalot left, peepsalot joined, shachaf left 10:09 zakame_ joined 10:10 dalek left 10:11 d4l3k_ is now known as dalek 10:15 rindolf left 10:18 zakame left
pugs_svnbot r19916 | moritz++ | [STD] more perlhints 10:19
diff: dev.pugscode.org/changeset/19916
rakudo_svn r25732 | jonathan++ | [rakudo] Implement $0, $1 etc match variables. 10:22
moritz_ STD.pm allows 'given' <EXPR> <PBLOCK>' 10:24
but what's the semantics of given $expression -> $foo { ... } ?
is that like a lambda? 10:25
10:30 zakame_ left 10:34 Lorn__ joined 10:40 ofer joined
cognominal_ what is $¢ ? I can't find it in the synopses 10:49
moritz_ I think it stands for "context"
is there no documentation in STD.pm for it? 10:50
cognominal_ I have not yet searched STD.pm
it seems related to whitespace 10:51
## <?{ $¢ == $!ws_to != $!ws_from }> in grammar.pg
so it must be true when we are after whitespace
10:57 riffraff joined 11:09 nipotan is now known as nipotaway 11:13 smtms left
ruoso does the name of a private storage contains the sigil? 11:16
11:17 Lorn__ left
ruoso pugs: class A { has $!a; has @!a; method a($b) { $!a = $b }; method b {push @!a: $!a } method c { say $!a; say @!a;}; my $a = A.new(); $a.a(); $a.b(); $a.c; 11:18
exp_evalbot OUTPUT[*** ␤ Unexpected end of input␤ expecting ";" or "}"␤ at /tmp/zg1rHS5xJt line 2, column 1␤]
ruoso pugs: class A { has $!a; has @!a; method a($b) { $!a = $b }; method b {push @!a: $!a } method c { say $!a; say @!a;}}; my $a = A.new(); $a.a(); $a.b(); $a.c;
exp_evalbot OUTPUT[*** No such method in class A: "&a"␤ at /tmp/MZJW0NWpNg line 1, column 131-137␤]
ruoso pugs: class A { has $!a; has @!a; method a($b) { $!a = $b }; method b {push @!a: $!a } method c { say $!a; say @!a;}}; my $a = A.new(); $a.a(1); $a.b(); $a.c;
exp_evalbot OUTPUT[*** Can't modify constant item: VUndef␤ at /tmp/3yVoGlOID1 line 1, column 66-80␤]
ruoso pugs: class A { has $!a; has @!a; method a($b) { $!a = $b }; method b { @!a.push($!a) } method c { say $!a; say @!a;}}; my $a = A.new(); $a.a(1); $a.b(); $a.c;
exp_evalbot OUTPUT[*** Can't modify constant item: VUndef␤ at /tmp/vDQ6YFJ8uj line 1, column 67-81␤]
ruoso pugs: class A { has $!a; has @!a; method a($b) { $!a = $b }; method b { @!a.push($!a) } method c { say $!a; say @!a;}}; my $a = A.new(); $a.a(1); $a.c; 11:19
exp_evalbot OUTPUT[1␤1␤]
ruoso hmmm
11:20 smtms joined
ruoso pugs: class A { has $!a; has @!a; method a($b) { self!a = $b }; method b { @!a.push($!a) } method c { say $!a; say @!a;}}; my $a = A.new(); $a.a(1); $a.c; 11:20
exp_evalbot OUTPUT[1␤1␤]
ruoso considering self!a is a valid way of accessing a private attribute
I can only assume the sigil is not part of the attribute name 11:21
pugs: class A { has $!a; has @!a; method a($b) { self!a = $b }; method b { @!a.push($!a) } method c { say $!a; say @!a;}}; my $a = A.new(); $a.b(); $a.c;
exp_evalbot OUTPUT[␤␤]
ruoso that makes everything much easier.. 11:23
TimToady, could you please just confirm me if the private attribute name contains or not the sigil?
and the twigil, for that matter... 11:25
11:36 blindfish joined, pbuetow joined 11:54 wknight-away left 11:55 rindolf joined 11:57 rindolf left 11:58 damianc left 12:10 smtms left 12:28 monomorph joined 12:30 chris2 joined
rakudo_svn r25735 | jonathan++ | [rakudo] First cut at < > postcircumfix, so now you can write %foo<bar>. 12:55
13:01 sri_work joined 13:05 macae joined, cmarcelo joined
rakudo_svn r25737 | jonathan++ | [rakudo] Implement $<foo> syntax for getting at named captures. 13:05
13:12 ebassi joined
rhr_ dev.pugscode.org is down 13:26
Juerd Then fix it 13:30
:)
Oh, wait... That's my job
13:30 zakame joined
pugs_svnbot r19917 | ruoso++ | [smop/src-s1p/Object.pm] BUILDALL code also initializes the instance storage slots for every attribute. 13:35
diff: dev.pugscode.org/changeset/19917
ruoso and now Attribute have a "create_container" method that returns a proper container to be in the new slot 13:36
13:41 ebassi left 13:42 fridim_ joined 14:10 alester joined 14:20 riffraff left 14:24 IllvilJa left 14:31 dmq left 14:34 alester left 14:35 zakame_ joined 14:36 rindolf joined 14:42 BinGOs joined 14:47 wknight8111 joined
ruoso @tell nothingmuch After our conversation, I realised it makes sense to have the HOW slot defined explicitly in p6opaque, so you can implement different MRO's and other meta-caracteristics... 14:53
lambdabot Consider it noted.
14:57 zakame left 15:00 GeJ left
ruoso which would be the name for the default Perl 6 MetaClass? 15:03
15:04 zakame_ left
TimToady the true name of a private storage location is $!x 15:06
if you say "has $x" it's like "our $x", it makes $x an alias to the true location 15:07
and then you can refer to it as either $x or $!x
but if you declare "has $!x" or "has $.x" you can only refer to it as $!x 15:08
ruoso ok...
TimToady because you haven't created an alias
ruoso but
what about $!a and @!a
is it allowed?
I mean... is the sigil part of the name?
or the name is a
TimToady yes
you can get collisions on the associated method name, but that's your fault. :) 15:09
ruoso hmmm
that makes things more complicated
TimToady same with $.x and @.x
ruoso because it will require the runtime to make a string replace in the attribute name when it's a public one
[particle1 my method x {};
can be called as $!x(), so it might collide, right? 15:10
15:10 [particle1 is now known as [particle]
TimToady presumably. 15:10
[particle] can method x be called as $x() ?
TimToady no 15:11
[particle] ok.
ruoso nor can "has $!x" be called $x
[particle] ruoso: correct.
TimToady basically, you can be precise if you like, but method calls let you drop the sigil where it's unambiguous 15:12
[particle] so, can we say that my method x stashes the method in a private attribute?
ruoso I was counting on that (private class attribute)
but...
class A { has $!a; has @!a; my method a() {...} }.... what does self!a points to? 15:13
TimToady the method, since you overrode any autogen
ruoso but self!a wouldn't access a method
would access the attribute slot 15:14
TimToady and with the ambiguity it will probably refuse to autogen an accessor anyway
ruoso private access is non-virtual
there's no accessor... they're all private
TimToady I was using "accessor" loosely
[particle] just don't use "glob"
TimToady it's more like a sub call than a method call 15:15
except you still pass the invocant
ruoso what makes it more complicated is the fact that, as "has $.a" declares "$!a", I'll need to do a string replace during object initialization 15:16
unless I make this conversion at compile time
and turn "has $.a" into "has $!a; method a {...}"
[particle] has $.a allows you to call $!a, $.a, and $a. correct?
oops
"has $a" 15:17
TimToady not hte last
yes
[particle] ok. great.
ruoso can I consider it to be expanded at compile time?
[particle] also allows self!a and self.a
TimToady as long as you give error messages the user expects, and not your rewrite :) 15:18
ruoso "has $a" would be expanded to "has $!a; my $a ::= $!a; method a {...}"
and this way the attribute name would always be the private one
maybe I would need a "real name" and a "name" to keep track of things 15:19
TimToady well, you can't really do ::= on a has that doesn't exist yet...
it's an alias to the slot
not to a real variable
ruoso that was what I meant actually
TimToady just trying to be precise when I'm not trying to be loose :) 15:20
ruoso so, if ::= can't be used, what could be?
TimToady $a is just a macro that means $!a inside an instance 15:22
ruoso ah.. .ok
so it can all be done at compile time
TimToady probably
ruoso that solves me the string replace problem during runtime
I will expect all attributes to have a "private name" 15:23
TimToady moritz_, cognominal_: $¢ is the current immutable match state; $/ is a mutable user-visible match state copied out of $¢ whenever user code is run
gotta run; eye doc appointment... 15:24
bbl &
[particle] aye, doc
15:25 Lorn left 15:26 Lorn_ left 15:29 jjore left 15:31 turrepurre joined
pugs_svnbot r19918 | ruoso++ | [smop/src-s1p/Object.pm] Attribute now have a "private_name" method. 15:33
diff: dev.pugscode.org/changeset/19918
ruoso just realises that p6opaque will require 11 different lowlevel responder interfaces 15:52
plus the MetaClass responder interface 15:58
15:59 alester joined 16:00 rindolf left 16:07 justatheory joined
pugs_svnbot r19919 | ruoso++ | [smop] include/smop_oo.h contain the reference to the p6opaque RI and the Default MetaClass implementation 16:12
diff: dev.pugscode.org/changeset/19919
16:15 meppl joined
pugs_svnbot r19920 | ruoso++ | [smop] removing the Undef type definition. 16:18
diff: dev.pugscode.org/changeset/19920
16:19 Auzon left 16:28 rindolf joined
ruoso had just rewrote the next major milestone in the ROADMAP. Now it's completely centered in having Object completely functional, take a look at www.perlfoundation.org/perl6/index.cgi?smop 16:32
lambdabot Title: SMOP / Perl 6
16:32 manfred joined 16:33 drbean left, drbean joined 16:41 rindolf left 16:42 peeps[work] joined 16:44 tuxdna joined
tuxdna hi 16:44
I have a query regarding parrot's src/oo.c:Parrot_remove_parent() interface 16:45
does anyone has any idea of what it should do?
pugs_svnbot r19921 | ruoso++ | [smop] starting to implement p6opaque. 16:46
diff: dev.pugscode.org/changeset/19921
16:46 macae left 16:55 chris2 left
pugs_svnbot r19922 | ruoso++ | [smop] adding the constant identifiers for the HOW and REPR API 17:01
diff: dev.pugscode.org/changeset/19922
17:03 Squern left
pugs_svnbot r19923 | ruoso++ | [smop] adding the constant identifiers for the methods and submethods in Object 17:07
diff: dev.pugscode.org/changeset/19923
17:14 justatheory left
[particle] tuxdna: hop over to irc.perl.org#parrot and repost 17:15
17:19 tuxdna left 17:25 stevan__ left, stevan_ joined 17:34 pmurias joined
pmurias ruoso: will the metadata part be shared between objects? 17:34
17:37 njbartlett joined, rindolf joined 17:39 zamolxes joined 17:40 Psyche^ joined
ruoso pmurias, the metadata will belong to the prototype 17:40
and therefore, will be shared among instances
pmurias nice 17:42
you should have the void* data pointer in SMOP__Object__BASE
* shouldn't 17:43
ruoso pmurias, that's a macro 17:44
it's defined in smop_base.h
oh.. wait... 17:45
what do you mean
?
pmurias so of your object are SMOP_Object sized 17:46
others are bigger
ruoso I'm not sure I'm following 17:47
pmurias ruoso: it's hard to explain ;)
ruoso heh 17:48
ok... let's start from the beggining...
you're looking at the SMOP__Object definition
pmurias ruoso: sometimes you are passing a pointer to a bigger struct as a pointer to SMOP_Object right?
ruoso yes
most of the time, actually 17:49
pmurias and the data field exists to make all object two bytes each
?
ruoso nope... it's there to make sure SMOP__ResponderInterface and SMOP__Object share a minimal structure 17:50
pmurias ruoso: i don't get it 17:51
ruoso but this actually may not be really necessary now...
the initial idea was that you could have objects that were subject to GC being RI at the same time 17:52
which means that the data the GC uses should be declared in both types
because for the GC, they're all SMOP__Object's
pmurias so what does the data pointer actually store?
ruoso depends on the responder interfaces 17:53
for instance...
every responder interface that uses the smop_lowlevel implementation
(which is the default GC)
keeps the refcount and rwlock in that field
in theory you can have a responder interface that is subject to garbage collection... having the data field there allows that... 17:54
the "constant identifier" on the other hand 17:55
stores the string in that field
pmurias ruoso: so data is the field for responder interfaces to keep their special stuff for each object they govern?
ruoso is *one* field to do that... 17:56
but not the only one...
17:56 Patterner left, Psyche^ is now known as Patterner
ruoso it's the only one that is there for every object 17:56
which means that you don't need to define a custom type if that field is enough...
or in the smop_lowlevel case 17:57
it's the thing that all objects, independent of type, share
and where smop_lowlevel can implement the GC
I agree that there might be no need for it to be in SMOP__Object__BASE, it's probably worth trying to move it to SMOP__Object definition and see what happens 17:58
because at this moment all responder interfaces are not subject to GC
(geez... that was a weird english construct...) ATM no responder interfaces are subjcet to GC (looks better) 17:59
but I don't know if that possibility is something we should remove... 18:00
pmurias ruoso: it can always be removed later on 18:02
ruoso yeah... true...
18:11 [particle1 joined 18:15 turrepurre left 18:17 rindolf left, meppel-san joined 18:18 turrepurre joined 18:29 [particle] left
pmichaud TimToady++ # saner handling of named unary and 0-ary subs 18:30
pugs_svnbot r19924 | ruoso++ | [smop] First sketch on the p6opaque C struct
diff: dev.pugscode.org/changeset/19924
18:33 aindilis left, meppl left
pugs_svnbot r19925 | ruoso++ | [smop] First sketch on the p6opaque C struct -- small fix 18:33
diff: dev.pugscode.org/changeset/19925
18:36 [particle] joined 18:38 tuxdna joined
pugs_svnbot r19926 | ruoso++ | [smop] First sketch on the p6opaque C struct -- small fix 18:38
diff: dev.pugscode.org/changeset/19926
18:39 ofer left 18:41 spinclad left
pugs_svnbot r19927 | ruoso++ | [smop] defining the struct for the lowlevel implementations of Array, Scalar, Array and List for each p6opaque member -- when you call $foo.^!can("bla"), it will return a lazy object that will iterate through all the methods that match. 18:44
diff: dev.pugscode.org/changeset/19927
ruoso now there's a serious amount of code to be written in p6opaque.c.... 18:47
but at least it seems that there's no much to be defined, just code to be written 18:48
[particle] so now it's truly smop 18:49
ruoso heh
18:53 [particle1 left 18:54 spinclad joined
ruoso TimToady, I was thinking about stack optimization and about optimizing a "return $a.b()" into a tail-call... The problem with that is that caller will refer to a different frame, and therefore, most of the time, the optimization cannot be done... It would be nice if there was a trait to be added to a routine, so the optimizer can know that this routine can be target to this optimization... 18:59
the user would know that this routine would be 'transparent' in the stack introspection...
but thinking better, if the user add the trait, he could do the tail call himself.. 19:01
TimToady I'd say assume tail-call, but pessimize if you see caller() 19:02
ruoso the problem is that if I assume tail-call it will be too late when I see caller
or else there's no point in the optimization
TimToady huh? you're the runtime. you run after the compiler... 19:03
and the compiler sees "caller"
ruoso but the compiler can't know for sure
can it?
TimToady assume tail-call
caller is exceptional, and should not impair performance 19:04
ruoso so you could say that "caller must be called explicitly, or the stack is subject to optimization and the result may be unexpected"
is it? 19:05
TimToady we'll assume tailcall is okay in the absence of any evidence to the contrary, which might be explicit caller, or a trait that suppresses tail call 19:06
ruoso Ok... I'd suggest that to be extensively noted in the spec...
pmichaud let me try rephrasing
when the compiler sees $a.b() , it can't really tell if b() uses caller or not 19:07
ruoso because b() might not even be there yet
TimToady yeah, I guess... 19:08
sorry, a bit distracted cooking...
pmichaud so it would normally pessimize to not use the tailcall. either that or the compiler needs code at runtime to query b() and see if it's possible to use the optimized tailcall
TimToady seems like such a trait could hang off a proto 19:09
ruoso OTOH, one could think that tail-call is assumed, and that the current routine should mark itself as "stackfull" if it want to avoid being optimized out 19:11
I mean... it wouldn't depend on the call, but on where I am
and I could say... this routine is important in terms of stack, and should not be optimized 19:12
where all others would be subject to optimization
TimToady maybe one could store a tail-recursion bit somewhere that would at least give a warning: "caller bypassing optimized-out frame" only in English
PerlJam or you could just redefine caller() such that it might not return the call frame that you expect it to even if you're using caller(0)
(IIRC, caller makes no guarantees beyond caller(0) anywya) 19:13
TimToady LEAVE blocks and such could also disable it
pmichaud I suspect it's generally possible to avoid a tail call altogether by not using an invocation as the argument to a return 19:14
TimToady but if fail would just end up propaging outward anyway, it's probably okay
pmichaud i.e., instead of return $a.b() write FOO = $a.b(); return FOO # for some appropriate FOO
that avoids the tailcall without needing a special trait or pragma
ruoso pmichaud, I was thinking on a trait to that
sub foo is stackfull 19:15
PerlJam pmichaud: but that puts the burden of surprise on the programmer and he may not know enough to do that.
pmichaud well, "is stackfull" doesn't mean much to me
i.e., looking at it I can't really tell what is intended
PerlJam: correct, but it's approximately the same amount of surprise as a trait, I think
19:16 alester left
[particle] sub foo dont tailcall {} 19:16
ruoso hmm
sure... traits can have other verb
PerlJam pmichaud: true. But it's eaisier to find info on a trait than some special arrangement of code that doesn't really have a name.
pmichaud pj: good point
ruoso but in fact... the only point of surprise would be on caller()... so if we have it documented, there's no surprise 19:17
TimToady the point is, if it doesn't matter, it doesn't matter. if there's anything in the code that requires the pad to stick around, we keep it around
but the *possibility* of someone calling caller doesn't count for that 19:18
ruoso althought a "temp $var" does
TimToady that's one of the things that would disable it
because you have to do "leave" processing out of the ordinary
PerlJam TimToady: so, if static analysis of the code doesn't tell us whether caller is called or not, we assume not and optimize?
TimToady I think assume not 19:19
ruoso PerlJam, I would argue that caller would count on having previous things optimized, and the user must only be notified about it
TimToady most everything else, like context vars, gives some indication that a sub might want to fiddle with it
pmichaud I think I'd prefer not even to consider static analysis of the code in the caller case
ruoso me too 19:20
TimToady as I say, caller can at least know whether something was optimized out with a single bit somewhere
pmichaud i.e., we optimize to a tailcall, and toss a warning if a called sub uses caller in a place where it might not be appropriate
ruoso sounds fine to me
as long as this is extensively documented
TimToady if we document something extensively, they won't read it. :/ 19:21
pmichaud I agree
it just needs to be documented and specced :-)
ruoso ok... the warning would include "see perldoc tailcall"
PerlJam ruoso: the warning should also spit out the contents of tailcall piped through an appropriate pager :-) 19:22
with flashing READ ME lights all aroudn
ruoso heh
ruoso wonders about the impact of that optimization in terms of performance...
pmichaud and it would also be nice if the warning could go back in time and undo the effects of the tailcall optimization, so that it acts as if it never happened. And it should deposit something in my bank account.
TimToady that and $5 will get you a hamburger 19:23
pmichaud mmm lunch
ruoso: which optimization -- the tail call or the checking on CALLER?
ruoso tail call 19:24
pmichaud in Parrot, at least, tail call optimization can be pretty impressive
ruoso In frameworks like Catalyst you see possible optimizations for that in almost all the code...
pmichaud in early versions of PGE on Parrot Leo was arguing to use tailcalls instead of branches and giving examples of the performance speedups 19:25
(I pointed out the branches were still more efficient)
but he did demonstrate some impressive speedups in tailcall vs. non-tailcall performance 19:26
19:26 awwaiid left, awwaiid joined
ruoso and not to count on memory usage 19:26
that can be drastically removed in complex frameworks, like catalyst..
pmichaud right, for recursive tailcalls there's a big win in terms of memory usage as well 19:27
afk, lunch 19:29
ruoso home & 19:30
19:30 zamolxes left, ruoso left 19:36 IllvilJa joined 19:45 rdice joined 19:48 buubot left 19:49 buubot joined 20:03 rindolf joined 20:06 meppel-san left 20:23 tuxdna left
[particle] pugs: my %a = (1,2); say pairs %a 20:33
exp_evalbot OUTPUT[1 2␤]
cognominal_ ok 20:34
pugs my @a = 1, 2; say @a 20:35
pugs: my @a = 1, 2; say @a
exp_evalbot OUTPUT[12␤]
20:50 TJCRI joined 20:59 rindolf left
wolverian wow, someone has added facts about the ampersand's use in perl 6 to wikipedia's Ampersand page :) 20:59
21:06 japhb left 21:15 feb left 21:17 shachaf_ is now known as shachaf 21:19 sri_work left 21:37 Caelum joined 21:38 smtms joined 21:46 rdice left 21:57 rdice joined, rdice left 22:06 [particle] left 22:11 [particle] joined 22:30 cmarcelo left, manfred left 22:34 simcop2387 left 23:01 TJCRI left 23:08 pmurias left 23:09 peeps[work] left 23:17 Limbic_Region joined 23:19 Helios left 23:21 r0bby left 23:24 Zygo left, meppl joined, Zygo joined 23:30 iblechbot left 23:33 Helios joined 23:38 wknight8111 is now known as wknight-away 23:49 jferrero joined
meppl good night 23:53
23:59 Auzon joined, meppl left