Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-09-23

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 thoughtpolice joined #perl6
00:05 theorb joined #perl6
00:19 ofer joined #perl6
00:24 avar http://use.perl.org/~avar/journal/34522
00:24 lambdabot Title: Journal of avar (6604)
00:26 Schwern joined #perl6
00:38 fax joined #perl6
00:40 avar fax: The code is in pugs svn under v6/v6-KindaPerl6
00:40 avar svn co http://svn.pugscode.org/pugs/v6
00:40 lambdabot Title: Revision 18100: /v6
00:41 avar The interesting stuff is ./lib/KindaPerl6/Visitor/EmitLisp.pm written in Perl 6 and lib/KindaPerl6/Runtime/Lisp/ which is the CL runtime environment written in CL
00:42 fax ooh
00:42 fax so you're writing it in perl?
00:42 fax how much is perl vs haskell?
00:42 avar oh kindaperl6 is a different project from pugs the haskell compiler alltogether
00:42 fax ah alright
00:43 avar it's a self-bootstrapping compiler written in a subset of perl6
00:43 avar So once the CL emitter is finished all of the compiler can run on say movitz
00:44 fax This is so amazing :D
00:44 avar Yeah:)
00:44 avar It's one of three-ish p6 compilers, I like it because I like the self-compiling emitter approach :)
01:46 daxim joined #perl6
01:54 vbattsAtWork joined #perl6
01:56 ahmadz joined #perl6
02:00 ahmadz_ joined #perl6
02:10 ahmadz__ joined #perl6
02:27 hoelzro joined #perl6
02:47 mr_ank joined #perl6
02:48 hoelzro left #perl6
04:11 BinGOs joined #perl6
04:16 MU9214 left #perl6
04:20 Ashizawa joined #perl6
04:23 BinGOs joined #perl6
04:34 ahmadz hi
04:37 BinGOs joined #perl6
04:37 ahmadz @seen svnbot ;-)
04:37 lambdabot I haven't seen svnbot.
04:53 ahmadz @tell moritz_ "Syntax highlighted pugs svn examples are now available using ':show' at http://feather.perl6.nl:8096/runpugs/"
04:53 lambdabot Consider it noted.
05:09 dduncan is there a reason that Test.pm's isa_ok() isn't implemented over .does()?
05:09 dduncan it just does an equality test on .WHAT, so it isn't suitable for testing inheritence
05:10 dduncan afaik, this is different than Test::More's same-named function
05:11 dduncan now, in case the current Test.pm is that way on purpose, I think I'll just add another function, does_ok(), rather than changing
05:11 dduncan the existing one, so not to break things that depend on the current behaviour
05:13 ahmadz_ joined #perl6
05:21 zakame joined #perl6
05:29 ahmadz_ hmmm... anyone online?
05:30 ahmadz_ i need help in testing runpugs on different browser/platforms. If you want to help please checkout http://feather3.perl6.nl/runpugs/ and tell me if you have any BUGS
05:30 lambdabot Title: Run Perl 6 Now -- in your browser!
05:31 ahmadz_ ideas/comments welcome... cya
05:37 ahmadz joined #perl6
05:51 Caelum joined #perl6
06:02 jisom joined #perl6
06:11 devogon joined #perl6
06:28 lisppaste3 joined #perl6
06:35 devogon_ joined #perl6
06:38 dduncan I just fixed an apparent Test.pm reporting failure in isa_ok()
06:39 dduncan it always said 'undef' for 'Actual:' rather than the actual package name
06:39 dduncan this may or may not be due to a bug in .defined, where calling .defined on the result of a .WHAT always returns false
06:40 dduncan in case that .defined behaviour was correct, I fixed the issue by casting the .WHAT result as a Str in isa_ok()
06:41 dduncan regarding my previously mentioned isa_ok() issue not using .does, I have for now left Test.pm alone and added a does_ok() to my own module's test suite, which is used rather than does_ok() ...
06:41 dduncan see the to be checked in Validator.pm under ext/Muldis-DB/ in case does_ok() is suitable for putting in Test.pm
06:41 dduncan or alternately whether isa_ok should be updated to use .does
06:42 dduncan I leave that up to others for now
06:43 dduncan r18103 was the Test.pm change that I did do
07:01 Caelum joined #perl6
07:09 araujo joined #perl6
07:11 kanru joined #perl6
07:11 dduncan and r18104 has the Validator.pm change
07:19 elmex joined #perl6
07:48 Aankhen`` joined #perl6
07:49 BinGOs joined #perl6
08:21 iblechbot joined #perl6
08:32 drrho joined #perl6
08:38 nipra joined #perl6
08:43 bengl joined #perl6
08:56 dduncan left #perl6
08:56 chris2 joined #perl6
09:02 ahmadz joined #perl6
09:19 turrepurre joined #perl6
10:17 drupek1245 joined #perl6
10:31 [particle1 joined #perl6
10:49 franck___ joined #perl6
11:23 polettix joined #perl6
11:29 nipra joined #perl6
12:01 zamolxes joined #perl6
12:49 tcliou joined #perl6
12:52 Blwood joined #perl6
12:55 lichtkind joined #perl6
13:13 riffraff joined #perl6
13:14 riffraff hi
13:18 ludan joined #perl6
13:18 ludan hi
13:35 dalek joined #perl6
13:35 cognominal_ joined #perl6
13:46 dalek joined #perl6
13:47 wilx` joined #perl6
13:48 cognominal_ joined #perl6
13:50 idiotben joined #perl6
14:02 drrho joined #perl6
14:04 lichtkind_ joined #perl6
14:25 Blwood joined #perl6
14:32 ahmadz joined #perl6
14:34 ahmadz hi
14:40 ahmadz is svn down? i cannot get feather.perl6.nl's dns to resolve
14:40 d4l3k_ joined #perl6
15:01 buzztracker joined #perl6
15:04 Juerd joined #perl6
15:19 wolverian joined #perl6
15:20 wolverian urgh, I think feather's dns server is having problems
15:20 wolverian irssi periodically loses connection and then can't resolve anything for a while
15:20 wolverian (the while being long enough for it to give up)
15:24 rocenting joined #perl6
15:25 Juerd Currently it works fine
15:25 lambdabot Juerd: You have 1 new message. '/msg lambdabot @messages' to read it.
15:25 Juerd @messages
15:25 lambdabot ahmadz said 1d 2h 7m 32s ago: "feather hostname could not be resolved (sat 1:17 PM utc)"
15:26 Juerd We've had some nasty network outages; I don't know if this could be related.
15:27 wolverian I think it gave up on reconnecting at 17:32 EET
15:27 wolverian that is, 50 minutes ago
15:57 iblechbot joined #perl6
16:07 fglock joined #perl6
16:21 vel joined #perl6
16:47 cerridwen joined #perl6
16:56 ahmadz_ joined #perl6
17:03 rindolf joined #perl6
17:14 fglock__ joined #perl6
17:19 barney joined #perl6
17:29 hoelzro joined #perl6
17:37 rindolf joined #perl6
17:49 Blwood joined #perl6
17:58 Psyche^ joined #perl6
18:06 Limbic_Region joined #perl6
18:06 drrho joined #perl6
18:12 d4l3k_ joined #perl6
18:12 hoelzro left #perl6
18:16 Aankhen`` Where's our svnbot? :-(
18:18 jisom joined #perl6
18:22 Juerd joined #perl6
18:30 Aankhen`` ?eval (1, 2, 3, 4).say
18:30 ahmadz_ kp6: "Hi"
18:30 exp_evalbot r18108: OUTPUT['Hi'␤]
18:30 avar Aankhen``: did you check out my new changes?
18:30 Aankhen`` Heh.
18:30 Aankhen`` avar: Which ones?
18:31 Aankhen`` kp6: (1, 2, 3, 4).say
18:31 exp_evalbot r18108: OUTPUT[syntax error at position 0, line 1 column 0:␤(1, 2, 3, 4).sa␤^ HERE␤]
18:31 Aankhen`` Bah.
18:32 avar $ echo 'say "hello world"' | perl kp6-mp6-perl5.pl --lisp | clisp | grep hello
18:32 avar MAIN[6]> hello world
18:32 avar these
18:32 avar got hello world working
18:32 avar (kp6-apply-function (kp6-lookup (kp6-lookup (kp6-packages) (make-instance 'kp6-Str :value "GLOBAL")
18:32 avar ) (make-instance 'kp6-Str :value "Code_say")
18:32 Aankhen`` Ah, right, cool.
18:34 Aankhen`` Wait, I don't seem to have that here.
18:34 Aankhen`` ,69(kp6-apply-function "Code_say" (mapcar #'cl->perl (list (make-instance 'kp6-Str
18:34 Aankhen`` ,69:value "hello, world")
18:34 Aankhen`` That's what I get.
18:34 Aankhen`` Fully updated, too.
18:34 avar forgot svk push
18:34 Aankhen`` Ah.
18:34 Aankhen`` Better update before pushing.
18:35 avar eek
18:35 Aankhen`` :-)
18:35 Aankhen`` See, this is why we need svnbot.
18:35 avar stupid confligcs
18:36 avar http://pugs.blogs.com/pugs/2007/08/playing-​with-th.html?cid=83743157#comment-83743157
18:36 lambdabot Title: Pugs: Playing with the new "Not Quite Perl", http://tinyurl.com/2hkd64
18:36 avar Aankhen``: we're currently the fastest perl6 on hello world:)
18:36 Aankhen`` Woo hoo.
18:37 Aankhen`` Now if only we didn't implement the tiniest subset of P6 possible. :-P
18:38 avar class Lookup {
18:38 avar method emit_lisp {
18:38 avar +>>>> YOUR VERSION v6/v6-KindaPerl6/lib/Kinda​Perl6/Visitor/EmitLisp.pm (/local/pugs) 119057254756866
18:38 avar '(kp6-lookup ' ~ $.obj.emit_lisp ~ ' ' ~ $.index.emit_lisp ~ ')'
18:38 avar +==== ORIGINAL VERSION v6/v6-KindaPerl6/lib/Kinda​Perl6/Visitor/EmitLisp.pm 119057254756866
18:38 avar +   '(kp6-find-package ' ~ $.obj.emit_lisp ~ ' ' ~ $.index.emit_lisp ~ ')'
18:38 avar +==== THEIR VERSION v6/v6-KindaPerl6/lib/Kinda​Perl6/Visitor/EmitLisp.pm (/mirror/pugs) 119057254756866
18:38 pmurias joined #perl6
18:38 avar +   '(kp6-lookup (perl->cl ' ~ $.obj.emit_lisp ~ ') (perl->cl ' ~ $.index.emit_lisp ~ '))'
18:38 avar +<<<< 119057254756866
18:38 avar }
18:38 avar }
18:39 Aankhen`` (kp6-lookup (kp6-packages) (make-instance 'kp6-Str :value "GLOBAL") # did you modify KP6-LOOKUP to get that working?
18:39 avar pmurias: http://pugs.blogs.com/pugs/2007/08/playing-​with-th.html?cid=83743157#comment-83743157
18:39 lambdabot Title: Pugs: Playing with the new "Not Quite Perl", http://tinyurl.com/2hkd64
18:39 avar yes it now does cl->perl
18:39 Aankhen`` PERL->CL, you mean?
18:40 avar right
18:40 Aankhen`` FWIW, I think the PERL->CL ought to be in the call rather than the function itself.
18:41 pmurias avar: it's nice to get something which is faster for a change ;)
18:41 avar (defmethod perl->cl ((object kp6-Container) &key)
18:41 avar (kp6-value object))
18:41 avar +>>>> YOUR VERSION v6/v6-KindaPerl6/lib/KindaPer​l6/Runtime/Lisp/foreign.lisp (/local/pugs) 119057279827248
18:41 avar (defmethod perl->cl ((object string) &key)
18:41 avar -  object)
18:41 avar \ No newline at end of file
18:41 avar +  object)==== ORIGINAL VERSION v6/v6-KindaPerl6/lib/KindaPer​l6/Runtime/Lisp/foreign.lisp 119057279827248
18:41 avar +==== THEIR VERSION v6/v6-KindaPerl6/lib/KindaPer​l6/Runtime/Lisp/foreign.lisp (/mirror/pugs) 119057279827248
18:41 avar +
18:41 avar +(defmethod perl->cl ((object kp6-Array) &key)
18:41 avar +  (mapcar #'perl->cl (kp6-value object)))
18:41 avar +<<<< 119057279827248
18:41 pmurias avar: sbcl is the common list i should get to try it out?
18:41 Aankhen`` pmurias: It's an implementation of Common Lisp, and currently the recommended one, yes. :-)
18:41 avar I'm using clisp mostly
18:42 avar but that's because sbcl crashes my box;/
18:42 Aankhen`` avar is teh sux0rz, so he's using CLISP.
18:42 avar Aankhen``: we can pass 01-tap.t if you implement Code_infix<~>
18:43 Aankhen`` No prob, I'm just waiting for you to check in your changes.
18:43 avar yeah, doing that
18:43 Aankhen`` Did you note the
18:43 Aankhen`` Er.
18:43 Aankhen`` <Aankhen``> FWIW, I think the PERL->CL ought to be in the call rather than the function itself.
18:43 Aankhen`` That.
18:43 pmurias avar: it crashes your box or crashes on your box?
18:44 avar http://forum.slicehost.com/c​omments.php?DiscussionID=564
18:44 lambdabot Title: Slicehost Forum - sbcl lisp crashes the xen kernel
18:44 avar it crashes the kernel
18:45 avar Aankhen``: svn up
18:45 jisom joined #perl6
18:45 avar it doesn't work now,
18:45 Juerd And another router reboot. (WHY do these routers keep failing?)
18:45 Juerd afk
18:45 Aankhen`` OK.
18:45 avar I used your version where there were conflicts
18:45 Aankhen`` avar: Er, SVN UP tells me I'm at r18109.
18:46 Aankhen`` Is that yours?
18:47 avar urgh
18:48 dalek joined #perl6
18:48 avar I didn't make any commits apperently, both of those were conflicting;/
18:48 Aankhen`` Heh.
18:49 Aankhen`` I'll BRB, feel free to commit. :-)
18:49 avar I'll just overwrite some of your stuff:)
18:51 Aankhen`` "Noooooooooooooooooooooo" and all that.
18:53 Aankhen`` Some weird changes in there. o_O
18:53 avar indeed
18:55 Aankhen`` Also, why'd you comment out KP6-REMOVE-PACKAGE?
18:56 avar it wasn't used
18:56 Aankhen`` And what's with "kill all da abstraction"? :-P
18:57 avar CL-USER> (in-package #:Main)
18:57 avar #<PACKAGE MAIN>
18:57 avar MAIN> (kp6-apply-function (kp6-lookup (kp6-lookup (kp6-packages) (make-instance 'kp6-Str :value "GLOBAL")
18:58 avar ) (make-instance 'kp6-Str :value "Code_say")
18:58 avar ) (mapcar #'cl->perl (list (make-instance 'kp6-Str :value "foo")
18:58 avar (make-instance 'kp6-Str :value "bar")
18:58 avar )))
18:58 avar foobar
18:58 avar #<KP6-BIT #x000333F0D1F0>
18:59 Aankhen`` Dude.  Ugh.  You really have tried to kill all the abstraction, haven't you? :-\
18:59 Aankhen`` (Not a response to what you just pasted, BTW. :-)
19:00 zostay joined #perl6
19:01 avar tp://dev.pugscode.org/changeset/18114
19:02 avar so things "work" now but your way of doing it is probably better
19:03 avar so could you try reverting back the stuff that works while still having hello world work?:)
19:03 avar that would be awesome:)
19:05 [particle] joined #perl6
19:06 Aankhen`` Already done, just reviewing the changes and then committing. :-D
19:07 Aankhen`` I'm leaving the KP6-PACKAGES hack in for now, though.  We probably need a proper PERL->CL method to fix that, which I'll think about after.
19:07 avar yaya
19:07 avar I'm not for killing kp6-package abstractions as such, I just found it quicker to get it worknig by using kp6-hash :)
19:07 avar argh, lag
19:09 avar the emitter also needs something to convert a perl 6 value to a CL boolean (t/nil), for if {} else {}
19:09 avar currently if (exp) is always true
19:09 Aankhen`` Fair enough.
19:09 avar $ echo '0' | perl kp6-mp6-perl5.pl --lisp |grep kp6-Int
19:09 avar (make-instance 'kp6-Int :value )
19:09 Aankhen`` Hmm.
19:09 avar some screwup there too:)
19:10 Aankhen`` I see what you mean.
19:10 Aankhen`` That's probably more to do with incorrect if/else handling, though.
19:10 Aankhen`` Hold on, I b0rked something.
19:11 avar $ echo 'if (1) { say "foo" }' | perl kp6-mp6-perl5.pl --lisp |grep if
19:11 avar (if (kp6-value (make-instance 'kp6-Int :value 1)
19:11 avar needs kp6-true? or something like that there
19:12 Aankhen`` What is the output?
19:12 avar "foo" but it's always true even on if (0) {}
19:13 avar MAIN> (if 0 "is true")
19:13 avar "is true"
19:14 avar { if (::DISPATCH(::DISPATCH(::DISPATCH( $::Int, 'new', 1 )
19:14 avar ,"true"),"p5landish") )
19:14 avar that's how p5 does it,
19:14 avar so having a kp6-true in all classes is probably the way to do it
19:14 avar (perl->cl (kp6-true (make-instance 'kp6-Int :value 0)))
19:17 Aankhen`` All classes already have a BIT slot.
19:17 Aankhen`` Okay.
19:17 avar ah, right
19:17 Aankhen`` Still fixing here, though.
19:17 avar yeah, take yer time:)
19:18 Aankhen`` Heh.
19:18 Aankhen`` I'm not sure what happened.  It was working beautifully, but now it's b0rked. :-(
19:19 avar eek
19:21 avar maybe you typed `make' ?:)
19:23 ahmadz joined #perl6
19:28 devogon joined #perl6
19:34 ahmadz @seen svnbot ;-)
19:34 lambdabot I haven't seen svnbot.
19:37 Aankhen`` BLOODY X SERVER JUST DIED AND KILLED MY COMMIT MESSAGE
19:37 allbery_b *munch*
19:37 avar dude, run emacs in screen:)
19:38 allbery_b save early, save often?
19:39 Aankhen`` Whew, thank $DEITY for swap files.
19:39 Aankhen`` avar: Please to be updating.
19:39 Aankhen`` It's still a little hackish since the function object is opaque.
19:42 arrowax joined #perl6
19:44 avar well, it works:)
19:46 avar MAIN> (perl->cl (make-instance 'kp6-Str :value "Code_infix:<~>"))
19:46 avar "Code_infix:<~>"
19:46 avar gotta love it:)
19:47 * Aankhen`` wonders why 0 is turning into (make-instance 'kp6-Int :value )
19:47 Aankhen`` Oh yeah, I'd better add that.
19:48 Aankhen`` avar: It'll be called with two arguments each time, right?
19:49 avar if $num {} in the emitter?
19:49 Aankhen`` $.cond.emit_lisp # $.cond is turning into that weird MAKE-INSTANCE call.
19:53 rlb3_work joined #perl6
19:53 Aankhen`` avar: svn up, I added infix:<~>.
19:53 avar sweeet
19:53 * Aankhen`` goes to review the interpolation spec.
19:53 Aankhen`` Wherever that was…
19:56 avar cat t/01-sanity-modified/01-tap.t  | perl kp6-mp6-perl5.pl --lisp| clisp
19:56 avar :)
19:59 Aankhen`` Works?  Yay!
20:01 avar you can do 03-equal.t if you feel like global hacking:)
20:05 pmurias avar: 03-equal.t fails in kp6.perl5
20:05 pmurias avar: global like in the whole of kp6?
20:05 avar no, are you using kp6-kp6?
20:06 avar note that it's supposed to not ok those todo tests
20:06 avar pmurias: as in stuff in GLOBAL.lisp
20:06 avar which implements say, ==, !=, ~ and so on
20:06 pmurias ah it work
20:06 Aankhen`` I'm thinking about the implementation of infix:<~>, actually.
20:06 Aankhen`` What should it really return?
20:06 Aankhen`` A new Perl 6–land string, right?
20:06 * ahmadz thinks that http://feather3.perl6.nl/runpugs/ is ready for run.pugscode.org
20:06 lambdabot Title: Run Perl 6 Now -- in your browser!
20:07 avar Aankhen``: yes
20:07 Aankhen`` Okay.
20:07 avar it's easier that way, then user-defined functions can be done in the same facility
20:09 stevan_ joined #perl6
20:13 Aankhen`` Yeah.
20:19 avar (define-kp6-function "infix:<eq>" (&rest strs)
20:19 avar (string= (perl->cl (car strs)) (perl->cl (cadr strs))))
20:19 avar does this suck?
20:20 Aankhen`` Seems okay to me, except you might want to use FIRST and SECOND instead of CAR and CADR.
20:20 Aankhen`` It's clearer.
20:20 Aankhen`` Also, svn up.  You might have a conflict or two. :-)
20:20 avar right, forgot about first and second
20:21 avar b.t.w the tests file lists pugs tests
20:23 ahmadz what's the status of kp6 atm?
20:24 avar amazingly awesome
20:24 ahmadz kp6: my @foo = <foo 1 2 3>;
20:24 exp_evalbot r18123: OUTPUT[syntax error at position 8, line 1 column 8:␤my @foo = <foo 1 2 3>␤        ^ HERE␤]
20:25 avar use :=
20:25 ahmadz i was thinking since im finished with runpugs, i may lend a hand on kp6
20:26 ahmadz what's there todo?
20:26 ahmadz kp6: my @foo := <foo 1 2 3>;
20:26 exp_evalbot r18123: OUTPUT[syntax error at position 8, line 1 column 8:␤my @foo := <foo 1 2 3>␤        ^ HERE␤]
20:26 Aankhen`` avar: What do we need for 03-equal.t?
20:26 Aankhen`` infix:<&&> and infix:<||>?
20:27 avar and ne and eq which I'm doing
20:27 avar (define-kp6-function "infix:<eq>" (&rest strs)
20:27 avar (make-instance 'kp6-Bit (cl->perl (string= (perl->cl (first strs)) (perl->cl (second strs))))))
20:27 avar (define-kp6-function "infix:<ne>" (&rest strs)
20:27 avar (make-instance 'kp6-Bit (cl->perl (not (string= (perl->cl (first strs)) (perl->cl (second strs)))))))
20:27 avar The ~; format directive is not allowed at this point.
20:27 avar Current point in control string:
20:27 avar ~{~A~; ~}
20:27 avar |
20:27 avar [Condition of type SIMPLE-ERROR]
20:27 avar hrm
20:27 avar I get that on Runtime.lisp
20:28 Aankhen`` That's strange.
20:28 avar well, something it uses rather
20:28 Aankhen`` Works fine here. :-S
20:28 Aankhen`` Did it merge?
20:28 avar (defmethod perl->display ((object kp6-Array) &key)
20:28 avar (format nil "~{~A~; ~}" (kp6-value object)))
20:29 Aankhen`` Yeah, that line is fine.
20:29 Aankhen`` Your implementation obviously sucks.
20:29 Aankhen`` Or not.
20:29 Aankhen`` I'll fix.
20:30 avar :)
20:30 avar I don't get anything on svk pull
20:30 Jurre75 joined #perl6
20:31 Jurre75 hi all
20:31 Aankhen`` Oh, I wanted ~^, not ~;
20:32 * ahmadz is thinking what to do now on kp6
20:32 avar Jurre75: hi
20:33 avar ahmadz: do you (want to) know common lisp?:)
20:33 Jurre75 hi avar
20:33 avar hi
20:33 Blwood_ joined #perl6
20:33 ahmadz avar: im a bit good in java bytecode...
20:34 avar ahmadz: :)
20:34 avar well do whatever you like :)
20:35 ahmadz avar: the thing is i dont know where to start on kp6...
20:36 ahmadz avar: that's why i asked about its status
20:36 avar Aankhen``: did you commit eq/ne or what?
20:37 avar ahmadz: The question is too vague, anything in particular you're wondering about?
20:37 Aankhen`` avar: I thought you were committing those.
20:38 Aankhen`` I just committed || and &&.
20:38 ahmadz avar: what does it compile to, how much is finished, what needs to be done... outstanding bugs... etc?
20:39 Aankhen`` avar: KP6 doesn't seem to handle 0 at all. :-S
20:39 bengl joined #perl6
20:39 Aankhen`` say 0 # results in (make-instance 'kp6-Int :value )
20:40 Aankhen`` Er, that is, just 0 by itself results in that.
20:40 Aankhen`` And it carries on to anywhere it's used.
20:41 avar ahmadz: fglock is working on bootstrapping std, we're working on the cl emitter
20:41 avar the perl5 emitter is more complete
20:41 avar all sort of stuff needs doing:)
20:41 avar to be honest I don't have much of an idea:)
20:42 ahmadz lol
20:43 ahmadz avar: i wanted before to add kp6 support on runpugs and then i saw how much is implemented through trying some examples. So the idea got postponed for a while.
20:43 avar it's complete enaugh for runpugs IMO
20:43 avar Aankhen``: I'll do ne/eq
20:44 ahmadz kp6: my @f = <1 2 3>
20:44 exp_evalbot r18125: OUTPUT[syntax error at position 6, line 1 column 6:␤my @f = <1 2 3␤      ^ HERE␤]
20:44 ahmadz pugs: my @f = <1 2 3>
20:44 exp_evalbot OUTPUT[["1", "2", "3"]␤]
20:44 avar Aankhen``: 0 works in --perl, it's a --lisp problem
20:45 Aankhen`` Hum, hum, hum.
20:45 Aankhen`` svn up again, BTW. :-)
20:47 avar ah cl->perl is sufficient now?
20:47 Aankhen`` It was always sufficient, I just forgot about it.
20:47 ahmadz so lib\KindaPerl6\Visitor is the main dev area for new/existing emitters, right?
20:48 * Aankhen`` grins sheepishly.
20:49 avar ahmadz: yes
20:53 avar MAIN> (cl->perl nil)
20:53 avar #<KP6-ARRAY #x000333EDFDC0>
20:53 avar and:
20:53 avar NO-APPLICABLE-METHOD: When calling #1=#<STANDARD-GENERIC-FUNCTION CL->PERL> with arguments #2=(T), no method is applicable.
20:53 Aankhen`` Yes.
20:53 avar [Condition of type CLOS:METHOD-CALL-TYPE-ERROR]
20:53 Aankhen`` You need 'true and 'false respectively.
20:54 Aankhen`` 'FALSE is because of the lack of a separate falsity notation.
20:54 Aankhen`` NIL may indicate false or the empty list.
20:54 avar so I need to be doing (cl->perl (if (call) 'true 'false))
20:55 Aankhen`` I figured NIL as the empty list and 'FALSE for the other meaning (along with a corresponding 'TRUE) should be okay.
20:55 Aankhen`` Yeah.
20:55 Aankhen`` I could add T -> true, but that would be inconsistent with NIL -> empty list.
20:56 wolverian joined #perl6
20:56 * wolverian is a sad panda
20:57 Aankhen`` What's wrong?
20:57 avar (define-kp6-function "infix:<ne>" (&rest strs)
20:57 avar (let ((one (kp6-value (first strs)))
20:57 avar (two (kp6-value (second strs))))
20:57 avar (cl->perl (if (string= one two)
20:57 avar 'false
20:57 avar 'true))))
20:58 ahmadz avar: so an emitter is good enough if it passes most tests that perl5 emitter does, right?
20:58 avar sh-3.1$ cat t/01-sanity-modified/03-equal.t     | perl kp6-mp6-perl5.pl | perl -I lib-kp6-mp6-p5/
20:58 avar 1..4
20:58 avar ok 1
20:58 avar ok 2
20:58 avar ahmadz: no we're still working on the very basics
20:58 avar ok 3
20:59 avar ok 4
20:59 avar WOOT
20:59 Aankhen`` Yay.
21:00 Aankhen`` avar: What exactly did you do to check whether 0 is handled properly under the Perl backend(s)?
21:00 avar ahmadz: One thing you could help with if you want some grunt work is `make test-lisp` :)
21:00 Aankhen`` What would test-lisp do?
21:01 Aankhen`` I've been meaning to add a test suite, but that would be in Lisp.
21:01 avar uh no, it screws up too
21:01 Aankhen`` :-)
21:01 avar just compare echo '0'  | perl kp6-mp6-perl5.pl --perl and echo '0'  | perl kp6-mp6-perl5.pl --lisp
21:01 avar Aankhen``: hrm, why?
21:01 Aankhen`` ::DISPATCH( $::Int, 'new', )
21:02 Aankhen`` Missing third arg there.
21:02 avar yup
21:02 ahmadz avar: i know a bit of clisp from six years ago ;-)
21:02 Aankhen`` So it is KP6.
21:02 Aankhen`` ahmadz: CLISP is an implementation, CL is an abbreviation of Common Lisp. :-)
21:02 Aankhen`` avar: Why what?
21:02 avar sh-3.1$ echo '1' | perl kp6-mp6-perl5.pl --ast | perltidy | grep Val::Int
21:02 avar body => [ ::Val::Int( int => '1', ), ],
21:02 avar sh-3.1$ echo '0' | perl kp6-mp6-perl5.pl --ast | perltidy | grep Val::Int
21:02 avar body => [ ::Val::Int( int => '0', ), ],
21:02 avar sh-3.1$
21:03 avar rather both of the emitters are broken
21:03 avar Aankhen``: why write on in lisp and not test the .t files? to test internals?
21:03 Aankhen`` avar: Yes, I meant a test suite for the Lisp runtime in isolation.
21:03 Aankhen`` Mostly because I have a habit of breaking things, so a test suite to catch it would be useful.
21:04 Aankhen`` The main test suite's scope is broader than what I'm thinking of.
21:04 avar yeah sure
21:04 avar but once we have test-lisp working it'll be pretty hard to break things without it breaking .t stuff
21:05 Aankhen`` Point.
21:05 Aankhen`` I guess a separate test suite for the runtime would simply be redundant.
21:06 avar not completely, I sometimes wished there were C tests for perl core for intance, but most of the time testing the stuff it runs is suficcient
21:06 avar class Val::Int {
21:06 avar method emit_lisp {
21:06 avar "(make-instance \'kp6-Int :value " ~ $.int ~ ")" ~ Main::newline();
21:06 avar }
21:06 avar }
21:06 avar $.int is undef there
21:08 Aankhen`` Yup.
21:08 Aankhen`` It's never passed to any of the emitters.
21:08 avar ahmadz: that's one bug:)
21:08 wolverian no interpolation in kp6?
21:08 marmic joined #perl6
21:08 Aankhen`` Not yet, presumably.
21:08 ahmadz so how do i run the --lisp kp6 test suite?
21:09 avar manually, as of yet
21:10 ahmadz avar: what about if i want to test kp6 on parrot.. what's the cmd?
21:10 Aankhen`` There's a Parrot emitter, but I dunno how up-to-date it is…
21:10 Aankhen`` Probably --parrot to the script.
21:10 avar it fails
21:10 Aankhen`` Ah.
21:11 avar and writing that PIR assembly soup is boring
21:11 avar And to be quite honest I don't see the point, stuff like JVM, CL, .net and so on would be a much more mature and faster target for the forseeable foture:)
21:12 avar PGE maybe
21:12 ahmadz hmmm
21:13 ahmadz you got a point there, avar
21:16 [particle] the point is to support an open source virtual machine designed for dynamic languages imo
21:18 Aankhen`` avar: I think with my latest update the CL backend should have the best security of all; I changed the &set_secure_mode sub to push onto *features*, so unsafe code will be left out at compile-time. <G>
21:18 avar kewl
21:20 kjwcode joined #perl6
21:22 Aankhen`` avar: Are we pushing the limits of KP6 yet? ^_^
21:22 avar urgh, did you break 03-equal?
21:22 avar Break 1 MAIN[6]>
21:22 avar *** - EVAL: too few arguments given to KP6-STORE: (KP6-STORE 'KP6-X (MAKE-INSTANCE 'KP6-STR :VALUE ""))
21:22 avar The following restarts are available:
21:22 Aankhen`` Not that I know of.
21:23 Aankhen`` What the heck is 'KP6-X?
21:23 avar indeed
21:23 avar )) (perl->cl (make-instance 'kp6-Str :value "Code_infix:<!=>")
21:23 avar ))) (mapcar #'cl->perl (list kp6-x kp6-x)))
21:23 avar (kp6-apply-function (perl->cl (kp6-lookup (kp6-lookup *kp6-packages* (perl->cl (make-instance 'kp6-Str :value "GLOBAL")
21:23 avar )) (perl->cl (make-instance 'kp6-Str :value "Code_say")
21:23 avar ))) (mapcar #'cl->perl (list (make-instance 'kp6-Str :value "ok 4")
21:23 Aankhen`` No idea where that's coming from.
21:23 Aankhen`` Oh, that'd be $x.
21:24 Aankhen`` I'll take a stab at the Lisp side of storing variables.
21:24 avar oh what the shit
21:24 avar 20:58:47 < avar> sh-3.1$ cat t/01-sanity-modified/03-equal.t     | perl kp6-mp6-perl5.pl | perl -I lib-kp6-mp6-p5/
21:25 avar I was running it on p5 earlier
21:25 avar Aankhen``: cool
21:26 avar Aankhen``: I'm working on global.lisp atm
21:27 ahmadz perl kp6-mp6-perl5.pl --parrot < hello.pl
21:27 ahmadz Can't call method "keys" on unblessed reference at lib-kp6-mp6-p5//KindaPerl6/Visitor/EmitParrot.pm line 19, <> line 1.
21:28 Aankhen`` avar: I'm thinking we could store variables and functions in the same hash table since it's an EQUAL hash table.  So, for example, a function "foo" would be stored under the key: ('function "foo")
21:28 avar [particle]: Want to work on it?:)
21:28 Aankhen`` avar: Or maybe that could just be ('& "foo").  That might actually be a better idea.
21:28 avar It's Code_foo and such currently I think
21:28 Aankhen`` Yeah, I know.
21:28 avar but yeah, ('& "foo") sounds good
21:28 Aankhen`` Actually, what am I saying?  We don't need a list, we can just store it is "&foo".
21:28 Aankhen`` s/is/as/
21:29 avar I like the list idea better:)
21:29 avar You can also look through it check what the code values are structurally
21:30 Aankhen`` Not sure I follow.
21:30 avar ('& "foo") is structured data, "&foo" is not
21:31 Aankhen`` Actually, "&foo" is a vector of characters.
21:31 Aankhen`` But oh yeah.
21:31 Aankhen`` Sorry, I misunderstood. :-)
21:32 avar sure, make it "&foo" :)
21:32 Aankhen`` ('& "foo") seems better to me.
21:33 Aankhen`` We'd have to access the first element of a sequence and compare it anyway; '& is a symbol which is cheap to compare.
21:36 avar NO-APPLICABLE-METHOD: When calling #1=#<STANDARD-GENERIC-FUNCTION KP6-CL::PERL->DISPLAY> with arguments #2=(#3=#<KP6-BIT
21:37 avar #x000333E704E0>), no method is applicable.
21:37 avar urgh
21:37 * ahmadz thinks on updating the EmitterParrot.pm
21:37 Aankhen`` avar: How'd you end up with that?
21:37 avar If enough people think about it it'll happen says discworld logic
21:38 Aankhen`` Heh.
21:38 avar echo 'say "foo" eq "foo"' | perl kp6-mp6-perl5.pl --lisp  | clisp
21:38 Aankhen`` ahmadz: It might be a better idea, if you can, to help with KP6's parsing and AST overall.
21:38 Aankhen`` avar: Give me a moment, I'll check.
21:38 ahmadz avar: i will start on it tomorrow after a good night sleep, meanwhile ty avar, Aankhen''
21:38 Aankhen`` G'night.
21:39 * ahmadz is sick with flu
21:39 ahmadz cya all
21:39 ahmadz ahmadz &
21:39 Aankhen`` avar: Also, this: say $x
21:39 Aankhen`` Completely bypasses ::Var.
21:40 avar not according to --ast
21:41 Aankhen`` I added `print` statements to check.  It only touches ::Var for KP6.
21:41 cognominal_ joined #perl6
21:43 Aankhen`` How should a boolean true or false be represented?
21:44 Aankhen`` Okay, I'll use Bool::{True,False} for now.
21:45 avar does sbcl support | sbcl ?
21:46 Aankhen`` | sbcl?  What is that?
21:46 Aankhen`` Also, svn up.
21:46 Tene Aankhen``: accept code on stdin.
21:47 Aankhen`` Oh.
21:47 Aankhen`` Not sure.
21:47 Aankhen`` TIAS.
21:47 avar works now
21:47 avar yeah, it does
21:47 Aankhen`` avar: I'll need to fiddle with GLOBAL.lisp for the sigil thing.
21:48 avar wait a sec
21:48 Aankhen`` Hold on, I might just need functions.lisp
21:48 Aankhen`` Yeah, functions.lisp will do.
21:50 Aankhen`` Er, no.  I'll need GLOBAL too.
21:51 avar $ echo 'say 1 != 1' | perl kp6-mp6-perl5.pl --lisp | clisp | grep Bool -A5
21:51 avar MAIN[5]> Bool::False
21:51 avar #<KP6-BIT #x000333D0F480>
21:51 avar MAIN[6]>
21:51 avar Bye.
21:51 avar hrm
21:51 Aankhen`` The KP6-BIT is the return value.
21:52 bonesss joined #perl6
21:52 Aankhen`` Also, awesome, you implemented !=. :-)
21:52 avar svn up
21:53 avar done with global for now, implemented == and !=
21:53 Aankhen`` Okay.
21:53 Aankhen`` Mind if I clean it up a bit?
21:53 avar sure, do whatever:)
21:54 fglock joined #perl6
21:55 Aankhen`` Is == *only* for numeric comparison?
21:56 avar no, eq, == etc are broken in that regard now
21:56 avar they should do number context I guess
21:56 avar this works in the p5 emitter because it piggybacks on p5
21:57 avar sh-3.1$ echo 'say 1 == 1' | perl kp6-mp6-perl5.pl  | perl -I lib-kp6-mp6-p5/
21:57 avar 1
21:57 avar sh-3.1$ echo 'say "1" == 1' | perl kp6-mp6-perl5.pl  | perl -I lib-kp6-mp6-p5/
21:57 avar 1
21:57 fglock hi  # backlogging
21:58 avar { ::DISPATCH( $::Bit, 'new', (_int($_[0]) == _int($_[1])) ? 1 : 0) }  # infix:<==>
21:58 avar fglock: http://use.perl.org/articl​e.pl?sid=07/09/23/0414244
21:58 lambdabot Title: use Perl | Perl 6 to machine code via Common Lisp and sbcl
21:58 avar Aankhen``: we need an _int()
21:58 Aankhen`` Whatcha mean?
21:59 avar (define-kp6-function "infix:<==>" (&rest strs)
21:59 avar (let ((one (kp6-value (first strs)))
21:59 avar (two (kp6-value (second strs))))
21:59 avar (cl->perl (if (= one two)
21:59 avar 'true
21:59 avar 'false))))
21:59 avar that should be kp6-int-value or something like that
21:59 avar so "1" == 1 will work
21:59 avar it'll cause an exception in the lisp runtime currently because it ends up as (= "1" 1)
22:00 fglock avar: send to pugs.blogs.com too?
22:00 Aankhen`` avar: My latest commit sidesteps the issue entirely by using EQL, and therefore breaking for strings. :-)
22:00 avar I thought about it but I don't know how:)
22:01 Aankhen`` Possibly breaking, rather.
22:02 avar definetely breaking, there's not a 1:1 mapping between what eql considers equivalent and what perl6 should do
22:02 Aankhen`` Hmm, we're going to have problems if we ever decide to implement hashes keyed by objects.
22:02 avar (eql 3 3.0) => nil
22:02 Aankhen`` Yes.
22:02 Aankhen`` So right now, it's basically comparing object identity.
22:02 avar yup
22:02 Aankhen`` Perhaps EQUAL is a better fit.
22:03 Aankhen`` Done.
22:03 Jurre75 joined #perl6
22:04 avar Can you maybe make a stub (_int ) or whatever you call it
22:04 avar that does that, then it can be fixed later
22:04 avar That's a misnomer though since == does numbers, not ints..
22:05 Aankhen`` I'm not clear on what you're asking.
22:05 Aankhen`` You just want me to create a conversion function?
22:05 avar yeah, a defgeneric
22:05 Aankhen`` Okay.
22:05 avar then classes can implement their own ints..
22:06 avar well,     sub _int {
22:06 avar my $v = $_[0];
22:06 avar $v = ::DISPATCH( $v, 'int' )   if ref($v);
22:06 avar $v = ::DISPATCH( $v, 'FETCH' ) if ref($v);  # .int may return a Scalar
22:06 avar return $v->{_value}            if ref($v);
22:06 avar $v;
22:06 avar }
22:06 avar that's what the pm does
22:08 Aankhen`` I created a KP6-COERCE generic which takes an object and the class name to coerce it into.
22:08 Aankhen`` I put in one method for strings and 'integer.
22:09 Aankhen`` For coercing numbers in general into strings, we'll have to use an external library.
22:09 Aankhen`` (It's been checked in, BTW.)
22:09 avar add it to runtime.lisp?
22:10 Aankhen`` Whoops.
22:10 Aankhen`` Done.
22:11 Aankhen`` I can't do anything about the variable storage thing until the emitter uses ::Var objects.
22:11 avar maybe you should bug fglock ?:)
22:12 Aankhen`` Good idea.
22:12 fglock uh?
22:12 Aankhen`` fglock: Hi. KP6 appears to be bypassing the ::Var class when it's emitting Lisp (that I know of, probably the others as well) except for the package.
22:12 Aankhen`` So this: say $x
22:13 fglock re coerce, TimToady was talking about using .Int and .Str methods
22:13 Aankhen`` Only touches ::Var for the KP6 namespace.
22:13 fglock Aankhen``: looking
22:13 Aankhen`` Would be great, thank you. :-)
22:15 avar Who can fix svnbot?
22:15 Aankhen`` diakopter, I think.
22:23 fglock Aankhen``: the reason it doesn't use ::Var is because $x is global - try my $x
22:23 fglock globals are looked up in a hash
22:23 fglock because --lisp uses Namespace.pm
22:24 hoelzro joined #perl6
22:25 Aankhen`` Ah.
22:25 Aankhen`` Thanks, sorry for the false alarm. :-)
22:25 fglock see $ echo 'say $x' | perl kp6-mp6-perl5.pl --do Global,Namespace --ast | perltidy
22:33 Aankhen`` What do I do to get a coherent namespace out of $.namespace in ::Var?
22:33 Aankhen`` All I get right now is an ARRAY=foo.
22:35 fglock $.namespace is an array
22:35 Aankhen`` Of?
22:35 Aankhen`` I try @($.namespace) and it complains about using a string as an ARRAY ref.
22:35 fglock strings - split /::/
22:35 Aankhen`` Hmm.
22:36 fglock do you have a test case?
22:37 Aankhen`` One sec.
22:38 Aankhen`` Wait, I think it's complaining somewhere else.
22:38 Aankhen`` It seems to be trying to coerce the output of Var::emit_lisp into an array. O_O
22:39 Aankhen`` Line 133 of EmitLisp.pm...
22:40 fglock looking
22:42 Aankhen`` It's the generated one.
22:42 Aankhen`` I'm still narrowing it down.
22:42 hoelzro left #perl6
22:43 Aankhen`` Okay, better now.
22:56 dduncan joined #perl6
22:58 koye joined #perl6
23:14 Aankhen`` avar: svn up, I did some work on ::Var and ::Decl.  Now `my $x` doesn't blow up, though I haven't put in assignment yet.
23:14 Aankhen`` That's for tomorrow.  G'night.
23:23 avar urgh, he broke stuff again:)
23:33 fglock kp6: my @foo = <foo 1 2 3>;
23:33 exp_evalbot r18141: OUTPUT[[ 'foo', '1', '2', '3',  ]␤]
23:35 bsb joined #perl6
23:35 fglock &
23:58 zakame joined #perl6

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

Perl 6 | Reference Documentation | Rakudo