6.2.7 released! | pugscode.org/ <Overview Journal Logs> | pugs.kwiki.org | paste: sial.org/pbot/perl6 Set by autrijus on 13 June 2005. |
|||
wolverian | nothingmuch: right. thanks. | 00:01 | |
("its") | |||
mrborisguy | opinion question for you guys... | 00:49 | |
I'm thinking about learning Haskell | |||
but not really to do anything with it, I just think it'd be good to take a step into the functional languages to learn what it's about | |||
would you say learning Haskell will improve my programming skills/logical skills when it comes to programming? | 00:50 | ||
(I ask here, 'cause obviously nearly everybody here is still doing perl, but I know quite a few of you know quite abit about Haskell too) | 00:51 | ||
mugwump | so, of course | 00:52 | |
s/so,// | |||
PerlJam | mrborisguy: yes. | ||
mrborisguy: What languages do you know? | |||
Darren_Duncan | large LKT design-based update committed, corres to large p5 update, ... which among other things should simplify getting it working in Perl 6 | 00:53 | |
mainly in that regard, the test suite is more focused on cases that should succeed, rather than fail | |||
mrborisguy | PerlJam: starting in order of learning: QBasic, C, Java, perl5, a bit of perl6 (and probably a few others scattered in there, like a step into php and python) | 00:54 | |
svnbot6 | r4657, Darren_Duncan++ | large Locale-KeyedText update that corresponds to an in-progress Perl 5 version large update : removed superfluous input filters on Msg/Trn.new() so that you can now set each property element to any defined value ; added input constraint that each Trn property must have at least 1 element; updated POD to reflect the change ; removed and added a lot of MsgProp and TrnProp tests so they focus mainly on success cases rather than failure | ||
PerlJam | mrborisguy: If you're just trying to broaden your knowledge base, I'd suggest picking up a little lisp/scheme too and maybe some prolog. And if you do haskell after lisp/scheme you'll have a tremendous sense of joy at what you have discovered. :) | 00:56 | |
Well, you may have that anyway, but you'll be happier that haskell is *not* lisp/scheme :-) | |||
mrborisguy | haha, okay | ||
but those would be the best to start off with? | 00:57 | ||
mugwump | elisp | ||
mugwump hides | |||
PerlJam | mrborisguy: lisp/scheem teaches you about functional programming and pain. Prolog teaches you about declarative programming and pain. :-) | 01:02 | |
mrborisguy: oh, and play with bc or postscript too (I found postscript kind of fun but some people don't quite think of it that way) | 01:04 | ||
mrborisguy | PerlJam: how much time do you think I have on my hands! ;) | 01:05 | |
PerlJam | mrborisguy: a whole lifetime | ||
mrborisguy | PerlJam: ah... good point | 01:06 | |
PerlJam | Also, playing with these other languages and learning to think about things differently will help you better understand and use perl (especially perl6) | 01:07 | |
Do you have a copy of HOP? That's a good intro to FP via perl. | |||
mrborisguy | High Order Perl? no, I don't | ||
I hear alot of people mention it, I'm guessing it's a good read then? | 01:08 | ||
PerlJam | you could wait for MJD to make it available on his website (or even volunteer to help him make it available on his website) | 01:09 | |
yes, it's a good book (modulo the errata) | 01:10 | ||
rjbs | It's great. | 01:12 | |
mugwump | mrborisguy: one interesting idea might be to learn OCaml and work through Types and Programming Languages | ||
as all the examples in that book are in OCaml | 01:13 | ||
mrborisguy | does he plan putting it on the website soon, do you know? | ||
I'm a bit strapped for cash, and the last couple of times I was in Barnes and Noble, i don't think it was there, otherwise I would have paged through it! | 01:14 | ||
mugwump | I heard mutterings about a PDF being around for it | ||
But that might not be entirely endorsed/legitimate | |||
Just an idea, anyway. Getting a book that covers various FP topics, and learning whatever language the book uses. | 01:17 | ||
Khisanth | meh actually tried two B&N :/ | 01:20 | |
PerlJam | I seem to recall the MJD needed help converting the source documents into something more webable. | 01:21 | |
meppl | gute nacht - good night | 01:22 | |
PerlJam | Ah yes ... hop.perl.plover.com/announce/20 | 01:23 | |
So send mjd a note that you'd like to help and you may get a pre-release version of what goes on the web. : | 01:24 | ||
:-) even | |||
Odin-LAP | PostScript 'fun'? | ||
Hm. | |||
That's counter to almost every other description I've heard of it. :) | 01:25 | ||
Khisanth | PerlJam ~~ Masochist :) | 01:26 | |
geoffb | I've known several people that enjoyed hand-coding PostScript, including a DJ who designed all his tape and CD covers in raw PS. | 01:28 | |
And yes, he was a freak. :-) | |||
arcady | I even know someone who wrote a postscript "virus" | 01:29 | |
PerlJam | arcady: have you seen the postscript web server? | 01:30 | |
geoffb | At least one friend used to have a ball upping the ante in display wars when running on NeXT boxen -- he would melt their displays along nice curves. :-) | ||
Odin-LAP | Doesn't there exist a post ... nevermind. | ||
PerlJam: Do you have a link? :> | |||
PerlJam | unfortunately no, but I'm sure google does :) | 01:31 | |
Odin-LAP | True, but I'm lazy. ;) | ||
PerlJam | Since there's no socket code in postscript it obviously has to run via inetd | ||
Odin-LAP | Aren't there network extensions? | ||
I'm sure I heard of a server which ran on printers... :p | 01:32 | ||
Hmm. | 01:33 | ||
PerlJam | anyway, postscript is fun to code. Not so much by hand but it's really easy to write a compiler that outputs postscript :-) | 01:34 | |
Odin-LAP | Ahhhh. | 01:35 | |
That's your argument, then. :p | |||
PerlJam | Well, it's fun but tedious to code by hand. The tediousness kinda saps the fun. | 01:36 | |
Odin-LAP | Any pointers as to how to learn it? :p | 01:37 | |
Odin-LAP has actually taken a look, once or twice. | |||
PerlJam | Odin-LAP: there are several full books on it available for free (in PDF format no less :) | 01:38 | |
Odin-LAP | Hmm. | 01:39 | |
PerlJam | Thinking In Postscript is probably a good start | ||
Also, I believe Adobe has made the complete reference manual available for free too | 01:40 | ||
(It's been a while since I've played with postscript obviously) | |||
Odin-LAP | :) | 01:41 | |
There's quite a bit of stuff from Adobe, actually. | 01:42 | ||
PerlJam | Yep ... partners.adobe.com/public/developer...refman.pdf | ||
Odin-LAP | It's just not very useful to learn from. :p | ||
PerlJam | Try "Thinking In Postscript" | 01:45 | |
Odin-LAP | Yeah, will do. :) | ||
PerlJam | anyway ... time for me to go hang out with my kids a little bit :) | 01:46 | |
btw, did I mention here that my wife is pregnant again? | |||
Found out yesterday that it's not just a third child we've having, but a third *and* a fourth. | 01:47 | ||
Odin-LAP | What fun. | ||
PerlJam | we'll see. Hopefully the twins turn out like their older siblings | ||
anyway, gotta go. | |||
g'night all | |||
PerlJam & | |||
03:47
Boogie__ is now known as Boogie
|
|||
geoffb | I'm just starting to read the core Haskell source for Pugs . . . and I came across the following in Prim.hs: | 03:48 | |
op2 "~~" = op2Match | |||
op2 "!~" = op2Cmp vCastStr (/=) | |||
That seems very wrong to me. Shouldn't !~ just be the opposite of ~~ ? | 03:49 | ||
arcady | I think so | 03:51 | |
scook0 | try to come up with a simple test case to check | 03:52 | |
arcady | ne is string inequality | ||
gaal | good catch - it can't be *just* the opposite though, because ~~ returns an "interesting" value. | 03:53 | |
so i'd expect you need something like (not . VBool) op2Match | 03:54 | ||
arcady | yeah, that's what I was going to say | ||
had I known haskell syntax | |||
gaal | er, no; s/VBool/the thing that casts to vbool/ | ||
:-p | |||
good morning, btw :) | 03:55 | ||
geoffb | good morning, gaal! | ||
gaal | try vCast | 03:56 | |
geoffb | as above "I'm just starting to read the core Haskell source for Pugs . . ." -- it'll be a bit before I go hacking | 03:57 | |
:-) | |||
gaal | oh, i seem to recall that !~ is not an oversight, it was added so that certain tests can parse | 03:58 | |
before there was a full ~~ | |||
QtPlatypus | BTW is there an introspective thing that gives you a list of methods that an object supports? | 03:59 | |
gaal | (~~ was once just a test for equality) | ||
arcady | maybe a "methods" method | ||
gaal | Qt, not yet, and even when we have introspection, that's impossible to fully do in a language that has AUTOLOAD :) | ||
QtPlatypus nods "I'm aware of the AUTOLOAD limitation" | 04:00 | ||
gaal | i think there's some symtable stuff already? in a pinch, you can ref the object, and grep { Code } its class' symtable | 04:01 | |
then walk its @INC etc | |||
mugwump | that will be at $object.ref.meta.methods | ||
eventually :) | 04:02 | ||
arcady | that looks kind of icky | ||
mugwump | you can judge your age by the amount of pain you feel when coming across a new idea | ||
It works like this. $object.ref returns the type of the object | 04:03 | ||
arcady | $object.meta.getmethods is mentioned in S12 | ||
mugwump | ah, you're right | 04:04 | |
wolverian | I wonder why it has 'get' in the name | 04:05 | |
mugwump | with that awful .dispatcher | ||
arcady | $object.ref.meta.methods would give you the methods of the metaclass | ||
the ones that you can call on the class object | |||
mugwump | so if $object is a MyClass, then $obj.ref =:= ::MyClass | 04:06 | |
arcady | and if $object is some anonymous type, then $obj.ref is the only way you can actually get at its class object | ||
mugwump | you might want to look at ext/Perl-MetaModel/docs/perl6_meta_model.pod | 04:11 | |
I am expecting to get the .dispatcher anomaly addressed eventually. .ref() is all you need | 04:12 | ||
.ref() returns a type, which is a dispatcher - something like a package in P5 land | |||
it might not be a class at all | |||
.meta() can be called on that object and returns the Class (or whatever) object that is the "master" for this class | 04:13 | ||
s/class$/type/ | |||
geoffb | Augh, finally: | 04:16 | |
pugs> not(0 !~ rx:Perl5/0/) | |||
bool::false | |||
pugs> not(0 ~~ rx:Perl5/0/) | |||
bool::false | |||
mugwump | the proxy methods, like $object.meta, ::($foo).getmethods, etc are shortcuts which bely the structure of the metamodel, so I don't like using them :) | ||
geoffb | It turns out things tend to stringify in such a way that it takes a little effort to find a case where string match doesn't give the same answer as smart match | 04:17 | |
arcady | come to think of it, $foo.ref.methods makes sense | 04:20 | |
it all depends on where you want to think the methods live | 04:21 | ||
mugwump | yes, .ref.meta.methods might reasonably only return the methods defined in that class | 04:22 | |
.ref.methods would probably return everything that the .ref.can() | |||
svnbot6 | r4658, geoffb++ | Test for bug: !~ is treated as string ne | 04:29 | |
geoffb absentmindedly does 'make un<tab>' in his shell and gets a list of matching make targets | 04:33 | ||
oooooh, shiny | |||
wolverian | geoffb: what shell is that? | 04:43 | |
geoffb | bash | ||
wolverian | what do I have to do to get that feature? :) | ||
geoffb | I'm guessing "enable bash_completion" | ||
What distro are you running? | 04:44 | ||
wolverian | ubuntu and debian | ||
mugwump | oh yeah, that annoying feature | 04:45 | |
geoffb | Assuming ubuntu shares Debian's bash config (one would hope), then give me a sec and I'll look it up | ||
wolverian | thanks! | ||
mugwump: why is it annoying? | |||
mugwump | the one that always makes me think directories are empty when I can't tab complete the files in it, then realise that it's because of the `cd' at the beginning of the line | 04:46 | |
wolverian | does 'cd'ing to a file make any sense? :) | ||
geoffb | wolverian, uncomment the 3-line bash_completion block in either /etc/bash.bashrc or ~/.bashrc | 04:47 | |
mugwump | It's just the way I've grown used to the shell tbh. I'm sure if it had always behaved like that for me, it would be nice | ||
wolverian | geoffb: oh, that's easy. thanks! | ||
mugwump: right. oh well. | |||
geoffb | wolverian, it doesn't, which is why the behavior is technically correct, but I've been annoyed by that just like mugwump. Some kind of out-of-band notice that the tab completion is being artificially limited would be nice | ||
wolverian | hmm. it doesn't work. | 04:48 | |
it works for 'ssh' though. | |||
geoffb | mugwump: you could always tune bash_completion to not do that for cd . . . . | ||
wolverian | I guess I'm missing the 'make' thing for the completion | ||
geoffb | wolverian, did you source your .bashrc? | ||
wolverian | yes | ||
as I said, 'ssh <tab>' works | |||
(shows remembered hosts) | 04:49 | ||
mugwump | sure, I could. Just like I could set a VIM option to turn off auto-indent. But what happens when I paste some code in there and VIM f*cks it up? I quit and start nvi :) | ||
geoffb | (I was behind in my responses) | ||
wolverian | mugwump: :paste | ||
geoffb | mugwump, chuckle | ||
wolverian | nice, perl -l<tab> | 04:51 | |
er, perl -<tab> | |||
geoffb | Heh, interesting | 04:52 | |
mugwump | you could make it search through your command history for one liners when you: | 04:53 | |
perl -e '<tab> | |||
geoffb | Ouch: disk grinds when you do perl -M<tab> -- It seems to search for all available modules! | 04:54 | |
Yep, very interesting. perl -MTe<tab> gets me a nice chunk of Test:: and Text:: modules | |||
Interesting . . . if (...) { ... } else { ... } parses faster than ... ?? ... :: ... | 05:09 | ||
mugwump | backtracking | 05:10 | |
geoffb | The question is, what about the if form reduces backtracking . . . or conversely, what about ternary op increases it? | 05:11 | |
Could someone who knows makefiles please make Pugs stop spuriously building on 'make install' when it is unchanged? | 05:13 | ||
link_time_frustration++ | 05:14 | ||
Or, since I guess that is interpreted as karma: | |||
link_time_frustration-- | 05:15 | ||
QtPlatypus | Seems with the PGE and rules its quite easy to create rules that suck up all the memory and Bus error. | 05:21 | |
05:41
_jql is now known as jql
|
|||
geoffb | I've managed to pull about 13% out of the parse time of Test.pm in my local tree, but it's been like pulling teeth the whole way | 05:50 | |
mugwump | nice | 05:51 | |
by changing the source? | |||
or hacking Parser.hs et al? | |||
geoffb | so far, by doing transforms of the source | 05:53 | |
I have a feeling that to get much more, I may have to understand Parser.hs even to know what Test.pm source transforms will help | 05:57 | ||
Of course, there's the nifty fact that about half of the test scripts use nothing other than plan, ok, and is . . . so a Test::Minimal or suchlike would have a huge impact on make test time | 05:58 | ||
mugwump | Sounds like a job for an autoloader! :-D | 05:59 | |
geoffb | If only . . . | 06:04 | |
If I knew how to autoload w/ "is export", I'd do that | 06:05 | ||
pasteling | "geoffb" at 69.110.115.185 pasted "Cumulative count of test files using various Test.pm functions" (20 lines, 691B) at sial.org/pbot/11074 | 06:08 | |
sdtr443w | How would I define an array of hashes and/or vice versa in Perl 6? | 06:09 | |
Or rather, declare? | |||
mugwump | my Array %HoA | ||
geoffb | As mentioned above, with just 3 functions, Test::Minimal would have 50% test file coverage; with half of Test.pm's functions, it would have met the 80/20 rule | ||
mugwump | my Hash @AoH | ||
wolverian | or my @AoH is Array of Hash; | 06:10 | |
geoffb | It's somewhat silly that Test.pm includes functions that never get used at all, and we have to pay the parse cost for them over and over (removing those is *not* included in the 13% figure above) | 06:11 | |
sdtr443w | in Pugs I just tried "my @array_of_hashes is Array of Hash;" and it didn't seem to work | ||
geoffb | well, it's getting late here. | 06:12 | |
mugwump | sdtr443w: for now you can use my Hash @array_of_hashes | ||
geoffb | Time to trundle off to bed, I think | ||
wolverian | geoffb: can't we precompile Test.pm? | 06:13 | |
nothingmuch | morning | ||
wolverian has no idea about the compiling features pugs currently has | |||
sdtr443w | mugwump: What then, of an array of hashes of arrays? | ||
wolverian | my Hash of Array @AoHoA | 06:14 | |
mugwump | which is also currently parsefail ;) | ||
geoffb | wolverian, that *might* be possible . . . but I don't recall pugs being able to compile just one module and use that, as opposed to an entire script | ||
wolverian | geoffb: right. | ||
just a thought. :) | 06:15 | ||
sdtr443w | Hmm yeah Pugs wasn't reaching a say statement right after "Hash @array_of_hashes;" either so I'm thinking it's not enjoying that. | ||
Aankhen`` | sdtr443w >> The sigil determines the primary type if it's @ or %, and any type restrictions apply to the elements. | ||
sdtr443w | To be fair, I'm using 6.0.11 -- I think. | ||
Aankhen`` | ?eval my Hash @array_of_hashes; | ||
wolverian | wow. that is ancient. | ||
evalbot6 | undef | ||
sdtr443w | I tried building the new one and had some trouble with ghc coming up in interactive mode during the build | ||
Aankhen`` | ?eval my Hash @array_of_hashes; @array_of_hashes[0] = (foo => "bar", baz => "quux"); | ||
evalbot6 | [('foo' => 'bar'), ('baz' => 'quux')] | ||
wolverian | sdtr443w: mail juerd for an account on feather.perl6.nl? | ||
Aankhen`` | ?eval my Hash @array_of_hashes; @array_of_hashes[0] = (foo => "bar", baz => "quux"); @array_of_hashes | 06:16 | |
evalbot6 | [[('foo' => 'bar'), ('baz' => 'quux')]] | ||
mugwump | sdtr443w: you have ghc 6.4? | ||
Aankhen`` | ?eval my Hash @array_of_hashes; @array_of_hashes[0] = { foo => "bar", baz => "quux" }; @array_of_hashes | ||
evalbot6 | [{('baz' => 'quux'), ('foo' => 'bar')}] | ||
geoffb is really going now | |||
sleeping & | |||
wolverian | ?eval my Hash @aoh; @aoh[0] = "hi"; # should fail? | ||
evalbot6 | \'hi' | ||
sdtr443w | mugwump: Yes, that's how I got this version of Pugs to build... | 06:17 | |
Aankhen`` | Shouldn't that be: ({ 'baz' => "quux", 'foo' => "bar" }) | ||
wolverian | Aankhen``: yes. pugs doesn't do typing very well yet | ||
QtPlatypus | I don't think it does typing at all.. | ||
wolverian | exactly. :) | ||
mugwump | sure it does | ||
Aankhen`` | wolverian >> If what Larry said about "my Dog $spot is just a statement" still holds true, the line you tried shouldn't fail. | ||
mugwump | MMD is basically type-based method dispatch | 06:18 | |
QtPlatypus | ?eval my Int $anint = "BooWhoo";$anint; | ||
evalbot6 | \'BooWhoo' | ||
Aankhen`` | mugwump >> It handles the primary type of the variable fine, but if the variable is a container, it doesn't seem to be handling the types of its elements very well... | 06:19 | |
wolverian | Aankhen``: the @aoh[0] = "hi" should fail, I think | 06:20 | |
Aankhen`` | wolverian >> Depends on whether types are supposed to be enforced outside of signatures. | ||
QtPlatypus | And my example should fail as well. | ||
Aankhen`` | Although I guess what I quoted above is quite outdated. | ||
QtPlatypus | Aankhen``: Why declear then if you don't wish them to be enforced? | 06:21 | |
mugwump | ?eval multi sub foo(Int $foo) { "int $foo" };multi sub foo(Str $foo) { "str $foo" }; "&foo(1), &foo('bar')" | ||
sdtr443w | Well ok presuming Pugs is having a little bit of trouble with AoHoA or anything like that, then how would I dereference that. Could it be something like my $final_scalar = @AoHoA[1]{"I like cake"}[3]; | ||
evalbot6 | 'int 1, str bar' | ||
wolverian | Aankhen``: yes, they are. saying my Foo @bar is a statement that only Foo-type things can be put into @bar. I don't see a way for an Str to be coerced into a Hash :) | ||
Aankhen`` | wolverian >> OK. :-) | ||
QtPlatypus >> Dunno, read the relevant Apocalypse... | |||
wolverian | Synopses are the recommended reading now. | 06:22 | |
(they are actually updated.) | |||
Aankhen`` | I know. | ||
wolverian | (sometimes.) | ||
Aankhen`` | That's why I said my quote was outdated. | ||
arcady | I think the "my Dog $spot is just a statement" means that it doesn't actually make a new Dog | ||
mugwump | in theory my Hash $foo; $foo = "bar"; should be a *compile time* error | ||
Aankhen`` | RFC 218: my Dog $spot Is Just an Assertion | ||
I expect that a declaration of the form: | |||
my Dog $spot; | |||
is merely an assertion that you will not use $spot inconsistently with it being a Dog. | |||
wolverian | isn't that RFC about not instantiating an object immediately? | 06:23 | |
Aankhen`` | Guess that's pretty old. :-) | ||
wolverian | mugwump: should $foo = bar; when bar is known and well typed be a compile time error, if bar is incompatible with $foo? | ||
mugwump | yes, the error should be detected as early as possible if types are declared | 06:24 | |
wolverian | I'm just wondering how that can happen when the sub can be swapped out at runtime. | ||
Aankhen`` | It's ye old question of: "should it be an error, or should I grab something to eat?" | 06:25 | |
mugwump | well, if you're going to change method signatures incompatibly at runtime, you deserve any problems you get :) | 06:26 | |
wolverian | Aankhen``: I want to have the cake and eat it too! | ||
er. or something like that. | |||
mugwump | In fact that's an interesting case. In some cases it should be an exception to change the signature of a method that has already had that signature used to shortcut evaluation in any way | ||
sdtr443w | Ah well I have some more reading to do about regex and OOP. This stuff is all very overwhelming. | ||
Aankhen`` | wolverian >> Sorry, we're all out of cake... | 06:27 | |
I finished the last bit yesterday... | |||
Would you like some soap instead? | |||
mugwump | The exception *could*, in theory, go back and compile the pieces of code that used its signature... | 06:28 | |
wolverian | no, I _hate_ SOAP. I prefer REST. :) | ||
mugwump | which in that case would then give you an exception when you try to alter the method's signature | ||
lumi_ | There's blue ice cubes in the freezer | ||
Aankhen`` | Hmm. | ||
Maybe we could work out something. | |||
A compromise. | |||
I'll, uh, give you SOAP, and you, uh, eat SOAP. | 06:29 | ||
mugwump & # home... | |||
QtPlatypus suggeses "use strict <types>" | |||
wolverian | I'm not sure if I see the compromise there... | ||
Aankhen`` | That's okay, you don't have to. :-D | 06:30 | |
That's the beauty of it. :-D | |||
wolverian | that only applies in a relationship. | ||
Aankhen`` | You just have to eat the SOAP -- even lazily, if you want! -- and I'll just point and laugh. :-D | 06:31 | |
QtPlatypus | The Appocalype seems to be more permissive then I would like. | ||
wolverian | than | 06:36 | |
svnbot6 | r4659, Aankhen++ | * libs/pugs/run.pod -- English tweaks. | 06:54 | |
nothingmuch goes to work | 06:58 | ||
, | |||
08:09
integral1 is now known as integral
|
|||
wolverian | hmm, nice. dan is still blogging a bit. | 09:27 | |
crysflame | . | 09:48 | |
wolverian | that's an interesting dot | 09:52 | |
chip | I wonder what stopped him from working on the register allocator before he quit. | 10:05 | |
QtPlatypus | ?eval "alphachars" ~~ m/<alpha>+/ | 10:09 | |
evalbot6 | pugs: src/events.c:265: init_events_first: Assertion `rc == 0' failed. | ||
QtPlatypus | ?eval "alphachars" ~~ m/char/ | 10:10 | |
evalbot6 | pugs: src/events.c:265: init_events_first: Assertion `rc == 0' failed. | ||
wolverian | chip: me too. | 10:15 | |
10:18
Steve_p_ is now known as Steve_p
|
|||
QtPlatypus | How do you say "Match alpha charicters" in perl6 rules. A05 says its <alpha> but PGE doesn't seem recognize it. | 10:23 | |
wolverian | I don't think the builtin rules are implemented yet | 10:28 | |
mr_ank | ?eval (1,1)+(1,1) | 10:35 | |
evalbot6 | 4.0 | ||
svnbot6 | r4660, autrijus++ | * Emit.PIR - does not depend on Pugs.* anymore; Harrorth can just use it. | 10:40 | |
r4660, autrijus++ | * abstract syntax for preludePIR landed. | |||
chip | so a list in a scalar context is its length? I thought Perl 5 was the end of that | 10:42 | |
Juerd | I understand that PIR generation is far from complete, but isn't the error message for pugs -C PIR -e'for(1..2){say}' not a little too verbose? | 10:43 | |
chip: Lists don't exist *at all* in scalar context. | 10:44 | ||
chip: So the question I have to ask you is whether you mean "," in scalar context, or an array. | |||
Doesn't matter much, because , in scalar context returns an array reference | 10:45 | ||
An array in scalar context returns a reference to itself. | |||
If you further specify scalar context, you get more interesting stuff out of it | |||
String context will stringify (by default: join on whitespace) | 10:46 | ||
Num context will evaluate to the number of arguments | |||
Bool context will evaluate to "does it have elements?" | |||
(Possibly by falling back to Num) | |||
mr_ank | ?eval ?() | 10:47 | |
evalbot6 | bool::false | ||
Juerd | All the same is true for array references too, except for bare scalar context, because it is already a reference | ||
mr_ank | i don't know enough of perl 6 yet - i found it strange that it returned a 4.0 and not a 4 | ||
Juerd | mr_ank: That's a pugs thing, not necessarily perl 6 | 10:48 | |
mr_ank | Why? Does it depend on an internal type? | 10:49 | |
(i.e., is it a bug we should write a test case for?) | 10:55 | ||
wolverian | ?eval ref 2+2 | 10:57 | |
evalbot6 | ::Int | ||
wolverian | ?eval 2+2 | ||
evalbot6 | 4 | ||
wolverian | hmm. | ||
?eval (1,1)+(1,1), ref (1,1)+(1,1) | |||
evalbot6 | (4.0, ::Num) | ||
wolverian | ?eval ref +(1,1) | ||
evalbot6 | ::Int | ||
wolverian | er. that looks weird. Int+Int -> Num? | 10:58 | |
Juerd doesn't understand the 4. | |||
wolverian | Juerd: why not? | ||
Juerd | Oh, I do. | ||
wolverian | okay. | ||
Juerd | The ones are misleading | ||
(Damnit, use fantasy values!) | |||
?eval (15,42)+(99,69) | |||
evalbot6 | 4.0 | ||
mr_ank | ?eval ()+1 | 10:59 | |
Juerd | Never ones, or 1, 2, 3, 4 | ||
evalbot6 | 1.0 | ||
Juerd | 0, 1, 2 is bad too | ||
wolverian | Juerd: right. good point. | ||
Juerd | And, of course, this is better written as [15,42]+[99,69] anyway. | 11:00 | |
wolverian | at least it confuses the hell out of perl5 coders. | ||
well, they both do. | |||
Juerd | In fact, I wouldn't mind if Perl disallowed comma in scalar context. | ||
It's great in void and list context | |||
wolverian | I like the fleeting List type :) | ||
mr_ank | (134,184,33)+314 | ||
?eval (134,184,33)+314 | |||
Juerd | In scalar it's always better written as [LIST]. | ||
evalbot6 | 317.0 | 11:01 | |
wolverian | ?eval +[1,2,3] ~ "a" | ||
evalbot6 | '3a' | ||
wolverian | ?eval +[1,2,3] | ||
Juerd | 1, 2, 3 is misleading | ||
evalbot6 | 3 | ||
wolverian | yes. sorry. | ||
Juerd | Is the resulting '3' the number of elements, or the -1th element | 11:02 | |
?eval +[42, 15, 99] | |||
evalbot6 | 3 | ||
wolverian | ?eval [42,15,99]+[99,12,94] | ||
evalbot6 | 6.0 | ||
wolverian | okay, they work the same then. | ||
Juerd | Yes. | ||
mr_ank | yep | ||
wolverian | bogus Int+Int -> Num in both | ||
Juerd | Comma in scalar context returns an arrayref. | ||
wolverian | right. | ||
Juerd | And yes, pugs uses nums always iirc | 11:03 | |
wolverian | in expressions you mean? | ||
mr_ank | I keep punching random bits in just to see what happens | ||
wolverian | (as in, results of them) | ||
Juerd | wolverian: Yes | ||
I think it doesn't really know what ints are | |||
wolverian | okay. that explains it then :) | ||
?eval +[49] | |||
mr_ank | thought so | ||
wolverian | er | ||
evalbot6 | 1 | ||
wolverian | ?eval ref +[49] | ||
evalbot6 | ::Int | ||
wolverian | it knows it up to that point, or at least pretends it does | 11:04 | |
Juerd | Hm | ||
mr_ank | ?eval [34,134] | ||
Juerd | ?eval ref +1 | ||
evalbot6 | [34, 134] | ||
::Int | |||
mr_ank | hm | ||
Juerd | ?eval ~('x' xx 42) | 11:05 | |
mr_ank | ?eval 33+7.0 | ||
evalbot6 | 'x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x' | ||
40 | |||
Juerd | ?eval ('x' xx 42) | ||
evalbot6 | ('x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x') | ||
Juerd | :) | ||
?eval want | |||
evalbot6 | 'Scalar (Any), LValue' | ||
Juerd | hm? not list context? | ||
mr_ank | weird | ||
Juerd | Then how can 'x' xx 42 be a list here? | ||
mr_ank | 33+7.0 --> no floating bit [list]+[list} --> floating? | 11:06 | |
Juerd | mr_ank: | ||
?eval 1+1 | |||
mr_ank | ?eval 33.0+7.0 | ||
evalbot6 | 2 | ||
40 | |||
Juerd | hm | ||
o...kay. | |||
Now I don't get it anymore. | |||
?eval ref 1+1 | |||
evalbot6 | ::Int | ||
wolverian | literals are optimised | ||
apparently | |||
?eval ref 3.0 | 11:07 | ||
evalbot6 | ::Rat | ||
mr_ank | ?eval 3.1-0.1 | ||
wolverian | well. at least in an expression! | ||
evalbot6 | 3 | ||
Juerd | ?eval ref eval("1") + eval("1") | ||
evalbot6 | ::Int | ||
Juerd | Rat?!~ | ||
s/~// | |||
wolverian | rational | ||
Juerd | Why not just Num? | ||
does Rat, sure, but is? | |||
wolverian | I have no idea. | ||
I don't know if pugs's numeric type system is specced at all | |||
or perl6's, for that matter | 11:08 | ||
?eval "1.0" + "4.0" | 11:09 | ||
evalbot6 | 5.0 | ||
wolverian | okay! | 11:10 | |
Juerd | ?eval "1" + "4" | 11:11 | |
evalbot6 | 5.0 | ||
svnbot6 | r4661, Aankhen++ | * added 'temp-ex*' and 'unlink-test*' to clean targets for Makefile.PL. | 12:34 | |
r4662, Aankhen++ | * lib/pugs/hack.pod -- small tweaks. | 12:39 | ||
autrijus | Juerd: pugs uses the scheme numeric tower. | 12:43 | |
Aankhen`` | autrijus, got a minute? | 12:45 | |
svnbot6 | r4663, andras++ | fake type methods | ||
autrijus | Aankhen``: yes | 12:46 | |
Aankhen`` | svn.perl.org/perl6/pugs/trunk/docs/...rview.html | ||
Could you look over the answer to "Can Pugs work with Perl 5..."? | |||
autrijus | sure | ||
Aankhen`` | (I modified it last night, just want to make sure that it's correct) | ||
autrijus | Aankhen``: they're fine. | 12:47 | |
thanks! | |||
Aankhen`` | OK. | ||
NP. :-D | |||
autrijus | also please note that pugs can already interface hs-plugins | ||
as well as dynload haskell modules | |||
and eval_haskell | |||
Aankhen`` | Alright. | ||
autrijus | so the question below it | ||
can be changed as well | |||
Aankhen`` | I was thinking of adding that, but I'm not very familiar with the Haskell side of it, so I held back. | ||
Aankhen`` goes to update it. | 12:48 | ||
hs-plugins basically allows Pugs to use Haskell libraries, right? | 12:49 | ||
autrijus | right. | ||
Aankhen`` | OK. | ||
Limbic_Region wonders if there is some cosmic force that intentionally attempts to take a very focused thread off on tangents | 12:50 | ||
Aankhen`` | Can I expand "dynload" to "dynamically load" without losing accuracy? | ||
dkf | L~R: Entropy, baby! | 12:51 | |
Limbic_Region | More likely - people want to push their own agenda and take any opportunity to do so even if the originator of the thread has made their intention to stay focused very clear | ||
Aankhen`` | &eval_haskell == &eval('...', :lang<haskell>)? | ||
autrijus | nod | 12:53 | |
Aankhen``: yes | |||
Aankhen`` | Committed. | 12:54 | |
s/ed/ing/ | |||
s/ing/ed/ now. :-) | 12:55 | ||
Hmm... would it be appropriate to add "What is the relationship between Pugs and Parrot?" with the answer including the fact that Pugs can/will target Parrot? | 12:56 | ||
svnbot6 | r4664, Aankhen++ | * docs/01Overview.html -- updated "Can Pugs work with Haskell libraries?". | ||
autrijus | Aankhen``: yes. make it "can" | 13:00 | |
"already" | |||
"and is improving steadily" | |||
Aankhen`` | OK. | ||
I'll do it in a sec. | |||
autrijus is working on getting svnbot.p6 compiled. | |||
Aankhen`` | Just tweaking the HTML. | ||
autrijus | it's so nice that it doesn't use OO :) | 13:01 | |
or rather, it uses OO without using "class" keyword | |||
Aankhen`` | Heh. | 13:02 | |
Shall I add the relationship question after "How can Pugs help the Perl 6 language design?"? | 13:05 | ||
Limbic_Region | Aankhen`` - 1. By helping flesh out corner cases | 13:06 | |
2. By exposing unspecced areas | |||
svnbot6 | r4665, Aankhen++ | * docs/01Overview.html -- HTML tweaks. | ||
Aankhen`` | Limbic_Region >> I'll add that, but what I'm asking is where to add "What is the relationship between Pugs and Parrot?". | ||
Limbic_Region | sorry - misunderstood | 13:07 | |
was helping answer the proposed new question | |||
Aankhen`` | No problem, those are good points to add. :-) | ||
Limbic_Region++ | |||
I have to say, that file has some very strange formatting. | 13:08 | ||
Limbic_Region | well - the 3rd I am thinking about is hard to boil down | ||
Aankhen`` | I understand the 80 chars wrapping thing, but I don't understand the seemingly random 60 chars wrapping thing. | ||
Limbic_Region | but basically writing examples of "real" code helps decision makers make sane decisions | ||
Aankhen`` | Well, not 60, more like 70. | ||
Hmm. | |||
"By providing concrete examples for the language designers to use in the decision making process"? | 13:09 | ||
autrijus | it's Nvu. | ||
Aankhen`` | autrijus >> Ah, I see. | ||
autrijus | I wonder if we should dig out 01Overview.kwid/.pod | ||
and just modify that instead. | |||
that's prolly Good Idea (tm). | |||
Aankhen`` | Dig out as in find a buried file or convert this one? | 13:10 | |
Limbic_Region | Aankhen`` I like how you phrased it - I might only add "real world" | ||
Aankhen`` | Limbic_Region >> A'right. | ||
autrijus | search.cpan.org/src/AUTRIJUS/Perl6-.../PA01.kwid | ||
Aankhen``: buried file... you can trace a bit and replay the html changes (not many) to this | 13:11 | ||
Aankhen`` | Hmm. | ||
autrijus | and replace it, in the source tree, as 01Overview.kwid | ||
I think. | |||
Aankhen`` | OK. | ||
autrijus | danke. | ||
Limbic_Region | autrijus - hit chip for us - he didn't journal up yesterday | ||
;-) | |||
Aankhen`` | I shall try. :-) | ||
autrijus | chip: Hit! | ||
autrijus hits chip! autrijus kicks chip! --More-- | |||
autrijus casts a "summon journal" at chip. You hear distant rumbling... --More-- | 13:12 | ||
Aankhen`` | LMAO. | 13:13 | |
Where can I find a brief listing of Kwid syntax? | |||
Limbic_Region | the masses demand blood err writing | ||
Aankhen`` | Just need something to refer to if I get confused. | ||
Limbic_Region | where's ingy | ||
stevan | violence at the hackathon!!! | ||
in a street fight, who do you think would win? the dog with the squished up nose, or the bird with the colorful feathers? | 13:14 | ||
Limbic_Region | I think the dog eats the bird whole, the bird starts pecking away at the dog from the inside, and we end up with a mutant | 13:15 | |
stevan | that sounds about right | ||
throw an AST or 2 in there, and we got a hackathon | |||
QtPlatypus | Could someone confirm to me that it makes no sence for 0-nary subs to be defined as (post|pre)fix: ? | 13:20 | |
svnbot6 | r4666, Aankhen++ | * docs/01Overview.html -- tiny language tweaks. | ||
Limbic_Region | I am not sure I am following QtPlatypus | ||
autrijus | Aankhen``: p6bible s26 | 13:21 | |
Limbic_Region | if you don't have any arguments - that doesn't mean you don't need to check something before doing what you are doing | ||
QtPlatypus | multi sub postfix:<silly> () {...} | ||
Limbic_Region | no - I know what you mean | ||
I just don't understand why you think it doesn't make any sense | |||
the arguments aren't the only thing a sub may need to check before doing work right? | 13:22 | ||
or am I missing the boat here? | |||
QtPlatypus | Well isn't that going to act in exactly the same mannor as | ||
multi sub silly () {...} | |||
Limbic_Region | I guess I need to read up on postfix: and prefix: then | 13:23 | |
woah - do I feel dumb | 13:26 | ||
QtPlatypus - not at all what I was thinking they were - I thought you were talking about sub wrappers | |||
Aankhen`` | autrijus >> Ah, thanks. | 13:27 | |
Limbic_Region | I agree, though obviously you shouldn't take just my word for it, that 0-ary subs don't make sense in (post|pre)fix: | ||
QtPlatypus | Limbic_Region: I'm constenstently feeling dumb. | ||
Limbic_Region | fwiw - I was thinking about PRE/POST/FIRST/LAST/NEXT/KEEP/UNDO stuff | 13:29 | |
QtPlatypus | Arh | ||
Limbic_Region | where the PRE/POST ne prefix: postfix: | ||
Aankhen`` | Considering the whole TMTOWTDI thing, and how Perl offers choices of pattern matching grammar, documentation syntax, and even the language itself, with macros, Perl 6 seems to be less of a language and more of a meta-language. | 13:30 | |
s/Perl offers/Perl 6 offers/ | |||
q[merlyn] waits for Limbic_Region | 13:37 | ||
gaal|work | hola | 13:50 | |
lumi | Hi Gaal | 13:52 | |
gaal|work | hey lumi | ||
was kinda swamped with $work lately, what's up? what's preludePIR i see in the svnlog? | 13:53 | ||
Aankhen`` | I've added PA01.kwid. Will work some more on it later (I've chosen a few sections to work on). Going out for a movie. & | 13:54 | |
svnbot6 | r4667, Aankhen++ | * readded and updated docs/PA01.kwid | ||
gaal|work | sub "&say" in Emit.PIR is wrong for a Perl 6 &say, i think? is it meant to be a demo? | 13:58 | |
svnbot6 | r4668, iblech++ | * Usual svn props added to examples/typefunctions/. | 14:19 | |
r4668, iblech++ | * Not so usual svn props (charset: iso-8859-15) added to t/pugsbugs/hyper_latin1.t. | |||
r4668, iblech++ | * New test: macro postfix:<!> (t/macros/operator_macros.t). | |||
r4669, iblech++ | * Added "*.hi" to the svn:ignore of src/Emit and added the usual svn props to | |||
r4669, iblech++ | docs/PA01.kwid. | |||
r4669, iblech++ | * Renamed examples/typefunctions to examples/unitfunctions. | |||
r4669, iblech++ | * Fixed "!~" to mean "not(... ~~ ...)", instead of "ne". | |||
r4669, iblech++ | * Moved now succeeding t/pugsbugs/inverted_smartmatch.t out of pugsbugs/. | |||
Boogie_ | iblech: ping | 14:22 | |
iblech | Boogie_: pong | ||
gaal|work | iblech, iso-8859-15 is latin-9, not latin1 :) | 14:23 | |
Boogie_ | iblech: why did you renamed typefunctions? it's not a problem, I just interested why do you think it's a better name? | ||
iblech: maybe the right name is fakemethods, but I'm not sure | 14:24 | ||
iblech | Boogie_: Sure: Many folks here associate type with the types like Int or (map :: (a -> b) -> [a] -> [b]). Units is not ambiguous | 14:25 | |
gaal|work: Oh, yes, of course, fixing | |||
svnbot6 | r4670, iblech++ | Fixef svn:mime-type of t/pugsbugs/hyper_latin1.t, gaal++. | 14:26 | |
Boogie_ | iblech: when I named it, I used type in this way. 5 is an Int, and 5.bytes is a function for the the Int. 10.minutes is the same with the type time (what is an Int) | 14:27 | |
iblech: but I know, that it's not the best name for it. :) | 14:28 | ||
nothingmuch | evening | ||
Boogie_ | iblech: fakemethods is maybe better, it looks like methods for the type Int, but just sample functions that can be called with Ints | 14:29 | |
iblech | Boogie_: Yep, but, if I understand the code correctly, the key of your examples is not a function minuts which has type Int -> Time, but the unit conversions -- minutes to hours, etc. But I maybe I' | ||
Boogie_: Yep, but, if I understand the code correctly, the key of your examples is not a function minuts which has type Int -> Time, but the unit conversions -- minutes to hours, etc. But I maybe I've complete misunderstood your code :) | |||
Boogie_: Like fakemethods, too | |||
eric256 | i can't seem to find that unitfunctions directory or file.... | 14:30 | |
Boogie_ | iblech: oh, now I got the meaning of "unit". :) I thought it the Pascal "unit" way, which as I remembers is like a module... | ||
iblech | ETOOMANYMEANINGS :) | 14:31 | |
Boogie_ | iblech: My examples are about presenting, that you can extend types, and the subject of the examples are unit convesions. :)) Like you don't call the dir of hangman hangman, you call it games. Maybe not the best example why I gave that name for it. | 14:33 | |
yes, toooooo many meanings. :) | 14:34 | ||
while just unit conversions inside, I think the name is ok, and better than the initial one. ;) | |||
iblech | Boogie_: Hm, then maybe we should rename it to fakemethods and add a non-unit example :) | 14:35 | |
eric256 | where is the file Boogie_? i can't seem to find it at all | ||
Boogie_ | eric256: examples/unitfunctions | 14:36 | |
eric256 | thats what i thought, but svn isn't bringing it to me...hmm | ||
Boogie_ | eric256: examples/typefunctions? | 14:37 | |
iblech: do you have any idea for a non-unit example? :) | |||
eric256 | neither where there... svn was choking on one file and stoping with what apparently was a fatal error. | ||
iblech | Boogie_: Hm... maybe "some_string".escape(:html)? | 14:38 | |
eric256 | "some string".words; | ||
Boogie_ | iblech & eric256: good idea. do you have time for it? | 14:39 | |
iblech | Boogie_: I'll do .escape(:html) | ||
Boogie_ | cool. :) | ||
steveq | How about Base64? | 14:40 | |
eric256 | i will. but i'm off to work for now. ;) back in a bit | ||
steveq | is there/could there be a method to do that? | ||
Boogie_ | steveq: I like this idea, too. I think not yet a Perl6 module for it, but you can use the Perl5 module. | 14:41 | |
steveq | yeah, I often have to load the MIME::Base64 module to do that encoding | ||
kungfuftr | hhhmmm p6 VMethods | ||
Boogie_ | I'm going back to work, too. ;) | 14:42 | |
kungfuftr: yes! 'virtual method' is the right expression for it. I wasn't able to remember for it. | |||
kungfuftr | Boogie_: yar, is what Template Toolkit calls it | 14:43 | |
svnbot6 | r4671, iblech++ | Added escape example to unitfunctions/. | 14:49 | |
Boogie_ | iblech: nice! | 14:56 | |
I love Perl6... :) | |||
iblech | :) | ||
Ok, should we rename it to fakemethods of virtualmethods now? | |||
or virtual_methods | |||
Boogie_ | virtual_methods looks fine, yes. | 14:57 | |
iblech | Ok. Will you do the svn mv or should I? | 14:58 | |
kungfuftr | vmethods | 14:59 | |
!!! | 15:00 | ||
iblech | I'm fine with that, too | ||
kungfuftr | =0) | 15:01 | |
iblech renames it to virtual_methods now | 15:06 | ||
Boogie_ | boogie thinks he was faster. :) | 15:09 | |
svnbot6 | r4672, andras++ | rename unitfunctions to vmethods | ||
Boogie_ | anyway: thanks for the help | 15:15 | |
svnbot6 | r4673, iblech++ | Added examples/output/vmethods/escape and modified example.t accordingly so it | ||
r4673, iblech++ | tests escape.p6. | |||
Boogie_ | iblech: what does it mean: "Usual svn props added to examples/typefunctions/"? | 15:16 | |
iblech | See docs/other/development_tips | ||
steveq | svn proplist foo | ||
iblech | These are Subversion properties so svn converts "\n" to the linebreak of your current OS | ||
Boogie_ | ah, ok. I'll check the doc. | 15:17 | |
autrijus | nested expressions works! | 15:20 | |
now moving on to user subs and named params | |||
chip | nested expressions .. you mean like (1+2)*3? | ||
autrijus | chip: right | 15:21 | |
chip | ok | ||
autrijus | sooner or later I'll need help on transcribing the entire Prim.hs into the prim table in Emit.PIR | ||
chip | darn it, everything is working but threading. this is soooo weird | ||
autrijus | i.e. having a one-to-one correspondence between our ops and parrot ones | ||
I'll check in now if peopl want to take a look. | |||
iblech++ # virtual methods is darned cool | |||
10.minutes.ago == time()-600 | 15:22 | ||
10.minutes.until(x) == x-600 | |||
iblech | Boogie_++ # They're Boogie_'s files :) | ||
autrijus | ok :) | ||
iblech | BTW, autrijus, are there any reasons that we don't create a src/parrot/prelude.pir, similar to Prelude.pm? (Just wondering) | 15:24 | |
chip | OK, I'm really not liking this 10.iminutes thing | ||
autrijus | iblech: well, the prelude pir isn't written in pir | 15:28 | |
svnbot6 | r4674, autrijus++ | * nested expressions and function calls (no `is lazy` support yet) | ||
r4674, autrijus++ | * a much saner preludePIR syntax. | |||
r4675, iblech++ | * t/pugsbugs/hyper_latin1.t -- Use \ddd notation so we can safe the file as | |||
r4675, iblech++ | utf-8 (so we don't confuse editors and my add-the-usual-svn-props script). | |||
r4675, iblech++ | * Added a new pugsbugs test: t/pugsbugs/assuming_and_mmd.t. | |||
autrijus | chip: it's not builtin | ||
iblech: programs written in PIR, at this moment, are almost guaranteed to net you segfaults. | |||
;) | |||
so I write in the "PIR" data structure sublanguage in haskell | 15:29 | ||
that implements a segfaultless, typed, well-formed subset of PIR. | |||
iblech: so unlike Prelude.pm, the prelude pir is actually in haskell. | |||
gaal|work | autrijus, except as an optimization, why do we need to write pir ops in pir at all? | ||
autrijus | iblech: look at the preludePIR for examples | ||
gaal|work | oh | ||
hmm | |||
autrijus | gaal|work: there's no optimisation involved. | ||
iblech | autrijus: Ah, makes sense :) | ||
autrijus | gaal|work: we need to have our Prims in a form parrot can understand. | 15:30 | |
that is just no avoiding it :) | |||
just like Prim.hs | |||
gaal|work | problem is that they do less than the (current) prims | ||
autrijus | right, but the current prims is of no use to parrot | ||
unless you statically link ghc or something | |||
or always embed parrot and foreign export them | |||
gaal|work | say $*ERR: for example works in the main prim | ||
autrijus | both ways aren't happen | ||
to be interesting enough | |||
gaal|work | right | ||
autrijus | hmmmmmmm | ||
actually no. | 15:31 | ||
there is a chance. | |||
to just use Prim.hs in embedparrot case. | |||
gaal|work | okay, this is serious incentive to push more and more to Prelude.pm :) | ||
autrijus | that will nest us a faster runloop | ||
but nothing more | |||
and is harder to maintain | |||
so perhaps not a good idea after all. | |||
gaal|work | *nod* | ||
autrijus | gaal|work: right. whatever in Purelude.pm is shared. | ||
gaal|work: so Prims are truly Prims | |||
and Prelude is Prelude. | |||
(the apparent tautology notwithstanding) | 15:32 | ||
gaal|work | heh, except that *most* of what's there now at least relies on very specific semantics from the internals. | ||
autrijus | gaal|work: we can recreate them at pir level. | ||
i.e. all Pugs::Internals::* should be carried to pir. | |||
in the P::I namespace | |||
gaal|work | what was it that i saw in the channel logs a while ago? ETOOMANYLANGUAGES :-) | 15:33 | |
but i agree we do need this | |||
autrijus | gaal|work: perl6 | ||
Odin-LAP | Hm. | ||
chip | FUCK FUCK FUCK | 15:34 | |
Odin-LAP | What'd that be, teleported to p6 exceptions? | ||
chip | DISTCLEAN ME HARDER | ||
gaal|work | how do you write Pugs::Internals::openFile in perl6? what actually opens the file? | ||
Odin-LAP | chip: O_o | ||
chip | OK, parrot's distclean just DELETED MY TODO AND MY OTHER SIDE DOCUMENTS | ||
Odin-LAP | Ouch. | ||
gaal|work | chip, what fs? | ||
"FAT has to be better for something" :-) | 15:35 | ||
Limbic_Region | chip - linux? | ||
perlmonks.org/index.pl?node_id=106709 # restoring deleted files on linux | |||
Limbic_Region was literally just reading that moments ago | |||
gaal|work | grep -500 "my data" /dev/hda1 ? | 15:36 | |
whaddya know, essentially yes. | 15:37 | ||
in any case you want to remount ro asap | 15:38 | ||
chip | ext3 | ||
it's too late | |||
crysflame | ow smashy | ||
chip | autrijus: I think it's time to test your memeory | 15:40 | |
autrijus: whatever I said was on my TODO list is now toast | |||
autrijus | ok... | ||
problem is you didn't tell me anything about your todo list. | |||
autrijus tries to imagine | 15:41 | ||
chip | it was all the things you said you wanted. single-quoted strings in PIR, := vs. =, that sort of thing | ||
gaal|work | item #1: fix "make distclean" target | ||
autrijus | oh! | ||
actually, those two, yes, but you said you'd like to fix the parsing too, like not relying on the [a;b;c] to parse different things | |||
.namespace [P0] | |||
nothingmuch | autrijus: buahahaha | ||
-- Forth CPS ;-) | |||
execute ((Call word):exps) = execute ((body word) ++ exps) | |||
Odin-LAP | gaal|work: "What, the kid already fell down the well. No need to board it *now*." | ||
autrijus | chip: but for me... '' and := are the two big ones | 15:42 | |
nothingmuch: right... that _is_ CPS | |||
nothingmuch: Emit.PIR is ready for you to target, btw. | |||
nothingmuch: I'm still trying to get svnbot working | |||
nothingmuch | how much will it keep me from learning PIR, btw? | ||
autrijus | nothingmuch: you need to learn an idealised form of PIR :) | ||
nothingmuch: just look at Emit.PIR.preludePIR | 15:43 | ||
nothingmuch | =) | ||
autrijus | I'll populate it with lots of other prims | ||
to get svnbot and mandel working | |||
nothingmuch | okies ;-) | ||
autrijus | and then you can help me :D and target that. | ||
nothingmuch | anybody got a nice PIR tutorial? | ||
well, you can target forth | |||
;-) | |||
autrijus | nothingmuch: right... just give me the INFIX_LEFT_ANGLE_BRACKET_STAR_RIGHT_ANGLE_BRACKET word! | 15:44 | |
oh and I want MMD too | |||
;) | |||
chip | nothingmuch: anyone who knows PIR wants to talk about it | ||
s/anyone/no one/ # so much for that joke | |||
nothingmuch | dan had a wonderful blog topic some time ago.. something like 'forth love if honk then' | ||
autrijus | that's lovely. | ||
nothingmuch: but in all seriousness, parrot/imcc/docs/ is not actively misleading. | |||
Boogie_ | gaal|work: ETOOMANYLANGUAGES means, that we totally misunderstood each other with iblech. He mean units like minutes, etc., I mean units like Pascal's modules. And ecetera, we did it with some words. :) | ||
autrijus | nothingmuch: and parrot/docs/compiler_faq is not all wrong either. | 15:45 | |
nothingmuch | okay, i'll take a look | ||
first I need to document this progress | |||
autrijus | cool. you r0x0rz. | ||
right, that has priority | |||
nothingmuch dances the r0x0rz dance | |||
autrijus | I count on your tutorial to teach other yapc hackathoners haskell | ||
gaal|work homewardses & | 15:46 | ||
nothingmuch | hurrah | ||
chip | That's my old like | ||
line | |||
nothingmuch | btw, does Interp and Eval belong in AST now? | ||
chip | YOU FORTH LOVE IF HONK THEN ... Forth bumper sticker | ||
nothingmuch | otherwise I need recursive modules | ||
autrijus | nothingmuch: you can factor them to AST, yes. | ||
gaal|work | Boogie_ - oh. i thought it was a babelfish fatigue error. | ||
autrijus | nothingmuch: or create a new Types and shuffle them there. | ||
gaal|work | anyway, i'm outta here, see y'all! | ||
nothingmuch | ciao gaal_ | 15:47 | |
autrijus | gaal|work: ciao | ||
chip | YOU SPEAK YODA SPEAK LIKE IF FORTH LANGUAGE FAVORITE IS THEN | ||
nothingmuch | Aankhen``: heads up, editing work soon | ||
autrijus | chip: *lol* | ||
SamB | that doesn't look right to me... I thought there was some bracket usage in the words for conditionals... | ||
chip | parentheses are an infix plot | ||
nothingmuch | you speak yoda = | ||
oh wait, I get it | |||
damn, forth *IS* confusing | 15:48 | ||
chip | it's a mystery of the INNER CIRCLE!! GET IT?!?! | ||
nothingmuch | no, i missed that =/ | ||
chip links to timecube.com and wonders why the world has more than four time zones | 15:49 | ||
Odin-LAP | Forth. It's lisp, the other way around without all the parentheses? :D | ||
SamB | not exactly. | 15:53 | |
svnbot6 | r4676, andras++ | vmethods: some example, sample outputs, etc. | ||
r4677, andras++ | vmethods: extra comments | |||
r4678, iblech++ | Added the usual svn props to andras++'s new examples/vmethods outputs and | 15:58 | ||
r4678, iblech++ | updated example.t so the examples are actually run. | |||
chip | Lisp programmers work with grand concepts. Forth programmers work with a 4K stack. | 16:02 | |
Odin-LAP | Hehe. | 16:06 | |
chip | And if your brain is shaped like Chuck Moore's, that's OK with you. | 16:08 | |
geoffb | Chuck Moore's brain apparently being shaped like a 16x16 square with pretty colors . . . . | 17:03 | |
Questions about last night's (my timezone) scrollback: | |||
iblech: would you mind putting your svnprop-adding script in util/ ? | 17:04 | ||
iblech | geoffb: It's a two-line sh-script :) | ||
geoffb: But yes, will do so in ten minutes or so | 17:05 | ||
geoffb | chip: Will parrot (or more accurately Perl6 on parrot) be doing the crazy crap that P5 does to try to downgrade numbers whenever you operate on them (trying to fit an NV into a UV or IV)? | ||
That just can't be good for performance on modern branch-hating processors | 17:06 | ||
iblech, thanks | |||
putter | autrijus: Could you give a one-line description of <-- .- <-& .& -->? Thanks. | 17:12 | |
geoffb | sometimes svnbot6 is ripping fast, and sometimes it takes quite a while . . . though I suppose it could be receiving brain surgery from autrijus | 17:16 | |
svnbot6 | r4679, geoffb++ | Added description entry for examples/vmethods to pugs::hack | 17:17 | |
geoffb | speak of the devil | ||
iblech | geoffb: That's because the readline() of the socket to the IRC server is blocking. That means: As long as the bot doesn't receive something from IRC, it can't check for new revisions. | 17:18 | |
geoffb: You can force an immediate check for new revisions by /msg svnbot6 ?check (this will cause readline() to return and svnbot to check for new revs) | 17:19 | ||
autrijus | 17:22 | ||
svnbot6 | r4680, iblech++ | Added util/add-svn-props.sh, per geoffb++'s request. | ||
geoffb | iblech, very interesting! | 17:23 | |
autrijus, you were trying to say something? | |||
svnbot6 | r4681, iblech++ | pugs::hack -- Filled in description of examples/p6explain. | 17:24 | |
iblech | food & | ||
geoffb does svk pull just to see that description | |||
Aankhen`` | Back! | 17:27 | |
autrijus >> Should I delete docs/01Overview.html? | |||
Support for `where` would be really useful for cases like that escape vmethod example. :-) | 17:29 | ||
Hrm... are any Pugs binaries available apart from the Windows binaries included in PXPerl? | 17:33 | ||
gaal | vmethods/README says that in a file called "bytes.p6", 1.megabyte is 1024. that can't be right :) | 17:36 | |
chip | geoffb: You are SO looking at the small potatoes. Branch-hating CPUs will die of apoplexy when running Parrot. | 17:41 | |
svnbot6 | r4682, gaal++ | fix README's idea of a megabyte | ||
r4683, Aankhen++ | * PA01: updated bit about binaries. | |||
geoffb | chip: LOL | ||
Well, fair enough | |||
I only thought of it because of the early-morning discussion about Pugs numbers varying almost randomly between Int, Rat, and Num | 17:42 | ||
chip | Mm. Parrot numbers will convert either according to the PMC's whim or according to the compiler's exact request. | ||
e.g. $I0 = $N0 or vice versa | 17:43 | ||
geoffb | And I remember just *retching* looking at the morphing code in perl . . . which I only discovered because that morphing code exposed some bugs in SDL_perl, which expected exactly NVs in a few cases, and did bad things when an NV "promoted" itself to IV | ||
fair enough | 17:44 | ||
chip | well, SDL will be a bunch of specialized PMCs in Parrot, and I think it'll be happy | 17:45 | |
geoffb | As long as it won't happen "behind my back", at least when writing raw PIR, I'm fine. And Perl 6 damn well better not try to change type under me when I specify a lowercase type . . . . | 17:46 | |
chip, yeah, I'm wondering how OpenGL will be supported for Parrot's SDL | |||
Aankhen`` | On the subject of wondering, I'm still wondering how a language can be parsed and compiled by a compiler written in itself... the mind boggles. :-) | 17:52 | |
arcady | Aankhen``, ever heard of gcc? : ) | 17:55 | |
Aankhen`` | Yes, and GHC... | 17:56 | |
I know that these things exist. | |||
It's just one of those things that defies comprehension until you take a closer look. :-) | |||
(perhaps a much closer look :-P) | |||
Hmm... what backends are available for Pugs? | 17:57 | ||
Oh, wait. | |||
svnbot6 | r4684, putter++ | Added some 0-ary primatives to Emit/PIR.hs. | ||
Aankhen`` checks the svn log. | 17:58 | ||
In case it's of any interest to anyone: I'm going out of town Friday morning, will be back on the 3rd of July, and cheerfully resume Pugs hacking in the next few days. :-) | 17:59 | ||
iblech | You'll be be away for approx. half a month? We'll miss you... | 18:02 | |
Aankhen`` | iblech++ # flattery will get you everywhere ;-) | ||
iblech | But it doesn't work at my school's director (I wanted to attend APW and the hackaton, but as we write tests ATM, I had to stay...) | 18:04 | |
putter | "Welcome back Aankhen``! Pugs achieved sentience last tuesday and..." | 18:05 | |
Aankhen`` | Awww. :-( | ||
putter >> I wouldn't be in the least surprised. ;-) | |||
iblech >> I guess he's not quite as malleable as me... | 18:06 | ||
cognominal | what is the purpose of calling a directory "t e s t" (with spaces)? | 18:13 | |
arcady | about the same as calling a program "oo, ick" | 18:14 | |
to annoy people | |||
putter | cognominal: breaking my find scripts? | ||
cognominal | I know how to use "find -print 0ĀØ and "xargs -0" but I don see the purpose | ||
except to gratuitouly annoy unix people | 18:15 | ||
PerlJam | cognominal: What is the purpose of calling a directory "test" or "foo" or "lib"? Whoever named that one "t e s t" probably had a reason that made sense to them. | ||
gaal | it was to test filenames with spaces, actually. | ||
PerlJam | Off hand, I'd guess that they wanted it to stand out a little more on thier terminal. | 18:16 | |
svnbot6 | r4685, putter++ | Added int registers to Emit/PIR.hs. | ||
cognominal | a fxg='find -type f -print0 | xargs -0 grep -n' | ||
a fxgi='find -type f -print0 | xargs -0 grep -ni' | |||
PerlJam | See? gaal gave good reason | ||
cognominal | that should to the trick for me | ||
gaal | though arguably the tests can generate that directory. | ||
(arguably they should. there's not much much to argue that they *can* :) | 18:17 | ||
cognominal | next is using control chars... | ||
gaal | heh | 18:18 | |
utf8 | |||
cognominal | I am probably too old skool | ||
gaal | ^G^G^G | ||
or, as screen would put it, "Wuff! Wuff!" | 18:19 | ||
cognominal | now, I have forgotten what I searched in the first place :( | 18:20 | |
svnbot6 | r4686, Aankhen++ | docs/PA01.kwid: * thorough edit. | 18:25 | |
r4686, Aankhen++ | * added bit about writing tests under "I have learned some Perl 6..." | |||
r4686, Aankhen++ | * added link to porting HOWTO under "I know Perl 5 but not Haskell..." | |||
r4687, Aankhen++ | * PA01: updated "Which compiler backends...". | 18:32 | ||
Darren_Duncan | question: what is the proper way to declare constructor methods, namely new(), so they get invoked? | 18:35 | |
case in point, the classes in my Locale::KeyedText module | |||
the new() used to be invoked a few weeks back, but now most of my current test failures seem to be that they aren't | |||
its like some default constructor is being invoked instead | |||
is what I'm doing out of date, or is Pugs broken? | 18:36 | ||
Aankhen`` | Could someone look over the "Which compiler backends..." question and verify the accuracy of the answer? | ||
Darren_Duncan | the version in the repository now (since yesterday) is the newest | 18:37 | |
Aankhen`` | Darren_Duncan >> I'm not able to answer whether Pugs is broken, but in general, it's better to use C<submethod BUILD ($foo, $bar) { $.foo = $foo; .perform_some_initialisation; }> and so on. | ||
Darren_Duncan | the signiture is: method new( $class: Str $msg_key, Str ?%msg_vars ) returns Locale::KeyedText::Message { | ||
Aankhen`` | (atleast, that's my understanding) | 18:38 | |
svnbot6 | r4688, putter++ | Added lit Double to Emit/PIR.hs. | ||
Darren_Duncan | so 'submethod' is what you invoke on a class name, whereas 'method' is invoked on an object? | ||
will try something like that | 18:39 | ||
Aankhen`` | No, see, when you do C<my $foo = Foo.new()>, the C<new> method of class Foo will return an object, and then C<BUILDALL> will be called on that object, which in turn will call C<BUILD>. | ||
So you already have an empty object, you just need to fill in the blanks. | |||
Once again, that's my understanding of it. I have been known to be wrong. :-) | 18:40 | ||
Take a look at the Tree and Set modules. | |||
And HTTP::Headers. | |||
Darren_Duncan | will do | ||
putter | autrijus: ping? | 18:41 | |
Darren_Duncan | I'm getting something ... | 18:43 | |
Aankhen`` | Goodie. ^_^ | ||
svnbot6 | r4689, Aankhen++ | * PA01: added "What is the relationship between Pugs and Parrot?". | ||
cognominal | are the tests backend agnostic? | ||
gaal | they're all interpreted, cognominal. | 18:48 | |
autrijus | putter: pong | ||
putter: please add comment / haddock for me | |||
<-- | |||
svnbot6 | r4690, autrijus++ | * Emit.PIR - move `&bool::*` into the "bool" namespace. | ||
r4690, autrijus++ | * Lexical pads and assignments. This now works: | |||
r4690, autrijus++ | my $x = $x = $x = 123; say $x; | |||
autrijus | is calling opcode | 18:49 | |
that returns a value | |||
.- | |||
is calling opcode without a rv | |||
<-& | |||
is calling a user-defined function | |||
that returns a list of values | |||
assigning to lhs | |||
.& | |||
is calling user-defined function | |||
without a rv. | |||
clkao | autrijus: hey! dont fix bug just by half! | ||
autrijus | clkao: huh? | 18:50 | |
Aankhen`` | autrijus >> Are you still busy? | ||
clkao | autrijus: svk ls -f doesn't have depotname part anymore | ||
Aankhen`` | I mean, are you still working on Emit.PIR? | ||
(I need review for a modification in PA01 :-) | |||
autrijus | clkao: oh. sorry. | 18:51 | |
Aankhen``: yes. | |||
Aankhen`` | OK. | 18:52 | |
I shall ask another time, then. :-) | |||
autrijus | Aankhen``: mv it to 01Overview.kwid | ||
when you have a bit time :) | |||
Aankhen`` | Alright. | ||
cognominal | how can one see the code emitted by pugs for a given backend? | ||
putter | autrijus: re haddoc, will do | ||
autrijus | Aankhen``: also the bootstrap plan needs to be revised in light of hw2005.tex | ||
putter: danke | |||
cognominal: ./pugs -CPIR -e 'say 123' | |||
cat dump.ast | |||
Aankhen`` | cognominal >> `pugs -C backend foo.p6`, `cat dump.ast`? | ||
autrijus | ditto for -CPugs etc | ||
Aankhen`` | autrijus >> I will revise it tomorrow morning. | ||
autrijus | andynu: danke! | 18:53 | |
cognominal | thx | ||
Aankhen`` | (I'd do it right now, but I'm guessing I'd have to actually grok hw2005.txt, which would require more mental power than I possess at the moment) | ||
Also, should I delete 01Overview.html? | |||
Aankhen`` goes to do something brainless. | 18:54 | ||
UT2004, here I come... | |||
& | |||
autrijus | Aankhen``: don't delete it just now... :) | 18:55 | |
svnbot6 | r4691, Aankhen++ | * moved docs/PA01.kwid to docs/01Overview.kwid | 18:59 | |
putter | autrijus: fyi, I'm getting a type error on the new/current PIR.hs. | 19:10 | |
autrijus | !. | ||
really. what's it? | |||
pasteling | "putter" at 66.30.119.55 pasted "type error" (16 lines, 672B) at sial.org/pbot/11096 | 19:11 | |
autrijus | it worksforme. you don't have local additions? | ||
putter | I'll try a clean build. | ||
autrijus | fwiw, my line 105 doesn't look like that. | 19:13 | |
so you mean want to resync. | |||
my l105is | |||
funC <- compile fun | |||
putter | Thanks. | 19:14 | |
autrijus | np :) | ||
thank _you_ | |||
gaal | nice meta line. | ||
autrijus purrs | 19:15 | ||
autrijus trying to think how to express C-style loops. | |||
say... if you don't have c-style loops and have to reinvent it in perl6 | |||
svnbot6 | r4692, putter++ | Added comment to Emit/PIR.hs. | ||
autrijus | how will you do it? | ||
goto label? | |||
and if you don't have goto label? | |||
autrijus ponders some more. | 19:16 | ||
integral | you have while loops? | ||
autrijus | currently I have nothing... all I have is function calls that get tail optimised automagically | ||
but if you see a need for a fundamental while loop | 19:17 | ||
I can add it too | |||
basically I'm thinking in term of the primitive semantics | |||
integral | tail optimised function call == goto | ||
autrijus | you need letrec for that | ||
oh wait. no, there's Y. | |||
autrijus forgot about Y. | |||
so maybe we Y everything? | |||
gaal | Y not. | 19:18 | |
autrijus | but Y... | ||
integral | this is in PIR? | ||
autrijus | integral: this is in PugsAST | ||
the conceptual Perl6 ast | |||
integral | there isn't a &?CURRENT_FUNCTION equivalent? | ||
autrijus | has nothing to do with parse tree | ||
nothing to do with pir either. | |||
raw perl 6 semantic ast | |||
integral | oh, ok, you're deciding on basic perl6 primitives, I get it | ||
autrijus | yup. | ||
which is something nobody had thought about until now :p | 19:19 | ||
(but I see it as essential to get retargetable compilation) | |||
I should look at PyPy's tree again. | |||
autrijus decides to look at what pypy considers as prim | 19:21 | ||
putter | autrijus: What would pop look like? This: sub "&pop" [tempPMC] [tempPMC <-- "pop" $ [tempPMC]] --> [tempPMC] not being it. Once there are a few more examples it will be easier for folks to add things. | 19:29 | |
autrijus | putter: right. | 19:30 | |
putter: let me write pop etc | |||
putter | ok. Thanks. ;) | ||
Darren_Duncan | ?eval class Foo { submethod BUILD( Str $bar ) { say "bar is '$bar'" } } my $baz = Foo.new( 'hello' ); | 19:35 | |
evalbot6 | Error: No compatible subroutine found: "&say" | ||
autrijus | my @a = (1,2,3); say (pop @a); | ||
that should be a good example. | |||
putter | Thanks! | 19:36 | |
Darren_Duncan | ?eval class Foo { submethod BUILD( Str $bar ) { say "bar is '$bar'"; } } my $baz = Foo.new( 'hello' ); | ||
evalbot6 | Error: No compatible subroutine found: "&say" | ||
Darren_Duncan | what I get for output on my Pugs is: bar is '' | 19:37 | |
what is the problem here? | 19:38 | ||
putter | Re primatives, one might do a kernel language... (like Oz) | 19:41 | |
Boogie | should something like this have to work? $num % all(2..$num/2) != 0; | 19:47 | |
svnbot6 | r4693, andras++ | vmethods: add some math | ||
autrijus | putter: right... what's in Pugs.Compile.PIR as PAST | ||
will end up as Pugs's kenrel lang | |||
putter | ah | 19:48 | |
autrijus | so need to keep the nodes very narrow | ||
Darren_Duncan | ?eval my $z = 13; class Foo { submethod BUILD( Str $bar ) { $z = 26; } } my $baz = Foo.new( 'hello' ); say "z is '$z'" | ||
evalbot6 | Error: No compatible subroutine found: "&say" | 19:49 | |
autrijus | in order for Eval to be fast and for retargetting other VMs. | ||
(and Ms) | |||
Darren_Duncan | this is getting frustrating | ||
autrijus | Darren_Duncan: er. "say" is disabled in safe mode | ||
Aankhen`` | ?eval my $z = 13; class Foo { submethod BUILD( Str $bar ) { $z = 26; } } my $baz = Foo.new( 'hello' ); "z is '$z'" | ||
evalbot6 | 'z is \'26\'' | ||
autrijus | Darren_Duncan: so I think you'll be frustrated to no end. | ||
Darren_Duncan | how do we debug then? | ||
autrijus | Darren_Duncan: like Aankhen`` did | 19:50 | |
(or run it on feather) | |||
Darren_Duncan | uhuh | ||
just a minute ... | |||
?eval class Foo { submethod BUILD( Str $bar ) { "bar is '$bar'"; } } my $baz = Foo.new( 'hello' ); | |||
evalbot6 | \{obj:Foo} | ||
autrijus | that sounds correct. | ||
Boogie | is there somebody can answer my junctions question? ;) | 19:51 | |
Aankhen`` | Darren_Duncan >> C<BUILD> doesn't return the value... | ||
autrijus | ?eval my @out; class Foo { submethod BUILD( Str $bar ) { push @out, "bar is '$bar'"; } } my $baz = Foo.new( 'hello' ); @out | ||
Darren_Duncan | class Foo { submethod BUILD( $bon: Str $bar ) { "bar is '$bar'"; } } my $baz = Foo.new( 'hello' ); | ||
evalbot6 | ['bar is \'\''] | ||
autrijus | ?eval my @out; class Foo { submethod BUILD( Str $bar ) { push @out, "bar is '$bar'"; } } my $baz = Foo.new( bar => 'hello' ); @out | ||
evalbot6 | ['bar is \'hello\''] | ||
Aankhen`` | Also, C<BUILD> expects named parameters. | ||
autrijus | I think it's named only. | ||
Aankhen`` | So, you need to do it like autrijus did. | ||
autrijus | all *%_ is. | ||
Aankhen`` | submethod (*%_) { ... } | ||
submethod BUILD (*%_) { ... } | 19:52 | ||
Darren_Duncan | just a minute ... | ||
PerlJam | From whence does this idea that BUILD needs named parameters come? | ||
Aankhen`` | PerlJam >> One of the Apocalypses. | ||
Hmm, according to S12, it could take regular positional parameters too... | 19:53 | ||
autrijus | oh? | ||
bug! | |||
PerlJam | indeed | ||
autrijus | write test! | ||
Aankhen`` | OK. | ||
autrijus | I completely missed that paragraph. | ||
PerlJam | Aankhen``++ | ||
autrijus | but that's kind of usual with S12. | ||
;) | |||
Darren_Duncan | FYI, what I *really* want to do is wrap the built-in new() that checks its input arguments first and causes new() to return undef instead of an object if they are bad ... how do I do this? | ||
Aankhen`` | autrijus >> It's not specifically mentioned. | 19:54 | |
However, there's an example. | |||
Submethods are for declaring infrastructural methods that shouldn't be inherited by subclasses, such as initializers: | |||
submethod BUILD ($arg) { | |||
autrijus | Darren_Duncan: well you can do your own new and call to super new | ||
Darren_Duncan | I did that before (checked in) but it wasn't being executed | ||
autrijus | ?eval class Foo { sub new { 123} } Foo.new | ||
evalbot6 | 123 | ||
Darren_Duncan | see the Locale-KeyedText I have checked in now ... maybe you can tell me why new() isn't being executed | 19:55 | |
run test LKT_20_MsgProps.t | |||
autrijus | ?eval class Foo { method new { 123} } Foo.new | ||
evalbot6 | 123 | ||
autrijus | you mean _10 | 19:56 | |
ok | |||
Darren_Duncan | yes _10 | ||
autrijus | Locale::KeyedText.new_message should do undef | ||
is that the idea? | |||
Darren_Duncan | the first call should, the rest shouuldn't | 19:57 | |
in the test file | |||
autrijus | ?eval class Foo { method new { return } } Foo.new | ||
evalbot6 | undef | ||
Darren_Duncan | maybe it has something to do with my class name having a :: in it | ||
autrijus | probably not | ||
Darren_Duncan | or that I say 'use' in a different file | ||
the Locale::KeyedText::Message.new() gives a "can't find" error without the preceeding :: | 19:58 | ||
svnbot6 | r4694, Aankhen++ | * added bug test for positional parameters not being passed on to the BUILD submethod. | ||
Darren_Duncan | I put 'say' inside new_message and Message.new ... the first was printed, the second wasn't ... | 19:59 | |
suggesting that something like SUPER::new was being executed rather than my new() ... | |||
since an object is always returned having empty properties | |||
autrijus | ?eval class Foo { method new { return } } ::Foo.new | ||
evalbot6 | undef | ||
autrijus | ?eval ::Foo.new(1); class Foo { method new ($x) { return } } | 20:00 | |
evalbot6 | undef | ||
Aankhen`` | ?eval class Foo { method new { return "foo" } } ::Foo.new | ||
evalbot6 | 'foo' | ||
autrijus | weird. | ||
Darren_Duncan: hm, weird indeed. | |||
Darren_Duncan | did you run my test and can you see the problem? | ||
autrijus | I did run your test and I can't easily see the problem. | 20:01 | |
:-( | |||
Darren_Duncan | do the tests all say 'ok' then? | ||
putter | pugs: internal error: startTask: Can't create new task Please report this as a bug to [email@hidden.address] | ||
Aankhen`` | Darren_Duncan >> Where is the test? | ||
Darren_Duncan | see /ext/Locale-KeyedText/t/ | ||
autrijus | Darren_Duncan: no, 12 failed | 20:02 | |
putter: er? | |||
Aankhen`` | Darren_Duncan >> I see only LKT_20_TrnProps.t, not MsgProps.t. | ||
Darren_Duncan | see 10_MsgProps | ||
Aankhen`` | OK. | ||
Darren_Duncan | I get 12 failed too, but I haven't been able to figure out why | 20:03 | |
Aankhen`` | C:\Development\pugs\ext\Locale-KeyedText\t>pugs LKT_10_MsgProps.t | ||
pugs: *** Can't locate t_LKT_Util.pm in @*INC (@*INC contains: t/lib ext/Locale- | |||
KeyedText/t/lib C:\Development\Perl6\lib C:\Development\Perl6\lib C:\Development | |||
\Perl6\site\lib C:\Development\Perl6\site\lib .). | |||
Darren_Duncan | I put a 'say' at the start of my new() and it doesn't print anything | ||
autrijus | Darren_Duncan: right, because your new() is not being dispatched to. | ||
Darren_Duncan | so you confirmed that | ||
the question is why | |||
autrijus | Darren_Duncan: move the entire class to before the declaration and drop the ::? | ||
yeah the question is why since it's not a mmd. | |||
Darren_Duncan | will try that | 20:04 | |
er, move what before what? | 20:05 | ||
autrijus | move the entire class | ||
before the other class that calls its new | |||
Darren_Duncan | just a minute | ||
thanks, that improved things it seems | 20:06 | ||
autrijus | cool! | 20:07 | |
putter | autrijus: re "er?", I went to add a say() to evalbot which raises a "sorry, no"... but the following made ghc go boom: | ||
Darren_Duncan | still other problems, but that seems to have helped ... will know soon | ||
please keep watching this channel | 20:08 | ||
putter | EVALBOT_CODE='42' EVALBOT_TMPFILE=./deleteme EVALBOT_PUGS=/.../pugs perl -w evalhelper.p5 | ||
autrijus | Darren_Duncan: sure | ||
Aankhen`` | autrijus, in the meantime, could you look over something for me to verify its accuracy? :-) | 20:10 | |
autrijus | Aankhen``: sure.. ? | ||
Aankhen`` | rt.openfoundry.org/Foundry/Project/...d?rev=4691 | ||
"What is the relationship between Pugs and Parrot?" | |||
And "Which compiler backends are available? Will more be added?" | |||
autrijus | Aankhen``: ok... change Parrot AST to Parrot PIR. | 20:11 | |
Aankhen`` | Ahh! | ||
One sec. | |||
autrijus | because there's no such thing as Parrot AST :) | ||
Aankhen`` | Yeh, I was a little confused about that. | ||
autrijus | otherwise fine. | 20:12 | |
putter | Ahem. Could someone on a non-x86_64 machine try the following: | ||
EVALBOT_CODE='42' EVALBOT_TMPFILE=/tmp/deleteme EVALBOT_PUGS=`pwd`/pugs perl -w examples/network/evalbot/evalhelper.p5; cat /tmp/deleteme | |||
Aankhen`` | OK. | ||
Er. | |||
Sorry | |||
putter | Thanks. I get a ghc error. | ||
Aankhen`` | . | ||
autrijus | I'll brb. | 20:13 | |
Aankhen`` | Um, I'm on Windows... should I still test? | ||
Boogie | I solved the prime question. But just another. Is :by() supported by Pugs? If yes, how should I use it? | 20:14 | |
Aankhen`` | Apparently not. No BSD::Resource. :-P | ||
putter | Aankhen``: Probably not worth the... yes, trouble. Thanks anyway. | 20:15 | |
Aankhen`` | Heh. | ||
NP. | |||
svnbot6 | r4695, Aankhen++ | * docs/01Overview.kwid: s:g/Parrot AST/Parrot PIR/. | ||
Aankhen`` | Boogie >> It doesn't seem to be supported. | 20:18 | |
Reading A03, it seems to be an adverbial trait for the range operator, so you'd probably use it like so: 1..10 :by(2) | |||
Boogie | OK, thx. It was my opinion, too, but not worked. | 20:19 | |
Aankhen`` | C<..>'s full name is C<< infix:<..>:(Int, Int) >>, so you can always use C<< infix:<..>($int, $other_int, :by($step)) >> to test. | 20:20 | |
Boogie | Aankhen``, I think it's alien language to me... ;) | 20:22 | |
Aankhen`` | Heh. | ||
autrijus | alien as in space aliens. | ||
pasteling | "Aankhen``" at 61.246.21.218 pasted "Testing :by" (7 lines, 226B) at sial.org/pbot/11104 | 20:23 | |
Boogie | repeat: it's chinese to me. :) | ||
Aankhen`` | Bah. :-P | ||
putter | Sigh. And ghc head isn't even building at the moment. Punt. | 20:24 | |
Aankhen`` | I could try explaining if you want to understand. :-) | ||
putter | Hmm, unless there is a snapshot... | ||
Boogie | oh, not your paste code is "alien" to me. I check it. | ||
Aankhen`` | Ah. | ||
I wish learning new languages was as easy as "push @brain, $lang". | 20:25 | ||
autrijus | you think CPU thinks it's easy? ;) | ||
Aankhen`` | Hmm, but then again, that wouldn't be any fun. | ||
Hehe. | |||
autrijus | indeed. | ||
Aankhen`` | OK, I have a new wish. | 20:26 | |
autrijus | For what do you wish? --More-- | ||
Boogie | Ok, I understand it. So it seems, that it's not working yet. ;) | ||
autrijus | Boogie: that would be Totally Correct. | ||
Aankhen`` | I wish taking time out to do stuff was as easy as "push @day, $hours;". | ||
autrijus | Boogie: I don't even know how to parse it ;) | ||
?eval 3 :by(3) | |||
evalbot6 | Error: unexpected ":" expecting operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
Aankhen`` | It has to be used on a range. | 20:27 | |
Something like: | |||
autrijus | ?eval 3,:by(3) | ||
evalbot6 | (3, ('by' => 3)) | ||
Aankhen`` | ?eval 1..10:by(3) | ||
evalbot6 | Error: unexpected ":" expecting digit, fraction, exponent, term postfix, operator, "does", "but", "is", "^..^", "cmp", "<=>", "^..", "..^", "..", postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
autrijus | right... what I'm not getting is | ||
does all infix get that? | |||
Aankhen`` | Parse error...? | ||
autrijus | no | ||
adverb | |||
Boogie | 1..10:by(3) is 1, 4, 7, 10 | ||
autrijus | 100 * 200 :modulo(10) | ||
Aankhen`` | I didn't understand what you said. :-P | ||
Oh, wait. | |||
I think only range gets :by. | 20:28 | ||
autrijus | sure | ||
but does all infix get potentially adverbs. | |||
Aankhen`` | Doesn't make sense to have 1+5:by(3). | ||
autrijus | is what I'm asking :) | ||
Aankhen`` | Ah. | ||
Yes, AFAIK. | |||
autrijus | ok, that makes it significantly easier. | ||
Aankhen`` | Any operator could get an adverbial modifier. | ||
But please wait. | |||
I am checking the Synposes. | |||
autrijus | also, an adverbial? | 20:29 | |
what about multiple? | |||
Boogie | S09 has a short info about it. | ||
Aankhen`` | Ah. | ||
As a unary prefix operator, you may also apply adverbs: | |||
for *$handle :prompt('$ ') { say $_ + 1 } | |||
I think all operators can get adverbial modifiers. | 20:30 | ||
(if not all functions) | |||
autrijus | cool. write tests then :) | ||
Boogie | And it should work, too: 1...:by(2) | ||
autrijus | for userdefined too. | ||
Aankhen`` | I'll do that, just going to read some more to make sure I grok it. | ||
autrijus | Aankhen++ | ||
Darren_Duncan | I committed what I have so far so we're all on the same page | 20:35 | |
autrijus | yay. "1=2" is now a compile time error in the compile monad. | ||
autrijus is happy that more and more things are catched/warned/strictness-controlled at compile level | 20:36 | ||
integral | autrijus++ | ||
Darren_Duncan | I agree | ||
autrijus | integral: I found that GADTs partially obsoletes metacomputation. | 20:37 | |
because data types are now as good as functions. | |||
so it can guide the dynam monad while being fully reified. | |||
integral | wow, that sounds good | ||
autrijus | integral: Pugs.Compile.PIR's PAST structure is that | ||
it guides the underlying Trans monad | |||
instance Translate (PAST a) a where | |||
... | |||
svnbot6 | r4696, Darren_Duncan++ | Locale-KeyedText updates : moved 'Locale::KeyedText' class declaration so it is the last one rather than the first; this is so that Message.new() and Translator.new() actually get executed; also fixed a syntax error in Translator.new() | ||
integral | hmm, so is AST.Internals looking any better now? | 20:38 | |
20:38
rjbs_ is now known as rjbs
|
|||
autrijus | integral: it will, once I switch the current Eval | 20:38 | |
to eval PAST (the syntax tree) instead of Exp (the parse tree) | |||
integral | sounds good :-) autrijus++ | ||
Aankhen`` | ?eval 1..10[0,1] | ||
autrijus | we can finally do away with this "evaluate the parse tree" mess! | ||
evalbot6 | (1, 2) | ||
Aankhen`` | ?eval 1...[0,1] | 20:39 | |
evalbot6 | Error: unexpected "[" expecting operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
Aankhen`` | ?eval (1...)[0,1] | ||
evalbot6 | [1, 2] | ||
integral | it's a pity all these cool ideas have a "hack lots and lots and lots of code" stage =) | ||
autrijus | integral: nah, you just have to spec them down. | ||
it's a nice byproduct that our specification language, which is called Haskell, is also executable | 20:40 | ||
;) | |||
Aankhen`` | ?eval my @foo = (1...); @foo[0,1] | ||
evalbot6 | pugs: out of memory (requested 1048576 bytes) | ||
integral | hmm, maybe, but you can't get away from the "convert everything in Eval.hs at once" thing | ||
Aankhen`` | Hmm. | ||
How does that work? | |||
integral | Aankhen``: afaik it's because = for an array is eager | 20:41 | |
Aankhen`` | Can I use lazy { (1...) }? | ||
Darren_Duncan | currently debugging a problem where an array arg seems to always contain exactly 1 element ... | ||
affecting 20_TrnProps ... | |||
Aankhen`` | Bleh, that doesn't work. | ||
Boogie | oh_my_god: ?none(2..sqrt($value)).is_factor_of($value); :D | ||
Aankhen`` | ?eval 1...[0,1] | 20:42 | |
evalbot6 | Error: unexpected "[" expecting operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input | ||
Aankhen`` | ?eval (1...)[0,1] | ||
evalbot6 | [1, 2] | ||
Aankhen`` | That works, but assigning it to an array doesn't. :-( | ||
autrijus | integral: I can :) | 20:45 | |
integral: by having a PAST backdoor to Exp. | |||
integral: so what's not compiled gets interpreted. | |||
integral | 8-) ok, that's scary :) | 20:46 | |
autrijus | PRaw Exp | 20:48 | |
just like that :) | |||
so have two runloops | |||
I've got it all worked out :D | |||
putter | ghc bug report sent. pop task_stack. | 20:50 | |
svnbot6 | r4697, andras++ | vmethods: more more math | ||
Aankhen`` | autrijus >> I will submit the test in the morning. | 20:51 | |
My mother's telling me to go sleep. | |||
G'night. | |||
autrijus | Aankhen``: you rock. go sleep. | ||
ntie! | |||
arcady | too bad "for 1... -> $i { last if $i > 10 }" doesn't work | 20:58 | |
putter | I propose to add the following line to evalbot.p6 evalhelper(): | 21:02 | |
$code = 'sub say(*@a){die("Cant say() in evalbot")};' + $code; | |||
But I can't really test it. | |||
autrijus | putter: just commit ahead then. | ||
we'll fix when it's broken | 21:03 | ||
putter | Ok. Tnx. | ||
Shillo | Hullo, folks! | ||
arcady | except you don't use '+' for string concatenation! | ||
autrijus | right. | ||
Shillo | Hey, just occured to me to check whether I remember an apocalypse correctly... | ||
What exactly is the left side of := supposed to be? | |||
I think I remember that := really imitates parameter binding in a function call. | 21:04 | ||
Or... ? | |||
autrijus | Shillo: that's right. | ||
however it's poorly implemented at the moment. | |||
Shillo nods. 'what I wanted to ask next. | |||
(+$x, +$y) = (:x<foo>, :y<bar>) should parse? | 21:05 | ||
autrijus | yes, but currently not | ||
Shillo noddles. | 21:06 | ||
arcady | well, it does parse... as something... something not very correct | 21:07 | |
Shillo looks into writing a test, just for fun.... | |||
chip | what does that + mean? | 21:12 | |
svnbot6 | r4698, putter++ | evalbot.p6 now says it cant say(). | ||
r4699, putter++ | evalbot.p6 tweak. | |||
r4700, putter++ | evalbot.p6 another tweak. Sigh. | |||
chip | oh dear, that's 'named parameter' +? | ||
?eval (+$x) := (:x<1>) | 21:13 | ||
evalbot6 | Error: Cannot bind this as lhs: Pos (MkPos "<eval>" 1 2 1 5) (App (Var "&prefix:+") Nothing [Var "$x"]) | ||
chip | jeepers | ||
Shillo | chip: I think := in pugs currently just behaves like = | ||
That's kinda bleh, I so liked [foo, bar, *baz] = list idiom that I added it in the one scripting language that was *fully* subjected to my design hackery. :) | 21:14 | ||
chip: Er, I mean, just /parses/ like = | 21:15 | ||
putter , in wait state for PIR.hs examples, ponders what to do next. | |||
Aankhen``++ # perl6 as "meta-language" | 21:17 | ||
autrijus: Is there any community you wish was more involved in pugs development? (so many languages, so little time) | 21:19 | ||
svnbot6 | r4701, Darren_Duncan++ | Locale-KeyedText update : changed all LKT_20_TrnProps.t tests that passed array ref args so they pass parenthesized lists instead; previously each Translator array argument was always getting a single argument that was an Array | ||
autrijus | putter: elaborate? | 21:24 | |
Shillo | ($a, @rest) = (1,2,3) <-- works | ||
autrijus is hunting down a rather weird bug in the Writer monad's "pass" function | |||
Shillo | ($a, *@rest) = (1,2,3) <-- works but @rest ends up empty. Bug? | ||
nothingmuch | fucking ISP | 21:25 | |
every 25 minutes the connection goes down | |||
autrijus | Shillo: slurpy star at assignment lhs is compile time error | ||
ideally | |||
that only makes sense in rvalue context. | |||
but becaus pugs's Eval has no notion of compile time error | |||
it ends up being a runtime bogusness. | |||
Shillo | Duh! I meant :=... testing again... | ||
($a, *@rest) := (1,2,3) <-- parse error | 21:26 | ||
($a, @rest) := (1,2,3) <-- works but @rest == (2) | |||
Hm, I think the latter is okay, actually. | |||
autrijus | right. | 21:27 | |
Shillo | Former? | ||
autrijus | former is borken. | 21:28 | |
Darren_Duncan | based on what I've seen so far with such as @foo arguments, I'm thinking of making my Perl 6 code look more Perl 5 ish and use a $foo argument instead, which would hold an Array reference ... then invoking said function with ['a','b','c'] should do what I expect | 21:32 | |
and for the near future it is important that my Perl 5 and Perl 6 versions of the same modules can be used in the same way | 21:33 | ||
so I'll probably undo my last commit as part of this change | 21:34 | ||
anyway, have to leave comp for awhile and will attend to this later ... have a good day y'all! | |||
fyi, in the meantime, the checked-in LKT_20_TrnProps.t currently passes all tests | 21:35 | ||
autrijus | woot | ||
Darren_Duncan++ | |||
Darren_Duncan | I'm still having problems with hashes though, which affects 10_MsgProps | 21:36 | |
20_TrnProps is arrays by contrast | |||
Shillo commits the tests for the conversation I just had. :) | 21:37 | ||
svnbot6 | r4702, shillo++ | tests: lhs of := is a parameter list (tested keywords and the slurpy) | ||
Darren_Duncan | autrijus, I would appreciate it if you could improve Pugs so I can declare my classes in any order and calling new() would still work | ||
autrijus | Darren_Duncan: I am in fact working on that. | 21:38 | |
(compilation phase) | |||
please be patient :) | |||
21:40
khisanth_ is now known as Khisanth
|
|||
autrijus | putter: I checked in some more pir prims. | 21:43 | |
Darren_Duncan | great ... anyway, back in while | ||
autrijus | Darren_Duncan: the thing is that currently there's only parse time and runtime | ||
so any info (like classes) not available immediately in parse time | |||
is lost. | |||
Darren_Duncan | yes | ||
autrijus | so another compiler phase will fix this. | ||
Darren_Duncan | okay | ||
this probably goes without saying, but I would like the flexability I have in Perl 5 with most reasonable things | 21:44 | ||
autrijus | right. | ||
me too. | |||
<- heavily invested in perl5 :) | |||
Darren_Duncan | it also occurs to me that as I've continued hacking LKT for Perl 6, its looking more like perl 5 as I go along | 21:45 | |
autrijus | nod. | ||
Darren_Duncan | so I'm not really using that many Perl-6-added features | ||
autrijus | because pugs is currently implementing very few p6 oo features. | ||
that will also improve with time :) | |||
Darren_Duncan | question: how long are you online today? | ||
how much longer that is | |||
autrijus | Darren_Duncan: not much... | 21:46 | |
<.5hr | |||
I hope. | |||
Darren_Duncan | so I thought | ||
Shillo | autrijus: Hey, ye still in the neibourhood? :) | ||
autrijus | Shillo: you mean austria? | ||
Darren_Duncan | so I'll work on my own the rest of the day and discuss with you again tomorrow, for the most part | ||
Shillo | autrijus: Yep! | ||
autrijus | Darren_Duncan: cool. thanks | ||
Shillo: yes | |||
Shillo | Heh... been doing 1 trip to Vianna/month till about half a year ago (project at work). | 21:47 | |
Darren_Duncan | that said, I will try to confirm a fix for the new() thing while you are online now if it is committed soon ... otherwise tomorrow | ||
just give the word ... | 21:48 | ||
svnbot6 | r4703, autrijus++ | * Sequentialised even more evaluation order. This now works: | ||
r4703, autrijus++ | my $x = 9; say $x++; say $x | |||
Shillo | So it's neighbourhood. ;) | ||
putter | autrijus: re elaborate? Embedding languages in p6 is so easy, I had to start n of them. So I was trying to find a way to choose which to poke further. | 21:51 | |
autrijus: re pir, great. will putter. | 21:52 | ||
Thanks, autrijus. | 21:54 | ||
autrijus | np :) | 21:57 | |
I'm feeling like Day 4 all over again. | |||
autrijus just got substr() working | |||
mugwump | including lvalue ? | 21:58 | |
hi btw | |||
autrijus | hi mugwump. | ||
no, rvalue only at the moment because parrot doesn't do lvalue substr natively. | |||
mugwump | on other subjects, I was wondering if there was some kind of model of PMCs that might be relevant to study for the MetaModel... | 22:00 | |
do you model PMCs at all or just target them? | 22:01 | ||
autrijus | just target them. | 22:03 | |
but we get to create our own PMC/ParrotObjects. | |||
mugwump | which source file is best to read? | 22:07 | |
Emit/PIR.hs? | |||
autrijus | mugwump: no, the PDDs | 22:10 | |
pdd15 | |||
mugwump | oh cool | 22:11 | |
svnbot6 | r4704, autrijus++ | * Add backdoors to raw Exp in PAST, and to raw Doc in PIR. | 22:40 | |
r4704, autrijus++ | This is to get the "compile if you can, interpret if you can't" | |||
r4704, autrijus++ | semantic working for gradual transition of Eval.hs. | |||
r4704, autrijus++ | * As an example, the old Parrot backend is now bridged for | |||
r4704, autrijus++ | (Syn "loop") syntax; this means mandelbrot runs for free. ;) | |||
r4704, autrijus++ | * For lexical names, generate a ".local" name instead of using | |||
r4704, autrijus++ | fresh supply of registers. That will make lexical access | |||
r4704, autrijus++ | potentially much faster (constant time) without going thru | |||
r4704, autrijus++ | the fetch_lex code. | |||
autrijus waves & | 22:45 | ||
svnbot6 | r4705, putter++ | Added abs() and prefix:- to Emit/PIR.hs. But - seems to be returning a ResizablePMCArray?!? | 23:34 | |
obra | Where do the tests of synopses live these days? | ||
putter | Any parrot-familiar folk around? (I seek clarity on infix .MMD_foo) | 23:54 |