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:01
Psyche^ is now known as Patterner
|
|||
Debolaz | Speaking of parrot, is there anywhere I can find the discussion/rationale behind a register based approach? | 00:04 | |
luqui | Debolaz, I don't remember where the doc is; but the surface reason is that we have tons of register based research to draw on; the deeper reason is that stack-based VMs do not like ILP very much | 00:05 | |
and there is probably an even deeper reason that I don't know about | 00:06 | ||
?eval class List is also { method shuffle() { $.pick($.elems)) } } | |||
evalbot_r14926 | Error: Unexpected ")"expecting ":", term postfix, operator or "}" | ||
luqui | ?eval class List is also { method shuffle() { $.pick($.elems) } } [1..5].shuffle | ||
evalbot_r14926 | [3, 4, 1, 2, 5] | ||
luqui | ?eval class List is also { method shuffle() { $.pick($.elems) } } <w 0 0 t>.shuffle | 00:07 | |
evalbot_r14926 | ["0", "t", "w", "0"] | ||
wolverian | whoa. luqui++ | ||
jrockway | Debolaz: the reasoning was that optimizations for register-machines are well-known | ||
since every *real* machine is register-based, and there are pretty good optimizing compilers for them | |||
almost every, i mean | |||
(further reasoning is documented somewhere on the parrot website, btw) | 00:08 | ||
Ovid | There's a List class separate from Array? Which inherits from the other? | 00:10 | |
(I'm feeling very slow right now) | |||
luqui | I left perl about the time the debate was going on | ||
my angle was: List is the value type for Array | |||
wolverian | luqui, should that be @.pick? | ||
luqui | wolverian, possibly, yes | ||
jrockway | ?macro circumfix:</* */> is parsed /.*?/ { '' } /* foo bar */ 1; | ||
lambdabot | Unknown command, try @list | ||
jrockway | ?eval macro circumfix:</* */> is parsed /.*?/ { '' } /* foo bar */ 1; | ||
evalbot_r14926 | Error: Unexpected "/.*?/"expecting trait or block | ||
luqui | luqui, an Array is a reference to a variable containing a List | ||
wolverian | reference? what's that? ;) | 00:11 | |
luqui | but on these issues I seldom get my way :-), so it's probably something else | ||
Debolaz | jrockway: But those real machines are register based because that's much more practical to implement in hardware aren't they? In many software cases, especially when allowing unlimited registers, it seems somewhat inefficient (Sort of like an obfuscated stack) to use registers. That being said, I'm not expert on the sbuject. | ||
jrockway | Debolaz: right, but that's where the research efforts have been made | ||
there'a *a lot* of literature on register-based machines | |||
even if they're "not as good" | |||
luqui | Debolaz, also, stack machines don't like ILP; they cause mispredicts too much | ||
er, cache misses | |||
py1hon | doesn't code for stack machines tend to be bigger too as it's littered with pushes and pops? | 00:12 | |
luqui | yeah, but whatever. | ||
py1hon | and i'd think stack based machines would be harder to do jit compiling on, not that i know | ||
Debolaz | I just feel that perhaps chosing a register based machine because more optimizations are known for it is sort of like chosing fortran over perl based on it being many possible optimizations in the context of fortran.. ie, it doesn't really counterargue using a stack machine in itself. | ||
jnthn | If you are interpreting the code and have no JIT available and you have a stack, you gotta maintain the stack pointer. = slow | ||
luqui | jnthn, yeah, that's the ilp thing; all your instructions are dependent on the stack pointer. | 00:13 | |
jnthn | And yeah, JIT on a stack is stack => register mapping, whereas JIT with register is essentially just register minimisation. | ||
Which if you have lots of registers and a Parrot sub doesn't use many, may be a no-op. | |||
jrockway | although my machine doesn't have a register that can store pmcs :) | 00:14 | |
luqui | jrockway, really? they're just pointers... | ||
jnthn | A Parrot register doesn't really, just a pointer to one. :-) | ||
Your hardware stores pointers just fine. | 00:15 | ||
Ovid | For shuffle, can't you just extend Array with the sig (*@list) and use it with both lists and arrays? (Or am I being totally naive again?) | ||
py1hon | arrays can't do o(1) insertions and deletions in the middle... | 00:16 | |
Ovid | Wait, I meant (*@list is copy). That's assuming that slurpy arrays don't default to 'is copy' | 00:17 | |
jrockway | ah :) | 00:18 | |
luqui | Ovid, I'm not sure | ||
I implemented it as a method | |||
so... | |||
Ovid | Well, Larry suggested it might be that way, but who knows? | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } <w 0 0 t>.shuffle | 00:19 | |
evalbot_r14926 | ["0", "t", "w", "0"] | ||
luqui | hmm. | ||
?eval <w 0 0 t> | |||
evalbot_r14926 | ("w", "0", "0", "t") | ||
luqui | why is it returning a ref | ||
Ovid | ?eval <w 0 0 t> | ||
luqui | ?eval <f o o b a r>.pick(6) | ||
evalbot_r14926 | ("w", "0", "0", "t") | ||
("b", "r", "o", "a", "o", "f") | |||
jrockway | ref? | ||
luqui | the square brackets | ||
Ovid | ?eval <w 0 0 t>.pick(3) | 00:20 | |
evalbot_r14926 | ("0", "0", "t") | ||
Ovid | ?eval <w 0 0 t>.pick(5) | ||
evalbot_r14926 | ("0", "w", "0", "t") | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } @{<w 0 0 t>.shuffle} | ||
evalbot_r14926 | Error: Unexpected "{<"expecting "@" or "::" | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } list <w 0 0 t>.shuffle | ||
evalbot_r14926 | ["0", "t", "0", "w"] | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } *<w 0 0 t>.shuffle | 00:21 | |
evalbot_r14926 | Error: Odd number of elements found where hash expected: VNum Infinity | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } *(<w 0 0 t>.shuffle) | ||
evalbot_r14926 | Error: Cannot cast from VNum Infinity to Pugs.AST.Internals.VCode (VCode) | ||
luqui | oh | ||
* doesn't do that anymore | |||
?eval class List is also { method shuffle() { @.pick($.elems) } } =<w 0 0 t>.shuffle | 00:22 | ||
Ovid | Why should "<w o o t>.pick(5)" only return 4 elements? That's silently discarding the information that I'm trying to pick too many elements. | ||
evalbot_r14926 | Error: Can't modify constant item: VUndef | ||
luqui | Ovid, you want it to die? | ||
Ovid | I always want things to die when they're a serious error doing something they shouldn't do. | 00:23 | |
Debolaz | Also, what is the adventage with a junction over a list that would be difficult to achieve using lists? | ||
audreyt | luqui: the obvious solution is the correct one: @() | ||
luqui | ?eval class List is also { method shuffle() { @.pick($.elems) } } @(<w 0 0 t>.shuffle) | ||
evalbot_r14926 | ["0", "w", "t", "0"] | ||
luqui | hmm.. | ||
apparently not | |||
audreyt | why not? | ||
Ovid | Of course, that might just be the "strong typing" pseudo-bigot coming out! | 00:24 | |
audreyt | arglist flattening is |<< btw | ||
?eval class List is also { method shuffle() { @.pick($.elems) } } |<< <w 0 0 t>.shuffle | |||
evalbot_r14926 | (["0", "t", "0", "w"],) | ||
audreyt | but that doesn't quite work here | ||
have to be inside a function call | |||
luqui | what is |<< ? | 00:25 | |
audreyt | ?eval class List is also { method shuffle() { @.pick($.elems) } } <w 0 0 t>.shuffle | ||
evalbot_r14926 | ["w", "t", "0", "0"] | ||
audreyt | ?eval class List is also { method shuffle() { @.pick($.elems) } } | <w 0 0 t>.shuffle | ||
evalbot_r14926 | ["0", "t", "w", "0"] | ||
audreyt | ?eval class List is also { method shuffle() { @.pick($.elems) } } sort | <w 0 0 t>.shuffle | ||
evalbot_r14926 | ("0", "0", "t", "w") | ||
Ovid | In other words, if there's a serious debate about what a non-sensical method call should return, I want it to die a quick and painful death. | ||
audreyt | luqui: prefix | is the new * | ||
Ovid | Of course, that might be the rum talking. | ||
audreyt | S03/Argument Llist Interpolation | ||
luqui | Ovid, I'm never sure about TimToady, but he might disagree with you | ||
Ovid, you're not too good with haskell, are you? | 00:26 | ||
(ha, speaking like I am! :-p) | |||
audreyt | you are quite good :) | ||
audreyt goes making Really Important phone call. bbiab & | |||
Ovid | I went through a Haskell tutorial a long time ago and I remember precisely squat (aside from the fact that i can recognize guards when I see them) | 00:27 | |
luqui | Ovid, it might be a good exercise to make it die when you try to pick too many elements | ||
audreyt | Ovid: web.archive.org/web/20060327034654/...review.pdf | ||
lambdabot | tinyurl.com/y94rfc | ||
audreyt ponders the ethics of linking into now-404'ed preview pdf of a book | |||
luqui | Ovid, src/Pugs/Prim/List.hs line 70 if you're interested | 00:28 | |
Ovid | Audrey: thanks! | ||
audreyt | but that's the best material I've found so far | ||
and I will buy the book once it comes out, so I guess that's ok :) | |||
Ovid | Audrey: no worries. I won't tell anyone and this will just be between us :) | 00:30 | |
luqui | and me, now | ||
Ovid | Shh! | ||
I just noticed that you linked to something that is from the University of the city I just moved to (and am now moving away from). Cool! | 00:31 | ||
TimToady is never quite sure about TimToady either... | 00:32 | ||
luqui knew that, he just didn't say | |||
Ovid | luqui: there's absolutely no point in making it try to pick from more elements than the list has, so anyone trying to do that is arguably trying to do something wrong. | 00:33 | |
audreyt | this certainty thing is certainly overrated... | ||
00:33
Ovid left
|
|||
luqui | oh, the old hit-and-run argument approach :-) | 00:33 | |
jrockway | heh, i printed a paper copy of that book a few weeks ago ( i think ) | ||
00:34
Ovid joined
|
|||
Ovid | Oops. | 00:34 | |
Just lost my chat log, too :( | |||
audreyt | there's always irc.pugscode.org | ||
Debolaz checks out the book. | 00:35 | ||
TimToady | ?eval <a b c>.pick(*) | ||
evalbot_r14926 | Error: pick not defined: VList [VStr "a",VStr "b",VStr "c"] | ||
TimToady | looks like the implementation is not yet complete... | ||
luqui | ah | 00:36 | |
I wonder what the internals of * look like | |||
Ovid | Thanks, Audrey. | ||
TimToady | matched by Whatever in the sig | ||
Debolaz | The biggest obstacle to learning haskell for me so far has been the tutorials going out of their way to just saying things the way they are but instead try to make up every imaginable analogy for it. | ||
TimToady | other than that, doesn't have much internals... | ||
luqui | looks like it is represented by VNum Infinity | 00:37 | |
jrockway | i just read through one of audreyt's talks on haskell | ||
TimToady | that's a hack | ||
jrockway | very accessible and entertaining | ||
TimToady | arbitrarily large is very different from infinity | ||
Debolaz | jrockway: Url? | 00:38 | |
luqui goes to perpetuate the hack in his implementation of pick | |||
TimToady | and * is really only "arbitrarily dwim" with a slight bias toward largeness. | ||
or smallness, in the case of *..0 | 00:39 | ||
Ovid | jrockway: which intro? I read one and was terribly confused, so it must be a different one (this being from a guy who went from OO to Prolog but doesn't quite grok the lambda calculus) | ||
jrockway | let me look around for it | ||
feather.perl6.nl/~audreyt/osdc/haskell.xul | |||
Ovid | Tjat | 00:40 | |
That's the the one I read. I guess I'd have to hear the accompanying talk. | |||
jrockway | just type them into ghci and follow along | 00:41 | |
and then read the book | |||
then you'll be the next audreyt, perhaps :) | |||
Ovid | I'll give that a shot. The fact is, I confess I'm just not as quick as the rest of you. I'm just persistent :) | 00:42 | |
jrockway | hehe | ||
some of the examples need let in front of them, i think | |||
TimToady | I am often persistent briefly. | 00:43 | |
jrockway | let double = (*) 2 instead of "double = (*) 2" as per the slides | ||
Ovid | TimToady: don't say that. I'll stop believing your honesty! | ||
So anyone willing to make a prediction about a timeline for Perl 6 alpha built in PGE? | 00:47 | ||
jrockway | people are willing to predict, but i bet you're tired of the answer ;) | ||
Ovid | (Warning: a O'Reilly blog post might follow that if there aren't enough caveats) | 00:48 | |
luqui is certain that people don't want to hear my answer... | |||
Ovid | Well, I've predicated "2007", but likely in the first half. | ||
jrockway | christmas 2007? | 00:49 | |
svnbot6 | r14927 | luqui++ | Implemented @list.pick(*). | ||
jrockway | ?eval (1,2,3).pick(*) | ||
evalbot_r14926 | Error: pick not defined: VList [VInt 1,VInt 2,VInt 3] | ||
luqui | jrockway, be patient! :-) | ||
Ovid | :P | ||
jrockway | *whir of evalbot self-compiling itself* | ||
luqui | ?eval [1..31].[5..*] | 00:51 | |
evalbot_r14926 | () | ||
luqui | hmm | ||
?eval (1..31).[5..*] | 00:52 | ||
evalbot_r14926 | (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) | ||
luqui | that seems, wrong | ||
the former, that is | |||
jrockway | ?eval [1..31] | ||
evalbot_r14926 | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] | ||
jrockway | ?eval [1..31].WHAT | ||
evalbot_r14926 | ::Array | ||
Ovid | Agreed. References should resolve themselves. | ||
TimToady | there are no references. :) | 00:53 | |
Ovid | We'll call them "spoons". | ||
jrockway | what's the difference between [...] and (...) ? | ||
sporks | |||
TimToady | Arrays are mutable | ||
luqui | I'm afraid of touching that bug though. | ||
TimToady | but that shouldn't matter for this | ||
luqui | I've been there before | ||
TimToady | ?eval [1..31][-1] | 00:54 | |
evalbot_r14926 | \31 | ||
luqui | was it the dot? | ||
?eval [1..31][5..*] | |||
evalbot_r14926 | () | ||
TimToady | ?eval [1..31].[-1] | ||
py1hon | array references wrap around? | ||
evalbot_r14926 | \31 | ||
TimToady | subscripts wrap around | ||
jrockway | py1hon: as per perl5, right? | ||
TimToady | yes | ||
luqui | py1hon, but not as in modular arithmetic | ||
just negative numbers | 00:55 | ||
?eval [1..31][42] | |||
evalbot_r14927 | \undef | ||
jrockway | ok :) | ||
py1hon | jrockway, i'm a c monkey =/ | ||
jrockway | ?eval (1,2,3).pick(*) | ||
evalbot_r14927 | (1, 2, 3) | ||
TimToady | however, once we get range objects, they may behave more toward | ||
jrockway | py1hon: learn perl :) | ||
Ovid | ?eval item [1 .. 31][-1] | ||
py1hon | i did a long time ago, then forgot it all ;p | ||
evalbot_r14927 | 31 | 00:56 | |
jrockway | i only program in C for the mental exercise | ||
using tools like valgrind has a certain satisfaction | |||
py1hon | i do tons of sockets programming for work... | ||
valgrind is so awesome | |||
jrockway | well, even better is a language that doesn't let you leak memory :) | ||
not as fun though | |||
luqui | I program in C++ for games (and I'm ashamed), haskell for mathematical inquiries, and perl for everything else | ||
Ovid | ?eval (1..23).pick(*) | ||
evalbot_r14927 | (11, 20, 7, 9, 1, 4, 22, 16, 18, 17, 8, 23, 14, 15, 6, 10, 12, 3, 2, 5, 19, 13, 21) | ||
sili | memory leaks are good thing. it keeps certain people employed | ||
jrockway | sadly kde's C++ base seems to lead to unstable apps | 00:57 | |
Ovid | Yeah, but they can never forget the pain! | ||
jrockway | whereas gnome's python base (now) is quite solid | ||
sili | what doesn't kill you... | ||
luqui is amused at the fact that .pick(*) is the same number of characters as .shuffle\ | |||
sili | makes you study liberal arts | ||
py1hon | lol | ||
or pure math? | |||
Ovid | ... leaves you in a half-dead, unreaped state. | ||
luqui | py1hon, hey! | ||
py1hon | mmm graph theory :) | 00:58 | |
luqui | I was almost killed by my math final today | ||
that was the hardest test I have ever taken (but I did well ;-) | |||
py1hon | i didn't finish my take home math final because i was finishing my project that i put off till the last minute =/ | ||
Ovid | Hey, I don't want to hear about Python. lambda is fundamentally borked and is going to stay that way :( | ||
py1hon | graduate course, too | ||
luqui | Ovid, how come | 00:59 | |
TimToady | ?eval ('a'..'c').pick:* | ||
luqui | my python-fu is weak | ||
evalbot_r14927 | Error: Unexpected ":*"expecting term postfix or operator | ||
TimToady | ?eval ('a'..'c').pick: * | ||
evalbot_r14927 | ("c", "b", "a") | ||
TimToady | heh. hoist by my own petard | ||
luqui | :-) | ||
sili | python does function-level scoping like javascript/ruby, right? that's really ick. | ||
Ovid | basically, lambda only allows a single statement (unless it's changed recently) | 01:00 | |
jrockway | python never excited me really | ||
luqui dislikes function-level scoping too | |||
jrockway | no better than perl, but really really ugly syntax | ||
luqui | jrockway, you say python's syntax is ugly? | ||
sili | luqui: it's just... dumb. there's no argument for it aside from the fact you can omit my()-like constructs | ||
Ovid | www.artima.com/weblogs/viewpost.jsp...ead=147358 | ||
lambdabot | Title: Language Design Is Not Just Solving Puzzles | 01:01 | |
jrockway | __init__.[__whoa__].[__underscores_arent_that_cool__] '''''''comment''''''' | ||
:) | |||
luqui | jrockway, wow, you're the first person to call python ugly when comparing to perl | ||
that I've heard | |||
jrockway | perl's not beautiful, but it's concise | ||
easy to type, easy to edit, easy to read | 01:02 | ||
not so easy to parse | |||
luqui | I think python looks cleaner, but then again I think italian sounds poetic. | ||
it doesn't really matter, because I don't know either language | |||
Ovid | Though now that I google for it, it appears that some folks seriously disagree with me: ivory.idyll.org/blog/nov-06/i-just-dont-get-it | ||
lambdabot | Title: Daily Life in an Ivory Basement : /nov-06/i-just-dont-get-it | ||
jrockway | if you want really ugly, look at PHP | ||
no postfix control statements, everything requires parens, etc. | 01:03 | ||
TimToady | someone really needs to write a refactoring PHP-to-Perl6 translator... | ||
jrockway | that would be potenitally easy | ||
php is just a simple bison grammar | 01:04 | ||
T_FUNCTIONNAME etc. | |||
it's slightly insane | |||
i found a bug the other day, but i couldn't bring myself to send them a patch :/ | |||
luqui | I think the "refactoring" makes it a little tougher :-) | ||
jrockway | yeah | ||
how to make dumb php smart | |||
TimToady | "here's the namespaces you should have used, dolt!" | ||
jrockway | who needs namespaces when you have 8 different ways to split a string? | 01:05 | |
sili | pretty soon someone's going to write a language that supports anything you could ever want in a language, then it's just a matter of giving it a syntax | ||
cough cough. | |||
jrockway | php is a great language to learn for one thing | ||
luqui | Ovid, hmm, the double colon seems slightly analogous to :: in haskell, but not very much so | ||
jrockway | it's every combination of poor design, all combined into one language | ||
sili | php isn't great for anything. take that back right now! | ||
jrockway | fine, i take that back | 01:06 | |
it's interesting to see why php is popular | |||
mostly, people feel smart when they do things the compiler should do for them | |||
like differentiate between when to use split and preg_split | 01:07 | ||
Ovid | Because it's so easy to get up and running with PHP. That's not something which should be ignored. | ||
jrockway | a smart language would say, "hey, this regex is just a string" and DWIM | ||
TimToady | er, unlike P5, which botches that... | ||
jrockway | p5 is included with every sane OS in the default install | 01:08 | |
what could be easier? | |||
catalyst is hard to install (i'm told), but so are the PHP frameworks | |||
and they're not worth the effort IMHO | |||
TimToady | I think "sane OS" indicates the null set. | ||
jrockway | non-insane then? | ||
luqui | wow.. it's amazing how much I disagree with guido. | 01:09 | |
thanks for the article Ovq | |||
er, Ovid | |||
sili | but he's our benevloent dictator for life! | ||
how dare you! | |||
Ovid | :) | ||
TimToady | I hope I'm just benevolent dictator till I can Get It Right... | 01:13 | |
luqui | you mean for life? | ||
01:13
lyokato joined
|
|||
luqui | hmm.. actually longer than that | 01:13 | |
TimToady | Life pluse 182 years... | ||
*plus | |||
jrockway | btw TimToady, have you read this? steve.yegge.googlepages.com/ancient...uages-perl | ||
lambdabot | Title: Stevey's Home Page - Ancient Languages: PerlxC2 | ||
jrockway | pretty hilarious | 01:14 | |
TimToady | sure | ||
it's a nice rant | |||
polettix | I don't fully get this in van Rossum's article: "This is also the reason why Python will never have continuations, and even why I'm uninterested in optimizing tail recursion.". Why this opposition to tail recursion *optimisation*? It should be benevolent with the caring programmer and not-malevolent with the uncaring one | 01:18 | |
jrockway | i learned the other day that elisp of all languages doesn't support tail recursion | 01:19 | |
pretty insane IMHO | 01:20 | ||
luqui | polettix, tail recursion optimization has some trade-offs, and it is good for programming styles that make good use of it. python's "one true style" does not. | ||
jrockway | what are some of the tradeoffs? | ||
polettix | luqui: does this mean that enhancing tail recursion would bash those not using it? | 01:21 | |
Ovid | Because tail recursion is something that many programmers don't quite 'get'. Guido's point seems to be that he wants a language that most programmers can understand. However, most programmers 20 years ago wouldn't have understood Python, so I don't follow his logic. | ||
jrockway | PHP is a language that everyone can understand | ||
polettix | ah, so it's for a readability issue | ||
Ovid | Of course, I could easily be misunderstading Guid | ||
jrockway | i personally would prefer a langauge that *I* can understand :) | ||
Ovid | ... misunderstading Guido, so that's not an objection. | 01:22 | |
luqui | polettix, that is my impression. I'm not heavily enough in implementation-land to defend it though. | ||
Ovid | Ah! I misspelled it again! | ||
"misunderestimating! | |||
luqui | "misunderstandimating" | ||
polettix | it seems some time that I don't update perl6 - when did it jump on new GHC 6.6? | ||
jrockway | before the latest release release, i think | 01:23 | |
Ovid | I note that TimToady i largely silent on this topic, but given the politics of the situation, I guess that's understandable :) | 01:24 | |
TimToady | Guido is not willing to give up indentation, and I'm not willing to give up list flattening. :) | 01:25 | |
allbery_b discovered perl and python at the same time. he stuck with perl. :) | |||
(after playing with both for a while) | |||
jrockway | i looked at python when i wanted a "real" object system, but python didn't satisfy | 01:26 | |
i would have been happy with perl6 = perl5 + java classes (+MI) | |||
TimToady | people keep talking about Python like it's the true successor to Lisp, but I don't buy it. | ||
py1hon | if it was, it'd have macros :) | ||
Tene | I think lisp variant allowing indentation to be used in place of ()s would be interesting. | 01:27 | |
py1hon | and oo based on multimethods | ||
Tene | entertaining, at least. | ||
jrockway | that would be hard | ||
py1hon | Tene, in practice that's what happens, when you write lisp you let your editor indent and mostly ignore the parentheses | ||
jrockway | how would you handle cond, for example | 01:28 | |
01:28
lyokato joined
|
|||
Ovid | Tene: I thought about that based on billhails.net/Book/, but I need tuits! | 01:29 | |
lambdabot | Title: Exploring Programming Language Architecture in Perl (cover art by the author) | ||
jrockway | something like: (let ((a 10)) (cond ((< a 10) t)((> a 10) t)((= a 10) nil))) | 01:30 | |
would it be let \n \t a 10 \n \t \t cond \n \t \t \t ... ? | |||
Ovid | I would have called that language "Cor" (massive bonus points to anyone who knows why) | 01:31 | |
jrockway | google from "cor python lisp" returns some possibilities | 01:32 | |
Ovid | Nope. | ||
jrockway | oh. :( | 01:33 | |
Ovid | The original Ovid wrote love poems to "Corinna". No one knows if she existed or if she was a literary device. | ||
TimToady | well, hey, the two are not mutually exclusive. :) | 01:34 | |
Ovid | There's some speculation that she might be the woman he was forced into marrying for his first marriage (an arranged marriage). | ||
01:34
seano joined
|
|||
luqui | TimToady, I don't understand the paragraph beginning with "It is allowed to specify" in your recent change | 01:35 | |
Ovid | So it might be the case that Ovid wrote many of his love poems to a woman he was forced to marry, but had the bad grace to actually fall in love with. | ||
01:35
Aankhen`` joined
|
|||
TimToady | luqui: the following example doesn't clarify it? | 01:37 | |
luqui | not really | ||
so you're talking about a sub taking a capture, and then continuing to bind? | |||
but doesn't the capture eat up everything? | |||
TimToady | no, it's a lookahead. :) | ||
luqui | so there is backtracking? | 01:38 | |
TimToady | no, just snapshotting | ||
luqui | sub foo (|$cap, $n) { say $n }; foo(3,4,5,6); # ? | ||
is it 6? | |||
01:38
mako132_ joined
|
|||
TimToady | no it'd be 3 | 01:39 | |
except there are too many args | |||
luqui | sub foo (|$cap) {...} foo(3,4,5,6) # legal? | ||
01:39
Aankhen`` joined
|
|||
TimToady | certainly | 01:39 | |
$cap is \(3,4,5,6) | 01:40 | ||
luqui | so the comma isn't so much a comma as an en-passant capturer? | ||
01:40
Aankhen`` joined
|
|||
TimToady | which comma? | 01:40 | |
luqui | after |$cap | ||
(|$cap) and (|$cap, $n) are very different | |||
TimToady | I originally didn't have one. Someone else put it in. | ||
luqui looks it over again | 01:41 | ||
TimToady | But it really doesn't matter, if |$cap is "zero width". | ||
luqui | but in my first example, foo(3,4,5,6) is illegal? | ||
TimToady | no compatible routine found... | 01:42 | |
luqui | one last test: | ||
sub foo (|$cap, $a, $b, $c) {...} foo(1,2,3) | |||
$a is 1, $b is 2, $c is 3, $cap is \(1,2,3) ? | |||
TimToady | that's the intent. | ||
luqui | okay | 01:43 | |
yeah, the comma is what is bugging me | |||
but I kind of grok the reasoning | |||
it's more like a processing queue than a specification list | |||
TimToady | I originally specced it (|$cap $a, $b, $c) | ||
luqui | or something | ||
why the change? | |||
TimToady | someone thought it was a typo | ||
luqui | oh, you were serious about someone else changing it | 01:44 | |
TimToady | and I thought maybe it didn't matter. | ||
but it could influence mmd | |||
luqui wants to hash out the consequences of a processing-queue model | 01:45 | ||
TimToady | either that, or you have to write the most generic form as (|$cap, *) or some such | ||
luqui wants also to go home now | |||
back in an hourish probably | |||
TimToady | and pragmatically, I figured if people thought it was a typo once, they'd do it over and over. | ||
luqui | uh huh | 01:46 | |
neither is really obvious | |||
one for syntax, one for semantics | |||
luqui & | |||
Ovid | OK, It's almost 2 in the morning here. I have to run. Bye folks. (And read the Peter Green's translations of Ovid's works. He's brilliant) | 01:47 | |
TimToady | decommuting & | ||
01:49
Aankhen`` joined
01:51
Aankhen`` joined
02:00
mr_ank joined
02:01
Azure-BOT joined
|
|||
Debolaz | What's the proper way to call a subroutine referenced in $foo? | 02:17 | |
$foo($bar)? | |||
Debolaz recalls eval | |||
eval my $foo = -> $x { say $x }; $foo(42); | 02:18 | ||
?eval my $foo = -> $x { say $x }; $foo(42); | |||
evalbot_r14927 | OUTPUT[42] Bool::True | ||
Debolaz | :o | ||
02:22
amf joined
02:28
Psyche^ joined,
Psyche^ is now known as Patterner
02:37
awwaiid joined
02:42
nipra joined
02:47
luqui joined
|
|||
TreyHarris | ?eval my $foo = -> $x { say $x }; $foo.(42) | 02:56 | |
evalbot_r14927 | OUTPUT[42] Bool::True | ||
TreyHarris | that syntax works too. | ||
03:54
bsb joined,
ssig33 joined
|
|||
ingy | hola | 04:16 | |
luqui | hola ingy | 04:18 | |
04:33
dduncan joined
05:14
mjk joined
05:23
Eidolos_ is now known as Eidolos
05:33
nipra joined
06:15
BooK_ joined
06:28
jdv79 is now known as capo
06:36
seano joined
06:43
capo is now known as jdv79
06:55
xinming joined
07:09
devogon joined
07:28
justatheory joined
07:39
ofer1 joined
08:00
iblechbot joined
08:19
rahikkala joined
|
|||
svnbot6 | r14928 | lwall++ | change call to callsame/callwith/nextsame/nextwith | 08:33 | |
09:45
falseep joined
10:02
luqui joined
10:11
elmex joined
10:23
dduncan left
10:54
ruoso joined
10:56
buetow joined
|
|||
Nei | am I still here? test test | 11:08 | |
jrockway | ?eval Nei.exists | ||
evalbot_r14928 | Error: No compatible subroutine found: "&Nei" | ||
Nei | dang! | 11:09 | |
thought so | |||
jrockway | declare yourself, human :) | ||
luqui | ?eval 'Nei'.exists | 11:10 | |
evalbot_r14928 | Error: No compatible subroutine found: "&exists" | ||
luqui | aww | ||
Nei | ^^ | ||
luqui | ?eval 1 < 5< 7 | 11:11 | |
evalbot_r14928 | Bool::True | ||
luqui | ?eval sub postfix:<!> ($x) { [*] 1..$x } 9! | ||
evalbot_r14928 | 362880 | 11:12 | |
luqui | ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } } [1,4,5,7,3] | 11:13 | |
evalbot_r14928 | [1, 4, 5, 7, 3] | ||
luqui | ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } } [1,4,5,7,3].stupid | ||
evalbot_r14928 | Bool::False | ||
luqui | ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } } [1,4,5,7,2].stupid | ||
evalbot_r14928 | Bool::False | ||
Nei | perl6 will make it easy to provide a mirc script like irc scripting glue | 11:15 | |
avar | why does make test always compile something even though I've just done "make" and haven't svn up-ed | 11:55 | |
12:00
chris2 joined
12:02
elmex joined
12:10
avar joined
12:13
Psyche^ joined
12:21
Psyche^ is now known as Patterner
12:40
mako132_ joined
12:50
xinming_ joined
12:59
xinming joined
13:22
buetow joined
13:26
weinig|bbl is now known as weinig_,
weinig_ is now known as weinig
13:48
kanru joined
13:52
weinig is now known as weinig|bbiab
13:53
gnuvince joined
13:54
gnuvince joined
14:11
weinig|bbiab is now known as weinig
14:36
iblechbot joined
14:42
weinig is now known as weinig|bbl
14:46
rahikkala left,
chris2 joined
15:03
c6rbon joined
15:04
bonesss joined
15:05
mdiep_ joined
15:07
azazello joined
15:13
awwaiid joined
15:28
mdiep joined
15:33
buetow joined
15:52
hexmode joined
16:00
marmic joined
16:32
penk joined
16:33
ruoso joined
16:36
penk joined
17:08
lisppaste3 joined
17:10
kanru joined
|
|||
svnbot6 | r14929 | wolverian++ | r32@pupu: wolverian | 2006-12-19 19:24:00 +0200 | 17:24 | |
r14929 | wolverian++ | update the hq9+ example | |||
wolverian | augh, can I make --verbatim the default somehow? | 17:25 | |
17:42
weinig|bbl is now known as weinig
18:03
coumbes joined
18:07
TSa joined
18:15
buetow joined
18:31
ozo joined
|
|||
nothingmuch | Coleoid: i know the problem | 18:34 | |
just back from a 4 day hike | |||
will take care of it soon | 18:35 | ||
18:46
drrho joined
18:50
justatheory joined
18:51
weinig is now known as weinig|bbl
18:52
justatheory joined
18:55
justatheory joined
19:05
prism joined
19:13
prism joined
19:18
autark joined
19:19
prism joined
19:21
larsen_ joined
20:17
cookys joined
20:39
Aankhen`` joined
21:04
chris2 joined
21:07
weinig|bbl is now known as weinig
21:09
ozo joined
21:12
Ovid joined
|
|||
Ovid | ?eval my @result; <a b c c d> ==> map { $_ xx 2 } ==> @result; @result.perl.say; | 21:13 | |
evalbot_r14929 | Error: Unexpected " map" | ||
Ovid | I gather that feed operators are not yet implemented? | 21:14 | |
When they are, will the following be legal syntax? <a b c c d> ==> map { $_ xx 2 } ==> my @result; | 21:15 | ||
Or wait, looks like I would do: my @result = < a b c c d > ==> map { $_ xx 2 }; | 21:16 | ||
jrockway | Ovid: i think the synopsis says ==> @result | 21:19 | |
@result <== map { .. } <== @input | |||
Ovid | Looking at it now: | ||
@oddsquares = | |||
(@nums ==> grep { $_ % 2 } ==> sort ==> map { $_**2 }); | |||
jrockway | so feed operators return the end of the pipeline | ||
makes sense | |||
Ovid | Needs parens, but it's still not implemented. Looks like the t/operators/feed.t is all :todo tests. | ||
jrockway | am i allowed to refer to list and scalar context in perl6, or is that gone? | 21:20 | |
sili | still there | ||
jrockway | so what do the feeds return in scalar context (without parens) ? | 21:21 | |
?eval (1,2,3) ==> my @output | |||
evalbot_r14929 | Error: Unexpected " my" | ||
jrockway | ?eval @in1 ==> map {} <== @in2 # :) | 21:22 | |
evalbot_r14929 | Error: Unexpected " map" | ||
jrockway | that should be fun :) | 21:23 | |
21:24
prism joined
|
|||
Ovid | Hmm, I wrote a program to split the 99 problems into separate Perl 6 test files. I wonder if those would be OK to commit? | 21:25 | |
I imagine they might slow down the test suite even more. | 21:27 | ||
jrockway | are they really tests? | 21:31 | |
maybe put them in examples? | |||
Ovid | Ah, that makes sense. I am writing them as .t files, but examples/ would be much better. | ||
jrockway | however, having them as tests seems like a beginning of a good idea to me | 21:34 | |
really you should give each example a test suite | 21:35 | ||
to make sure the example works, and the perl6 implementation can run it and get correct results | |||
i think that would be pretty awesome | |||
99 working programs with good test coverage | |||
Ovid | Each problem has been split into it's on .t file (and it turns out that there are only 84 problems, go figure) and I'm slowly working through them. I just don't know if t/ is really a good place to put them since they *are* examples. | 21:36 | |
Still, they are also tests. | 21:37 | ||
jrockway | what is the output of your .t files? | ||
allbery_b | new section? | ||
jrockway | i only briefly looked at the problems, but they're things like "get the last element of a list" | ||
allbery_b | perhaps rigging the test harness so you can toggle its inclusion? | ||
Ovid | They are standard Perl 6 tests using the 'Test' module. | 21:38 | |
jrockway | (easy in perl, harder in lisp :) | ||
Ovid | Oh, some of the problems get *much* harder. There are other beginner ones like 'packing elements in a list into sublists and stuff'. | ||
Of course, I don't think I'll be tackling the sudoku solver right away :) (problem 97) | 21:39 | ||
And I'm not even remotely able to write an Ada identifier syntax checker! | 21:40 | ||
Oh, wait. It actually turns out to be easy. Never mind :) | 21:41 | ||
Junctions are broken in Pugs? | 21:44 | ||
Wow. They're horribly broken! | |||
?eval use Test; plan 1; is 'b', any('a' .. 'h'), 'junctions should work'; | 21:46 | ||
evalbot_r14929 | Error: *** Unsafe function 'use' called under safe mode at -e line 16, column 7-138 | ||
Ovid | :( | ||
Debolaz | :~( | 21:47 | |
Ovid | ?eval sub a (Str $g, Str $e) { my $t := $g eq $e; $t ~~ s:P5:g/#/\\#/;say('whee!',$t) } a('b', any('a'..'h')); | 21:58 | |
evalbot_r14929 | OUTPUT[whee!1whee!whee!whee!whee!whee!whee!whee!] (Bool::True) | ||
Ovid | Yeah, that looks like a bug to me. | 21:59 | |
Ah, it's calling a() once every every item in the any() junction. | 22:00 | ||
22:08
amf left
|
|||
Ovid | OK, gotta run. Night all. | 22:13 | |
22:28
silug joined
22:29
gnuvince joined
|
|||
jrockway | ?eval 'b' == any('a', 'b', 'c') | 22:36 | |
evalbot_r14929 | (Bool::True) | ||
jrockway | ?eval 'b' == any('a'..'z') | ||
evalbot_r14929 | (Bool::True) | ||
jrockway | that's horribly broken? | ||
?eval sub a(Str b){ b == 'a' } a(any('a'..'c')) | 22:37 | ||
evalbot_r14929 | Error: Unexpected "Str"expecting "\\", ":", "*", parameter name or ")" | ||
22:37
gnuvince joined
|
|||
jrockway | ?eval sub a(Str b){ b == 'a' }; a(any('a'..'c')) | 22:37 | |
evalbot_r14929 | Error: Unexpected "Str"expecting "\\", ":", "*", parameter name or ")" | ||
22:38
sili joined
|
|||
jrockway | ?eval sub a (Str b){ b == 'a' }; a(any('a'..'c')); | 22:38 | |
evalbot_r14929 | Error: Unexpected "Str"expecting "\\", ":", "*", parameter name or ")" | ||
jrockway | jrockway-- # :( | ||
22:39
sili left,
dduncan joined
22:58
dmq joined
|
|||
dmq | seen audreyt? | 22:59 | |
allbery_b | ?seen audreyt | 23:06 | |
lambdabot | audreyt is in #ghc, #haskell and #perl6. I last heard audreyt speak 22h 31m 53s ago. | ||
23:09
Psyche^ joined,
weinig joined
23:14
Aankhen`` joined
23:25
Psyche^ is now known as Patterner
23:27
Aankhen`` joined
23:32
Aankhen`` joined
23:35
Aankhen`` joined
23:45
sonorous joined
23:49
Aankhen`` joined
23:52
Aankhen`` joined
23:53
luqui joined
23:54
xpika joined
|