Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net
Set by autrijus on 4 August 2005.
autrijus sub infix:<$> (&f:(::A --> ::B) --> A $x --> B) { f($x) } 00:00
autrijus is motivated to make that happen ;)
hm, the body should be 00:01
return { f($^x) } 00:02
svnbot6 r6097 | putter++ | Undisabled two more test files. t/rules/rules.t has many failing tests which still need to be :todo<bug>ed. While some failing tests are no doubt incorrect, PGE should now have lots of real failing tests to drive its development.
r6098 | putter++ | t_disabled/rules/from_perl6_rules/subrule.t: Now well behaved. Some former parsefails now work. Some failures todoed. 00:16
r6099 | putter++ | t_disabled/rules/from_perl6_rules/subrule.t: Undisabled by moving to t/rules/from_perl6_rules/subrule.t.
r6100 | iblech++ | * pugs::hack: PODified putter++'s new section.
r6100 | iblech++ | * Array-Lazy: Added Makefile.PL so the tests are run from make test.
r6100 | iblech++ | * Usual svn props.
r6101 | iblech++ | PIL2JS: PIL2JS.js, PIL::Subs, PIL::Params: Necessary infrastructure to
r6101 | iblech++ | implement junctions.
putter autrijus: ok, now plenty of simple pge failure cases to chew on. 00:30
svnbot6 r6102 | putter++ | t/rules/from_perl6_rules/stdrules.t: Undisabled. Well behaved and todo-ed.
putter good night all & 00:31
autrijus woot! 00:33
autrijus wonders if we should send all failures to pmichaud, or convert them data-driven to parrot rules tests, or both
autrijus hacks --> parsing in. 00:34
brentdax Hmm...Pugs is consuming seemingly infinite amounts of time before it even executes the first statement of test.p6, and I'm not really sure why. 00:39
svnbot6 r6103 | autrijus++ | * Parse for the tentative return type feature:
r6103 | autrijus++ | sub inc (Int $x --> Int) { $x + 1 }
r6103 | autrijus++ | * Also, this form is parsed too, although full named binding
r6103 | autrijus++ | havn't been implemented, documented, or canonized:
r6103 | autrijus++ | sub inc (Int $x --> Int $y) { $x + 1 }
r6104 | autrijus++ | * CodeGen: currently commented-out hook for -C PIL2.
QtPlatypus brentdax: Are you using the precompiled Prelude? 00:41
brentdax As far as I know.
autrijus what's test.p6?
brentdax (I say "seemingly" because I Ctrl-C after about ten minutes.)
autrijus and did it work before? 00:42
brentdax The script for WWW::Kontent. And yes, it did, but I haven't updated Pugs since 2.6.9 was released, so it has to be something I did.
jql that return type feature is so blatantly stolen from other languages... I love it 00:43
autrijus jql: right, perl (was|is|will still be) all about stealing the right features
QtPlatypus autrijus: Does that mean we will get sub curryadd (Int $x --> Int $y --> Int) { $x + $y } 00:44
svnbot6 r6105 | autrijus++ | * new PIL.Container design based on this drawing:
r6105 | autrijus++ | pugscode.org/images/container.png
autrijus QtPlatypus: no, that is
return { $x + $^y } 00:45
but yes.
and the signature is
Int $x --> Int --> Int
although doesn't hurt if you add $y.
cool eh?
autrijus ponders 00:46
QtPlatypus 0 Kelvin man, 0 Kelvin.
autrijus my $x is free; $x + 3 === 4; say $x; # 1
brentdax Happens after kontent-config.yaml is read in, but before the configuration is completely applied. Maybe it's having trouble loading one of the modules...
autrijus decides that particular kind of insanity is better left for another day. 00:47
brentdax The HTML renderer? Hmm. 00:48
jql wonders if we're gonna get a tuple syntax, next
autrijus jql: (1,2,3) is a tuple no?
and :(Int,Int,Int) is a tuple type. 00:49
jql hmm... :(Int,Int,Int) specifies something?
autrijus yeah, it's a type literal.
brentdax Aaaah, a stray quotation mark. That's pretty random, and possibly a bug in Pugs... 00:50
autrijus brentdax: tests welcome :)
brentdax That depends on my ability to reproduce it. 00:51
Or rather, produce a test case from it.
It's also a bug that manifests itself as Pugs freezing up during parsing--I'm not sure how to test safely for that.
QtPlatypus Can we use a simmler technique to create type restricted hashes? 00:52
jql can't picture how that would be used... my @foo is :(Int,Num,Str) can't be right
autrijus jql: infix "as" 00:53
QtPlatypus: that's the shape of hash, so yes
jql that's better
scook0 autrijus: the new Container/Cell structure makes a lot more sense 00:54
autrijus scook0: thank you, and it seems that "is constant" is indeed rebindable
scook0 yeah
autrijus and MultiSub is just a kind of Code.
so all is well
scook0 before, I was having trouble figuring out which of Container/Cell/Box fits with which parts of my mental model 00:55
but now it fits anyway
autrijus scook0: and I dropped the Box :)
I figure that was the key move.
scook0 so, Container kinda-sorta represents the variable /name/
and Cell represents the anonymous slots that names get bound to 00:56
autrijus yeah, although you have anonymouse containers.
my $x = \3; # reference to an anonymous constant container.
scook0 because 3 is just a value 00:57
so we need somewhere to store it
if we're going to take a reference
autrijus right. and references refer to containers, so it's promoted to a constant container.
$$x := 4; # hat trick!
(that works.) 00:58
jql and, containers implement stuff like "will undo" and value constraints and whatnot?
scook0 (brain explodes!)
autrijus jql: yes.
scook0 mind you, I was examining the metamodel yesterday
so I already have skull fragments all over my walls :)
I think I get it now though 00:59
autrijus good. and if you don't, I'll shower you with more diagrams :) 01:00
actually, I'll shower you with diagrams anyway even if you got it.
scook0 so, in your meta-universe:
Classes and Objects are two completely separate kinds of things
(i.e. a Class is /not/ an Object) 01:01
but then we have clsMeta
which points to what is essentially the Object-reification of the class
(woo, I used 'reification' in a sentence!)
autrijus yes!
the Class is a very thin shadow wall 01:02
between the metaverse and mortal land
scook0 my stumbling block was all the meta-this and meta-that
autrijus to the mortals it's an object
oh, it's easy. when you read meta, think "guts"
scook0 so I translated it into my own notation, in which the word 'meta' doesn't appear at all
autrijus as in, non-user-visible internals.
scook0 yeah, my interpretation of 'meta' was different
that's what threw me off
autrijus same here
but then I learned "meta" means "below" here. 01:03
just like I just learned that "eigenclass" is just your ordinary singleton classes.
scook0 what sort of stuff is involved in metamorphing (demiurge) into (theos)? 01:04
autrijus scook0: stevan explained that in the 10k ft view
it happens at Perl6::MetaClass::_build_meta. 01:05
hence, "metamorph"
scook0 having all the gnostic names for everything is /so/ much cooler :)
autrijus :D
glad you like it
it first adds the add_method method
by binding it to the primitive _add_method
so we can call add_method from there on 01:06
scook0 you have to add 'add_method' magically, right?
that's part of the bootstrapping
autrijus right.
then we add accessor methods to all its structure
scook0 because you can't add it normally until it's already been added, which is too late
autrijus completing the reflection.
then we add magics like _merge
which handles role merging 01:07
all using add_method
then we add a method, add_attribute
then use that add_attribute to add attribute declarations
brentdax Okay, what I think this comes down to is that it takes Pugs a really long time to figure out that quotation marks are mismatched, and the amoung of time increases dramatically with code size.
autrijus to all its structure
brentdax: good. example?
brentdax *amount
autrijus brentdax: I bet it's a redundant "try" in parsec. 01:08
although if it wasn't, then the grammar structure is in trouble.
but I think it is.
scook0: so it adds the attribute layer of introspection also
scook0: then we can use attribute accessor to manage the superclass attribute. 01:09
which is what genesis does.
end of story
brentdax The pastebot isn't agreeing with me...
Okay, hold on a sec.
scook0 (genesis) just declares that the 'Class' class is a subclass of the 'Object' class 01:10
but in order to do that, (theos) needs to be reflective/introspective enough
pasteling "brentdax" at 64.81.33.205 pasted "Parsing this takes 43 seconds to fail (1.6GHz x86, 512 MB RAM, very lightly loaded)" (15 lines, 293B) at sial.org/pbot/12288
brentdax Removing any of the lines inside that if block decreases the failure time dramatically. 01:11
(Oh, and I'm using stock CPAN 6.2.9.) 01:12
autrijus scook0: that's right. 01:24
brentdax: can you turn it into a test? 01:25
i.e. make something that takes 10sec to parsefail and test that it should fail for <3sec
or something like that.
brentdax That would depend on the speed of the computer...
autrijus I need to run now, so unless it's turned into a test (or less preferably a p6c post) I may forget about it 01:26
brentdax: well, test two strings, one 2x the other
and test that it scales linearly or something
improvise :)
brentdax Alright, I'll see what I can do.
autrijus thanks! brentdax++
&
svnbot6 r6106 | iblech++ | PIL2JS: Junctions, but with some problems which I'll probably fix tomorrow: 01:59
r6106 | iblech++ | * +$junc doesn't return a new junction, but dies.
r6106 | iblech++ | * If a sub accepts more than one parameter, it will always autothread, even if
r6106 | iblech++ | one of the parameters accepts raw Junctions.
r6106 | iblech++ | * Probably minor slowdown as most subs call PIL2JS.possibly_autothread now, and
r6106 | iblech++ | this sub involves various loops... We'll see.
r6107 | fglock++ | * Junctions supported in 'Lazy::List' and 'Array::Lazy' 03:12
r6107 | fglock++ | * Multi-dimensional Lazy Array with 'Array::Lazy'
r6107 | fglock++ | * New lazy methods: reverse(), grep(), map()
r6107 | fglock++ | * Removed 'Iter' class; renamed 'Iter::Range' to 'Lazy::Range'
r6107 | fglock++ | * A few new internal Classes
r6107 | fglock++ | * More tests
scook0 brentdax: is this your (takes-ages-to-fail) bug from before? 04:07
brentdax Yes. 04:08
scook0 maybe in t/pugsbugs ? 04:09
brentdax t/pugsbugs/parse-fail.t, maybe?
scook0 are you expecting it to work, or just to fail elegantly? 04:10
that's probably fine; if anybody really cares they can always move/rename it later 04:11
brentdax I'm expecting it to fail elegantly. Right now, if it encounters the code `"$1$2$3$4 {}{}{}{}` (note the unmatched quote), it fails in 0.4 seconds. If it encounters `"$1$2$3$4$5$6$7 {}{}{}{}{}{}{}`, it takes about thirty seconds.
scook0 ker-razy 04:12
brentdax Place a stray double quote in the middle of a 150-line module and you can imagine the result.
I was having instances of Pugs that I would Ctrl-C after ten minutes of trying to parse. 04:13
My test makes sure it doesn't take more than ten times as long to parse the latter than the former. 04:15
svnbot6 r6108 | brentdax++ | Test for a degenerate case in the parser triggered by an incomplete literal 04:59
r6108 | brentdax++ | string. (It's not that it should succeed, it's that it shouldn't take fifty
r6108 | brentdax++ | times as long for a string with less than twice as many interpolators.)
meppl in german perl6 sounds like perl-sex 05:10
("sechs") 05:11
just info
class Perl is Sex {}
:D
05:33 gaal_ is now known as gaal
meppl (6 sounds like "sex" in german - written "sechs"....) 05:38
ods15 heh 05:41
brentdax ...go me? 06:27
brent@motoko:~/Workspace/Kontent$ ./test.p6 PATH=/kontent/settings/uri_prefix
Segmentation fault
coral hi, brentdax
brentdax Hello, coral.
I swear, the errors get more and more severe as I go on. 06:34
Okay, happens during rendering... 06:35
...Scalar::Perl5. Looks like it tried to call a method on a Perl 5 string. 06:39
meppl relay.slayradio.org:8000 is a cool radio 06:52
relay.slayradio.org:8100 for isdn-users or some low bandhwiths
asdf
bandwidth 06:53
09:44 Maddingue__ is now known as Maddingue
Aankhen`` ?eval my %foo = (a => 'b', c => 'd'); my $bar = "f"; %foo<e> := $bar; %foo 11:23
Bah.
11:48 nnunley3 is now known as nnunley 12:36 cnhackTNT is now known as cnhackTNT|away 16:13 Aankh|Clone is now known as Aankhen``
chip calls this meeting of the cabal to order 16:48
stevan wonders who chip is talking to :) 16:50
autrijus chip: in cabal meeting again?
what's the topic?
hi stevan
stevan rehi autrijus
autrijus stevan: drawing metamodel is challenging 16:51
stevan autrijus: yes it is
autrijus I can do a data-oriented drawing like yours
or a timeline
chip list operator forward declaration
autrijus of the bootstrap sequence
but very hard to do them in one
nothingmuch waves
stevan autrijus: timeline of bootstrap is a good thing
autrijus hey nothingmuch.
stevan hola nadda-mucho
autrijus: I dont think it would make sense to have both in the same drawing 16:52
autrijus eh but you wouldn't know what the players in the bootstrap contains
without a structure
anyway, I'll figure it out.
stevan will be releasing a highly experimental Class::C3 in the next hour or so
autrijus oooooh.
stevan autrijus: link the pictures 16:53
or maybe a legend
putter nothingmuch: looks like smoke hasnt been updated in a bit...
stevan autrijus: I know you would like that :)
autrijus :)
nothingmuch putter: uh, will fix
autrijus I'll go grab some food. bbiab
chip: if some _breaking_ news occurs be sure to post it here :)
whoa, I got a bug report, test cases and possible patch to Acme::Hello. 16:54
the perl community is very advanced.
food &
chip autrijus: question for when you get back. given a forward declaration that says literally 'sub foo {...}', what function prototypes are compatible for the actual definition of sub foo?
autrijus chip: surely, sub foo (*@_) {...}. 16:55
unless we rule that the {...} special form without parens is all-catching
nothingmuch putter: restarted 16:56
autrijus because {...} is a special form already
that's not a bad thing.
putter Regards :global :g matching - my @a = "aaa" ~~ rx:g/a/; +@a # => 0, instead of 3. A three-line patch fixes simple cases, but not quite. Here is the commit message for a patch I believe I'm going to punt:
nothingmuch chip: as if he actually leaves the computer behind when he goes for food
putter Match.hs: matching against a global pattern without a subpattern now uses the entire pattern instead. 'aaa' ~~ rx:g/a/ # => 3, not 0. (The .from and .to positions remain wrong.) This is however an incorrect kludge. Lacking a way to ask the pattern if it has a capture group, the match array is used instead. But that could be empty for other reasons. 'ba' ~~ rx:g/ba|(a)/ should return a one element array of a failed match (the (a)),
not of a sucessful match 'ba'.
autrijus chip: though if we do that, it needs to be consistent with roles.
chip autrijus: it seems easier to rule what definitions are _not_ compatible. AFA Larry can tell, only declarations that would turn foo into unary or nonary operator would be _in_valid. 'sub foo () {...}' would be invalid. 'sub foo ($x) {...}' would be invalid. Everything else should be OK.
autrijus role Foo { method stub { ... } }
putter fyi.
chip autrijus: since methods all use parens for their parameters, the current issue (parsing compatibility) seems not to apply to methods 16:57
putter It seemed the simple and consistent incorrect behavior, even if it were more common, was prerferable to a more complex incorrect behavior.
putter now returns you to your regularly scheduled program... 16:58
autrijus chip: meth $obj: 1, 2, 3
chip: is that always listop?
anyway, bbiab &
chip autrijus: yes 16:59
cya
multi f(U, All); # lucs didn't notice this until he'd written it 17:26
stevan :)
riiiight,.. sure he didnt notice
chip really! when he figured out why everyone was laughing he was surprised 17:27
stevan :)
I assume lucs == Luke Palmer, in which case, I am not actually suprised then 17:28
integral luqui == Luke Palmer
stevan who is lucs then? 17:29
stevan assumed it was some secret cabal nick of luqui's
integral hmm, not sure
chip I know him only as "Luke" in realspace
so I guess that's him. luqui 17:30
stevan chip: tell luke "multi f(U, 2)" for me 17:32
actually this works quite well: multi f(U, 2) { ... } 17:33
multi f(U, All) { ... }
chip will do
stevan muchas gracias chip
stevan is thinking in mutually recursive insults now 17:34
nothingmuch lucs != luqui 17:36
lucs is someone else... ingy knows him well, IIRC
17:38 ods15 is now known as o1s5d, o1s5d is now known as ods15
autrijus rehi! 17:39
ooh, the All type! 17:40
I actually propose that Any means both the Top type and the Bottom type.
the fact that it has no finite manhatten distance will then fall directly from that 17:41
and (Array of Any) can then be used both in return and param position
and
sub f (Any $x --> Any) {...}
will DWIM.
sounds sane?
effectively it'd play the same role as wildcard types in java 17:42
which we've been using that informally anyway.
chip double plus is back, Larry says, for mandatory named params 17:43
I don't know what Top and Bottom are 17:44
autrijus I didn't know it was gone.
chip: it's the top type and bottom type
everything .does(Top), and Bottom.does everything
chip WTF?
autrijus it's not perl6 17:45
chip oh.
autrijus it's just type theory terms
luke's All is supposedly Bottom
and Any is Top
I've been using Any|All informally but I think it sutis perl6 better if Any|All is unified as just "Any".
I think luqui will like that.
?eval sub f (++$x) { $x }; f(x=>3) 17:46
evalbot6 \3
autrijus ?eval sub f (++$x) { $x }; f()
evalbot6 Error: No compatible subroutine found: "&f"
chip what he really wrote was f(U, Object) and we suggested jokingly that it should be f(U,All)
autrijus good, ++ is still there.
oh. heh. but still, my suggestion stands, especially now that --> type is in
without that treatment, (Any --> Any) needs to be written as (Any --> Any|All)
which is less than good.
chip you'll have to write that up 17:47
autrijus I did
chip what I mean is, I don't understand the proposal yet, so I can't express it here 17:48
specifically I don't know the delta from current truth
autrijus ok.
the current truth is that Any is top but not bottmo.
chip ok 17:49
then why doesn't sub f (Any $x --> Al) {...} work? 17:50
s/Al/All/
autrijus because inside the function, the &return has the type
sub return (All $v) {...}
which means the actual parameter passed to return must be an instance of All
which can't happen 17:51
as you can't instantiate All
it's the bottom type
chip Hm. So then, why can't sub f (Any $x --> Any) work?
autrijus because then inferencing would die
chr( f( 3 ) )
chr expects Int
but f() promises Any
so you need to test Any.isa(Int)
which is terribly false 17:52
it's all in www.nntp.perl.org/group/perl.perl6....uage/22482
chip ah. I see the geometric value of the Top and Bottom names
autrijus the C) proposal has Any|All form.
and it's terrible to type
chip reads
autrijus so I think unifying them as Any would work.
because it will also solve the "Array of Any" problem 17:53
see www.nntp.perl.org/group/perl.perl6....uage/22492
as it stands
(Array of Int).does(Array of Num); # false
(Array of Num).does(Array of Int); # false
but we actually want (Array of Any) to be okay 17:54
since that's the default type we use for arrays
so it needs to be able to contain any type and yield any type
i.e. be useful in both return position and param positoin
so I proposed
(Array of Any|All)
in that thread for the same reasons
but I think that's cumbersome to type, so again, unify Any|All into just Any will work
as an additional bonus, we no longer need to explain the All type to people. 17:55
__END__
chip ok
svnbot6 r6109 | putter++ | PCRE :global rules, without a subpattern, now return the correct match array. my @a = 'aaa' ~~ rx:perl5:g/a/; +@a #=> 3, not 0. PGE rules are not fixed, awaiting a way to determine if they contain a subpattern. Match .from and .to still incorrect. The patch is a bit messy. This would all be better handled by p6-side analysis and implementation of :global. 18:12
r6110 | iblech++ | * Usual svn props and EOLs at EOFs.
r6110 | iblech++ | * PIL2JS: More work on junction support.
r6110 | iblech++ | * PIL2JS.js: Added ::Junction class.
r6110 | iblech++ | * PIL::Params, PIL2JS.js: Now only parameters not accepting a raw Junction
r6110 | iblech++ | may cause autothreading.
r6110 | iblech++ | * PIL::Params: Minor compile-time optimization: If all subparams accept raw
r6110 | iblech++ | Junctions, PIL2JS.possibly_autothread is not even called.
r6110 | iblech++ | * Prelude::JS::Keyed: Implemented $junc.values and $obj.pick.
r6110 | iblech++ | * *BUT*: Most of the t/junction tests won't pass, as -CPIL outputs 1|2|3 as (1|2)|3.
autrijus iblechbot: Eval line 784 needs to be ported over. 18:13
either that, or Parser needs to actually understand AssocList 18:14
the later is arguably easier.
brentdax autrijus: I did end up committing a test for that too-long-to-fail issue.
autrijus brentdax: yeah, I saw that. thanks! 18:15
brentdax np.
putter Hmm, if Parser is still in a poorly understood state, I think I'll wait on my rx hook patch (as it has the potential to acheive a poorly understood state all by itself...;). 18:18
autrijus putter: no, go ahead
we have tests 18:19
that's what tests are for.
putter Are you sure... I saw a 25+ minute Prelude compile last night (5x normal)... and Prelude is also touched... 18:20
Ah well, I'll dust it off and plug it in.
autrijus mmm craziness. 18:30
multi append ([], @ys) { @ys }
multi append ([*$x, *@xs], @ys) { ($xs, append @xs, @ys)
}
sub last ($l) { my ($`x, @`xs); append(@`xs, [$`x]) === $l; $`x;
}
chip We just discussed the Any/All problem.
autrijus chip: oh cool. consensus?
chip It is now understood.
Khisanth what is the ` suppose to mean? 18:32
chip Consensus is that "sub Any foo (Any $x) { return $x }" needs to work, and "Array of Any" needs to work. This may imply that 'Any' becomes a magical object that understands how to respond appropriately to covariant vs. contravariant type checks. If that's the case, then the top of the type hierarchy (and the bottom, for that matter) will probably have more obscure and technical names.
autrijus good. I propose "Object" :D
chip I did too.
autrijus also I don't think we need a bottom type.
many language did without one.
chip Allison busted that
autrijus oh well. I guess we better take "everything is an object" slogan down then :) 18:33
j/k
chip "But isn't the point of types to eventually instantiate them?", I asked?
"No," responded Allison.
I boggled, and life went on.
autrijus hm. I wonder why.
hm, typo in that "sub last"
sub last (@l) {
my ($`x, @`xs);
append(@`xs, [$`x]) === @l;
$`x;
}
Khisanth: $`x reads "let $`x be free" 18:34
and "===" means "we assert that"
Khisanth ...
autrijus luqui proposes the ` twigil, not me
chip Free variables? WTF?
autrijus chip: this is not canonical
just playing with syntax.
chip ok. I vote for 'our' or other explicit declaration.
autrijus because Ovid's presentation is nice
and now it gets people thinking
chip: the "free" here means "logic programming" 18:35
look at that sub body again :)
Khisanth I hope we won't have to start changing the name to Erl ...
autrijus it deducts how to satisfy them.
chip oh. n/m
autrijus Khisanth: you think logic programming isn't practical? :)
autrijus notes that Rules is a limited form of logic programming
Khisanth no opinion on that but Perl might not be that practical to use :/ 18:36
autrijus because you will encouter unfamiliar code styles?
chip autrijus: BTW, the 'weird object' definition of Any is essentially your proposal, it's just that luqui gets the screaming heebie jeebies when he contemplates that A.isa(B) could be false, while A.isa(Any) and Any.isa(B) are both true.
autrijus: so he can't admit that Any really is Top and Bottom, even if it acts just like it is 18:37
autrijus chip: Any is a wildcard.
okay. we won't force him to admit it.
chip heh
autrijus Any has no identity
the Any that isa B and the Any that A isa
isn't the same Any.
problem solved
also, to wit
chip nice
autrijus A.isa(A|B)
(A|B).isa(B)
look ma, same problem 18:38
chip hey, neat: Any is shorthand for any(@all_types)
autrijus yeah.
that's what it means :)
chip "I love it when a plan comes together."
autrijus :D
Khisanth: anyway, rest assured... I don't think we'll get this prolog stuff into perl6 in the near future 18:39
Khisanth: if it can't be made coherent and practical it won't go in. it's just early speculation here
Khisanth actually I think my reaction was more from "ugh perl6 takes another step towards not finished" 18:41
autrijus you think perl5 is finished? :)
biology, stable, etc 18:42
Khisanth couldn't think of a better word than finished
I don't know any word that means "finished but not really" :)
autrijus nod... but I don't think logic programming will delay perl6's production release
Khisanth but will perl6 maintain the backwards compatibility thing like perl5? 18:44
brentdax would really like MMD with subtyping...
(It would simplify many aspects of this project.) 18:45
autrijus Khisanth: I think so, inasmuch as that existing programs won't break easily 18:47
but that certainly doesn't stop adding new features
brentdax: I thought pugs MMD has subtyping.
?eval multi f (Num $x --> Int) { int($x) }; multi f (Int $x --> Int) { $x * 2 }; f(9) 18:48
evalbot6 18
autrijus ?eval multi f (Num $x --> Int) { int($x) }; multi f (Int $x --> Int) { $x * 2 }; f(4.5)
evalbot6 4
autrijus isn't that that?
autrijus loves the arrow type notation. larry++
?eval multi f (Any $x --> Int) { int($x) }; multi f (Num $x --> Int) { $x * 2 }; f(9) 18:49
evalbot6 18
autrijus so it calculates distance too
brentdax ?eval multi f(Num $x where { $_ % 2 }) { say "odd" }; multi f(Num $x where { ! $_ % 2 }) { say "even" }; f(2)
evalbot6 Error: unexpected "w" expecting trait, "-->", ",", ":" or ")"
autrijus oh you mean constraint subtyping.
brentdax Yeah.
autrijus it's a matter of desugar them into given/when 18:50
so you can write them with given/when using the same number of lines, no? :)
(but yeah, it'd be nice to have them)
stevan autrijus: perlcabal.org/~stevan/Class-C3-0.01.tar.gz 18:53
uploading to PAUSE right now too
autrijus ?eval 'stevan++' xx 5
evalbot6 ('stevan++', 'stevan++', 'stevan++', 'stevan++', 'stevan++')
stevan autrijus: it basically pre-caches the method dispatch 18:54
so classes are effectively closed
but I think I can work around that maybe
autrijus can you trigger recalculation at runtime?
perl5 does that, I think
stevan autrijus: not yet, but its only a short refactor away
autrijus cool! 18:55
stevan I have to look at how Perl 5 actually does it
brentdax It is and it isn't. In most cases I want to say `multi method adapter(WWW::Kontent::Class::Whatever $class, WWW::Kontent::Request $request where { .mode eq (something) }: )`, which I can fake with given/when. But occasionally I want to do something like `multi method adapter(WWW::Kontent::Class $class, WWW::Kontent::Request $request where { .mode eq 'history' } where { .format eq 'html' })`
stevan autrijus: and I want to build some kind of call-next-method mechanism as well
autrijus it's a when and
infix:<and>
stevan: like NEXT?
brentdax Which is somewhat harder when you don't know all of the combinations beforehand. 18:56
stevan autrijus: yes, but it chooses the next more relevant class in the MRO
autrijus true.
ahh k
stevan autrijus: like next_METHOD() in the metamodel
autrijus k 18:57
Yaakov autrijus: Will parrot be able to compile Piet? 19:03
autrijus I have no idea. but leo is crazy enough 19:04
so if you present the idea to him he might implement it.
Yaakov Heh. 19:05
gaal wow
that looks interesting
Yaakov I bet emacs has a Piet mode :)
gaal Yaakov, you mean this? en.wikipedia.org/wiki/Piet 19:06
Yaakov Yes, that.
gaal damn, now i'll have to code a p6 version. 19:08
Yaakov Heh, you should.
stevan that looks nothing like Piet Mondrian's work, but its still pretty cool 19:09
Yaakov It is in the spirit of it, not an imitation. 19:10
stevan yes
gaal actually it dosen't sound very hard to implement
Yaakov I suppose you could do a variation based on only |, -, + and . 19:11
gaal hard to *write* in, fer sure :)
stevan restricting the color palette to primaries would have probably been too restrictive 19:12
chip breaking news. 19:14
autrijus?
autrijus yes?
autrijus is just pondering the elimination of Code container type
chip luqui has explained that type junctions are not types, which is Bad.
autrijus but breaking news first
Int --> Int
is not a type?
chip (Int|Str) is not a type, mathematically
autrijus | is a type operator 19:15
that takes two types and return one.
chip It's a junction operator.
autrijus it is of kind *->*.
chip It returns a Junction object.
autrijus that's not going to work.
chip Apparently you are already cheating. :-)
autrijus is a junction of int considered int?
Yaakov Hey there, chip.
autrijus i.e. can you call chr() on it?
chip TENTATIVE NEW PLAN: Type does Set. Set operators standard in Perl: (+) union, (-) difference, (*) intersection. 19:16
autrijus not sure I grok type differences.
Num-Int
chip What we now call (Int|Str) shall be henceforth (Int (+) Str) ... the junion of all Ints and all Strs
autrijus like that?
chip the parens are required. Unicode version is circled.
autrijus (Num (-) Int)
chip All non-integral numbers, yes 19:17
autrijus ok. so we still have higher kinded type operators
chip Right
autrijus just not sharing it with junctions
I'm entirely fine with that.
chip Excellent.
"Let's do it." - saith Larry
autrijus woot.
yay. 19:18
btw, can I get a quick review on
sub id (::T $x --> T) { $x }
which is my current working syntax, but I'm open to other suggestions 19:19
(it means that ::T binds from $x and the latter T unifies passively with ::T)
essentially, scoped type variables.
chip I can't bring up a new thing until after lunch (about an hour), as Luke is still working out what value might still adhere in the Junction object that results from Int|Str
autrijus oh ok. then don't bother
after lunch is fine, and I'll be asleep anyway 19:20
will you continue tomorrow?
tomorrow your time, that is
chip No, we're dispersing soon. Damian in 1hr, me in four
autrijus okay, see you on the list then 19:21
excellent work done
thanks for your relaying
chip I'll ask him about the ::T thing at lunch, if I can
autrijus cool
chip My pleasure
Yaakov: hi there
sorry missed you above
Yaakov No problem, you are focused :)
Hope you and all of yours are well.
chip thank you; you too 19:22
Yaakov Thanks.
autrijus sub f (((Int āŠ– Num) āŠ• Str) āŠ˜ Tieable) { ... } 19:24
I guess I can grow to like it.
wolverian I just see boxes :/ 19:25
autrijus sub f (((Int āŠ– Num) āŠ• Str) āŠ˜ Tieable) { ... } 19:26
still boxes?
wolverian yes.
I think the font just doesn't have those characters
(courier new)
autrijus oh well. probably not good for public consumption then.
what happened to "unicode operators will be within latin1" :)
in that case, we might as well write --> as ā†’ 19:27
wolverian doesn't fortress do that?
autrijus just so type operators are sufficiently unicody.
wolverian: probably just for typesetting
wolverian oh, okay.
autrijus haskell people do that in latex mode too 19:28
wolverian confusing.
Aankhen`` Yowza.
autrijus hi Aankhen``.
Aankhen`` What's the whole `Int $x --> Int` thing?
Hi. :-)
autrijus Aankhen``: it's a type of Code
Aankhen`` I just popped in to backlog before I go to sleep.
autrijus that takes a positional or named $x of Int type or its subtype
and returns something that can be used as Int or its supertype. 19:29
Aankhen`` The --> Int means the sub returns an Int?
autrijus the "-->" reads "yields" or "returns" or "gives"
yeah.
Aankhen`` Ah, I see. 19:30
How does that work with multiple parameters?
You just put the --> at the end?
wolverian does it differ from the 'returns' trait?
autrijus I think , binds tighter than -->
so
Int $x, Int $y --> Num
means
(Int $x, Int $y) --> Num
Aankhen`` Mmm, okay.
autrijus wolverian: the returns trait is private to the function
wolverian autrijus, oh. is that useful
s,$,?, 19:31
autrijus wolverian: yes, because then you have covariance but avoid contravariance.
Aankhen`` ?eval sub foo (Num $x, Num $y --> Int) { int($y) }; foo(10.3953893)
evalbot6 Error: No compatible subroutine found: "&foo"
Aankhen`` ?eval sub foo (Num $x, Num $y --> Int) { int($y) }; foo(10)
evalbot6 Error: No compatible subroutine found: "&foo"
autrijus Aankhen``: it takes two params.
x and y
Aankhen`` bangs forehead on wall.
autrijus ...
Aankhen`` I ought to go to sleep, really.
wolverian autrijus, I'm going to have to wikipedia those. :)
Aankhen`` ?eval sub foo (Num $x, Num $y --> Int) { int($y) }; foo(10, 15.2348)
wolverian reads
evalbot6 15
autrijus wolverian: go ahead :) 19:32
Aankhen`` Yay.
OK.
Sleepy time.
G'night.
autrijus wolverian: namely
sub foo (Int $x) returns Int {}
both Int cannot accept a Complex
but you can call foo when it was expecting a subtype of Int, say Prime 19:33
and it will die if coercion fails
however
sub foo (Int $x --> Int) {}
you can't call foo when you are expecting Prime, then. 19:34
inferencer will stop you.
wolverian hmm. that's not obvious to me.
autrijus neither is it to me. I don't know why they kept the "returns Int" form.
probably because that you can say "returns Animal" 19:35
and coerce it into a Dog
I don't really know, not my decision :)
wolverian right. this is complicated stuff. I guess it can't be exactly obvious
autrijus wolverian: www.nntp.perl.org/group/perl.perl6....uage/22482 19:36
www.nntp.perl.org/group/perl.perl6....uage/22492
wolverian mm. 19:38
choosing between --> and returns makes my head hurt 19:39
autrijus intuitively, if you want compile time checking, choose -->
if you can accept runtime casting failures, use returns. 19:40
chip More set setuff
(<=) (<) (>=) (>) (in) (==) are all infix ops that take Sets on both sides 19:41
autrijus chip: if (Array of Num) is, as the spec says, Array[returns => Num], and we take "returns" to be coercive
chip Unicode equivs not available here
autrijus then (Array of Int).isa(Array of Num) can be true
because it will always coerce on fetch
and only check store type
that may be intuitive to some
but anyway, that's time consuming to discuss fully, so probably for another day 19:42
chip New 'set' op, like junction types
junction creators, that is
binary Set operators coerce their listlike parameters into Sets
autrijus I expects that junctions are sets ;)
chip No, they're not. Very much not. 19:43
autrijus either that, or $junction.values returns a set?
chip <1 2> (+) (2, 3) is a Set of Any with three elements
autrijus or is that $junction.set?
chip Junctions are not Sets, any more than arrays are.
Even less, really.
autrijus hm, I thought that's a Set of (Str (+) Int).
not a Set of Any.
also, <1 2> is qw(), hence it's four elements. 19:44
putter nothingmuch: a bit more red smoke in t/rules/ than expected. are you running parrot-0.2.3?
chip Hm. I was assuming '2' eq 2 therefore duplicate. Hm.
autrijus sets uses string equality? horrors. 19:45
chip No, that was my assumption, not a discussion conclusion
autrijus k.
perl6's lack of generic equality is felt :)
chip the default test is identity, not equality. =:= <- word of Larry
autrijus larry is confused. =:= tests container eqality; .id == .id tests object eqality; values have neither. 19:46
or are we extending =:= to objects to test their .id
and rule that autoboxing will give identialy id to identical pure values with the same type? 19:47
that's a bit confusing levels but fine with me.
actually, a lot confusing levels :) $a =:= $b is testing containers? objects? values?
chip We're reviewing that issue. 19:49
autrijus k.
in the current spec, if ($a =:= $b) is true, then assigning to $b will always touch $a. 19:50
so extending that to mean object identity test is very risky.
better use ~:~ or something else.
or just .id == .id
and then rule that 3.id always == 3.id 19:51
and never == '3'.id
pasteling "putter" at 66.30.119.55 pasted "rules Parser hook - snapshot of an unfinished patch. fyi." (152 lines, 5.7K) at sial.org/pbot/12303 19:56
putter I was going to apply the patch with the known first regression. But the second is not acceptable. I won't be able to bang on it further today, so this is simply a "what's up" fyi. ah well. 19:57
autrijus ok.
chip it's going oddly. 19:59
autrijus I bet. 20:00
I hope pugscode.org/images/container.png would help... probably not at this point :)
hm, I can't wait to see what {==} means. 20:05
since [...] is reduction and (...) is set.
(not quite the same, I know, but same mental space)
chip back
putter how would one create a Complex which could be passed to foo(Int $i) and throw a runtime error it was imaginary or non-integral? ie, how does one arrange at class level for implicit casting?
chip hash keys and set elements will default to the same comparison rules, i.e. =:= 20:06
autrijus putter: $complex as Int;
what is =:=?
putter (random question as I skim the backlog - feel free to punt) oh, ah.
autrijus are we getting rid of the relationship between := and =:= ?
chip =:= is value identity for value types, and reference equality for everything else
autrijus so it no longer tests for binding equivalence.
oops.
S03: 20:07
There is also an identity test, "=:=", which tests whether two names
are bound to the same underlying variable. "$x =:= $y" would return
true in the above example.
(the above example is $x := $y)
putter err. well, I'm still puzzled, but later.
cheers &
chip asking
autrijus =:= was specced to "whether the two sides has been := 'ed before"
chip "oh yeah." - luqui
autrijus now you're using it for something entirely orthogonal.
not going to work really well. 20:08
autrijus proposes ~:~ again
chip ow. 20:10
autrijus or just .id == .id
please don't write it as =id=
chip Well, I think =:= is staying referential equality. Nobody wants to lose that
autrijus you mean, whether they point to the same container
chip I suggested infix:<equiv> but nobody's really happy with that
autrijus so 3 =:= 3 won't make any sense 20:11
chip yes, =:= for same container
autrijus well, we can rule that it makes sense, but I'd rather not.
chip Right, no sense, because it may or may not be true at implementation's whim
autrijus yup.
so I'll just demand both side to be lvalues.
easiest to unask the question.
chip 1 eqv 1? 20:13
autrijus sure.
high typo rate though.
different things looking similar.
chip I like 1 equiv 1 , but luqui thinks it's too much typing for something he'd say often 20:14
autrijus I don't think he will say often at all.
I think huffman should penalize this.
Java has == as eqv and .equals as eq 20:15
globally considered as bad idea
and all Java dialects switch them ;) 20:16
s/all/most/
chip Larry still wants "eqv", as shorthand for "equal by value"
autrijus sure then.
1 iso 1 20:17
"is object" and "isomorphic"
bad idea, ignore
clkao 1 orz 2 20:20
autrijus 1 <> 2
gwbasic rules
clkao gwperl 20:23
etperl.rom
chip luqui is suggesting that equiv is so important that it ought to be spelled "==". Not getting much traction. Fortunately. 20:30
autrijus whew.
please don't forget our blue collar roots, where I'd very much like coercion everywhere and == denotes numeric coercion. 20:31
increase manipulexity is good but only if gradually :)
okay, I need to sleep. g'nite 20:37
chip: I've put the writeup to use.perl.org/~autrijus/journal/26160 -- corrections welcome as comments 20:38
if the whim changes, I'll update the journal tomorrow
autrijus waves &
chip: oh. do we get 20:44
gtv ltv lev gev
for generic ordering? ;)
&
chip luqui has made a suggestion that generic ordering is a Good Thing, but we're right now considering to what extent Set does Hash 21:04
mugwump Set does Map, Hash does Map perhaps? 21:05
chip that's closer to what he meant, I think 21:06
integral sets don't map (mathematically thinking)
chip Yes they do; object => boolean
for membership
mugwump sure they do, integral, they map identity
integral hmm! 21:07
coral what
i said that in one channel
and irssi put it in two! pardon the ww
chip food 21:09
&
mugwump Actually the differences in answer there are worth considering. 21:11
Does a Set map identity ? ie ($x => $x), or ($x => Bool) 21:12
integral hmm, sounds a wee bit more like there's a map that can be derived from it, but it's not a map itself
mugwump: in the former, what is the d
what is the domain in each case?
mugwump The difference is that the boolean can represent the absence of particular members 21:13
which is important if you are interested in inverting the set
chip mugwump: Set maps $x to 1 for all $x (E) @set 22:58
autrijus: still up? 23:08
brentdax You know what would be useful? 23:10
`eval $var, :lang<Perl6qq>`
luqui and that would refer to your lexical scope? 23:11
brentdax Yeah. It'd be like saying `eval "qq($var)", except you wouldn't have to worry about escaping the delimiters. 23:12
`eval "qq($var)"`
luqui right... I suppose that would be useful
is there a module that does that in p5? 23:13
if not, it would probably be about four lines long
brentdax Don't think so, but with closure interpolation, Perl 6 strings are a good deal more powerful than Perl 5 ones were. (I've said before that I don't think Perl 6 will need an ASP-style templating language...) 23:14
(And yes, I know about @{[]}, but that's cheating.) 23:15
luqui it will eventually get one (or ninety) anyway
brentdax True, but at least I'll be able to go "haha, that's silly" and use `eval :lang<Perl6qq>` instead. 23:16
luqui well, I'm sure nobody's opposed to it 23:17