Pugs t-shirts www.cafepress.com/pugscode | Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net Set by stevan on 15 August 2005. |
|||
stevan | autrijus: ping | 01:02 | |
autrijus: I assume you backlog,.. so I will tell you | 01:06 | ||
I got singleton methods working | |||
see t/36_singleton_methods.t | |||
I found out how Ruby does it,.. which is insert an anon-class in between the regular class an the instance | 01:07 | ||
so you have this [Object] -> [Foo] -> [anon class for $foo]-> $foo | |||
then all the singleton methods get stashed into the anon class | |||
since it is specific to $foo only,.. it works | |||
I did this with a subclass of $::Class | 01:08 | ||
:) | |||
ok... time to watch some TV & | |||
svnbot6 | r7225 | stevan++ | Perl6::MetaModel 2.0 - | 01:10 | |
r7225 | stevan++ | * fixed the test to create *proper* singleton methods (ala Ruby) | |||
r7225 | stevan++ | basically we just insert an instance specific anon-class into | |||
r7225 | stevan++ | the mix at the right time, and whalla you have singleton methods. | |||
r7225 | stevan++ | I implemented this by making a subclass of $::Class, however it | |||
r7225 | stevan++ | might make sense to actually integrate this into the core of the | |||
r7225 | stevan++ | metamodel itself. I would certainly make class methods easier, and | |||
r7225 | stevan++ | allow for some very interesting assorted evil tricks :) | 01:11 | ||
brentdax | ?eval class X { submethod BEGIN { say "X" } } class Y is X { submethod BEGIN { say "Y" } } Y.new | 06:19 | |
evalbot_7225 | Y.new(); | ||
brentdax | ?eval class X { submethod BEGIN { say "X" } } class Y is X { submethod BEGIN { say "Y" } } Y.new() | ||
evalbot_7225 | Y.new(); | ||
brentdax | ?eval class X { submethod BEGIN() { say "X" } }; class Y is X { submethod BEGIN() { say "Y" } }; Y.new() | 06:20 | |
evalbot_7225 | Y.new(); | ||
Khisanth | heh | ||
brentdax | evalbot is not being very helpful. | ||
Khisanth | ?eval class X { submethod BEGIN() { say "X" } } class Y is X { submethod BEGIN() { say "Y" } } Y.new() | 06:21 | |
evalbot_7225 | Y.new(); | ||
Khisanth | ?eval class X { submethod BEGIN() { say "X" } } class Y is X { submethod BEGIN() { say "Y" } } my $y = Y.new() | ||
evalbot_7225 | \Y.new(); | ||
Khisanth | well ... | ||
brentdax | Even when I take X out of the equation, Y still doesn't print. This is odd. | 06:22 | |
...oh, wait, I'm an idiot. | |||
?eval class X { submethod BUILD { say "X" } } class Y is X { submethod BUILD { say "Y" } } Y.new | |||
evalbot_7225 | X Y Y.new(); | ||
brentdax | Okay. Doesn't explain why actions being taken by X's (or Cipher's) constructor aren't registering, but it's a start. | 06:23 | |
Er...except that I made the same mistake there, too. Heh. | 06:24 | ||
nothingmuch | glorf | 06:42 | |
svnbot6 | r7226 | brentdax++ | Cipher API: | ||
r7226 | brentdax++ | * Full testing of Cipher.pm (including new test cipher) | |||
r7226 | brentdax++ | * Documentation for Cipher::Caesar | |||
brentdax | I actually have copies of Cipher::Stream and Cipher::Arcfour (RC4) locally, but I haven't tested either of them. | 06:43 | |
nothingmuch | check in | 06:46 | |
we can submit some tests | |||
the most basic test for all of them is round trip | |||
and that the thing at the middle of the trip ne the thing before and after it | 06:47 | ||
and that middle of trip is ne middle of trip when key is different | |||
brentdax: ? | 06:58 | ||
www.cypherspace.org/adam/rsa/rc4.html | 07:04 | ||
brentdax | I'd at least like to get some test vectors pulled together first. Testing it is pretty easy--I just have to do it. | 07:12 | |
nothingmuch | i'm willing to help if you like | 07:17 | |
svnbot6 | r7227 | nothingmuch++ | test for optional trailing semicolon on blockish exprs. | 07:25 | |
brentdax | ?eval class X {} my %options = (:foo<bar>); X.new(*%options) | 07:46 | |
evalbot_7227 | Error: Must only use named arguments to new() constructor | ||
brentdax curses quite a bit. | 07:47 | ||
?eval class X {} my %options = (:foo<bar>); X.new(%options.pairs) | |||
evalbot_7227 | Error: Must only use named arguments to new() constructor | ||
brentdax | ?eval class X {} my %options = (:foo<bar>); X.new(map { $_ } %options.pairs) | ||
evalbot_7227 | Error: Must only use named arguments to new() constructor | ||
brentdax | That makes it rather hard to pass options from the various wrapper routines into the constructor. | 07:48 | |
Guess I'll just test with the OO core. | 07:51 | ||
Gah, I'll commit it anyway. Stupid OO. | 07:58 | ||
nothingmuch | hehe | 07:59 | |
nothingmuch wants luqui's tuples to make it in | |||
svnbot6 | r7228 | brentdax++ | Cipher API: | 08:01 | |
r7228 | brentdax++ | * Undocumented Cipher::Stream | |||
r7228 | brentdax++ | * Undocumented Cipher::Arcfour (RC4) | |||
r7228 | brentdax++ | * arcfour.t, which fails the second test for mysterious reasons | |||
r7228 | brentdax++ | Ideas on what's causing arcfour.t to fail would be appreciated. | |||
nothingmuch | theorbtw1: long time no see! | 08:14 | |
theorbtw1 | Allo, nothingmuch! | 08:15 | |
nothingmuch | what's up? | 08:16 | |
theorbtw1 | Been working on a contest entry, and ended up possibly missing the entry deadline by 40 minutes because the terms weren't clearly written. | 08:19 | |
08:20
theorbtw1 is now known as theorbtwo
|
|||
kgftr|konobi | theorbtwo: oioi | 08:21 | |
theorbtwo | Yeah. | ||
Well, it'll still get used, if only by Jess and I. | |||
kgftr|konobi | theorbtwo: jess on her way or still feeling under the weather? | ||
theorbtwo | Sorry I wasn't at the pub on Friday; Jess wasn't feeling well (and is staying home sick again today). | ||
kgftr|konobi | ah... hokey dokey... no probs! perhaps next time? | 08:22 | |
theorbtwo | Next time indeed. | ||
nothingmuch | bah | ||
nothingmuch backlogs | |||
theorbtwo | I should probably finish the "create a new user" page before I point you at it... | 08:23 | |
nothingmuch | what is the contest? | ||
theorbtwo: ? | 08:31 | ||
kgftr|konobi | theorbtwo: damn prvmsgs are blocked... can you ask jess to ring anthony to confirm sick, etc. | 08:38 | |
spinclad | ?eval $?PUGS_VERSION | 08:44 | |
evalbot_7228 | \'Perl6 User\'s Golfing System, version 6.2.9, August 3, 2005 (r7228)' | ||
spinclad | ?eval class X {} my %options = (:foo<bar>); X.new(*(map { $_ } %options.pairs)) | ||
evalbot_7228 | Error: Must only use named arguments to new() constructor | ||
spinclad | ?eval class X {} X.new(:foo<bar>) | 08:45 | |
evalbot_7228 | X.new(('foo' => 'bar')); | ||
dada | ?eval class X {} my %options = (:foo<bar>); X.new(%options) | 08:48 | |
evalbot_7228 | Error: Must only use named arguments to new() constructor | ||
dada | mmm | ||
that's unorthogonal | |||
theorbtwo | backstage.bbc.co.uk. | 08:49 | |
I created a TV schedule grid that shows customized ratings -- it tells you what's on that it thinks you'd like. | 08:50 | ||
nothingmuch | hola castaway_! | ||
castaway_ | kgftr|konobi: I already called HR, doesnt that cover it? Else, whats his number? | 08:51 | |
nothingmuch | wow, attribute grammars are fun | 08:53 | |
now lets see if they actually work ;-) | |||
castaway_ nudges Scott | 08:54 | ||
svnbot6 | r7229 | brentdax++ | Cipher API: | ||
r7229 | brentdax++ | * Documentation for Cipher::Arcfour. | |||
scook0 | gah, goddamn tests! | ||
I spend half an hour getting the damn test script to run | 08:55 | ||
and then it pretends my test statements don't even exist! | |||
(and the test takes about a minute to load before doing nothing!) | 08:56 | ||
nothingmuch | blah | 08:58 | |
scook0 | well, hopefully it'll be worth all the trouble | ||
! | 08:59 | ||
svnbot6 | r7230 | iblech++ | * Usual svn props. | 09:00 | |
r7230 | iblech++ | * System.FilePath: Added a not (null fname) guard (i.e., fixed a bug). | |||
r7230 | iblech++ | We should probably propagate the fix upstream (at least when ok'd by a real | |||
r7230 | iblech++ | lamda hacker). | |||
r7230 | iblech++ | * Main: Added %?CONFIG<sourcedir> to the list of paths to search and | |||
r7230 | iblech++ | added a tryIO call so the search doesn't die. | |||
nothingmuch struggles with his pretty printer | 09:01 | ||
kgftr|konobi | castaway_: ah... that should be fine... will let anthony know | 09:02 | |
castaway_ | ok good | 09:03 | |
castaway_ passes around the Sinupret | |||
nothingmuch | luqui: !!!!!!!!!!!! | 09:04 | |
i've been waiting for ever | |||
luqui | hi nothingmuch | ||
nothingmuch | fix your svn repo | ||
luqui | yeah, I've had my nose in school | ||
it is fixed | |||
castaway_ wanders again | |||
nothingmuch | also, i need to do some funky stuff with L::AG | ||
luqui | (it dies every once in a while ??) | ||
nothingmuch | i have a test for threaded attributes | ||
luqui | nothingmuch, like? | ||
Oh, I figured out a new lazy algorithm that could be much better than the one I am using memory-wise | |||
I have to do some analysis though | |||
nothingmuch | and also i have e.g. type::operator::arrow isa type::operator::binary | 09:05 | |
luqui hates threaded attributes | |||
do it without punning if you can | |||
type::operator::arrow? | |||
svnbot6 | r7231 | iblech++ | util/smokeserv/smokeserv-server.pl: Always set $*ENV<TZ> to "UTC" so the | ||
r7231 | iblech++ | template ("Timezone is UTC") doesn't lie. | |||
nothingmuch | i would like 'to say operator::binary: layout($$) = { join(" ", layout($.left), $.symbol, layout($.right)) }' | ||
and have that work on type::operator::arrow and type::operator::pair | 09:06 | ||
luqui | ahh yes | ||
you mean it should respect inheritance? | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "an AG for pretty printing types" (40 lines, 1.2K) at sial.org/pbot/13424 | ||
nothingmuch | also yes | ||
if there is no attr defined on blessed($node) it should iterate Class::ISA::super_path | |||
i guess that C3 order is a good choice | 09:07 | ||
anyway, that's why i need threaded attributes | |||
see free_in and count_in? | |||
well, admittedly "need" is a strong word | |||
luqui | yeah, you can always make a threaded attribute with a inherited+synthesized attribute of different names | 09:08 | |
threaded is just a pun making two different attributes have the same name | |||
nothingmuch | but it's tres cool ;-) | ||
anyway, that grammar is dying, and i can't figure out why | |||
Nonlinear attribute: you have two or more ways to assign a value | 09:09 | ||
to the attribute 'layout' near grammar line 11. | |||
but i have no attrs that are nonlinear, IMHO | |||
this is about variable::free: layout($$) = { ... } | |||
anyway, new tests submitted to L::AG | |||
you're welcome to mark t/threaded.t as TODO ;-) | |||
luqui | yeah, I saw that, thanks | ||
nothingmuch | wait... conflicts | 09:10 | |
luqui did a little renaming around, and then unrenaming, and yucks | |||
I don't think I'm going to use Kasten's ordered approach. Lazy is just too much easier. | |||
er, Kastens's | |||
nothingmuch | how do you get 3-way merge with svk? | 09:11 | |
luqui | ?? | ||
nothingmuch | i want the conflict to go to FileMerge.app | ||
i don't know what command I want =) | |||
luqui | nothingmuch, this grammar is dying with the CPAN version of L::AG (ie. you haven't made any changes?) | ||
nothingmuch | this is with the svn version, but i have not edit the .pm file | ||
s/have/did/ | |||
luqui | hmm okay. That might be a bug. | 09:12 | |
let me look at it | |||
nothingmuch | okay | ||
luqui | even though I'm about to rewrite the .pm | ||
oh, do you have a file with a test for this grammar? | 09:13 | ||
nothingmuch | not yet | ||
i'm trying to get my earlier tests in | |||
struggling with svk | |||
luqui | no, I mean, you said the grammar was dying | ||
on what input tree? | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "the input tree" (10 lines, 430B) at sial.org/pbot/13425 | 09:14 | |
nothingmuch | oh shit, i think i get it | 09:15 | |
nothingmuch confused himself in the constructors | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "the correct input tree, generates same error" (9 lines, 398B) at sial.org/pbot/13426 | 09:16 | |
"scook0" at 220.253.106.5 pasted "What the heck is wrong with my test?" (52 lines, 1.1K) at sial.org/pbot/13427 | |||
nothingmuch | luqui: any idea what's going on? | 09:22 | |
luqui | hmmm... | ||
nothingmuch | i'll post the full script | ||
luqui | well, it is installing layout of that thing twice | ||
I'm trying to figure out why | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "type pretty printer & misc" (193 lines, 3.5K) at sial.org/pbot/13428 | 09:23 | |
nothingmuch | just run perl on that thing | ||
luqui | are you using "root" as the meta root, or as type::root? | 09:24 | |
nothingmuch | no, type::root | ||
luqui | okay good | 09:25 | |
nothingmuch | shouldn't that be ROOT: ? | ||
(for pseudo-root) | |||
luqui | yeah it should | ||
in other words, you did it right for what you were trying to do | |||
luqui just realized that ROOT and -prefix don't mix | |||
huh, the root is being scanned twice | 09:28 | ||
interesting, that shouldn't happen | |||
(and would explain the error) | |||
nothingmuch | hrmm | ||
luqui is on the trail though | 09:29 | ||
nothingmuch | oh, also have a look at t/errors.t later | ||
it tests for current behavior | |||
i'm not 100% sure it's the right behavior | |||
luqui | got it | 09:30 | |
count_in is an inherited attribute | |||
nothingmuch | and also, in basic.t one test tries to assign the same attr to ROOT and Foo, where Foo is the root anyway | ||
luqui | but it doesn't have anybody to inherit it from | ||
nothingmuch | right now ROOT overrides | ||
oh crap | |||
=( | |||
luqui | (the new structure with declared unions ought to make finding errors like that easier) | 09:31 | |
nothingmuch | root: count_in($.type) = { 0 } is not helping =( | ||
luqui | do you have a root node in your structure? | ||
nothingmuch | $pretty->apply(bless { type => $self }, "type::root")->layout; | 09:32 | |
} | |||
luqui tries | |||
uh, type => $self? | |||
nothingmuch | yep | ||
luqui | what's $self? | ||
nothingmuch | type::operator::arrow->new(type::variable::free->new, type::variable::free->new); | ||
luqui | oh, I see | ||
nothingmuch | pseudoroot is not good enough for root: layout($$), right? | 09:33 | |
luqui | I think a real root was a good choice in this case | ||
nothingmuch | counting works | 09:34 | |
if i root: cont_out($$) = { count_out($.type) } then I get back 2 | |||
free_out doesn't work | 09:35 | ||
i'll investigate | |||
luqui | yikes. need much more error checking code | 09:36 | |
free_in is an inherited attribute | |||
nothingmuch | right | ||
luqui | but operator::binary does not set free_in of its child | ||
ren | |||
nothingmuch | right... | ||
luqui | but it should | 09:37 | |
nothingmuch | fixing | ||
luqui wants automatic attr generation now | |||
I'll start the rewrite | |||
nothingmuch | yay! | 09:38 | |
luqui | works? | ||
nothingmuch | luqui++ | ||
not yet, i'm rewriting the stuff | |||
yay for the rewrite | |||
luqui | ah | ||
luqui wishes he didn't have homework | 09:39 | ||
nothingmuch | woot! | 09:40 | |
# got: 'āĻ. Ļ ā Ī±' | |||
# expected: 'āĪ±. āĪ². Ī± ā Ī²' | |||
not *exactly* it, but the AG side is working =) | |||
luqui | oohh pretty | 09:41 | |
nothingmuch | blammo! | ||
ok 1 | |||
i have an elegance issue | 09:42 | ||
dada smells APL | |||
nothingmuch | operator::binary: free_in($.left) = { Set::Object->new } | ||
operator::binary: free_in($.right) = { Set::Object->new } | |||
operator::binary: free_out($$) = { free_out($.left) + free_in($$) + free_out($.right) } | |||
or | |||
or thread the free stuff | |||
so that free_in($.left) = { free_in($$) } | |||
free_in($.right) = { free_out($.left) } | |||
free_out($$) = { free_out($.right) } | |||
which is cooler? | 09:43 | ||
luqui | well the latter doesn't do any set operations at all | ||
nothingmuch | right | ||
luqui | so I would probably like that better, as it's more general | 09:44 | |
without understanding your problem very well, of course | |||
nothingmuch | hmm | ||
right | |||
looking up all the free variables | |||
luqui++; # thanks | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "working test script" (207 lines, 3.9K) at sial.org/pbot/13429 | 09:46 | |
luqui ponders "multi attribute" | |||
nothingmuch | luqui: don't worry about backwards compatibility | ||
luqui won't | |||
nothingmuch | i'll be glad to upgrade my code | ||
luqui | in particular, I'm going to start requiring data structure declarations, I think | 09:47 | |
nothingmuch | but also try to make it at least semi efficient | ||
since now that I've practiced a little with the pretty printing, i'm going to try to represent type inferrence in AGs | |||
luqui | interesting | ||
pasteling | "nothingmuch" at 82.81.247.180 pasted "working test script" (207 lines, 3.9K) at sial.org/pbot/13430 | ||
nothingmuch | shit | ||
sorry everyone | |||
oi vey | 09:50 | ||
{ | |||
my $type = type::operator::arrow->new( | |||
my $a = type::variable::free->new, | |||
my $b = type::variable::free->new, | |||
); | |||
$a->instantiate($b); | |||
is($type->stringify, "āĪ±. Ī± ā Ī±"); | 09:51 | ||
} | |||
this is problematic since $b exists both under $type and under $a now | |||
Nonlinear attribute: you have two or more ways to assign a value | |||
to the attribute 'free_in' near grammar line 27. | |||
is there any way to deal with one thing appearing in several places in an AG? | 09:52 | ||
luqui | "one thing appearing in several places"? | ||
what kind of thing | |||
nothingmuch | look at 'sub instantiate' | ||
it assigns $b to $a.instance | 09:53 | ||
and reblesses $a to type::variable::instantiated | |||
luqui | okay | ||
... | 09:54 | ||
nothingmuch | the AG module tries to apply free_in($b) once from variable::instantiated and once from type::operator::binary | 09:55 | |
luqui | oic... | 09:56 | |
uh, reblessing is not supported :-) | |||
(however, one could fix it) | |||
by instead of using overload::StrVal everywhere, use refaddr or whatever from Scalar::Util | |||
nothingmuch | luqui: reblessing happens wayb the AG gets to eat it | 09:57 | |
rafl_ | luqui: I prepared a Debian package for Class::MultiMethods::Pure (it will be the first one that I'll upload with the newly created @debian.org account I'll get that week, btw. :-) But I still need a nice text for the description. You said you could provide one to me once.. | ||
luqui | oh | ||
nothingmuch | forget the reblessing | ||
it sets $a.instance to $b. | |||
luqui | rafl_, oh, yeah, but that requires work | 09:58 | |
luqui is a lazy bastard | |||
bug me on email and I'll email you one back | |||
nothingmuch asked about this on #haskell | 09:59 | ||
and figured out that true lazy evaluation of AGs should eat this | |||
luqui | so what's going on? | 10:00 | |
nothingmuch | what do you mean/ | ||
luqui | I never understood your question | ||
nothingmuch | well | 10:01 | |
we're constructing a type, right? | |||
in a lambda | |||
luqui | mkay | ||
nothingmuch | fun: type($$) = { type::operator::arrow->new( $a, $b ) } | ||
$a and $b are two free type variables | |||
in the env, the param is bound to $a | |||
so whenever the param is used, $a is used | 10:02 | ||
now, at some point a deeper operation is going to unify $a with something else | |||
e.g. type::operator::named->new("int") | |||
it does this by instantiating $a to be the new type | |||
luqui | by putting it in the env right? | ||
nothingmuch | in e.g. Ī»x. x | 10:03 | |
$a is unified to $b | |||
to yield the type a -> a | |||
forall a. a -> a | |||
luqui | alright | ||
nothingmuch | my $type = type::operator::arrow->new( | ||
my $a = type::variable::free->new, | |||
my $b = type::variable::free->new, | |||
); | |||
$a->instantiate($b); | |||
this is the operation i'm trying to do | |||
is($type->stringify, "āĪ±. Ī± ā Ī±"); | |||
this is the result | |||
variable::instantiated: free_in($.instance) = { free_in($$) } | 10:04 | ||
that is where it blows up | |||
since free_in($b) is set by that | |||
but also by this: | |||
operator::binary: free_in($.right) = { free_out($.left) } | |||
luqui | how is that possible? | ||
is this a dag? | 10:05 | ||
svnbot6 | r7232 | iblech++ | * t/operators/operator_overloading.t: s/sub/multi/ in one case | ||
r7232 | iblech++ | * t/packages/{symbols,reflection}.t: =begin obsolete'd the tests, | |||
r7232 | iblech++ | see thread "Packages, Modules and Classes" on p6l started by Stevan: | |||
r7232 | iblech++ | www.nntp.perl.org/group/perl.perl6....uage/23019 | |||
r7232 | iblech++ | * t/packages/{autoload,scope,import,require_and_use}.t: | |||
r7232 | iblech++ | skip all tests under PIL2JS and PIL-Run, as the tests need eval(). | |||
luqui | (me is still a little lost, so I'll ask a bunch of questions) | ||
interesting grammar, luqui | |||
nothingmuch | you're going to ask a bunch of questions, and you want to have them answered immediately? | ||
the reason it's possible: | 10:06 | ||
$type = (a -> b) | |||
$a.instantiate($b); | |||
$type = ($a($b) -> $b) | |||
$type = ($b -> $b) | |||
so far it's a DAG | |||
luqui | that's why | ||
dag not supported. If you can think of a way where an AG would make sense on a dag | 10:07 | ||
I'll try to do it | |||
but you have two ways to set an attribute of a single node. Which do you pick? | |||
nothingmuch | if it's evaluated lazliy, the attr of $b is once this, and once that | ||
depending on it's caller | |||
luqui | you mean it takes on two values over the course of the evaluation? | 10:08 | |
nothingmuch | hmm... yes | ||
dynamically scoped | |||
but that's hard | |||
luqui | that doesn't sound like a well-defined attribute to me | ||
nothingmuch | hmm | 10:09 | |
i think i'm slightly screwed | |||
i'll seperate the phase so that the check for frees and allocation of symbols happens before the AG pass | |||
luqui | you're not mutating anything over the course of the evaluation though, are you? | ||
nothingmuch | no, i'm not | 10:10 | |
luqui | hmm. yeah, it might be that what you're trying to do is not in AG's domain | ||
nothingmuch | *sob* | ||
it was such a pretty grammar | 10:11 | ||
luqui | on the other hand, it could be, and your brain is being foggy about exactly what an attribute should be | ||
but I don't really grok the problem... again. | |||
nothingmuch | do you know how milner type inferrence works? | 10:12 | |
luqui | not in detail | ||
nothingmuch | okay | ||
essentially going into the AST you allocate type variables, which are free | |||
you bind type variables to identifiers | |||
going out of the recursion you unify stuff | 10:13 | ||
luqui | by building a "substitution object", right? | 10:14 | |
nothingmuch | "substitution object"? | ||
luqui | a map from variables to types | ||
nothingmuch | hmm | ||
i went slightly more OO | |||
yes | |||
but the map is embedded in the vars | |||
so each var is either free or instantiated | 10:15 | ||
and it can be instantiated to point at another free var | |||
luqui | okay, fair enough | 10:16 | |
you want to do all this inside an AG? | |||
nothingmuch | this part can be in AG | ||
because the AG that infers is not touching the types | |||
i | |||
the AG that comes later, to print the types cannot work with the DAG that is the output of the type inferring AG | 10:17 | ||
luqui | ahh | ||
yeah, you'd have to convolve it into a tree | |||
nothingmuch | yep | ||
i'll just do a single pass traversal first | |||
cna you traverse a DAG with synthesized attrs only? | 10:18 | ||
no, that doesn't make sense either | |||
luqui | well, it sorta does | ||
but it would be tough not to use any inherited attributes anywhere | 10:19 | ||
nothingmuch | only for relative calls though | ||
root: layout($$) = { | |||
join(" ", | |||
(map { "?${_}." } sort map { layout($_) } free_out($.type)->members ), | |||
layout($.type), | |||
); | |||
} | |||
that will be undefined | |||
no, it won't, sorry | |||
but anyway, i'll just make a higher order traversal cmd | |||
svnbot6 | r7233 | iblech++ | t/unspecced/chop.t: &chop should be non-destructive, exactly as &chomp is. | 10:21 | |
r7234 | iblech++ | PIL2JS: | |||
r7234 | iblech++ | * Prelude::JS::Str: Implemented non-destructive chop. | |||
r7234 | iblech++ | * Prelude::JS::Array: Fixed array autovivification ($undef[42] = 23) (two-char patch). | |||
nothingmuch | frank zappa is sick | ||
www.lyricsfreak.com/f/frank-zappa/56813.html | 10:22 | ||
luqui | I hope he gets well soon | ||
nothingmuch | i think it's way too late | ||
luqui is frightened by those lyric | 10:23 | ||
s | |||
I need to source filter attributes now | 10:26 | ||
what would be a good syntax? | 10:27 | ||
nothingmuch | ? | ||
luqui | Node: SOMESYNTAX $.foo = { SOMESYNTAX $$ } | ||
it needs to be recognizable, so I can turn it into, eg. $parent->{'child:attr'}->() | 10:28 | ||
nothingmuch | what's bad with the function call interface? | ||
eep | |||
luqui | it doesn't work with the new algorithm | ||
nothingmuch | ah | ||
i kinda wished for $$.attr | |||
luqui | yeah, and I guess it only makes sense anymore to do it on direct children | ||
then we could compute deps to | |||
*too | |||
so we have $$.attr and $.left.attr | |||
that should do it | 10:29 | ||
nothingmuch | yep | ||
and anything that isn't an attr is a method call / hash key? | |||
luqui | error? | ||
nothingmuch | oh, wait | ||
yes, i see | |||
$$.attr vs $.key | |||
luqui | right | ||
nothingmuch | what about $.left.right.attr ? | ||
luqui | illegal | 10:30 | |
nothingmuch | okay | ||
svnbot6 | r7235 | iblech++ | PIL2JS: Prelude::JS::Array: &push and &unshift autovivificate undefined vars | 10:32 | |
r7235 | iblech++ | now, too (this means "my $arrayref; push $arrayref, 42" works now and | |||
r7235 | iblech++ | t/var/autovivification.t passes 19/20). | |||
nothingmuch has a half picture of what AGs could look like as a true language feature in perl 6 | 10:35 | ||
luqui | written or mental? | ||
nothingmuch | they are just methods | ||
both | |||
not syntax | |||
but structuure | |||
usually they are in a role tailored for a class | |||
but that role is not integrated | |||
instead you do a runtime mixin to get the effect of apply | 10:36 | ||
that way you can use grammars with conflicting namespaces on the same object | |||
but also use them statically to define a class | |||
attribute resolution within the role uses itself in a fully qualified manner before method resolution | 10:37 | ||
svnbot6 | r7236 | iblech++ | Pugs.Prim: &chop is now non-destructive (&chomp is non-destructive, too -- consistency). | ||
luqui | you should probably write something up | ||
nothingmuch | so when it is applied to root object, it will apply itself as a role to all the children implicitly | ||
(i'm still brainstorming) | |||
luqui | also see: svn.luqui.org/svn/misc/luke/work/co...grammar.pl | ||
for a reasonable implementation strategy | 10:38 | ||
nothingmuch | i haven't read the guts yet | ||
so i can't diff | |||
please explain it a bit | |||
luqui | which one? | ||
nothingmuch | the reasonable impl strategy | ||
visit creates all the possible attrs as thunks, right? | 10:39 | ||
luqui | you just do a one-pass traversal on the tree (using the "visit" method in this example) | ||
nothingmuch, yeah, you got it. that's about it | |||
nothingmuch | what is t() constructing? | ||
luqui | that's just debug code | ||
(defined at top) | 10:40 | ||
nothingmuch | ah | ||
oh, i see | |||
you should have used Devel::STDERR::Indent ;-) | |||
luqui | heh, yeah, I guess so :-) | ||
hmm, how would you like to see attrs declared? | 10:41 | ||
UUAG style (that always bothered me a bit) | |||
nothingmuch | same syntax as they're called | ||
yes, me too | |||
foo: $$.attr = { ... } | |||
foo: $.child.attr = { } # inherited | |||
luqui | hmm.. I suppose we could just construct on the fly | ||
no declaration then | 10:42 | ||
svnbot6 | r7237 | iblech++ | * t/general/basic.t: unEVAL, skipped the eval test under PIL2JS and PIL-Run, | ||
r7237 | iblech++ | and moved the MMD test to the end of the file. | |||
r7237 | iblech++ | * t/general/config.t: $*OS eq "browser" is ok. | |||
nothingmuch | ? | ||
luqui | defining it declares it, type-inference-style | ||
nothingmuch | oh, i see | ||
luqui | ("can't use attribute as both synthesized and inherited at grammar line...") | ||
nothingmuch | why do you hate threaded attrs? | ||
luqui | because it's a pun | 10:43 | |
you're really defining two different attributes | |||
nothingmuch | in that case, do you think a macro-ish approach to defining threaded attrs could work/ | ||
luqui | I'd like to find a way to define a threaded attribute cleanly without punning | ||
I mostly hate them because of how confused I was when I saw this in UUAG: | 10:44 | ||
@lhs.number = @lhs.number + 1 | |||
nothingmuch | $$.number = $$.number + 1 is a bit clearer | ||
luqui | uh, no | 10:45 | |
it's precisely as unclear. this is functional, damnit! $$.number is $$.number! | |||
nothingmuch | it feels like OO to me | ||
okay okay =) | |||
luqui | :-) | ||
nothingmuch | the rule for this is pretty simple though, isn't it/ | 10:46 | |
? | |||
the real .number is the synthesized one | |||
and any calls to it from within it's body goes to the inherited one | |||
luqui | that's the rule? | ||
nothingmuch | and conflicting inherited ones get name-mangled | ||
luqui | yeah, I guess so. | ||
I'd like to search for a better solution for a little while though | 10:47 | ||
since it's macroey and doesn't really require any magic on the part of the core, I can put it off | |||
nothingmuch | what i would really like is to be able to be more generic | ||
i wouldn't mount lack of threaded as a convenience if i could write | 10:48 | ||
attr_out($$) = { attr_out($.child) } | |||
and attr_in($.child) = { attr_in($$) } | |||
only once | |||
and have $.child be some sort of fmap | |||
luqui | elaborate | ||
nothingmuch | implemented with unordered (or order undefined) fold | ||
so that i could either cons the thing up to get a map | 10:49 | ||
or I could aggregate in the fold it to unify the attr into a scalar | |||
luqui | so the attr_in magic, afaict, is planned | 10:50 | |
you're saying that $.child represents more than one child? | |||
nothingmuch | no, that syntax is crazy | ||
but I would like to be able to define aggregate attrs without enumerating all my children | |||
especially for n-ary trees | |||
since map { attr($_) } @{ children($$) } | 10:51 | ||
whill no longer be alloweed | |||
luqui | oh. shit. | ||
maybe allow @.children | |||
as long as it is uniformly typed | |||
hmm, maybe not though | 10:52 | ||
I don't want to parse $.children[4].attr | |||
luqui wonders what it would take to make it more dynamic | 10:53 | ||
luqui stares at his attrgrammar.pl example | |||
hmmm | |||
It might be possible still to allow map { attr($_) } @{ children($$) } | 10:54 | ||
nothingmuch | btw, for all the haskell heads who don't appreciate foldr enough: let mymap f l = foldr ((:) . f) [] l | ||
mymap (+ 1) [ 1 .. 3 ] | 10:55 | ||
how is it possible? | 10:56 | ||
and please allow reduce instead of map, it's more general | |||
luqui | wow | ||
nothingmuch | wow? | ||
luqui | the foldr thingy | ||
nothingmuch | ah | ||
luqui | by "It might be possible still..." | ||
nothingmuch | yes, I like it a lot, after figuring it out a few mins ago =) | 10:57 | |
luqui | I meant that for arbitrary definitions of map | ||
nothingmuch | okay =) | ||
how will that work? | |||
luqui | for parents that set inherited attributes | ||
they just have a thunk hash key that looks like 'attr:Object=HASH(...)' | |||
and then you look up yourself in your parent's hash | 10:58 | ||
nothingmuch | i don't understand | 10:59 | |
joao | mymap seems obvious :) haskell is neat :) | ||
nothingmuch | who is yourself? | ||
the user? the attr def? | |||
luqui doesn't think mymap seems obvious. but it does seem cool | |||
the node who is inheriting the attribute | |||
joao | luqui, do you understand foldr function? | ||
nothingmuch | attrs are not really inherited? | 11:00 | |
luqui | no, they are looked up in the parent | ||
nothingmuch | oh | ||
so the impl of inheritence is like OO inheritence | |||
instead of putting the value in the child, it stays in the parent... right? | |||
luqui | joao, I understand it to the degree that I understand the compose operator: I know what it does, but I have to think about it for a while | ||
nothingmuch, right | 11:01 | ||
nothingmuch | what is the compose operator? | ||
luqui | (.) | ||
nothingmuch | ah | ||
luqui | so then a definition that uses compose and foldr in the same statement takes a little more while | ||
nothingmuch | simpler form will be 'let my map f l = foldr (\x, xs -> (f x):xs) [] l | ||
luqui | right, that makes sense | 11:02 | |
broquaint | That's a map() implementation, right, nothingmuch? | ||
nothingmuch | broquaint: yep | ||
luqui | that's one of my complaints with [+] and reduce in p6 | ||
joao | i think the other is better :) | ||
luqui | there are two kinds of reduce, and we don't let the user pick | 11:03 | |
joao | you can even forget that l :) | ||
nothingmuch | joao: ofcourse =) | ||
broquaint | I think, sometimes, Haskell is a little too terse. | ||
nothingmuch | you can also use autocurrying and flip to get rid of f too | ||
let me try | |||
luqui | joao, the reason that people liked "the other better" is the reason that it took me two months to learn haskell instead of a week | ||
joao | luqui, :) | 11:04 | |
have you ever seen those catamorphisms diagrams? :) | |||
luqui | uh... catamorphism... rings a bell | ||
joao | after that, foldr (which is a catamorphism on lists) seems nicer | ||
nothingmuch | what's a catamorphism? | 11:05 | |
google has no defs | |||
luqui | @pl let mymap f l = foldr ((:) . f) [] l in mymap | ||
flip foldr [] . ((:) .) | 11:06 | ||
nothingmuch | let mymap = ((flip foldr) []) . ((:) . ) | ||
luqui | how very clear | ||
nothingmuch | right | ||
oh, lambdabot does it? and i worked by hand? how lame! | |||
luqui | :-) | ||
nothingmuch | so what's a catamorphism? | 11:07 | |
joao | well | 11:08 | |
a catamoorphism is a function | |||
that operates on an indutive type | |||
and builds some value | |||
this is the most "general" definition I can give | 11:09 | ||
I am searching a paper to show you | |||
wiki.di.uminho.pt/wiki/pub/Educatio...calc_2.pdf | |||
page 58 :) | |||
nothingmuch | "inductive type" is what I would call an aggregate type? | ||
luqui | recursive | ||
like a list | |||
nothingmuch | ah | ||
joao | If an aggregate type is a recursive type, yes :) | ||
nothingmuch really needs to take his dad's course | 11:10 | ||
joao | [] -> base ; (:) -> constructor | ||
You can decompose [a] in ([] + a x [a]) | |||
meaning: the list is empty OR it is composed by an element (head) followed by another list (tail) | |||
luqui | ahh, x like cartesian product | 11:11 | |
joao | yes | ||
(a,[a]) :-) | |||
Using diagrams to express catamorphisms is nice to explain recursive pointfree programming :) | 11:12 | ||
nothingmuch | define: decompose | ||
be able to take it apart recursively? | |||
joao | yes, I think so :) | ||
luqui | he's just saying data List a = [] | a : [a] again | ||
er, data [a] | |||
nothingmuch | and what is the + saying in that expr? | 11:13 | |
luqui | union | ||
nothingmuch tries to transpose what he knows about unions and products into this discussion | |||
luqui thinks joao is using ocamlesque notation | |||
nothingmuch | so much to learn, so little brain | 11:14 | |
joao | luqui, it's the notation I've learned to do pointfree proofs... | ||
luqui, not sure if it derived from ocaml :P | |||
luqui | okay | ||
nothingmuch | what is pointfree? | 11:15 | |
luqui | it's what you did to mymap | ||
rep | you mean pointless :P | ||
luqui | getting rid of all the names | ||
nothingmuch | ah | ||
joao | The nice thing about this stuff is that you capture the datatype recursion in the catamorphism definition (there is also the anamorphism notion, which is the opposite) | ||
and then.. having a library defining the type and their cata and ana | |||
luqui | this is sounding like category theory | 11:16 | |
joao | you just define the little pieces (called the gene) that make what you want :) | ||
the recursion is captured in the libraries :) | |||
you haskell code reduces a lot :) | |||
luqui | reminds me of the type analog of fix | ||
nothingmuch thinks he wants to know that business =) | 11:17 | ||
i have to quit my job and go study already | |||
joao | nothingmuch, I can give some examples someday (not now, sorry) | ||
I'd be happy to show you how that stuff works :) | |||
luqui | joao, please do someday | ||
nothingmuch | joao: i'll try to remember to ask you... thanks =) | ||
joao | I will, thanks for letting me do it :) | ||
nothingmuch | luqui: whatever that stuff is, we want it in perl 6, right? | 11:18 | |
;-) | |||
joao laughs | |||
luqui | of course | 11:19 | |
joao | I'll eat something, be back later :) | ||
nothingmuch | ciao joao, and thanks again =) | ||
luqui | perl 6 is *the* fat language: everything that is in anything anywhere is in perl 6 | ||
nothingmuch | s/is/will be/ | ||
luqui | mathematically: perl6 = Union_(x in anything){ x } | ||
nothingmuch | where x is whitespace and anything is python? | 11:20 | |
luqui | uh | ||
perl6 = Union_(x is a feature of anything) { x } | |||
joao | but without cholesterol :))) | ||
luqui | and the stuff that is unique to perl 6 comes from the fact that perl6 (in) anything. | 11:22 | |
nothingmuch | i think you want [ x | <- x in anything, f(x) > t ] where f x = (flip foldr [] . ((:) . )) (likes x) @larry | ||
oh wait | |||
no, you actaully want a real reduction, not a map ;-) | 11:23 | ||
luqui | haha | ||
nothingmuch | btw, wrt foldr - i learned to appreciate from the why ags matter article | ||
luqui | really? | ||
nothingmuch | so you should have done your homework better =) | ||
yes, i thought that the def of diff *without* the AGs was really superb | |||
not as maintainable or clear as an AG | 11:24 | ||
but much more impressive ;-) | |||
luqui | in listing two? | ||
nothingmuch | yes | ||
nothingmuch expanded it on paper | |||
and then realized WTF was going on | 11:25 | ||
luqui | see, that's why I haven't switched to haskell yet. Programming is the middle ground between literature and mathematics | ||
nothingmuch | ? | ||
luqui | Haskell is much further on the right than most programming | ||
you're supposed to be able to "read" code | 11:26 | ||
nothingmuch | yes, but the moment you bring yourself to that space, you can read almost as well | ||
but write books that are black with ink | |||
luqui is too tired to deal with metaphor right now | 11:27 | ||
:-) | |||
nothingmuch | okay | ||
basically: once you get used to haskell, you can still read code | |||
less people in the world can | |||
luqui | that's sorta true | ||
nothingmuch | but the code you are now used to handling is much more dense | ||
because most of the things that make your mental stack overflow become idiomatic the moment you understand them once. | 11:28 | ||
luqui | exactly, it's much further on the right, i.e. much more like mathematics | ||
nothingmuch, good point | |||
nothingmuch | i don't want perl 6 to be this way though ;-) | ||
luqui | exactly | ||
nothingmuch | i think haskell, despite all it's advantages, is not accessible to enough people | ||
luqui | well, haskell forces you to rewire your brain | 11:29 | |
nothingmuch has a friend he would like to experiment on | |||
the friend is just learning to program | |||
luqui | something that perl 6 is trying really hard not to do (but it's hard, because you'll have to rewire *more* to read code) | ||
nothingmuch | and the idea of teaching him haskell from day one crossed my mind | 11:30 | |
it will help me improve | |||
luqui | that would be a very interesting experiment | ||
nothingmuch | the problem is that his army duties have increased recently | ||
so far we've gotten around to the meaning of structure and binding | |||
he coded up a bottles of beer program | |||
but we haven't done anything but get drunk together since | 11:31 | ||
luqui | haha | ||
rep | hehe | 11:33 | |
nothingmuch suddenly realized that there is more than met his brain, but seemed to have met your eyes in his last two sentances ;-) | 11:34 | ||
masak | :) | 11:36 | |
nothingmuch | i need a break, i'm being silly instead of writing code | ||
svnbot6 | r7238 | iblech++ | * t/builtins/{arrays,hashes}/slice.t: Added tests for @array[1,2,3] := | 11:38 | |
r7238 | iblech++ | @array_containing_less_than_3_items; | |||
r7238 | iblech++ | * PIL2JS: Prelude::JS::Array, Prelude::JS::Hash: | |||
r7238 | iblech++ | Implemented binding of array and hash slices. This means | |||
r7238 | iblech++ | t/builtins/{arrays,hashes}/slice.t pass 99% now. | |||
r7238 | iblech++ | * t/builtins/undef.t: Added a try {...} around a (in PIL2JS) dieing test. | |||
luqui | nothingmuch, there was an AG discussion on PerlMonks | 12:03 | |
? | |||
nothingmuch returns | 12:04 | ||
where? | |||
luqui | r8709@syeeda: nothingmuch | 2005-10-01 14:52:23 +0200 renamed 'avg' to 'global_avg' to make things clearer (this confused Corion on perlmonks) | 12:05 | |
nothingmuch | ah | ||
i talked to Corion about this in pm chat | |||
and he said 'i don't fully grok that yet' | |||
so we went over it | |||
and then he said 'well, i don't see how avg can be inherited, that just doesn't make sense' | |||
luqui | I see | 12:06 | |
nothingmuch | so i said 'oh, that's because it's not really the average, it's the global average' | ||
so yes, but not a posted discussion | |||
arf! | 12:08 | ||
i lost my copy of the hair soundtrack! | |||
nothingmuch wonders how such idiocy happenned | 12:09 | ||
12:28
Aankh|Clone is now known as Aankhen``
|
|||
luqui sent off theory.pod to @Larry | 12:30 | ||
nothingmuch | woot | 12:31 | |
nothingmuch really hopes it'll be accepted | |||
btw, i was meaning to implement the tuple type at some point | |||
and type infer it | |||
but i need to type infer regular pairs first ;-) | |||
luqui | oh you mean the arg tuple... | 12:32 | |
that could be a challenge | |||
luqui hopes it isn't though | |||
nothingmuch | i don't think it's too hard | ||
it's just a concrete data type that nests | 12:33 | ||
err, abstract | |||
but can be implemented concretely | |||
and happens to be manipulated at compile time as well as runtime. | |||
luqui | well, I have to be off to school now | 12:37 | |
nothingmuch | a.as-us.falkag.net/dat/bgf/200410/13/1085.gif (Add a FREE SpyWare program to your desktop) | ||
luqui | heh | ||
& | 12:38 | ||
nothingmuch | ciao | ||
svnbot6 | r7239 | iblech++ | PIL2JS: Prelude::JS::Array: Sped up the new autovivification-capable &push and | 13:20 | |
r7239 | iblech++ | &unshift by 88% by porting the necessary if-clause to JS. As &push is used very | |||
r7239 | iblech++ | often (for, map, etc. all use it), this should speed up make smoke by 10 min or so. | |||
nothingmuch | en.wikipedia.org/wiki/Wayne_McLaren | 13:50 | |
cute | |||
joao | nothingmuch, but people continue to smoke... | 14:19 | |
nothingmuch | i smoke too, occasionally | ||
i just think it's funny =) | |||
not so much the actual cancer stuff | |||
joao | I don't mind if others want to destroy their health, actually. I'm just bothered when they don't respect mine.. | 14:20 | |
svnbot6 | r7240 | iblech++ | * t/builtins/perl.t: Added tests for "\t".perl, "\n".perl, etc. | ||
r7240 | iblech++ | * perl5/Perl6-Value/lib/Perl6/Value.pm: Fixed the stringification | |||
r7240 | iblech++ | ("$key\t$value") and .perlification of pairs ("($key.perl() => | |||
r7240 | iblech++ | $value.perl())"). | |||
nothingmuch | but the fact that an icon of maniliness (implying stamina, power, etc), that caused people to consume cigarettes so directly meets such an end | ||
and i also find it ironic that while advertisement makes it easy for people to start smoking, you don't see it stopping anyone (my bet is the budget difference is the reason for this) | 14:21 | ||
joao | Probably | 14:22 | |
nothingmuch | as for your health - smoking is like peeing in a swimming pool... I totally agree, and people should ask permission before smoking next to anyone | ||
as for mine - i'm not too worried - i smoke around once a week | 14:23 | ||
joao | Well, I read somewhere that being a passive smoker gives you more 40% possibilities of having coronary issues | ||
I'm not worried if someone smokes near me; I just think it's disrespect | |||
nothingmuch | it is | 14:24 | |
joao | I'm from Portugal, and believe me, portuguese smokers don't care about others ;) | ||
For instance, in my department I've seen people smoking below the "NO SMOKING" sign | 14:25 | ||
Instead of removing the smokers... they removed the sign! :) | |||
nothingmuch | i thought the trend in europe in the past 20 years was against smoking | ||
i remmeber that 10 years ago in austria you couldn't walk into a resteraunt without choking | 14:26 | ||
but nowadays even my aunt's husband quit | |||
joao | It's funny, some days ago, I've seen some old men who want to sue tobacco companies because the companies made them believe that smoking was a "men thing" | 14:29 | |
Today they need special devices to emit some sounds... it's sad. | |||
nothingmuch | it is | 14:30 | |
i think you'll like this: www.adbusters.org/spoofads/alcohol/...impotence/ | |||
joao | hehe :) | 14:31 | |
shakespeare was a bright fellow :) | |||
nothingmuch | yup | 14:32 | |
joao | nothingmuch, where are the list operations defined? | 14:36 | |
nothingmuch | src/Pugs/Prim.hs or src/perl6/Prelude.pm | ||
svnbot6 | r7241 | iblech++ | util/run-smoke.pl: "You may want to submit the report to the public | ||
r7241 | iblech++ | smokeserver: [...]" | |||
Aankhen`` | I definitely am worried if people smoke near me. They are consciously choosing to adversely affect my health through secondhand smoke. "Disrespectful" is not the word. | 14:37 | |
joao | I am trying to get into Pugs... | ||
Aankhen``, I agree, byt my english level don't allow me to be more explicit :)) | 14:38 | ||
Aankhen`` | Heh. | ||
joao | :) | ||
nothingmuch | yowza! | 15:33 | |
type inferrence of non generic functions is working | |||
now to do generics | |||
svnbot6 | r7242 | iblech++ | * STATUS: s/PIL2JS passes almost 90%/PIL2JS passes 90%/ :) | 15:36 | |
r7242 | iblech++ | * pugs::hack: s/a public server/the public smokeserver/ | |||
r7243 | iblech++ | * t/builtins/strings/substr.t: substr(..., $replacement) superceded by | 16:47 | ||
r7243 | iblech++ | substr(...) = $replacement? | |||
r7243 | iblech++ | * PIL2JS: Prelude::JS::Str: &substr: | |||
r7243 | iblech++ | * Fixed &substr when $start_pos > 0 and $len < 0. | |||
r7243 | iblech++ | * Made &substr return a readwrite proxy object: | |||
r7243 | iblech++ | substr($str, $pos, $len) = $replacement; # works now | |||
r7243 | iblech++ | * This means substr.t passes 30/31 now, with 6 unexpected successes. :) | |||
joao | what is the equivalent for "apt-get update; apt-get upgrade;" on freebsd? "freebsd-update fetch; freebsd-update install" ? | 16:57 | |
nothingmuch | uh | ||
autrijus: ping? | |||
i guess you ought to try #freebsd | |||
i don't know about anyone but autrijus who uses freebsd and is active on this channel | |||
seen autrijus | |||
jabbot | nothingmuch: autrijus was seen 1 days 22 hours 38 minutes 38 seconds ago | ||
joao | nothingmuch, thanks :) | 16:58 | |
b6s | /c/c | ||
oops, sorry | |||
joao | let me see the handbook, first :D | ||
nothingmuch | b6s: that's really unacceptable | ||
please take this behavior to another channel | 16:59 | ||
joao grins | |||
nothingmuch | OOOF!!! Milner is melting my bRAIN | 17:00 | |
joao | nothingmuch, Pugs should have a TODO list in its root :-) | ||
nothingmuch | errm. there's too much to do ;-) | ||
i can spit out some random stuff | |||
if you want to hack core - look at the smoke reports | |||
if you want to hack perl 6 - make the smoke report have bigger numbers | |||
or port/write a module | 17:01 | ||
otherwise there are some side projects: | |||
PIL2JS, PIL-RUN, the metamodel, Blondie | |||
blondie has a side project that I'm working on right now - hindley-milner inferrencing in perl | |||
with enough hooks to be able to generate type runtime type boxing and unboxing apps instead of type errors where applicable | 17:02 | ||
when this is done it'll get backported to blondie | |||
then that will hopefully give us knowlege on how to compile perl 6 statically | |||
PIL2JS is a PIL compiler that emits JS written in perl 5 | 17:03 | ||
and PIL-RUN is a PIL interpreter written in perl 5 | |||
the metamodel is a spiritual project, and is implemented mostly in perl 5, but is supposed to be ported to haskell | 17:04 | ||
i hope some of these interest yyou | |||
and if they don't - you can add a TODO file ;-) | |||
do you have commit access? | |||
joao | yes, I do | ||
nothingmuch | good | ||
joao | I just need to get into the structure, and then into *something* where I can be useful :) | 17:05 | |
nothingmuch | would you like a brief explanation of how pugs works? | 17:06 | |
joao | I don't want to bother or make you guys loose your time... but I'd appreciate if you really want to do it :) | ||
nothingmuch thinks long and hard if he *really* wants to override isa | |||
joao: well, in the long term I guess by helping you out I could be saving time ;-) | 17:07 | ||
either way, it's worth the effort | |||
even if only for the hype | |||
so ask away | |||
joao | :) | ||
well, what would you say to someone who's looking into the source for the first time? :) | 17:08 | ||
nothingmuch | ermm | ||
pugs is an interpreter written in haskell | 17:09 | ||
it parses (src/Pugs/Parser.hs) perl 6 with parsec | |||
and constructs an AST | |||
this AST is then reduced | |||
joao nods and pays attention | |||
nothingmuch | the reduction is done along side an Env | ||
this contains symbols and stuff | |||
when you compile pugs an interesting thing happens: | 17:10 | ||
src/perl6/Prelude.pm is compiled | |||
into haskell | |||
which is #included into Run.hs | 17:11 | ||
that is +- the initial env | |||
this is the big slow down in compiling Run.hs, btw | |||
the AST itself can be serialized or evaluated by pugs | |||
the serialization emits PIL (pugs intermediate language) | 17:12 | ||
and the evaluation emits 'IO ()' | |||
now your turn to ask more questions | |||
*now it's | |||
joao | ok, first: you said the AST is reduced along with an Env. I didn't understand what you mean. (The reduction is optimizing code, right? Evaluating certain things to get a smaller AST, etc..) | 17:14 | |
nothingmuch | no, the reduction is the actual evaluation | ||
i kind of confused the order | |||
we have no optimizer yet | |||
joao | oh | ||
nothingmuch | (though a peep hole optimizer for PIL could be a cool project) | ||
joao | ok, so.. | ||
the AST is evaluated using an Environment, is that it? | 17:15 | ||
joao smiles | |||
nothingmuch | yes | ||
the env keeps the symbols and stuff | |||
i forgot the precise details | |||
joao | where is that env defined? :) | ||
Run.hs ? | |||
nothingmuch | let me see | ||
i doubt it | |||
Run.hs is the command line arg processing stuff | |||
and the code to take source from a file/string/interactive input, and compile/run it | 17:16 | ||
AST.hs is everything AST | |||
and AST/Internals.hs contians 'data Env' | |||
joao | ok, another question. Run.hs includes a PreludePC, is it the Prelude.pm compiled into haskell? | ||
nothingmuch | yes | ||
joao | ok, last question for now: when you say "AST serialization" what do you mean? | 17:17 | |
nothingmuch | the AST can be dumped to a file/stdout | ||
for example: | |||
joao | oh, ok | ||
No need to explain | 17:18 | ||
nothingmuch | ./pugs -CPIL -e 'say 10' | ||
joao | :) | ||
nothingmuch | just FYI regarding the PIL: it's scheduled to be replaced by PIL2 soon | ||
but it should be quite similar | |||
joao | hmm | ||
PIL is also used for Parrot Intermediate Language, right? | |||
nothingmuch | as you can see the PIL output contains MkPos etc to give back nice runtime errors | 17:19 | |
joao | (the acronym) | ||
nothingmuch | (no, that's PIR - which is like assembler, while PIL is like ANF) | ||
(not that I know what ANF is - excpet the acronym ;-) | |||
joao | Good, PIL is defined as an Haskell DT | ||
nothingmuch | yes | 17:20 | |
rep | DT? | 17:21 | |
joao | What is the role of Prelude.pm in this figure? (sorry, I am just trying to put things together) | ||
datatype | |||
nothingmuch | data type | ||
Prelude.pm is written in perl | |||
and it's just the basic functions | |||
that can be implemented in perl | |||
(src/Pugs/Prim.hs contains the table of perl stuff implemented in haskell) | 17:22 | ||
it's precompiled for speed | |||
joao | Oh, but you could implement those in haskell too, right? | ||
nothingmuch | instead of being compiled as perl into every program | ||
whatever's implemented in perl is not implemented in haskell | |||
if I get my way (which there is no reason that won't happen, because no one said it's a stupid way yet) this distinction won't be there | |||
the prelude will implement stubs for E.G. IO | 17:23 | ||
and each runtime will implement whatever prelude functions it wants for efficiency/features/whatever | |||
joao | E.G. ? | ||
nothingmuch | err, e.g. | ||
you should know, you speek a latin derived lang, don't you? | |||
for example in english.. i forget the latin | |||
joao | ou | 17:24 | |
:) | |||
nothingmuch | i remember id es | ||
joao | I thought it was some acronym :) | ||
nothingmuch | exempli gratia | ||
no, i just had a brain fizz and typed it uppercase by accident ;-) | |||
joao | :) | 17:25 | |
Ok... | |||
Southen_, it would be nice for me to start by Parser.hs | 17:26 | ||
And then take a look at Run.hs | |||
s/Southen_/So, | |||
nothingmuch tab completes words he shouldn't all the time too | |||
joao | :) | ||
nothingmuch | sure | ||
you should know: | |||
joao | xchat, here.. | ||
nothingmuch | in perl we have begin blocks | ||
they are executed the moment they are done parsing | 17:27 | ||
joao | uh? you execute a block after parsing it? | ||
nothingmuch | ?eval BEGIN { say("foo") } oiu2165 {}{{{{{ syntax error | ||
evalbot_7243 | foo Error: unexpected "{" expecting block construct, ":", term, term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
nothingmuch | as you can see it emitted foo before even parsing the other stuff | ||
that's the unsafe stsuff in the parser | 17:28 | ||
joao | hmm, what's the reason? | ||
nothingmuch | uh, perl just is that way =) | ||
it's useful | |||
joao | I'm learning perl6 at the same time I look into Pugs. It will be nice ;) | 17:29 | |
nothingmuch | =) | ||
joao | The problem is all the stuff I have to end this month | ||
(work stuff) | |||
nothingmuch | work is always a problem ;-) | ||
dev.perl.org/perl6/doc/synopsis.html | |||
that link contains most of what you need to know about perl 6 | |||
joao | yes... I was following the oreilly book | 17:30 | |
nothingmuch | as a delta against perl 5 | ||
ah | |||
nothingmuch bought it but hasn't read it yet | |||
joao | but I think some little things are already old | ||
nothingmuch | it's probably way out of date by now | ||
so i'm undermotivated to start reading it now ;-) | |||
joao | :) | ||
why 1-6, 9-13, 29 ? | 17:31 | ||
nothingmuch | 7 is obsolete, i think | 17:32 | |
8 is unwritten | |||
joao | oh , ok | ||
nothingmuch | 13-28 are unwritten (but mostly minor) | ||
dev.perl.org/perl6/doc/apocalypse.html | |||
these are much bigger, more detailed, and less processed | 17:33 | ||
as you can see A7 is a placeholder | |||
and E explains how that behavior will be implemented for backwards compatibility with perl 5 as a standard module | |||
joao | I think I won't read the book. Synopses look better :) | 17:34 | |
nothingmuch | i think they're easier | ||
since they encourage interactivity | |||
joao | :) thank you | ||
nothingmuch | you can find syopsis and tests that are interlinked here: nothingmuch.woobling.org/pugs_test_.../Synopsis/ | ||
for example operator overloading, in s06 is tested in two placed | 17:35 | ||
denoted by the small 't' links next to the heading | |||
the tests can also point to text within the section by matching a regex | 17:36 | ||
that can help you see how these things look and run | |||
joao | thanks! very cool :) | 17:37 | |
nothingmuch will go biking soon | 17:40 | ||
lets see if i can finish the generic function stuff first though | 17:41 | ||
shit | 17:44 | ||
joao | what? | 17:48 | |
nothingmuch is not getting along with AGs at the moment | |||
i have to keep track of which type variables are generic | |||
and my code to unify the set with a new member is not being invoked at all =( | |||
autrijus | greetings from .fi! | 18:00 | |
nothingmuch | hola autrijus! | ||
what is fi? | |||
finland? | 18:01 | ||
joao | finland? | ||
:) | |||
obra | 'afternoon, autrijus | ||
autrijus | yup :) | ||
autrijus gets ready for the weekly parrot meeting | |||
nothingmuch | autrijus: full milner type inferrencing is almost ready for blondie | ||
autrijus | nothingmuch: excellent. then we can talk about adding the annotation strata on it | 18:02 | |
nothingmuch | define: strata | ||
gah: No method found for args (type::operator::nullary=HASH(0x196c5b0) ide=HASH(0x191f440) val=HASH(0x196c550)) at (eval 138) line 20 | |||
i have no 'No method' or 'args' in the file | |||
i wonder what bit of code is making that ;-) | |||
autrijus | nothingmuch: see Francois Pottier's paper... a sec | 18:03 | |
nothingmuch | nono | ||
no more papers today | |||
my brain is at 98c | |||
autrijus | nothingmuch: search for "From ML Type Inference to Stratified Type Inference" | ||
oh ok. | |||
nothingmuch | a little more stress and it'll melt | ||
let me ask another question: | |||
what is stratified type inference good for? | |||
autrijus | it's good for propagating user-annotated types first | 18:04 | |
nothingmuch | ah | ||
autrijus | because you see, in H-M the user doesn't have to annotate any time. | ||
nothingmuch | right | ||
autrijus | but in richer type systems, H-M no longer suffice | ||
nothingmuch | yep | ||
autrijus | one well known example being higher ranked polymorphism | ||
nothingmuch | i learned some things about haskell that I didn't imagine really were | ||
autrijus | so there need to be a systematic way to codify the heuristic | ||
of taking user annotations and propagate in "obvious" direction | 18:05 | ||
befor you run the M-L | |||
thus saving the user from having to type in every type. | |||
nothingmuch | woah | ||
autrijus | it's also known as "local type inference" and "wobbly types" | ||
nothingmuch | hmm | ||
makes sense | |||
autrijus | but pottier gave it a consistent treatment. | ||
nothingmuch will look at it tomorrow | |||
nothingmuch 's code is actually running again | 18:06 | ||
# got: 'āĪ±. Ī±' | |||
# expected: 'int' | |||
bah | |||
now to find out where i forgot to unify now that we're dealing with generic types | |||
autrijus is playing around with Visual Haskell | 18:07 | ||
nothingmuch | shyte | ||
if i clone the a in a -> b and b is intantiated to a i need to keep them in synch | |||
nothingmuch will do a deep clone of both | |||
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOTTTTT | 18:10 | ||
it actually work! | 18:11 | ||
s | |||
now to fix the pretty printer | 18:13 | ||
what's the perl switch to make all handles utf8 by default? | 18:14 | ||
Test::Builder is not listening to 'BEGIN { binmode STDOUT, ":utf8" } | |||
autrijus | nothingmuch: use encoding 'utf8' | 18:19 | |
nothingmuch | doesn't help | ||
the problem is sub _new_fh in T::B | |||
perl -CDS is somehow not convincing *that* instance of open to use utf8 by default | |||
oh well | 18:20 | ||
whatever | |||
now to splat a DAG into a tree | |||
joao | when I remove a file in a svn rep, doing svn up restores the file. svk pull shouldn't do the same? | 18:23 | |
autrijus | joao: no, it's "svk revert" and for directories, "svk revert -R". | ||
hey stevan! got questions for you! | |||
(but in a meeting now) | |||
joao | autrijus, thanks | ||
Khisanth | nothingmuch: seems to work fine with the binmode | 18:26 | |
nothingmuch | Khisanth: the problem is that T::B::_new_fh is opening local *FH | ||
as a dup of STDOUT, i think | |||
and somehow it's not applying to it | |||
Khisanth | hmm | 18:27 | |
nothingmuch | Wide character in print at /System/Library/Perl/5.8.6/Test/Builder.pm line 1078. | ||
asee also 'sub output' and 'sub _new_fh' | |||
autrijus_tw | gah. my laptop is drinkign tea again. | 18:41 | |
autrijus_tw hopelessly waits it to dry up | |||
Khisanth | oO | 18:47 | |
nothingmuch | heh | 18:52 | |
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE | |||
pasteling | "nothingmuch" at 82.81.247.180 pasted "inferrence" (18 lines, 344B) at sial.org/pbot/13440 | 18:53 | |
"nothingmuch" at 82.81.247.180 pasted "inferrence" (18 lines, 449B) at sial.org/pbot/13441 | 18:54 | ||
nothingmuch | oops | ||
nothingmuch whores lots of karma in this commit =) | 19:01 | ||
we need more smokers | 19:03 | ||
linux is not being done at all | |||
oh, sorry | 19:04 | ||
wrong group | |||
svnbot6 | r7244 | nothingmuch++ | Milner - Hindley type inferrencing for blondie | 19:09 | |
r7244 | nothingmuch++ | * implemented with Language::AttributeGrammar and Class::Multimethods::pure | |||
r7244 | nothingmuch++ | (thanks to luqui++) | |||
r7244 | nothingmuch++ | * new temporary AST for easier polymorphic thunks, will be backported | |||
r7244 | nothingmuch++ | * type pretty printer with unicode | |||
autrijus_tw | smoke.pugscode.org is up as an easier-to-remmber facade | 19:10 | |
nothingmuch | how do you svn prop? | ||
yay! | 19:11 | ||
svk | |||
autrijus_tw | nothingmuch++ for spreading the love to parrot :) | ||
svk prop? | |||
nothingmuch | no, i mean the "default" ones we use | ||
autrijus_tw | svn:mime-type text/plain; charset=UTF-8 | 19:12 | |
nothingmuch | gaal told me about the script | ||
autrijus_tw | svn:eol-style native | ||
nothingmuch feels like this could have been really beautiful code if it were perl 6 | 19:13 | ||
we need AGs for p6 | |||
autrijus_tw | port L::AG over? | ||
shouldn't be that hard :) | 19:14 | ||
nothingmuch | luqui is redoing it | ||
so not now | |||
and I think this can be implemented with a much better integrated interface with perl 6 | |||
svnbot6 | r7245 | nothingmuch++ | r8815@syeeda: nothingmuch | 2005-10-03 21:12:32 +0200 | ||
r7245 | nothingmuch++ | propfix | |||
nothingmuch | eepp | ||
nothingmuch always forgets to push --verbatim | |||
vladtz | I could do some linux smoking (however my box is a amd-64 and I use the 32 bit compilers) | 19:15 | |
nothingmuch | autrijus_tw: thanks *yet again* for introducing me to AGs | ||
vladtz: it still runs, doesn't it? | |||
vladtz | Did yesterday, lets svn and check, back in an hour,.... | ||
nothingmuch | vladtz++ | 19:16 | |
autrijus_tw | nothingmuch: looks like you are having a lot of fun with AG :) | 19:20 | |
nothingmuch | autrijus_tw: lots | ||
autrijus_tw wonders if nothingmuch will benefit from the EHC tutorials/code | |||
nothingmuch | i'll have a look tomorrow | 19:21 | |
autrijus_tw | it's a surprisingly complete Haskell implementatino :) | 19:22 | |
nothingmuch | what does it compile to? | ||
or is it an interpreter? | |||
autrijus_tw | it compiles to Grin | ||
nothingmuch | cool | ||
autrijus_tw | from there to native, I think | 19:23 | |
there's some talk about LLVM but didn't transpire | |||
P6 probably doesn't want grin, I think it wants ANF with some modifications. | |||
nothingmuch | is there any place I can learn about ANF that isn't the compiling with continuations paper? | 19:24 | |
it's a bit over my head | |||
i'll go over it with dad tomorrow (he's a logician, so he can read this stuff) | 19:25 | ||
autrijus_tw | oh, ANF is actually very simple | ||
nothingmuch | what is diff(ANF, SSA) ? | 19:26 | |
Aankhen`` goes to sleep. | |||
G'night. | |||
joao wonders what ANF is | 19:27 | ||
b6s | A-something normal form? | ||
autrijus_tw | Administrative. | ||
nothingmuch: www.cse.unsw.edu.au/~chak/papers/CKZ03.html | |||
joao | American Nurses Foundation? :) | ||
b6s | oh, restricts to lambda | 19:31 | |
vladtz | pugs still build on linux/amd-64, cpan however is confused somehow and tries to run tests with pugs iso perl, anyone??? | ||
autrijus_tw | vladtz: nopaste a log? | 19:32 | |
vladtz | where is pastebot? | ||
kolibrie | perlbot nopaste | 19:34 | |
perlbot | Paste your code here and #<channel> will be able to view it: sial.org/pbot/<channel> | ||
pasteling | "vladtz" at 80.127.84.50 pasted "CPAN confused into usign pugs" (13 lines, 841B) at sial.org/pbot/13443 | ||
vladtz | kolibrie: thanks | ||
kolibrie | vladtz: no problem | 19:35 | |
vladtz | time for a drink with the so, bye | 19:39 | |
IÄŗl check the logs for possible anwers.... | 19:40 | ||
Limbic_Region | nothingmuch - did you see luqui just journaled on AG again? | 19:42 | |
nothingmuch | yep | ||
he raised the topic earlier today | |||
kolibrie | nothingmuch: can you figure out what vladtz's paste means? Test-TAP-Model problem | 19:43 | |
nothingmuch | phooey | ||
i wonder what version of Module::Build it is | 19:44 | ||
kolibrie | who knows | ||
nothingmuch | T::TH has no relation what so ever to pugs | ||
perhaps PERL_TEST_HARNESS leaked? | |||
kolibrie | that's what's so weird | ||
nothingmuch | it looks like it | ||
autrijus_tw gives up on he h6-e 6f the 2eyb6ard behavng t nght | 19:45 | ||
nothingmuch | heh | ||
i hope there was no sugar in the tea | |||
autrijus_tw | we'33 see if tomorrow wil3 mae it better | ||
gah :( | |||
nothingmuch | go to sleep autrijus-san | ||
you deserve it | |||
autrijus_tw | well at leat I'm bac to full wireless world | 19:46 | |
obra | autrijus_tw: ow :/ | ||
autrijus_tw waves & | |||
cognominal | autrijus is cloning himself, for more productivity? | ||
kolibrie | autrijus_tw: good night, better laptop success tomorrow | 19:47 | |
Limbic_Region | so without waking autrijus back up - how much has he gotten done with the Haskell MM implementation? | 19:49 | |
nothingmuch commented milner.pl | 19:59 | ||
the algorithm is so much simpler than I had initially thought | |||
Limbic_Region | Just about everything, properly understood, is simple | 20:01 | |
svnbot6 | r7246 | nothingmuch++ | r8817@syeeda: nothingmuch | 2005-10-03 21:57:57 +0200 | 20:02 | |
r7246 | nothingmuch++ | Minor cleanup and lots of comments in the milner script | |||
r7247 | nothingmuch++ | Also explain the unification multimethods | 20:07 | ||
nothingmuch goes biking | 20:32 | ||
svnbot6 | r7248 | autrijus++ | * GHC 6.4.1 reportedly works without gcc_select, | 20:38 | |
r7248 | autrijus++ | so reflect this in Makefile.PL. | |||
nothingmuch | $30 for a fucking article?! | 20:42 | |
phooey! | |||
this world needs to appreciate free knowlege better | |||
ciao | |||
vladtz | found my CPAN problem: HARNESS_PERL was set (is that still needed?) | ||
nothingmuch | vladtz: that is not a good thing if you are installing perl modules instead of testing pugs | 20:43 | |
and for pugs it's only needed if you're running 'prove' instead of 'make test' | |||
vladtz | nothingmuch: it's seems to a bad thing while smoke testing as well... | ||
nothingmuch | could be... but i don't see why | 20:44 | |
vladtz | nothingmuch: I'lll remove it from my profile, thanks. Smoke coming up soon (I hope). | ||
nothingmuch | yummy | ||
nothingmuch leaves for the 2nd time ;-) | |||
obra | Which lambdacamels are blogging about perl6? | 21:58 | |
autrijus | luqui in particular | ||
stevan too | |||
obra | what's stevan's url? | 21:59 | |
Luke I've got | |||
autrijus | use.perl.org/~stevan/journal/ | ||
obra | Last name is Little? | 22:00 | |
autrijus | aye | ||
obra | anybody else who should be on planetsix? | 22:02 | |
autrijus | not sure... nothingmuch didn't keep a journal iirc | 22:04 | |
gaal's got livejournal but not usually p6 related | |||
obra | nod | 22:06 | |
ok | |||
joao | autrijus, weren't you sleeping? :)) | 22:30 | |
autrijus | ah, but my keyboard came back to live... | 22:31 | |
joao | or you just need to sleep 2 or 3 hours? :) | ||
autrijus | nah, usually 10hrs. | 22:32 | |
joao | really? wow | ||
and still have time for everything you do? | 22:33 | ||
joao smiles | |||
autrijus | the trick is to sleep 10 hours for every 25 or 26 hours :) | ||
joao | I thought you were like Paul Erdos, that needed 4/5 hours :) | ||
hehe! | |||
autrijus | nah, I'm not currently powered by amphetamine :) | ||
joao | "currently" :) | 22:34 | |
rep | i sleep 6 hours every 24 hours.. | ||
well | |||
as in i go to bed at around 4am every day | |||
and wake up at 10am | 22:35 | ||
joao | I can't do less than 8 hours. it's phisically impossible :PP | ||
25 continuous hours looks a lot.. even with the 10h sleep :P | 22:37 | ||
svnbot6 | r7249 | autrijus++ | * finish removing IRC-OO.pm | ||
clkao | agent tang | 23:07 | |
svnbot6 | r7250 | autrijus++ | * Cabalization for real, thanks to Visual Haskell's help. | ||
r7250 | autrijus++ | * Also checks in the "solution" file for VS2003. | |||
clkao | src/Pugs/Compat.hs:80:5: | 23:12 | |
Duplicate instance declarations: | |||
src/Pugs/Compat.hs:80:5: instance Typeable DirStream_ | |||
justatheory | seen autrijus | 23:46 | |
jabbot | justatheory: autrijus was seen 1 hours 12 minutes 48 seconds ago | ||
buu | How many freaking bots do we have any here? | 23:53 | |
s/any/in/ | |||
QtPlatypus | None, all our buts are freek free. |