Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2006-06-02

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 unobe_____ joined perl6
00:02 Khisanth joined perl6
00:23 Khisanth joined perl6
00:23 Quellism joined perl6
00:25 Limbic_Region left perl6
00:41 mjk joined perl6
00:44 macroron joined perl6
00:47 imperator joined perl6
01:16 lambdabot joined perl6
01:24 mako132_ joined perl6
01:31 pfenwick joined perl6
01:42 particle_ joined perl6
01:43 weinig_ joined perl6
01:44 sri__ joined perl6
01:48 b00t joined perl6
01:50 unobe_____ joined perl6
01:50 unobe_____ is now known as unobe
01:55 jserv-- joined perl6
02:03 weinig_ is now known as weinig|sleep
02:19 unobe_____ joined perl6
02:20 unobe_____ joined perl6
02:20 unobe_____ is now known as unobe
02:30 SamB joined perl6
02:44 FurnaceBoy is now known as MannishBoy
02:50 MannishBoy is now known as FurnaceBoy
02:56 Quellism joined perl6
03:12 justatheory joined perl6
03:34 nperez joined perl6
04:01 Shabble joined perl6
04:33 neoesque joined perl6
04:50 FurnaceBoy_ joined perl6
04:57 cmarcelo left perl6
05:59 qu1j0t3 joined perl6
06:21 pfenwick joined perl6
06:55 iblechbot joined perl6
06:58 Aankhen`` joined perl6
07:10 mjk joined perl6
08:12 Ymmv joined perl6
08:20 marmic joined perl6
08:22 lichtkind joined perl6
08:33 elmex joined perl6
08:37 lisppaste3 joined perl6
08:55 Ymmv joined perl6
08:56 penk joined perl6
09:15 bjoern_h joined perl6
09:18 buubot joined perl6
09:55 andara joined perl6
10:02 Ymmv joined perl6
10:28 Ymmv joined perl6
11:10 iblechbot joined perl6
11:34 weinig|sleep is now known as weinig
11:38 chris2 joined perl6
11:47 Limbic_Region joined perl6
12:05 Khisanth joined perl6
12:13 bjoern_ joined perl6
12:16 cognominal joined perl6
12:31 elmex joined perl6
12:53 Ymmv joined perl6
13:16 trym joined perl6
13:17 justatheory joined perl6
13:18 mako132_ joined perl6
13:21 pfenwick left perl6
13:44 FurnaceBoy joined perl6
13:56 sahadev joined perl6
13:57 Qiang joined perl6
13:57 vel joined perl6
14:07 ludan joined perl6
14:08 ludan hi
14:08 lichtkind hello
14:09 PerlJam good $localtime
14:13 iblechbot joined perl6
14:24 particle_ joined perl6
14:51 DaGo joined perl6
14:54 Hue-Bond joined perl6
15:34 segv_ joined perl6
15:45 kanru joined perl6
16:11 sahadev left perl6
16:11 sahadev joined perl6
16:14 macroron joined perl6
16:16 jsiracusa joined perl6
16:19 marmic joined perl6
16:19 neoesque joined perl6
16:23 szbalint joined perl6
16:24 andara left perl6
16:34 nowhere_man joined perl6
16:48 merlyn joined perl6
16:49 beerboybeeerboy joined perl6
16:49 leku joined perl6
16:49 leku left perl6
16:54 shachaf joined perl6
17:16 Limbic_Region joined perl6
17:34 lichtkind joined perl6
18:03 FurnaceBoy is now known as FB|afk
18:20 putter joined perl6
18:20 putter I'm probably being prematurely puzzled by this, but...
18:22 putter f(g())  where  sub f(\$a){ rand > 0.5 ?? j.call($a) !! k.call($a) }  and sub j($x){}; sub k(*@y){}
18:25 putter is g called in a scalar or list context?  if it could be either, then its execution is lazily deferred until you know??
18:25 PerlJam looks like scalar context to me.
18:27 putter "Any remaining variadic arguments at the end of the argument list are bound to the slurpy array (*@data above) and are evaluated in list context. " S06/List parameters
18:27 putter so k(g()) would do g in list context, no?
18:28 PerlJam yes.
18:29 shachaf_ joined perl6
18:30 putter ah, "Individual parameters may confer a scalar or list context on their corresponding arguments, but unlike in Perl 5, this is decided lazily at parameter binding time." S03/Parameters and arguments
18:31 putter It just hadn't occurred to me that with Captures, parameter binding time might be quite so late.
18:35 putter PerlJam: was that "yes", "yes, k(g()) would be listy, but f(g()) would still be scalary", or "yes, it could be either"?
18:35 PerlJam putter: the former (AFAIK. but I'm no expert)
18:36 PerlJam er, I guess "the middle one"  :)
18:36 putter ah.  hmm.  lol
18:38 weinig joined perl6
18:39 shachaf__ joined perl6
18:42 putter if it isnt lazy, then delegatation has issues; if it is, p6 is a lazy functional langauge.  which could be neat, but I wonder if it was intended.  by repeatedly doing captures, the thread might execute an arbitrary number of subs before g actually gets called.
18:42 TimToady g() is not lazy.
18:42 putter :)
18:43 TimToady the delayed binding of context really only applies to things that are already objects
18:43 TimToady there's something in there about the context of a function being assumed to be list context if unknown.
18:44 TimToady but what a function returns  is a Capture object, and that's what gets lazily contextualized.
18:44 putter ah, so capture param => unknown => list context for g
18:45 putter err, rephrasing,
18:46 PerlJam TimToady: Where did perl5's OO model come from exactly?
18:46 * Limbic_Region just worked around an extremely bizarre p5 tie bug
18:46 weinig is now known as weinig|away
18:47 TimToady bits of it came from Python, bits of it just from considering how to minimally hook up to C++ via XS.
18:47 Limbic_Region FETCH only gets called once
18:47 PerlJam TimToady: thanks, that jibes with what I thought (mostly :-)
18:48 putter f, because of it's capture param, creates a situation of unknown context for its arguments, and g(), being a function call in unknown context, defaults to list context.  yes?
18:48 TimToady if g() calls want(), it will be told it's in list context.
18:49 * putter waits for the other shoe...
18:49 TimToady but the return in g() is just a function that hands its Capture back
18:49 TimToady which gets installed into the Capture list of f()
18:49 TimToady so the binding of f() decides whether to flatten the return value of g().
18:49 FB|afk is now known as FurnaceBoy
18:50 * putter ponders
18:50 * TimToady too...
18:50 TimToady It's not quite what you want for MMD...
18:51 TimToady unless you count the type of the Capture as the "of" type of g().
18:51 TimToady or peek inside it.
18:52 TimToady (to get the actual run-time type of the result)
18:53 TimToady I suppose MMD will ask g()'s return value for its scalar value in any event, which if g() returns a list, might just say "I'm still a Capture, if you want a scalar."
18:54 TimToady But if it just returns a scalar, that's what you get without the Capture wrapper.
18:54 TimToady (just thinking out loud here...)
18:54 TimToady Or maybe the listy version just turns into a List object.
18:55 TimToady (of course, you can always flatten earlier with [,])
18:55 FurnaceBoy is now known as FB|afk
18:56 TimToady but you want to return a Capture so that you can say @a := g()
18:56 TimToady or $b := g()
18:56 TimToady The whole point of a Capture is that it hasn't decided what its context is yet.
18:57 TimToady Is this making any more sense now?
18:58 PerlJam Will want() return a junction in the presence of multi-methods?
18:59 TimToady I don't think so.  I'm not terribly fond of want() any more.
18:59 TimToady I think declaring the return type is much more useful.
19:00 PerlJam Are you unfond of want enough that it will be extirpated?
19:00 TimToady No, but I'm not interested in slowing anything else down in order to support it.
19:00 PerlJam Seems like it's still useful but occasionally is allowed to return an "I don't know" ansswer
19:01 TimToady In which case the best response is often to return a proxy object that lazily produces the desired value once the context *is* known.
19:03 TimToady there could be some syntactic relief for that so we don't always have to close over all the closures that might be returned if we know the context earlier.
19:03 TimToady Or maybe some kind of tiebreaking MMD based on context.
19:04 TimToady where the default method just closes a call back to the MMD dispatcher for later lazily.
19:04 PerlJam Seems like it would be easy for the programmer to write some circular logic where one sub's context is dependant upon another's and vice versa  (though I guess that's easy to detect too)
19:05 TimToady (or however you say that in English...)
19:05 TimToady I think ignorance and apathy are a good default.  :)
19:05 Aankh|Clone joined perl6
19:06 TimToady "I don't know and I don't care" works pretty well for questions of context.
19:08 TimToady I think returning Captures but resolving them lazily for MMD is probably a reasonable approach.
19:08 wolverian "You'll have to tie me down and beat me with a hammer before I tell you!"
19:09 TimToady they can be resolved more eagerly for single predeclared subs, or for multis that have a proto.
19:10 TimToady (in which case g() even knows its context from want(), probably)
19:13 PerlJam TimToady: well, it sounds good from where I'm sitting (in as much as I can't really think of anything that would fatally wound the idea)
19:14 putter my take-away line is something like, lhs's establish context, so Closures, arg#!@!, Captures, being a generalized rhs, will sometimes have their arguments evaluated with unknown context, so the context defaults are used.
19:14 TimToady Basically, as with all the rest of Perl 6, we're just ignoring the fact that it's impossible and doing it anyway.  :)
19:15 PerlJam putter: I would say that "as long as you don't force evaluation in a particular context, you don't know what the context is and often don't need to know (yet)"  :)
19:16 PerlJam putter: for your "sometimes" case
19:16 TimToady yes, it's okay for Capture context to call functions eagerly, as long as the eventual objects migrate through unmolested somehow.
19:17 TimToady Most "real" objects (arrays and hashes and scalars) don't care until binding time what there context is.
19:17 TimToady *they're
19:17 TimToady *their
19:17 TimToady take your pick :(
19:18 putter I'm still a bit fuzzy, but all set for now.  Thanks. :)  lol
19:18 TimToady Oh, don't bring sets into it.  :P
19:18 putter :)
19:18 PerlJam putter: you're only fuzzy when I'm not wearing my contacts.
19:19 * particle_ makes sure he's in #perl6 and not #pun6
19:19 PerlJam putter: or you've somehow gotten fur stuck to yourself, but I don't even want to know what happened there!
19:19 TimToady (speaking of contacts...)
19:19 TimToady well, I've gotta run off to a lunch.
19:20 TimToady munch &
19:21 putter bye.  thanks again.
19:21 PerlJam fuzzy wuzzy was a putter, fuzzy wuzzy liked to mutter, fuzzy wuzzy had trouble rhyming at this point  ;-)
19:26 putter Extreme Programming, 2007 - "Since if it's not coded, it doesn't exist, it eventually proved possible for coders to maintain a code-all-implementation-paths superposition.  This had the now familiar side effect of making them appear fuzzy."
19:27 putter cheers &
19:29 jserv-- joined perl6
19:29 weinig|away is now known as weinig
19:40 penk left perl6
19:40 vel joined perl6
19:43 vel joined perl6
19:45 vel joined perl6
19:47 vel joined perl6
19:50 larsen joined perl6
19:59 sahadev joined perl6
19:59 vel joined perl6
20:01 vel joined perl6
20:02 Khisanth joined perl6
20:03 vel joined perl6
20:06 _SamB_ joined perl6
20:16 FurnaceBoy joined perl6
20:26 FurnaceBoy joined perl6
20:33 mako132_ joined perl6
20:44 vel joined perl6
20:49 putter joined perl6
20:50 putter hmm.  upside, pugs now builds fine.
20:57 putter downside, uncommenting the Test config.yml line, make clean, make, results in a pugs which seems _slower_ than before.  For both -e 'say 3;' and -e 'use Test;'.  Just an off-the-cuff observation.  I haven't looked at it real hard.
20:58 putter But 'use Test' is ~6 cpu sec vs ~9 cpu sec.  So not a subtle difference.
20:59 putter puzzled &
21:20 theorbtwo asdfasdfsdfasdf
21:24 buu Fascinating.
21:34 justatheory joined perl6
21:53 fglock joined perl6
21:55 fglock is :ratchet passed as a parameter to subrules? specifically to <ws>, which would not backtrack inside a 'rule' but would backtrack inside a 'regex'
21:58 TimToady no, every regex keeps its own idea of ratcheting.  if the <ws> backtracks it does so as a whole, unless the definition of <ws> includes its own backtracking.
21:58 TimToady I think the standard <ws> probably doesn't backtrack internally.
22:01 fglock TimToady: does :perl5 rules called from plain 'regex' backtrack from them? (this is a bit difficult to implement, if we use different engines)
22:04 fglock regex any :p5 {.*} regex xx {x<any>x$} - does matching "xxx" work?
22:05 Hue-Bond left perl6
22:06 jsiracusa joined perl6
22:17 TimToady fglock: it would be nice if that could work.  that probably means the implementation of :P5 really wants to just translate the regex to P6 form and use the same engine, rather than trying to use an engine that can't take continuations.
22:19 TimToady Alternately, it could just refuse to work if called in a context that requires backtracking into a subrule.  That approach might be okay for a bootstrap.
22:21 TimToady That might also be the best we can do when calling into a subrule defined by a different language.
22:21 TimToady (unless we can get at the original text and emulate in P6)
22:23 TimToady The other alternative in such a case is to provide our continuation to the subrule to be called recursively, assuming the other engine has the capability of calling back to us somehow.
22:25 TimToady (That's basically how the P5 engine works with respect to itself--it recurses deeper to test the following pattern, even if that following pattern is "shallower" in some sense.)
22:36 trym joined perl6
23:03 Ymmv joined perl6
23:05 rashakil joined perl6
23:39 ruoso joined perl6
23:41 Quellism joined perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo