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