svk sy -s 12103 //mirror/pugs | paste: sial.org/pbot/perl6 | pugs.blogs.com | pugscode.org | pugs.kwiki.org | www.treehugger.com/files/th_images/paradigm.jpg
Set by audreyt on 11 August 2006.
00:03 mauke_ is now known as mauke 00:46 robkinyon joined
dazjorz Khisanth: Now you've banned me too! 0.o 00:56
Khisanth your assumption that it was unintentional is incorrect 00:57
dazjorz aww 00:58
:(
He was the one who called me an asshole :P
my bot reaction was quite understandable
Khisanth that is a very ... poor excuse 00:59
dazjorz yeah, but its the best one i have >.<
Khisanth: At least unban _me_ in #perl plz, i'll keep the bot out of there 01:06
01:15 khisanth_ joined, khisanth_ is now known as Khisanth 01:40 elmex joined 01:46 agentzh joined
agentzh audreyt: could you get openfoundry support https? http here is awfully slow since only one proxy here can connect to that. 01:48
01:56 aufrank joined 02:03 justatheory joined 02:21 Yappo joined
agentzh it seems to me there's a lot of differences between FIRST {} and INIT {}. 02:32
not only the one mentioned in S04.
TimToady1 INIT runs once just before the mainline code runs. 02:33
agentzh even if INIT is in a block?
TimToady1 FIRST runs later when you first try to use a block.
yes.
agentzh ah, so S04 is confusing. 02:34
TimToady1 a FIRST will run multiple times in a block that is clones as a closure.
INIT only ever runs once.
*cloned
agentzh TimToady1: thanks!
TimToady1 basically, FIRST is there to support "state"
agentzh FIRST won't be called at the time of block construction?
TimToady1 and each clone of a closure gets its own state.
agentzh TimToady1: yes, S04 states that. 02:35
TimToady1 I don't know what you mean by block construction.
agentzh $ref = { FIRST {...} }
TimToady1 that is when the closure is cloned.
agentzh it is cloning a sub? 02:36
TimToady1 a bare { ... } is a sub
agentzh i mean "=" clones a sub?
02:36 justatheory joined
TimToady1 executing the {...} construct clones it. 02:36
= doesn't care.
agentzh oh, gotcha! 02:37
it is already specc'd somewhere in the synopses. 02:38
02:42 MacVince joined 02:52 justatheory joined 03:01 nperez joined
pasteling "agentzh" at 210.22.200.67 pasted "Tests for FIRST/INIT blocks. TimToady: Please check their sanity. :)" (22 lines, 491B) at sial.org/pbot/18944 03:03
agentzh Hmm, the relationship between FIRST {} and state variables now makes much sense to me. :) 03:06
03:23 mako132_ joined 03:24 MacVince left 03:28 mako132_ joined 03:29 nirgle joined 03:31 mako132_ is now known as mako132
svnbot6 r12177 | agentz++ | [ext/Test/lib/Test.pm] 03:31
r12177 | agentz++ | s/say/warn/ in sub diag in order to get more detailed diagnostic messages when using prove or prove6.
r12178 | agentz++ | [ext/Test/lib/Test.pm] 03:38
r12178 | agentz++ | s/warn/$*ERR.say/ in sub diag to be more consistent with other parts of Test.pm.
03:43 lambdabot joined 04:01 tup joined 04:37 ruz joined 04:48 norageek joined
norageek Boofy 04:49
04:54 lambdabot joined
svnbot6 r12179 | gaal++ | * parameterize Capt (now spelt that way again) over Exp for runtime 04:54
r12179 | gaal++ | or Val for parsetime.
04:59 agentzh joined
agentzh dolmans: re backtracking 05:00
from the machine's point of view, no backtracking means the engine won't step back to some earlier point of the matching process so as to try out an alternative matching rule when a mtach failure occured. 05:01
in case of matching /.*\w/ against "abc", the matching process is as follows: 05:02
0) abc .*\w 05:03
1) bc .*\w
2) c .*\w
3) \w
2) c \w
so the backtracking happened at step 3. 05:04
From the programmer's point of view, no backtracking means at any point of the matching process, there's no more than one matching rule (or matching route) to try out. 05:05
the best way of grokking it may be writing a elementary backtracking regex or rule engine using CPS or Combinators yourself. :) 05:06
TimToady1 agentzh: I don't think that's quite right. What I meant was that the cloning sets up to init the variable again, but it doesn't actually get set till the block is called. 05:11
agentzh TimToady1: Hmm 05:12
TimToady1 also, the INIT's settings are going to get wiped out when the my is executed, so you probably just end up with 'o'
05:12 TimToady1 is now known as TimToady
agentzh TimToady1: yes, the INIT {} test is a typo. :P 05:13
TimToady: so exactly when will FIRST {} get called? 05:14
TimToady when you say "state $x = func()", func() has to have access to everything that happened right up until that moment the = is executed, which is the same moment it would have been exectued for a my. the difference is it only does it once. 05:15
so maybe FIRST isn't even a block property. 05:16
agentzh is confused. 05:17
TimToady: would you please correct the FIRST tests for me?
TimToady if the above desugars to "state $x; FIRST { $x = func }" then it has to execute after the declaration.
agentzh tests maybe better for me to understand this issue.
TimToady can't right now, but maybe tomorrow. 05:18
agentzh TimToady: okay. i'll reread your message above.
*messages
TimToady basic point is that state initializer has to have access to the current routine's parameters, plus any prior my declarations. 05:19
agentzh TimToady: hmm, this makes sense. 05:20
TimToady anyway, gotta run... 05:22
agentzh TimToady: so "state $x = FIRST {}" calls func() everytime the sub gets cloned while "my $x = FIRST {}" calls func() only once?
agentzh thinks hard on this.
TimToady the implicit FIRST has to be around the assignment. 05:23
in fact, the state one is redundant, since it desugars to
state $x; FIRST { $x = FIRST {} } 05:24
the my example would calculate a FIRST value, and then every time
through reinit $x to that value.
agentzh TimToady: fair enough :) 05:25
TimToady in either case, a FIRST is reset by cloning.
agentzh got it
TimToady It's just a different function that has the same name.
or something like that.
but anyway, I think FIRST isn't a block property like ENTER or LEAVE. 05:26
agentzh TimToady: so S04 needs tweaks?
TimToady it just runs inline. so maybe it shouldn't be capitalized.
agentzh *nod*
TimToady it's just a control structure with a bit of its own hidden state. 05:27
agentzh it's a source of confusion.
TimToady on the other hand, that's a good reason for capitalizing it too. :)
it's a "until state $hiddenstate++ {...}" or some such, only without the variable name. 05:30
agentzh S04 -- "FIRST {...}* at every block entry time" but in fact, the "entry" time is very fuzzy.
TimToady I don't think FIRST even belongs in that list any more. 05:31
agentzh :)
TimToady but let me think about it overnight.
agentzh please do :) 05:32
TimToady thanks, and good night. &
agentzh night!
05:36 weinig is now known as weinig|sleep
svnbot6 r12180 | agentz++ | [t/closure_traits] 05:42
r12180 | agentz++ | renamed eval.t to in_eval.t
agentzh TimToady: the INIT test *is* correct, since it's "my $str ~= 'o'" instead of "my $str = 'o'". :) 05:43
svnbot6 r12181 | agentz++ | [t/closure_traits/init.t] 06:03
r12181 | agentz++ | added tests for cases like INIT in nested scope and closures with INIT {} in it which is cloned multiple times.
r12182 | agentz++ | [t/closure_traits] 06:18
r12182 | agentz++ | added tests to first.t to reflect today's IRC discussion with TimToady. (hopefully i'm not misunderstanding him)
r12182 | agentz++ | TimToady: please tweak these tests mercilessly. :)
r12183 | agentz++ | [t/closure_traits]
r12183 | agentz++ | fixed an obvious bug in first.t
r12184 | agentz++ | [t/closure_traits/in_eval.t] 06:24
r12184 | agentz++ | fixed the FIRST test.
agentzh is somewhat discouraged by the handwaving parts of the Perl 6 Spec. 06:26
06:26 norageek joined
agentzh I'll simply code up the tests by my understanding and leave the validity issue to TimToady. 06:29
anyone who's interested in Perl 6's closure traits can help out under t/closure_traits! :)
nirgle what's the t stand for 06:30
agentzh nirgle: t is a directory.
nirgle in in_eval.t
agentzh .t?
t means "test"
.t files are also perl scripts just like .pl files. 06:31
nirgle: does it make sense now?
agentzh goes back to prepare more tests & 06:33
nirgle thanks
06:34 crem_ joined
pasteling "agentzh" at 210.22.200.67 pasted "tests for traits blocks used in a for loop. comments welcome." (18 lines, 491B) at sial.org/pbot/18946 06:52
06:59 MacVince joined
svnbot6 r12185 | agentz++ | [t/closure_traits] 07:09
r12185 | agentz++ | removed the "obsolete" obsolete.t
r12185 | agentz++ | added in_loop.t with the remaining tests in obsolete.t, which tests various traits blocks in a ``for'' loop.
r12185 | agentz++ | TimToady: please check the validity.
agentzh so much for t/closure_traits...i'll turn to other parts of the test suit... 07:12
agentzh worries about his productivity. 07:13
07:32 marmic joined
agentzh TimToady: does unspace also work in comments? for example, "#\ (comment)". 07:41
?eval my $a = #\ (abc) 32; 07:42
07:43 evalbot_12172 is now known as evalbot_12185
evalbot_12185 Error: unexpected end of input expecting comment or term 07:43
agentzh pugs doesn't support this form.
07:43 iblechbot joined 07:46 tup joined
svnbot6 r12186 | agentz++ | [t/syntax/comments.t] 07:49
r12186 | agentz++ | added an unpace-in-embedded-comment test. (TimToady: check the validity please.)
07:51 Aankhen`` joined
svnbot6 r12187 | agentz++ | [t/syntax/force_context.t] 07:58
r12187 | agentz++ | fixed some misleading comments.
r12187 | agentz++ | added tests for the case of prefix:<->, revealing pugs' "-0" bug.
r12187 | agentz++ | improved the coding style
froh-doh agentzh: ping 08:00
agentzh froh-doh: pong
froh-doh I've coded a minimal implementation for quotemeta 08:01
agentzh :)
froh-doh :)
agentzh oh, where's it?
froh-doh basically replicating what's in Perl 5
I waited to commit
because I wanted to ask if it's all ok doing this
agentzh which file/directory will you commit to? 08:02
Prelude.pm?
froh-doh no, wait 10 seconds that I see
M docs/Perl6/Spec/Functions.pod 08:03
M src/Pugs/Prim.hs
A t/builtins/strings/quotemeta.t
the docs, the implementation and the test
agentzh ah, froh-doh++ # haskell programer
froh-doh well, I actually added 6 lines of code :) 08:04
agentzh *programmer
haskell tends to be extremely concise. :)
froh-doh now, is there some procedure before committing? I compiled and run the test, and it seems fine 08:05
agentzh feel free to commit!
if it compiles, commiting is fine.
froh-doh ok, I'll update my working copy and the I'll commit 08:06
agentzh froh-doh++
froh-doh it would be great if someone added some test to the test suite, in particular using weird characters 08:07
agentzh froh-doh: i will try later. :) 08:09
froh-doh ok, thanks
ah, one thing 08:10
svnbot6 r12188 | agentz++ | [t/syntax/force_context.t]
r12188 | agentz++ | added a magic link (L<...>) to it.
froh-doh the quotemeta function isn't documented, this is why I worked on docs/... as well
but I see that the maintainer of this doc is TimToady, is it ok to add stuff there?
ok, there will be occasion to revert, {version control}++ 08:12
svnbot6 r12189 | polettix++ | Added quotemeta builtin, based on current Perl 5 semantics
agentzh froh-doh: look at Spec/Function.pod 08:13
08:14 norageek joined
froh-doh ah, like it wasn't written clearly! :) 08:15
agentzh froh-doh: i don't think you can commit to synopses maintained by Larry.
i didn't find "quotemeta" in the synopses via grep.
froh-doh this is weird, because there was a placeholder 08:16
a single =item quotemeta in Spec/Functions.pod
agentzh oh? in S29?
froh-doh hmmmm
agentzh heh, i didn't grep S29. ;-)
so i think quotemeta is already specified. 08:17
froh-doh I basically copied the help from Perl5 documentation :) 08:18
agentzh froh-doh: no need to revert then. :)
froh-doh is struck by a light
apparently out of context: does .shift work on @_ by default? and on @*ARGS at the top level?
agentzh froh-doh: nope. 08:19
.shift always work on $_ according to S04 or S02.
*works
froh-doh ok, this seems consistent (but a little less perlish) 08:20
agentzh of course, you can always cheat by binding @_ to $_.
say, $_ := @_;
froh-doh: i think Perl 6 encourages using explicit param list. :) 08:21
sub foo ($a, $b, *@others) {...}
froh-doh yes, I've seen this. And it's agreeable. Once you have this, having shift working on @_ by default is only a nostalgic memory 08:22
agentzh aye 08:23
svnbot6 r12190 | agentz++ | [t/syntax/force_context.t] 08:30
r12190 | agentz++ | added more magic links to Syn.
08:31 norageek joined
agentzh i'm not sure whether or not Perl 6's quotemeta should be the same as Perl 5's. 08:39
froh-doh this was my fear, but I thougth that could be a reasonable starting point
*thought 08:40
agentzh froh-doh: have you seen the quotemeta.t in perl 5.9.3's test suit? 08:41
froh-doh: indeed.
froh-doh no, I'll check it out! That's Columbus' egg! 08:42
agentzh i'll paste it here if you like.
froh-doh if there's some repository I'll take it from there, don't waste time :) 08:43
agentzh okay
even a quotemeta deserves a lot of thinking. :) 08:44
Hmm, perl 5's quotemeta looks quite sane. maybe it's already enough for perl 6 strings. :) 08:47
froh-doh all the tests are defined in terms of escaping sequences, but I'll try to extract something reasonable 08:49
agentzh heh, simply copying over the tests in quotemeta.t is fine. 08:50
froh-doh uhm, I'm not sure. quotemeta is used as the backend function for stuff like "\Qhey you\E"
ah, now I get what you mean 08:51
test-driven development
agentzh yeah
froh-doh OTOH, it will be probably useful to replicate some of the tests in order to directly exercise quotemeta 08:52
agentzh we can also borrow other tests in perl 5's test suit if appropriate.
froh-doh: indeed.
suppertime & 09:05
09:05 agentzh left 09:08 norageek joined 09:09 cnhackTNT joined 09:18 chris2 joined 09:24 ruz joined 09:31 ruz joined
froh-doh it seems that the behaviour of quotemeta in Perl 5 isn't exactly that specified in the docs 09:37
10:08 luqui joined
svnbot6 r12191 | polettix++ | Added some tests from the Perl 5.9.3 test suite, as suggested by agentzh. 10:12
r12191 | polettix++ | There remain the question of what to do with Unicode, see comments just
r12191 | polettix++ | before the failing tests (marked with :todo<bug>)
froh-doh ouch, I forgot to put [t/builtins/strings/quotemeta.t] in the log message :/ 10:13
10:41 kanru joined, dazjorz joined 10:45 HEx joined 10:57 kane-xs joined
kane-xs seen audreyt 11:08
jabbot kane-xs: audreyt was seen 18 hours 38 minutes 1 seconds ago
11:10 Nanomon joined 11:12 elmex joined 11:14 agentzh joined
agentzh is using WaysOnlines' proxy to connect to IRC, which is very reliable but costs him 1.3 US dollar per month. 11:15
agentzh ponders replacing t/syntax/hexidecimal.t with t/syntax/char_by_number.t. 11:19
svnbot6 r12192 | luqui++ | Reworked t/closure_traits/first.t to represent my interpretation of 11:29
r12192 | luqui++ | TimToady's comments. This exposed a bug (previously, the test was
r12192 | luqui++ | bugged and pugs was working correctly).
agentzh luqui++ 11:32
svnbot6 r12193 | luqui++ | Fixed the test that INIT runs only once, in spite of multiple 11:35
r12193 | luqui++ | copies of a closure. I am about to break this. :-)
r12194 | agentz++ | [t/syntax]
r12194 | agentz++ | renamed hexadecimal.t to char_by_number.t and also added more test for \x[a] and \x[a,b].
agentzh luqui, or maybe "for <first second third> {}". ;-) 11:38
the code looks much shorter. nice.
luqui why? is two not enough to test?
agentzh i'm kidding. never mind.
luqui agentzh, well, in addition to looking shorter, it tests what it is supposed to :-)
(cloning a closure means it is the same position in the code, but in two different lexical environments) 11:39
agentzh really? i didn't know.
luqui that is my impression
agentzh luqui: what happened if it's not in the same position? 11:42
luqui that's not really... possible 11:43
basically, each time around the loop, you can consider a new Code object created with its lexical environment
even though the text is the same, it creates a different object.
FIRST is associated to that object, not the text.
whereas in the tests that were there before, you created only one object 11:44
agentzh hmm
luqui and just called it from multiple places
agentzh i see. thanks! 11:45
11:47 chris2 joined 11:48 cognominal joined 11:49 norageek joined
agentzh luqui: is #\ (foo) valid perl 6? 11:50
luqui #\ ?
svnbot6 r12195 | luqui++ | Fixed the test that INIT runs only once, in spite of multiple
r12195 | luqui++ | copies of a closure. I am about to break this. :-)
r12196 | luqui++ | Conjected that state variables do not leak outside of cloned closures.
r12196 | luqui++ | See the test for a better explanation.
agentzh "\ " is an unspace mark or so.
luqui oh right 11:51
I'd expect unspace not to count after a comment
agentzh okay, so it should be invalid.
luqui I would think that it is just a comment
agentzh yes, i was saying whether it is a valid embedded comment or not. 11:52
luqui so.. for example you mean: $foo += #\ (foo) 42 11:53
would in fact add 42 to $foo?
agentzh aye
luqui hmm... that's a good question
I don't know 11:54
agentzh i'd like to see what TimToady will say on this. ;-)
luqui likewise
well, I don't actually care, but it's an interesting corner case
agentzh i've already added this to t/syntax/comments.t 11:55
it is failing (as expected). :)
froh-doh people are probably too used to the idea that what follows unquoted # is a comment 12:01
luqui froh-doh, however, I believe we have $foo += #{bar} 42 12:02
froh-doh ugh
agentzh and also $foo += #<< bar << foo >> >> 42; 12:03
froh-doh fears this will open the gates of hell
agentzh ;-)
froh-doh: see t/syntax/comments.t for more horrible samples.
froh-doh: see S02 (Spec/Syntax.pod) for the formal description of embedded comments in Perl 6. 12:06
12:06 mandhriah joined 12:07 |mandhri| joined
froh-doh "ohmygod"s! 12:08
agentzh also thinks Perl 6 is a horrible language. 12:11
svnbot6 r12197 | agentz++ | [t/syntax/force_context.t]
r12197 | agentz++ | more magic links to Syn
12:16 plisk joined
agentzh luqui: please take a look at t/closure_traits/in_loop.t when you have some cycles. :) 12:16
i'm not sure whether i was doing a right thing there. 12:17
12:20 mandhriah joined
agentzh S04 says too little about ENTER/LEAVE/NEXT/LAST/etc. :-/ 12:21
luqui looking
agentzh yay 12:24
luqui for the first one, it all looks good, except I'm not sure about the ordering of such block 12:25
s
for example if LAST comes before LEAVE or not
however, if FIRST comes before ENTER, I would expect LAST to come *after* LEAVE 12:26
agentzh Hmm, sounds reasonable. 12:27
fixing
luqui for the second one, "exit" blocks (LAST, LEAVE) should come in reverse order of their appearance 12:28
that is Leave2 Leave1 Last2 Last1, probably
hmm 12:29
agentzh but i'm doubting whether NEXT and LAST should run at the same time.
they seem to be similar things.
luqui NEXT and LAST are mutually exclusive, are they not?
oh, but whether NEXTs should be in reverse order, too?
agentzh yes 12:30
luqui Maybe you ought to fire off a message to p6l asking about these thing?
*things
agentzh good idea!
luqui i.e. relative ordering between types, and reverseness
agentzh and also the #\ (...) one. :)
12:42 robkinyon joined 12:48 norageek joined
agentzh mails sent to p6-l. :) 12:55
12:55 cm joined
agentzh night, all & 13:03
13:03 agentzh left 13:04 luqui joined 13:20 Aankh|Clone joined
audreyt my $obj = (class { has $.x }).new(x=>1); 13:31
I wonder what name of META($obj) has
luqui hey audreyt, I'm trying to redo state variables
audreyt and whether they are somewhere in side the symbol table 13:32
luqui how do closures work?
audreyt that also relates to anonclass in general
my C $obj; $obj does Foo; # this creates anonclass
but is META($obj) still known as "C"?
in perl5, you can always take ref() as a string and look it up with symbol table, walking from root 13:33
luqui I don't think that last property is essential 13:34
I would say either that META($obj) doesn't have a name, or it has a name like ANON006346
audreyt right. what I'm getting to is that if you have two classes
luqui which would not be in the symbol table.
audreyt both known as Bit (counting from the root namespace up)
in perl5 they are guaranteed to be the same thing 13:35
I wonder if it would help to keep that
luqui how does this affect that?
audreyt (there's nothing stopping ANON006346to be in the symbol table too)
concretely, an object can either keep a identifier
as its META
or it can keep a pointer to another object 13:36
as its META
luqui that's true... I suppose I would like it not to have a name, so that anon classes can be GC'd
while still being safe
13:36 xdg joined
audreyt but then it can't be shared 13:36
luqui how so?
audreyt arguably we want the
my C $obj; $obj does D;
my C $obj2; $obj2 does D; 13:37
luqui oh my, yes
audreyt at this point it might be wiser to have $obj/$obj2 share a table
instead of blindly GC'ing things away
so that argues for a nominal, put-it-into-symbol-table-with-a-name system
luqui isn't the type of $obj and $obj2 supposed to be the same according to the language, too? 13:38
audreyt that is underspecced...
it might or might not be.
I think they should, following a recent discussion with stevan
luqui I seem to recall that it is, but I could be misremembering
audreyt also our module name identifier is already pretty liberal
luqui from a logical standpoint, it could be made clean by having classes be value types
but I don't think that will fly 13:39
audreyt that won't fly as it will seal them
we don't want to seal them...
i.e. they need to be mutable whilst preserving identity
which means they are not value types
Type, however, can be a value type
what I'm getting to is that objects carry Type names
and then you always lookup concrete Class from that type by walking sym table 13:40
luqui class X { method foo() {...} } multi foo(X $self) {...} # same thing?
audreyt luqui: no, not really
luqui okay. in any case, I think we are thinking the same thing. 13:41
audreyt $obj.foo # this dispatches via meth first and then fallback to multi
&foo($obj) # multi gets it, meth never consulted
luqui Ever since L::AG, I have been paranoid about GC
audreyt so they are not same thing
luqui so I would like a way to clean up unused classes
audreyt I understand as you are working with a refcounting GC :)
luqui not really that, it's more that I don't like named indirection 13:42
audreyt ok. anyway, back to your Q
but in this case name is full
luqui full?
audreyt Bool is actually perl6:Bool-6.0.0-cpan:LWALL 13:43
or something like that
luqui I mean I don't like named indirection because it kills GC
kane-xs hey audreyt. pop over to #p5p for a sec if you have the time please
luqui okay, anyway, back to my Q
audreyt luqui: not neccessarily
luqui :-)
audreyt you can still tell the Type to keep a ref to the concrete class
and make the symtable enttry weak
then it will be gone the time the last object with that type gets GCed 13:44
luqui right, then it doesn't seem reasonable to have a symtable entry at all
just make it all referential
audreyt well no
then you kill sharing
think $obj and $obj2 above
they won't have a way to know about each other anymore
luqui well, symtable for implementation purposes I suppose would be okay. kind of like a cache.
audreyt yup
luqui I don't think it should be language-accessible 13:45
well, non-uberguts-language accessible anyway
audreyt really?
right.
ok, I think we are in violent agreemtn
luqui okay then
state varaibles are presently broken
I would like to fix them
but I can't figure out where to look
13:46 foo\ joined
luqui for ^2 { my $c = { state $x = 42; say $x }; $c(); $c() } 13:46
print 42 43 44 45
should print 42 43 42 43
er, *say $x++ 13:47
13:48 Aankh|Clone is now known as Aankhen``
audreyt hm 13:49
state vars are to be cloned when closure is cloned
13:49 lichtkind joined
luqui aye 13:49
audreyt k. didn't know that
luqui S04:670 13:50
audreyt yup
thinking 13:52
Eval.hs line 414 governs closure cloning 13:53
luqui hm, okay that is what I was looking for 13:54
audreyt the subBody will look like
subBody = Syn "block" [Pad SState MkPad (padToList [("$x",[(<ref>,<ref>)])])
the problem is that "Pad SState" refers to compiletime-generated refs
as well as first_run etc 13:55
but they must exist in compile time
so one solution is do a full run thru subBody
search for Pad nodes
luqui was that the reason for the @INIT[$idx] business for rvalue INIT?
audreyt and thoroughly clone their values
luqui is there a way to plop state variables in the sub's env? 13:56
audreyt in the new AST yes, quite easily, 13:57
it's just Pugs.Val.Code.c_pad
in the old one... no. you need to walk the subBody for Pad nodes.
(which is why we are switching to the new one :))
luqui ouch
well I'm interested in working on the new one 13:58
but as I told gaal, I'm having trouble navigating it; i.e. finding tasks to do
audreyt so maybe you can help writing the fromVV instance for Code
I mean toVV
in line 229 Internals
yeah. we ourselves isn't yet very sure of the roadmap of mmigration
the nominal Type versus concrete Clas thigng 13:59
was a blocker
that gaal identified; I'm glad to find a (at least emporarily looks-sane) solution of it
13:59 jferrero joined, robkinyon joined
audreyt so, to case oldland Code to newland Code 13:59
toVV' (VCode v) = return $ VV $ val $ ((cast v) :: PureCode) 14:00
will do
but then you need to write a cast instance from old to new
by collecting all the oldland's Pad and stuff it to newland's
which means you are writing a Pad walker anyway
so maybe you can first write a padwalking cloner 14:01
as was the original plan on Eval line 414
and then we reuse that to make it oldPad->newPad
the alternate path would be for Parser to directly generate newCode
(er I meant oldCod-e>newCode)
but that is significantly riskier, as we are still exploring the layouts that works 14:02
luqui I never really grokked pugs's pads
so I think the former would be good
are you going to be around for a while?
audreyt a while, yes, maybe 1 hour or 2
luqui kay, I'll ask you if I run into troubles, assuming I do not fall asleep first 14:03
audreyt Internals line 1069 is definition of pad
ok
have fun :)
luqui (I'm switching from nocturnal)
14:11 explorer__ joined 14:12 elmex joined 14:23 explorer__ left, jferrero joined 14:25 weinig|sleep is now known as weinig
luqui what does the 'fresh' field do? 14:35
er, audreyt, ^
it is not used immediately from the pad structure, but its guts get passed around a lot
audreyt yo 14:39
the fresh field controls whether "my" refresh should happen
luqui which is what? 14:40
audreyt line 316 Eval
in "sub f { my $x; BEGIN { say $x } }"
you are in compile time looking at a container already
luqui with a proper clone is that still necessary? 14:41
audreyt that container should not get freshened when f() is first called
but any subsequent calls to f() will refresh i
but any subsequent calls to f() will refresh it
you can verify this curious behaviour in perl5 with 14:42
sub f { my $x; BEGIN { $x = "Hi!\n" }; print $x } f()
luqui ahh, i see
audreyt I'm not sure if it's sane keeping it, but many BEGIN-time behaviour seems to rely on this
since the main body closure is a block after all
so we pay the cost 14:43
fresh means roughly "has been entered at runtime"
luqui now I remember what hacking in haskell is like. Stare at code for an hour to make a one-line change :-)
audreyt you can add comments around the code :)
luqui that's not what I meant...
audreyt but yeah, it seems to have that Zen-like pattern 14:44
it's typechecking your brain
luqui more as a contrast to C, where you type constantly for an hour to make the same change
audreyt if you know what you are doing, then you can do it instantly
if you don't, then typing around won't help :)
luqui so um, where are 'state's stored? in envLexical? 14:46
audreyt they are genearted by Pad nodes 14:47
at runtime they are joined into envLexical
line 342 Eval
luqui heh, that place again
15:16 Jedai joined
audreyt gaal: oleg reimplemented the syb idea without Typeable and Data deriving 15:19
ccshan dubbed it "smash your boilerplate" as it's all compile time and requires no runtime reflection
# www.haskell.org/pipermail/haskell/2...18353.html 15:20
lambdabot Title: [Haskell] Smash your boiler-plate without class and Typeable
audreyt # okmij.org/ftp/Haskell/syb4.hs
investigating applicability :)
15:29 cognominal joined
audreyt hm, probably not applicable. oh well. 15:31
audreyt goes back metamodeling
luqui yay it compiles! let's see if it works 15:34
wolverian hrm, it seems to be my GHC or Cabal installation is borked. I get this on 'perl Makefile.PL': Could not find module `Distribution.Simple' 15:42
any hints how to fix? I just have the ubuntu ghc6 package, shouldn't have anything in local 15:43
hrm actually: library-dirs: /usr/local/lib/Cabal-1.1.4/ghc-6.4.1 15:45
weird.
(that doesn't exist)
btw, README refers to Artistic License 2.0b5. should that be updated? 15:47
audreyt wolverian: I'd like to stay GPL compatible for a while... 15:53
we can probably upgrade to A2 once OSI/FSF people have reviewed it, and GPL3 is out which will probably will be compatible with A2
wolverian audreyt, I thought A2 is compatible with GPL2
audreyt really? apache2 is not, so I doubt artistic2 is 15:54
both has patent retaliation clause
wolverian ah, okay.
audreyt (GPL will be updated to be compatible with that, but meanwhile.) 15:55
wolverian yeah.
I thought you can kind of ignore the differences because of 4.c.ii 15:56
(relicense clause)
audreyt yeah. 15:59
it's compatible-by-casting 16:00
but then we might as well go GPL all the way :)
wolverian depends on how compatible we want to be with perl6 ..
audreyt or perl5...
wolverian licenses are hard
audreyt I mean, parrot and perl5 are both in A1/GPL 16:01
wolverian why is there no Comparison of Free Software Licenses page on wikipedia?
16:05 cmarcelo joined
audreyt cmarcelo: hi! 16:08
cmarcelo audreyt: hello =).. apparently the lots of errors is a mistake I made in trying make this work statically. at least GHC 6.4.2 + dynamic link works fine (almost same number of errors) with quasi-trunk..
audreyt oh good 16:09
commit! commit!
cmarcelo i'm investigating now segfault problems with GHC 6.5... and how to came back with static thing.. ("make" takes too much time here)
audreyt ah. ok :) 16:10
audreyt meanwhile is deep in mzscheme, mono and ruby internals
luqui does audreyt find the ruby internals frighteningly undocumented? 16:11
audreyt er no
luqui really?
audreyt I find it to be crystal clear compared to perl5
luqui has hardly touched the perl5 source
audreyt you see, I start with a very low expectation... 16:12
;)
luqui the code is clearly written, but there was nary a comment to be found
audreyt because, as ingy likes to say, the code is self-documenting
luqui I submitted a -2 line patch to p5p once
audreyt (that is true only sometimes.)
luqui yeah... as an embedder, not a hacker, I would have appreciated english
but yeah, it's pretty nice code when you get down to it
audreyt mono's handling of MONO_TYPE_VALUETYPE got me what Im looking for 16:13
luqui and I understand that matz's english is not so great; probably a mixed blessing
audreyt so I'm happy :)
luqui neat
audreyt well, _my_ english is pretty bad, and that partly explains the lack of comments in my code...
(though the blogging had made my english considerably more natural, I've heard) 16:14
luqui yeah, audrey, your english is terrible. I mean you make minor grammatical errors one in ten utterances. Come on, get with the program!
audreyt :D
16:17 iblechbot joined 16:20 sysfault joined, sysfault left
audreyt ok. I think I grokked how value types are treated in mono 16:21
will try to put that into code tomorrow 16:22
when I finally got a whole day for pugs :)
audreyt waves and goes to sleep &
16:23 pdcawley joined 16:26 Psyche^ joined, Psyche^ is now known as Patterner
gaal ooh, thanks for the link audreyt! 16:33
sadly I'm zonked after $work
maybe recover in a few hours, if not - Tuesday
ah, I notice you mentioned it's not applicabele. oh well. 16:34
audreyt it;s applicable but requires hand deriving of the Dat type
(or DrIFT-assisted deriving)
since unlike Data, there's no builtin support
gaal I was amazed that ((:<:) Foo) was autoderivable 16:35
audreyt and the visitors, while easier to write than syb's and more powerful, I don't see an easy way to use the more powerful parts
gaal (*why* was it derivable?) 16:36
audreyt it's only derivable for newtypes
you can derive anything for newtypes :)
gaal what's a good thing to read to grok why that is the case? 16:37
the report?
audreyt newtypes are at runtime exactly the same thing as its base type
it exists solely to give you a chance to hang different instances to it
so you can automate deriving by simply adding the tycon and casing it
and in fact the compiler erases both anyway before codegen 16:38
GHC user guide, "7.4.12. Generalised derived instances for newtypes"
gaal so it's just lip service to the typechecker?
ok i'll read that 16:39
SamB actually they are also useful for keeping you from getting confused, sometimes 16:41
audreyt :) &
gaal zones out & 16:44
16:49 vel joined 17:08 robkinyon joined 17:19 justatheory joined 17:26 Odin- joined 17:33 lumi_ joined 17:36 weinig is now known as weinig|away 17:41 mauke_ joined 17:45 xerox joined, lollan__ joined, lollan joined, lollan_ joined 17:55 nirgle joined 17:56 nothingmuch joined 17:57 lollan joined 18:01 mauke_ is now known as mauke 18:13 diakopter joined 18:56 cm joined 19:00 hexmode joined 19:08 mdiep joined 19:14 lumi joined 19:20 jferrero joined
mdiep Coke++ # test_more.tcl changes 19:34
err... wrong channel :-) 19:36
19:36 justatheory joined
marcus_ Ë 19:36
19:38 rgs joined
diakopter seen TimToady 20:19
jabbot diakopter: TimToady was seen 14 hours 47 minutes 22 seconds ago 20:20
20:40 weinig|away is now known as weinig 20:42 cognominal left 20:43 cognominal joined 20:44 cognominal left 20:53 cognominal joined 21:26 rashakil joined, crapulous joined 21:30 vsoni joined 22:17 hexmode joined 22:23 weinig is now known as weinig|coffee 22:51 weinig|coffee is now known as weinig 23:08 justatheory joined 23:18 justatheory joined 23:30 ludan joined 23:48 kanru joined 23:50 diakopter_ joined 23:59 Bit-Man joined