svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com
Set by avar on 16 November 2006.
00:05 awwaiid joined 00:09 polettix joined 00:10 awwaiid__ joined 00:22 awwaiid_1 joined 00:58 lyokato joined 01:00 mako132_ joined
Debolaz What's the status of multithreading with pugs? 01:20
audreyt async works, which creates a thread object 01:21
and you can manipulate it a bit
grep -r async examples
Debolaz What other choices than async for managing threads? 01:22
audreyt you mean, for creation?
not sure the context of the question
Debolaz realizes that was somewhat vague.
01:23 mako132_ joined 01:27 Auzon joined
Debolaz Where is async documented? 01:27
audreyt not anywhere, really. docs/Perl6/Spec/Concurrency.pod mentions it but it's not doc 01:29
it follows perl5 api
01:29 felipe joined
TreyHarris waves at audreyt 01:29
audreyt: long time no speak :)
audreyt TreyHarris: heya!
indeed
been busy with realspace. it's turning rather beautiful lately though :) 01:30
TreyHarris well, me too... amazon holiday rush, i go incommunicado for at least three weeks every year
audreyt I can imagine that
TreyHarris audreyt, allbery_b and i were talking on another channel about ovid's question on junctions. maybe the autothreading property needs to be drawn out in greater detail--if Ovid could miss it, knowing how accomplished a hacker he is, i fear that others will too 01:33
(drawn out in S09 i mean) 01:34
allbery_b I pointed out that when I look at what ovid is doing, my naive initial response is the same as his --- I have to think it through before realizing that autotheading is the *correct* thing to do
audreyt aye. 01:35
01:36 luqui joined
Debolaz That's actually something else I've been wondering about, where is there a magical junction thing, why not have functions generating threads based on lists (Ie, the any(x,x) way of using junctions)? 01:36
jrockway example?
Debolaz I should really look stuff up in documentation so I can reference it before I ask.
:/
01:37 bonesss joined
jrockway not a documentation issue so much as, "show us what you want to do"... 01:37
i'm not quite sure what you're asking :)
Debolaz It's not so much what I want to do, but why I'm able to do it.. why can I do my $foo = 1 & 2? 01:38
TreyHarris Debolaz: the way i formulate it in my brain is, Junctions are a sibling, not a descendant, of Any. So unless you specifically use Junction as a parameter type, you're asking for an argument under Any, not Junction. So Perl does a coercion--which in the case of Junctions, causes autothreading to happen
?eval my $foo = 1&2; $foo += 3|4; $foo.perl.say 01:39
evalbot_r14932 OUTPUT[\((4 | 5) & (5 | 6))␤] Bool::True
Debolaz It seems like adding uneccesary complexity when you can do the same with any & co..
TreyHarris for things like that
jrockway ?eval my $foo = all(1,2); $foo += any(3,4); $foo.perl.say
evalbot_r14932 OUTPUT[\((4 | 5) & (5 | 6))␤] Bool::True
jrockway it's the same thing
luqui Debolaz, heh... I argued that case for many months
jrockway & and | are nicer to look at though 01:40
luqui Debolaz, junctions did not want to move
jrockway junctions are quite useful in real life
Debolaz jrockway: I know it's the same thing, if it were different things I wouldn't have this problem. :)
luqui Debolaz, oh, are you arguing agains the & / | syntax?
jrockway you are upset that there are two ways to say the same thing?
Debolaz luqui: Yes. any() I'm fine with.
TreyHarris Debolaz: well, do you have the same qualm with (err|//), (or/||), (and/&&)? 01:41
luqui oh, nevermind then. that is not the same as my case
jrockway "foo" vs qq/foo/ vs qq{foo}
Debolaz TreyHarris: That's not quite the same.
TreyHarris Debolaz: ok, so what is the difference? that's what i'm trying to tease out
Debolaz and and && are used the same way, any() and | aren't used the (exact) same way.
luqui Debolaz, neither is all/&; one is a listop, the other is an infix operator
jrockway why not? 01:42
say $_ for (1&2&3);
?eval say $_ for (1&2&3);
evalbot_r14932 OUTPUT[all(VInt 1,VInt 2,VInt 3)␤] undef
jrockway erm
luqui the only difference between && and "and", is that one has tight precedence, the other loose
Debolaz my $a = 1 | 2; does magical stuff. my $a = any(1,2) does not. It's just a function returning an object, it makes perfect sense. | and & adds complexity.. when I look at $a, I think scalar, not junction. At least if junctions had their own @$% type prefix, it'd be somewhat ok.. 01:43
(Yes, I realize objects are already also on the $ bandwagon)
TreyHarris "magical stuff"? what magical stuff
luqui Debolaz, so the fact that 1|2 returns an object is weird to you? 01:44
TreyHarris with autoboxing, just plain 1 returns an object too.
jrockway should we replace 2 + 3 with add(2,3) ?
it sounds like that's what you want
and when you do that, everything sort of makes sense, but you end up with PHP
Debolaz luqui: The fact that it's very easy to think scalar when it really isn't scalar. I don't think I would ever recommend anybody ever using & and | when assigning something to a variable, it's just too prone to cause difficult to spot bugs.
jrockway they tried the "everything is a function" approach, and failed miserably 01:45
oh, i see
TreyHarris but (1|2) *is* a scalar....
luqui Debolaz, but using any() is o.k.?
jrockway what i don't see how any(...) solves the problem
right
TreyHarris it's a junction composed of scalars, so it's a scalar
Debolaz luqui: As long as you don't assign the result to anything, yes.
jrockway are you expecting bitwise and to occur when you do 1&2
luqui (my case was that assigning junctions at all to scalars causes difficulties, no matter how you construct them)
Debolaz, oh. 01:46
jrockway ?eval class Foo { method bar { 42 } }; my $f = Foo.new; $f.bar;
evalbot_r14932 42
TreyHarris luqui: can you construct a quick example of a difficulty it causes?
jrockway junctions are just like Foo, except more useful
luqui if $x < 0 { say "a" } if $x >= 0 { say "b " }
if $x is a junction, then that is not equivalent to using if {...} else {...} 01:47
jrockway ?eval $x = 1|2; if $x > 1 { say "a" }
evalbot_r14932 OUTPUT[a␤] Bool::True
jrockway that's fine right?
Debolaz for any(1,2,3) -> { } would be ok. my $a = 1&2&3; for $a -> { } would be confusing. Same functionality, but the former is much easier to understand.
jrockway x is greater than 1
Debolaz So just let me emphasize again, I'm not fundamentally against the concept of junctions, just the way they are wedged in. 01:48
luqui jrockway, in your example, both $x >= 2 and $x < 2 hold
Debolaz Even though I think junctions are less than elegant.
I can probably grow to like them. :)
jrockway luqui: yeah
luqui I think junctions are beautiful, but when they "do their thing" it should be marked 01:49
Caelum oh neat, there's a Perl6::Junction on CPAN
jrockway i think they tend to just work
luqui otherwise they have a tendency to break the laws associated with data types
jrockway Quantum::Superpositions
i use it in my HTML parser
luqui jrockway, I'm not saying junctions are bad
I'm saying they don't scale
jrockway luqui: i think in the examples we're using, they look ugly
luqui they are only there for small syntactic conveniences
jrockway in places where people would use them, they work great and are transparent 01:50
i.e.:
Debolaz luqui: They have a tendency to cause surprise among new programmers. That's supposedly why the author of ruby invented that language, because he was tired of languages (Refering to C++) that kept surprising him even after he had learnt them.
luqui and using their (powerful) semantics is too tricky
TimToady junctions are a linguistic convenience, not a real mathematical thing.
TreyHarris luqui: your example just falls out from the properties of junctions. like quaternions or surreal numbers or any number of other constructs, they violate some of the properties of the real number (or real truth) space
jrockway if $tag eq any(qw<br a li ul>) { ... }
if that's a variable, it makes sense
luqui TimToady, you agree with me
jrockway it could be just br, or it could be just li, or it could be either
that's fine, the code in the block is happy either way
yes, you get things that are both equal and not equal 01:51
luqui which is why I don't think they should autothread if they're inside a variable
jrockway but if you're not testing for both, there's no confusion
TimToady sure, I just don't agree with people who want to turn them from linguistic conveniences into mathematical thingies.
TreyHarris agrees with TimToady
allbery_b seems to me that they scale fine. it might be worth having warnings (which can be disabled by experts) when a junction is used in some situations and isn't explicit
such as your variable case. 01:52
TimToady the only reason they got in in the first place is because I realized English has 'em. :)
luqui TimToady, my case was to pick one. either make them a mathematical thing, or make sure that the language knows they are linguistic
TimToady I think the restriction on parameters accomplishes most of that.
allbery_b (this doesn't help Ovid's confusion though since his was explicit)
TimToady if we want to restrict variables as well, well a pragma could do that.
just not clear it's worth a default.
since the variable is usually in the same "visual scope" as the junction. 01:53
01:53 ssig33 joined
TimToady people who return junctions should maybe be taken out and shot though. 01:53
luqui you don't say: John is happy or sad. Is john happy? (yes) John is happy and sad? Is john happy? (no)
junctions don't abstract across discourse. They are only useful *within* a sentence 01:54
jrockway the html example is a counterexample
"if we have one of these, then"
works fine
Caelum you can be happy and sad, and you can be unsure if john is happy or sad or both 01:55
luqui jrockway, but your junction is in the part of the sentence "one of", not "these"
TimToady I think of junctions much like placeholders--if it hurts, don't do that...
jrockway why pick opposites
how about "clothes john is wearing"
he can have a shirt, pants, both, neither, socks, ...
so if you want to ask "does john have some article of clothing" or "is john clothes-less", junctions allow that nicely
luqui TimToady, my fear is that they will start to be used in API interfaces 01:56
(I have seen it already)
jrockway without your if statement needing to know the details of how people wear clothes
luqui and they don't belong there
jrockway people abuse perl5 too
TimToady I've just made Ranges kinda autohyper themselves
luqui jrockway, again, you are using the junction in that sentence when you say "some article of clothing"
jrockway in the end, it's their problem
luqui jrockway, as "any(@clothes)"
which I am fine with
jrockway true, true 01:57
TreyHarris TimToady: "people who return junctions should maybe be taken out and shot though": what, sqrt(4) shouldn't return 2|-2? :)
luqui TreyHarris, TimToady, precisely!
01:57 kanru joined
jrockway TreyHarris++ 01:57
much better example :)
luqui sqrt(4) should definitely not return 2|-2
jrockway what should it return? -2 ?
TimToady yeah, it's 2^-2
:) 01:58
luqui sighs
TimToady sqrts(4)
luqui sqrts(4) == set(2,-2) 01:59
not a junction, again :-)
TreyHarris groans
jrockway how does a "set" work
is the sqrt(4) less than 0?
is it greater than 0?
Tene Is perl6 sqrt going to return x^-x ?
TimToady sets aren't imperialistic about the logical relationship
Tene: no
Tene kk
TreyHarris luqui: is that even mathematically correct? the mathematical square root of 4 is plus-or-minus 2. that seems junctional to me; it's a single value that has two states, not two values
luqui jrockway, sqrt(4) is greater than 0, not less than 02:00
jrockway -2 * -2 = 4
luqui TreyHarris, the mathematical square root of 4 is 2
jrockway what?
luqui because we define square root to mean principal square root
(i.e. the positive one)
so that it is a functoin
the solutions to the equation x^2 = 4 are sqrt(4) and -sqrt(4)
TreyHarris cocks his head
02:00 jdv79 left
jrockway that is true 02:01
you can use the negative half too, if you want
TreyHarris It all depends on your definitions, I guess. But if I write a radical symbol over 4, it reduces to +/- 2, not 2
TimToady luqui's other point is also that a set is just the two numbers, without the enforcement of & or | or ^
luqui TreyHarris, not in my maths educatoin
TreyHarris perhaps "sqrt" is not the same as 2-with-radical
TimToady you don't know what logic you want to apply to the numbers out of context. 02:02
luqui mathematicians don't use things as functions when they aren't
TimToady maybe you want all(@root) not any(@roots)
jrockway well here's the thing
let's say you want to write a perl6 root solver
the junction syntax will be great for that
no more handling the negative case and the postive case separately
it Just Works
luqui jrockway, are you kidding?
TreyHarris luqui: maybe this is a point of discrepancy depending on where you took maths. i was a math minor, and that's how *i* learned it :)
jrockway yes. i lost many many points on exams until i made sure that sqrt(4) == 2|-2 :) 02:03
02:03 bonesss joined
luqui jrockway, are you sure you are not referring to solutions of equations? 02:03
TimToady that's a highly context-sensitive |
luqui hmm... 02:04
jrockway TimToady: you have a good point
I think TreyHarris and I like the idea of | in our context
and can think of places where the current implementation makes sense
TimToady yes, but...
luqui jrockway, ooh
here's a good one
TimToady you have to realize that you're using the listiness of junctions there
jrockway it you guys think it will do more harm than good, i suppose that's ok
TimToady to emulate sets
luqui sqrt(4)*sqrt(4) == -16 ? 02:05
jrockway hmm, let me try something
TimToady a set doesn't care about & or |
jrockway ?eval (2,-2)*4
evalbot_r14932 8.0
jrockway ?eval any(2,-2)*4
evalbot_r14932 (-8 | 8)
TimToady the pragmatic question of whether 1|2|3 is a valid way to write a set depends on whether we allow junctions to coerce to sets.
and that can be argued either way. 02:06
Debolaz jrockway: That would make more sense using hyperoperators though.
jrockway before we explore that direction; luqui could you explain what you would like to change?
?eval (2,-2)>>*<< 4
evalbot_r14932 (8, -8)
jrockway ok
luqui jrockway, I would like it either to be illegal to store a junction in a variable, or make the use of junctions in variables as junctions explicit 02:07
allow me to elaborate a little
my $x = 1 | 2; $x == 2; # error, can't compare junction to number
1 | 2 == 2; # fine, true
my $x = 1 | 2; J$x == 2; # true (for some value of J)
jrockway i definitely see your point 02:08
things have the potential to go very wrong...
?eval 1.0 == 1
evalbot_r14932 Bool::True
luqui jrockway, the biggest reason for that, is that i want to be able to pass junctions into any function 02:09
functions which handle objects generically, without worrying about what type it is
but we can't allow junctions to come into functions expecting numbers as numbers...
jrockway why can't objects think they're equal to both 1 and 2, though 02:10
allbery_b any($x) / all($x) seems the obvious syntax for that
jrockway is that physically impossible?
(ok, yes, i guess it is...)
luqui jrockway, no, of course you can overload == to do that
jrockway but that's all a junction is
luqui but that would not be considered good practice :-)
jrockway ok
Debolaz jrockway: Someone should probably write a doc about why junctions are neccesary (In the sense that they do something you cannot do with hyperoperators and/or list magic)
TreyHarris to put the definition-of-root question aside, since that's not directly relevant, what if you wanted to write a sub that returned the result of the quadratic formula. it contains a +/-. is the result a set? or a junction?
jrockway Debolaz: the if case
Debolaz: i use Q::Superpositions in perl5 code and it saves me typing 02:11
keyboard typing that is :)
TimToady they're mostly there for "when"
jrockway wonders...
?eval (1,2)>>==<<(2,3)
evalbot_r14932 (Bool::False, Bool::False)
jrockway that is somewhat interesting
allbery_b TreyHarris: I could argue return principal root if scalar context, else list...
Debolaz jrockway: Sure, I like the ifs. But junctions seems to add a lot of complexity for something that could probably had been implemented simpler.. 02:12
luqui allbery_b, that can get deadly though: my @x = (sqrt(1), sqrt(2), sqrt(3))
@x has six elements?
lambdabot Maybe you meant: . v
jrockway ?eval if (1,2)>>==<<2 { say "yup" }
evalbot_r14932 OUTPUT[yup␤] Bool::True
jrockway so hyper handles the any case
luqui jrockway, not so
jrockway what about the all case
allbery_b point. set would probably be better but there is no "set context" in perl
luqui ?eval if (5,6) >>=<< 2 { say "yup" }
evalbot_r14932 Error: ␤Unexpected ">>=<<"␤expecting operator or bare or pointy block construct
luqui huh? 02:13
jrockway ==
luqui ?eval if (5,6) >>==<< 2 { say "yup" }
evalbot_r14932 OUTPUT[yup␤] Bool::True
TreyHarris allbery_b: whereas i would imagine the next question i'd want to ask be, "is $x a root?" and thus writing "if $x == rootOf($eqn)"... in that case, rootOf returning a junction would be natural. if it returned a list or set, I'd have to write quite a bit more code
TimToady a hyper is almost always going to true in Boolean context
unless there were 0 elems
jrockway heh 02:14
even though:
?eval (5,6)>>==<<7
evalbot_r14932 (Bool::False, Bool::False)
jrockway false, false == true ?
luqui jrockway, a list with two elements is true
TimToady yes, there are 2 elems so trjue
luqui because it has more than 0 elements
jrockway *nod*
return undef; in perl5
TimToady hypers are not for logic
junctions are for logic 02:15
jrockway junctions are
yeah...
TreyHarris ?eval any(5,6) == 7
evalbot_r14932 (Bool::False)
TreyHarris afk's a moment
TimToady @foo[ $start + ^3 ] now does @foo [ $start <<+<< (0..2) ] 02:17
lambdabot Unknown command, try @list
TimToady s:2nd/<sp>\[/[/ 02:18
what actually happens is $start + ^3 turns into $start ..^ $start + 3 02:19
luqui oh, interesting 02:20
TimToady but it means we can write slices in start/length form instead of start/end form.
see S03 diff on p6l
I was trying to think of a new syntax for it, but realized it fell out if we did Range transforms properly. 02:21
02:22 devonst17 joined
TimToady not that pugs really even has Range objects yet... 02:23
TreyHarris ?eval -> $x { say $x }.(all(1..3)) 02:24
evalbot_r14932 OUTPUT[1␤2␤3␤] (Bool::True)
TreyHarris ?eval for all(1..3) -> $x { say $x }
evalbot_r14932 OUTPUT[all(VInt 1,VInt 2,VInt 3)␤] undef
TreyHarris what's the difference there?
luqui TimToady, so does range arithmetic work as it does in eg. mathematica?
or is it simpler-minded than that?
TimToady how can I answer that when I don't know how mathematic does it?
but I presume it's something like my conjecture at the bottom 02:25
luqui essentially you apply the operation to all the numbers in the set and take the new set
i.e. (-4..4)**2 == (0..16)
TreyHarris I thought for all(@list) -> $item { CODE } and -> $item { CODE }.(all(@list) were equivalent 02:26
TimToady looks like for defeats autothreading. 02:27
luqui: which "you" is me?
TreyHarris TimToady: should it?
02:27 Auzon left
TimToady TreyHarris: dunno 02:27
luqui it might be nice if "given" did not defeat autothreading 02:28
could be a nice threading idiom
maybe...
TimToady blocks aren't exactly subs...
when you use a block as a block, it's still the same chunk of code psychologically.
TreyHarris In some talk I saw him give... or blog post... or something, Damian at one point used "for all..." as an example of how Perl 6 does hard things more naturally, so I just assumed it would work.
i even put it into the perl 6 wikipedia article *grin* and wikipedia's always correct, so i think it trumps any other considerations *smirk* 02:29
TimToady currently you'd have to say "for all(@foo).values {...}"
but we could debate whether junctions should be list context sensitive and just do .values for you. 02:30
TreyHarris yes, but that would specifically not authothread
"for all" reads like it should autothread
luqui to me, it reads like an assertion 02:31
but not really
TimToady for a while we had "for any(@foo) == 42 { ... }"
TreyHarris luqui: but the word "for" introduces an assertion in theorems, so that doesn't really matter unless you want to get rid of the for loop :) 02:32
TimToady: I liked that
TimToady but the basic problem is that junctions do not imply ordering
and usually you want to preserve it.
luqui for @foo.grep 42 {..} is fine 02:33
er, .grep(42)
dduncan can .grep work that way?
TimToady ?eval for list(1..100) ~~ /7/ { .say } 02:34
luqui I think .grep() takes anything that you can put after "when"
evalbot_r14932 OUTPUT[7␤17␤27␤37␤47␤57␤67␤70␤71␤72␤73␤74␤75␤76␤77␤78␤79␤87␤97␤] undef
TimToady I think that's where we left it.
dduncan okay
TreyHarris well, if you just want to dispatch a block on some set of values, you've basically already decided that ordering doesn't matter. (unless you're returning values and collecting them, but a for loop is usually imperative, not functional)
dduncan it doesn't have to be
TreyHarris dduncan: i know it doesn't have to be, that's why i said "usually" :) 02:35
luqui it pretty much is imperative
given the uselessness of its return value
(last thing executed on the last iteration)
TimToady anyway list(@foo) currently does that in comparison context.
TreyHarris nods
luqui ? 02:36
dduncan on the other hand, assuming there are no situations where 'for' means the same thing as 'map', then I agree it is imperative
TimToady seem eval abovfe
see eval above even
luqui haha
oh... weird
where is the spec for that?
TreyHarris ?eval gather { for list(1..100) ~~ /7/ -> $x { take ":$x:" } }
evalbot_r14932 (":7:", ":17:", ":27:", ":37:", ":47:", ":57:", ":67:", ":70:", ":71:", ":72:", ":73:", ":74:", ":75:", ":76:", ":77:", ":78:", ":79:", ":87:", ":97:")
TimToady S09 I think, checking
TreyHarris TimToady: so is that getting ordered after the for loop has completed? or is the for loop not allowed to autothread? 02:37
TimToady there's no junction there. 02:38
list(1..100) ~~ /7/ basically turns into a grep
dduncan that's an interesting thought ... situations where the actual execution order of iterations doesn't matter, but just that outputs have the same order as their corresponding inputs 02:39
that could still be parallelized, but its more tricky than when the order doesn't matter
TreyHarris right... so if i wanted to autothread and didn't care about ordering, I'd have to write... um...
luqui so what does list(...) return? 02:40
just a list?
TreyHarris oh, we don't have list comprehensions, do we? so i couldn't write it with autothreading
TimToady S02:2206
dduncan maybe behind the scenes each list item could be tagged with meta-data that says what its original ordinal position was, then they hyperthread, then the results are sorted by the same meta-data
luqui see, that's essentially how I want junctions to work...
TreyHarris so there's no implicit way for me to say, "in any order, give me the numbers between 1 and 100 containing a 7, surrounded by colons, and please autothread" 02:41
dduncan but I'm applying the above to actual arrays or seqs where we somehow determine no connection between iterations
luqui list(1,2,3) < list(4,5,6) # ?
dduncan I don't see junction elements as having an order
02:42 dmq joined
luqui I don't know why we don't adopt the standard list comprehension idea... 02:42
TreyHarris ?eval any(1..10) ~~ /7/
evalbot_r14932 (no output)
luqui being able to use logical language like that is nice
TreyHarris ?eval my @a = any(1..10) ~~ /7/; @a.perl.say
evalbot_r14932 (no output)
TreyHarris doesn't understand 02:43
luqui no output is a bad thing... means crash or something right?
TreyHarris ?eval 1 + 1
evalbot_r14932 2
TreyHarris luqui: yeah, you're right, it gives me a bus error on my local pugs
luqui TreyHarris, yes, it's crash
TimToady segv
TreyHarris ok, running way late now, decommuting. thanks for the interesting things to think about, all :) 02:44
TreyHarris &
luqui ooh, junctions really do "thread" on pugs 02:48
TimToady so do hypers 02:49
luqui struggles to find a way to test that
TimToady ?eval (0..10)>>.say
evalbot_r14932 OUTPUT[1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤0␤] (Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True)
TimToady ?eval (1,2,3,4,5,6,7)>>.say 02:50
evalbot_r14932 OUTPUT[2␤3␤4␤5␤6␤7␤1␤] (Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True, Bool::True)
luqui yeah...
but how do I know it's not just mixing up the order (it's fairly obvious that it's not in this case, but for the junction case it wasn't) 02:51
02:51 GeJ_ joined
TimToady cuz I was here when audreyt hacked it in :) 02:51
luqui I was outputting [0][1][2][3][4], and I got it to output [0][1[2][3][4]]
hehe
TimToady and her hypers ran twice as fast on her 2-cpu machine... 02:52
luqui cool 02:53
oh, can I have outer, please?
(maybe with a good name, too?)
we have zip and roundrobin... 02:54
02:55 awwaiid__ joined
TimToady outer? 02:55
@foo XX @bar ?
lambdabot Maybe you meant: faq ft todo yow
02:56 Psyche^ joined
luqui outer(1,2; 3,4) == ([1,3], [1,4], [2,3], [2,4]) 02:56
XX eh?
?eval (1,2) XX (3,4)
evalbot_r14932 Error: ␤Unexpected "XX"␤expecting operator
TimToady not impl
but see "your" synopsis
S03:1186 02:57
Cross operators
luqui huh. 02:58
a metaoperator..
a bit overkill, but satisfactory
TimToady feel free to implement it. :) 02:59
luqui can I ask a metadesign question? 03:00
03:00 fridim joined
fridim hi there. 03:00
luqui why all the metaoperators?
hi there fridim 03:01
TimToady why not?
luqui because they will be hard to look up for people not familiar with them 03:02
TimToady beats doubling the number of operators
03:02 Lee_ joined
luqui I mean, why not: cross(&infix:<~>, <a b>, <c d>) 03:02
TimToady I think we'll have to be sure to provide a pleaseexplain "X,X" command
luqui along with XeqX, X~X, etc...
TimToady because <a b> X <c d> is prettier.
luqui yeah, but it doesn't matter if it's never used 03:03
TimToady I think X will be used frequently.
luqui I've never used whatever functional programming word there is for [\+]
TimToady particularly in constructing filenames
I'm not too worried as long as we have something that will explain snippets 03:04
luqui I like outers... Haskell's list monad is so good at them that I use it for any type of combinatorical or probabilistic problem I have
TimToady it saves a heap of nested loops. 03:05
and we'll see a lot of "for @foo XX @bar XX @baz -> [$a, $b, $c] {...}" 03:06
03:06 Lee_ is now known as LeeD
luqui well, I can at least implement X and XX, without implementing the whole metaoperator 03:06
TimToady, true, but the big reason to do that is when you don't know how many arrays you have
TimToady everything else just desugars to XX and reduce
luqui would you say: for [XX] @arrays -> @xs {...}
TimToady why not? 03:07
luqui okay...
(it took too much thinking to determine whether that was what I wanted :-
TimToady dinner &
03:08 wamiks joined 03:10 hexmode left 03:11 Psyche^ is now known as Patterner
svnbot6 r14933 | luqui++ | Implemented XX (but not the metaoperator). 03:43
03:43 GeJ_ is now known as GeJ 03:50 luqui joined
luqui ?eval 1,2 XX 3,4 03:50
evalbot_r14932 Error: ␤Unexpected "XX"␤expecting operator
luqui ?eval 1,2 Y 3,4
evalbot_r14932 ((1, 3), (2, 4))
TimToady ?eval 1,2 XX 3,4 03:53
evalbot_r14932 Error: ␤Unexpected "XX"␤expecting operator
TimToady huh, recompiled mine in that time...
luqui i think evalbot checks every 5 minutes or so
so it may have just started 03:54
TimToady ?eval 1,2 XX 3,4 03:56
evalbot_r14932 Error: ␤Unexpected "XX"␤expecting operator
luqui wonders whether evalbot cleans before rebuild 04:01
TimToady ?eval 1,2 XX 3,4 04:02
evalbot_r14932 Error: ␤Unexpected "XX"␤expecting operator
TimToady ?eval 1,2 XX 3,4 04:03
evalbot_r14933 ((1, 3), (1, 4), (2, 3), (2, 4))
TimToady ?eval [~]<< 1,2 XX 3,4 04:04
evalbot_r14933 Error: ␤Unexpected "<< 1"␤expecting dot, ":", "(", term postfix or operator
luqui no hyper-reduce?
?eval [~]<< [1,2,3]
evalbot_r14933 Error: ␤Unexpected "<< ["␤expecting dot, ":", "(", term postfix or operator
luqui of course that is nonsense
?eval [~]<<[1,2,3] 04:05
evalbot_r14933 Error: ␤Unexpected "<<["␤expecting dot, ":", "(", term postfix or operator
TimToady ?eval [~]« 1,2 XX 3,4
evalbot_r14933 Error: ␤Unexpected "\171"␤expecting dot, ":", "(", term postfix or operator
luqui so is (-4..4)**2 == (0..16) ?
huh?
TimToady why not?
luqui no reason 04:06
interval arithmetic can get tricky
but as long as we only define it for "normal" operators, it should be fine
TimToady question is what does (-4..4:by(2)) ** 2 give you?
something that would be hard to write otherwise, I expect 04:07
luqui let's see... (16, 4, 0, 4, 16). so it would be :by(4(i-2)) 04:08
hmm... :by(4($^i-2)) 04:09
shades of the einstein notation discussion
except that's wrong.. 04:10
(-12, -4, 4, 12) :by(8*$^i-12) 04:12
but that's not really important...
the point is log(1..4) listifies to (0, log(2), log(3), log(4)) 04:13
TimToady right
luqui but how far do we take it? 04:14
and ranges are not referentially transparent (very strange)
TimToady however far we take it, someone else will take it farther... :/
04:15 ssig33 joined
luqui (-1..1) * (-1..1) == (-1..1) ; my $x = -1..1; $x * $x == (0..1) 04:15
TimToady multidimensional ranges? 04:16
luqui affine and nonlinear slices, you mean?
TimToady I'm not a PDLer... 04:17
luqui I'm not either..
TimToady at some point I wish those folks would say something. 04:18
luqui just slices whose span are not hypercubes
04:48 mr_ank joined 04:49 kanru joined 05:37 nipra joined 05:39 nekokak joined 05:59 nipra joined 06:01 iblechbot joined 06:03 nipra joined 06:11 justatheory joined 06:12 baest joined 06:15 BooK_ joined 06:16 kanru joined 06:57 lisppaste3 joined, Lee_ joined 07:01 ofer1 joined 07:08 rintaro joined 07:21 RHainsworth joined 07:27 TSa joined 07:38 luqui joined
TSa HaloO Luke 07:42
07:47 RHainsworth left 07:58 Lee__ joined
luqui hello TSa 08:10
TSa ups that was a long reaction time 08:15
luqui heh, there is a little lag :-) 08:22
TSa not now
luqui hey
TSa what's your local time
luqui 1:23 am 08:23
TSa nighttime then
I'm not sure what the best time is on #perl6
luqui well, I suppose. Boulder time is 1:23 am. Luke time is about 3:00 pm
TSa european evening seems a bad time 08:24
luqui perhaps
I don't know when audreyt comes around
TimToady is around during US daytime
TSa have you discussed supertyping with larry 08:25
luqui not really
dduncan I have an opinion question re the naming of a data type ...
luqui I don't really get the module thing he proposed
dduncan, ... kay
TSa BTW, do you meet him in person on a regular basis? 08:26
luqui no
dduncan I would like to have a data type which can have just 1 value, and it is used as the implicit default value for a variable or parameter or whatever whose declared type is Any.
luqui TSa, I (am going to start) attend(ing) the weekly phone meetings again
dduncan its more meant as a marker, something people can query for to see if it isn't a normal value
and the declared semantics of Undef suggest that isn't quite what I want 08:27
TSa you have been offlist for a whie
luqui Nothing?
dduncan because the type I'm thinking of should not automatically become the prototype value for other classes
luqui TSa, ya, beed doing school
s/beed/been/
dduncan that's a thought
I wanted to use it in some of the same places that a SQL Null is used, but I explicitly want to not name it Null, so that people wouldn't be confused as it is different 08:28
baest 7win 1
sorry :)
dduncan I suppose I could go with Nothing until something better comes up
luqui Nothing is better than something!
dduncan indeed
luqui is reminded of a great dialogue in my linguistics homework: "I suppose this sandwich is better than nothing" ; "You're right, nothing is worse than that sandwich!" 08:29
dduncan does Nothing sound better or worse than None ? or Empty ? 08:31
08:32 devonst17 left
luqui Empty is reasonable; though that seems more like the name of a container (my $x is Empty) 08:32
dduncan or is there a common term that describes both the number zero and the empty string, which are normal values that are closest to that type's concept of nothingness
luqui Idenitity...
haha 08:33
"Nullity"
TSa lugui: are 'is also' re-openings of classes lexically scoped?
luqui TSa, I don't think so 08:34
dduncan fyi, for declared types of Str or Int etc, I would default containers of such to the empty string or zero, but in the case of containers declared Any, I have to use some other type because there is no value of type Any
that's the context ... something thematically similar that works with Any
TSa so they re-open the underlying package of the class
luqui dduncan, but specifically isn't of a more specific type?
TSa, yeah... multis can be lexically scoped
luqui isn't sure whether he wants to embrace lexically scoped methods 08:35
reminds me of the dependency problems of C++ (and most other statically typed OO languages) 08:36
dduncan Any is conceptually like the maximal type of Perl 6 ... everything else is one, but you can't have a value of Any ... though I think Perl 6 also uses Object for a similar purpose
TSa another thing that haunts me is homonymous role, class and module
dduncan, I can imagine a undef of Any 08:37
dduncan anyway, thanks for your help
luqui TSa, homonymous?
TSa yes, e.g. Array denotes a class and a role 08:38
luqui oh.
I suppose
TSa how does user code achive this?
luqui I kind of like the role/class homonymy. the role is the type or the interface, the class is the implementation
it means you can re-implement the interface of a class if you need to, and it will work everywhere the class was expected 08:39
without inheriting...
TSa I like this as well, but I'm unsure if you can have both under the same name
luqui I think of the class as the thing that comes before .new, and the role as everything else 08:40
TSa Yeah, but how is homonymity written? Aren't roles and class declarations competing for the same name slot= 08:41
or can you write 'does A' even if A is a class? 08:43
luqui a role name comes after "does"
it's actually kind of annoying me... there is very little difference between a role and a class anymore
I'm beginning to think that most perl 6 code will simply ignore the distinction 08:44
dduncan you can't instantiate a Role, can you?
luqui no
but that is pretty much the only difference
TSa a role is closed
dduncan does that mean a Role can have attributes?
TSa yes
luqui yes, a role can have attributes 08:45
they are (yay!) just shorthand for their accessors
TSa but they will become attributes of the class the role is composed into
what is unclear to me is if roles are kept after compilation 08:46
dduncan that sounds good ... it means the class still has the actual say of physical representation, and it is encapsulated away from the role code
TSa that is for looking up methods
or is the role not needed after composition because all info is stored in the class 08:47
luqui yeah, I like the situation: I beginning to think that inheriting structure is not as good as inheriting interface
so I don't see the point of class inheritance
TSa, I think that's the idea 08:48
TSa so the only remains of the role is the fact that instances of teh class do the role
luqui and that the role can be mixed in to existing objects 08:49
TSa ahh, yes but again it is edited in not linked by reference 08:50
luqui hmm.. 08:52
that's a good question
my gut says referential semantics are more expressive
but then composition rules break if you can edit roles
ah, essentially the discussion that was happening during the supertyping thread 08:53
TSa yes
so we have some fundamental differences between role and class 08:54
luqui hm. okay.
TSa could the compiler always distinguish role and class contexts? 08:58
I mean when it were allowed to have homonymous class and role
08:59 Lee_ joined
luqui I think so... 09:01
in term position, it is the class (the package); in type position, it is the role 09:02
hmm
what about .does?
.does(MyRole) # MyRole is in term position
TSa BTW, should homonymous class and role be allowed only when teh class does the role 09:05
I mean could there be some automatisms to enforce it? 09:06
E.g. 'class does Foo' could give the role name to the class
and of course there can be only one otherwise anonymous class that does the role 09:07
I'll be AFK for a while 09:13
09:22 araujo joined 09:31 elmex joined 09:41 andara joined 09:49 zdeqb joined 09:53 buetow joined 09:57 devogon joined, nipra joined 10:23 zdeqb joined 10:24 zdeqb left, foo\ joined 10:40 fglock joined 10:44 nipra joined 10:54 nekokak_ joined 10:57 nipra joined 11:11 ruz joined 11:32 Kattana joined 11:38 dduncan left 11:42 iblechbot joined 11:59 kanru joined 12:15 chris2 joined 12:16 frankg joined 12:24 RHainsworth joined, RHainsworth left 12:30 nipra joined 12:53 araujo joined 13:28 luqui joined 13:30 buetow joined 13:35 kanru joined 13:38 LeeD joined 13:56 elmex joined 13:59 Shabble_ joined 14:16 gnuvince joined 14:27 andara joined
TSa bye to whoever listens 15:07
15:08 hexmode joined 15:13 araujo joined 15:26 fglock joined 15:28 stevan joined 15:31 marmic joined 15:49 bonesss joined, penk joined 15:54 weinig|away is now known as weinig 15:55 kanru joined 16:09 iblechbot joined 16:14 RHainsworth joined 16:17 RHainsworth left
xinming what is the name of the module which is make perl 5 oop better please? I forgot. 16:19
16:20 chris2 joined 16:22 wamiks joined
broquaint Moose. 16:22
xinming Thanks. :-) 16:23
16:24 amnesiac joined 16:38 elmex joined 16:56 kane-xs_ joined 17:12 justatheory joined 17:13 ruoso joined 17:23 nipra joined 17:28 weinig is now known as weinig|away 17:36 ozo joined 17:47 nipra joined 17:49 _bernhard joined 18:02 weinig|away is now known as weinig 18:13 buetow joined 18:15 bonesss joined 19:04 rindolf joined
rindolf Hi all. 19:05
TimToady howdy. 19:07
rindolf Hi TimToady! What's up? 19:09
19:09 justatheory joined
rindolf TimToady: what was the first computer you worked on? 19:09
TimToady PDP 11/20 19:12
rindolf TimToady: did the 20 means 20 KB of memory? 19:13
TimToady: did it ran some kind of unix? 19:14
TimToady maybe, if you count in octal. 19:15
it had 16KB
rindolf TimToady: hmm...
Then what did the /20 stand for? Some kind of model? 19:16
TimToady I think it was just a model
they soon upgraded to an 11/45
Juerd But... 11/45 < 11/20 :)
TimToady and we programmed in RSTS
Juerd Were they trying to reach 0 eventually? :)
TimToady which eventually was upgraded to RSTS/E 19:17
don't know what you get when you divide RSTS by E...
maybe that's 0.
Juerd Depends on the value of E.
Perl 5 would make this a division by 0 :)
rindolf en.wikipedia.org/wiki/PDP-11#PDP-11_models
Juerd svg.tnx.nl/dump/2006-12-21T00:19:19...7v0.svg.gz 19:18
Wrong window
Ignore that url :)
(Or not, I don't care, but note that it's incredibly off topic here)
19:18 thestarslookdown joined
TimToady I do remember we got an offer several years later for V6 Unix for $300 "a special price because we're going to V7". 19:20
we didn't see the point, at that point.
"It doesn't seem to have BASIC..." 19:21
rindolf TimToady: when did you receive this offer? 19:22
TimToady so I never ran Unix till after I was married and moved to LA.
mid 70's, don't remember exactly.
rindolf TimToady: OK. 19:23
TimToady and it wasn't like we could dual-boot The Computer which was the only computer in the whole college. 19:24
rindolf TimToady: so this was at college?
Juerd My first computer was Intel 80286 based :)
rindolf Juerd: mine was 8080-based.
8088 even
TimToady yes, though I also worked there while packing 4 years into 8.
Juerd I had an 8088 later
jrockway 4.7MHz or 8? 19:25
Juerd The 286 belonged to my parents; the XT was MINE :)
TimToady first computer I ever *owned* was an Amiga 1000.
Juerd jrockway: I have absolutely no idea. I wasn't geek enough at the age of 7.
The XT quickly broke, and I was back to not owning a computer.
jrockway Juerd: ah, i remember when I got (to use) a tandy1400 laptop that was 8MHz instead of my tandy 1000 at 4.7MHz :)
memories :)
TimToady I still have that Amiga 1000. 19:26
It still runs.
rindolf TimToady: heh.
TimToady: have you tried running Linux or BSD on it?
Juerd I have owned an Apple ][, but sold it, not realising how hard it'd be to get one again.
TimToady Linux never made it onto the 1000, as far as I know. No memory management.
had it on the 2000 and the two 3000s though. 19:27
jrockway Juerd: i've gotten over my attraction to junk computers. probably related to having no storage space in my apartment :)
Juerd My current office has too much unused wall. 19:28
I want old junk computers up there 19:29
But I need a few to begin with. Otherwise it just looks silly
TimToady I mean Unix in any form never made it onto the 1000. The Unix on the higher models was a SysV clone. 19:31
but it cost like $500, so never installed it.
19:33 larsen_ joined
Juerd I've never in my life worked with a commercial Unix 19:46
Just never encountered it
19:46 wamiks joined
TimToady I've been on most of them at one time or another, but mostly 19:48
Solaris
however, mostly I was on BSD. (the Real BSD. :) 19:49
that was back when "All the world is a Vax."
Juerd I guess I'm just lucky :) 19:51
TimToady ah, yes, HP/UX and AIX...fond memories.
"smit happens"
Juerd has always taken all the nice modern tools for granted :) 19:52
TimToady and 10 years from now you'll wonder how you ever survived without something that hasn't been invented yet.
Juerd In fact, it wasn't until the post-oscon Amsterdam.pm meeting where you got the black camel trophee, that I knew that *you* made patch :)
Yea. I already can't imagine how I ever survived without a car, even though they were invented long before I was born :) 19:53
gaal so was cdr 19:55
TimToady I don't think it was invented before I was born...
Juerd Hehe :) 19:56
kolibrie isn't sure how he survived without Perl 6 regexes, and they are not even finished being invented
TimToady yeah, it's turning us all into a bunch of whiners...
Juerd I'm finding it harder and harder to cope without gather/take, actually :) 19:57
TimToady but we have gather/take. :)
gaal I like how lambda calculus was around before computers.
Juerd TimToady: I don't have it in my production perl 5 :)
TimToady not that difficult to emulate, actually. 19:58
gaal Acme::Gather::Round:Ye::Perl6::Hackers
kolibrie looks like it's not implemented in v6.pm yet 19:59
jrockway kolibrie: just use pugs instead of perl :) 20:06
TimToady we just need a Haskell-to-MiniPerl6 translator.
kolibrie jrockway: but then it is not in Juerd's production perl 5
TimToady how hard can h2m be? 20:07
kolibrie times TimToady
TimToady hmm, I'd have to learn Haskell again...
kolibrie stops his stopwatch - any other takers? 20:08
wolverian did you unlearn it?
TimToady didn't have to, kinda unlearned itself. 20:09
kolibrie only a temporary rewiring then
TimToady It's just a variant of BASIC, right? 20:10
jrockway instead of GOSUB they have lambda
i think this would be nice, btw:
wolverian it's very intuitive, except when it's not. 20:11
20:11 mrossetti joined
jrockway use Haskell; let f = ( * 2); use v6; print f(2); 20:11
misplaced space...
TimToady use Inline::Haskell
jrockway although perl6 seems to remove the "inline" part and make it Just Work 20:13
i.e., no Inline::Perl5 required, just "use v5"
TimToady well, sure, it's just a multi-line macro now. 20:14
20:17 thestarslookdown joined 20:42 ruoso joined 20:52 thestarslookdown joined
Tene ?eval use Haskell; let f = ( * 2); use v6; print f(2); 21:00
evalbot_r14933 Error: *** Unsafe function 'use' called under safe mode␤ at -e line 16, column 7-112
gaal when does a gather/take assignment happen? Can my @g = gather { ... refer to @g ... } ever make sense? 21:07
Juerd IIUC, declarations happen instantly, so "my $foo = \$foo" would be problematic. 21:11
21:13 penk joined 21:15 miyagawa joined 21:19 elmex joined
TreyHarris anyone with CPAN.pm clue on right now? please IM me? 21:33
21:36 dduncan joined
Juerd TreyHarris: This is #perl6, about Perl 6. You may want to try #perl for Perl 5 stuff. 21:36
TreyHarris Juerd: i was in the wrong window 21:38
apologies
21:39 elmex_ joined 21:41 gnuvince joined
jrockway maybe he was trying to get the 6pan up and running :) 21:43
Juerd Brave 21:55
gaal is "gather { return }" legal? 22:18
I'm sure you can all guess what I'm spending the evening on :-) 22:19
22:19 justatheory joined 22:29 justatheory joined 22:36 gnuvince` joined 22:37 gnuvince joined
gaal perlcabal.org/~gaal/Perl6-Gather-0.01.tar.gz though after I finished testing it I discovered Damian already put something on CPAN. 23:02
ah well, mine has fewer deps. :) 23:03
qmole that's a good hint that you're doing something slightly crazy
23:04 Odin-LAP joined
gaal you be the judge. :) 23:04
although being on this channel is alredy considered a good hint 23:05
qmole heh 23:06
i observe from a safe distance 23:07
23:07 mrossetti joined 23:08 mrossetti left 23:15 Aankhen`` joined 23:17 thestarslookdown joined 23:19 Psyche^ joined 23:21 amnesiac_ joined 23:23 dolmen joined
avar sial.org/pbot/21928 <- from perl 5.10 docs, isn't this just something that should be fixed in s04 if it hasn't already? 23:25
lambdabot Title: Paste #21928 from Someone at 85.197.228.236
23:28 GeJ joined 23:31 luqui joined 23:34 thestarslookdown joined 23:35 polettix joined 23:37 Psyche^ is now known as Patterner 23:41 neonse joined 23:50 weinig is now known as weinig|away