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.
pugs_svnbot r18174 | azawawi++ | [k6-parrot] Lit::Code implemented, new String "Hello world", shows up ;-) 02:00
diff: dev.pugscode.org/changeset/18174
lambdabot Title: Changeset 18174 - Pugs - Trac
tewk Is there a pseudo perl6 rules implementation in perl5? 02:49
tewk How old is search.cpan.org/~dconway/Perl6-Rule.../Rules.pm? 02:50
lambdabot Title: Perl6::Rules - Implements (most of) the Perl 6 regex syntax - search.cpan.org
dduncan tewk, I believe there is something newer and more complete ... looking ... 03:26
tewk, look at search.cpan.org/dist/Pugs-Compiler-Rule/ 03:27
lambdabot Title: Agent Zhang (&#31456;&#20134;&#26149;) / Pugs-Compiler-Rule - search.cpan.org
dduncan that's what you want, afaik ... though it is possible that it is about to be superceeded by something else ... or not, but its quite regularly maintained none the less 03:28
ahmadz @tell fglock "should EmitParrot.pm emit PIR directly or should it use a Parrot Runtime like lisp/Perl5..?" 05:24
lambdabot Consider it noted.
dduncan @tell tewk look at search.cpan.org/dist/Pugs-Compiler-Rule/ for Perl 6 rules in Perl 5 05:54
lambdabot Consider it noted.
fax ?eval [~] <m oo se> 09:33
masak #pugs [~] <m oo se> 09:43
hm, seems to be no-bots day today... 09:44
fax I tried in pugs :D
Have learned <m oo se>
Aankh|Clone ?kp6 "hello" 09:49
lambdabot "hello"
Aankh|Clone waves at fax.
fax ?kp6 reverse "!ih"
lambdabot reverse "!ih"
buubot lambdabot: "hi!"
Aankh|Clone I'm not sure much works on KP6 yet though. 09:50
pugs_svnbot r18175 | pmurias++ | [kp6] initial rules2c 12:55
diff: dev.pugscode.org/changeset/18175
lambdabot Title: Changeset 18175 - Pugs - Trac
pugs_svnbot r18176 | avar++ | r65542@t: avar | 2007-09-26 13:53:13 +0000 13:55
r18176 | avar++ | More operatiors: < > <= >= + - * / length
diff: dev.pugscode.org/changeset/18176
lambdabot Title: Changeset 18176 - Pugs - Trac
avar Aankh|Clone: hi 14:01
pmurias avar: hi 14:12
avar bye... 14:16
pmurias avar: had to turn the computer off for testing if our power sockets are properly grounded 14:36
avar pmurias: hi 14:37
pmurias is there a portable equivalent of gcc's ({}) 14:40
?
pmurias it's the c equivalent of do {} 14:42
avar pmurias: no 14:42
pmurias avar: thanks 14:43
avar if you're thinking of macros you'll have to write a function
pmurias avar: i use it for declaring temporary variables for storing the position in alteration 14:44
Rule::Or in lib/KindaPerl6/Visitor/TokenC.pm 14:45
declaring a lot of variable at the function start should also work but it's troublesome 14:47
[particle] declare an array 14:54
pmurias a stack should work, but would introduce a performace penalty 14:56
a performace penalty is to big a word 14:57
* too big a phrase
[particle] you can optimize later... just get it working and maintainable 14:59
avar or you could depend on gcc:) 15:00
pmurias does anyone here not use gcc? ;) 15:05
avar Only traitors
[particle] me, but i haven't been doing any kp6 dev lately... tried, but make doesn't work on win32 either and i haven't tried to fix it 15:06
fglock_ [particle]: kp6 works without make 15:09
avar fglock_: No, you need GNU make 15:10
..if you want to develop it anyway 15:11
fglock_ dependencies-- 15:11
Aankh|Clone avar: You rang? 15:21
fglock_ pmurias: how about s/TokenC/EmitTokenC/ 15:23
avar Aankhen``: fleh 15:29
Aankhen`` What do you mean "fleh"?
Aankhen`` wants a Mercurial mirror. 15:34
avar isn't that evil pythoon? 15:40
Aankhen`` It's gooooooooood Python.
pmurias fglock_: ok 15:47
TokenC isn't a good name
pugs_svnbot r18177 | pmurias++ | [kp6] c rules return a match 15:53
r18178 | pmurias++ | [kp6] missing files
diff: dev.pugscode.org/changeset/18178
lambdabot Title: Changeset 18178 - Pugs - Trac
avar I think "my" should be called "may" 15:55
may $res = 0; reads better
.o O ( oh so this is why it's failing, Aankhen`` sucks ) 15:56
:)
pmurias avar: what should "our" be called 15:58
pugs_svnbot r18179 | pmurias++ | [kp6] TokenC -> EmitTokenC
r18180 | pmurias++ | [kp6] - missing file
diff: dev.pugscode.org/changeset/18180
lambdabot Title: Changeset 18180 - Pugs - Trac
pmurias ? ;)
fglock_ have $it = 1 15:59
avar pmurias: "mah"
pugs_svnbot r18181 | avar++ | r65546@t: avar | 2007-09-26 16:06:36 +0000 16:07
r18181 | avar++ | Support for stringify and numify
diff: dev.pugscode.org/changeset/18181
lambdabot Title: Changeset 18181 - Pugs - Trac
fglock_
.oO( stringification and mummification
16:11
avar Aankhen``: sh-3.1$ echo '0 && say "not ok"' | perl kp6-mp6-perl5.pl --lisp | sbcl 2>/dev/null | grep ok 16:18
* not ok
sh-3.1$ echo '1 && say "not ok"' | perl kp6-mp6-perl5.pl --lisp | sbcl 2>/dev/null | grep ok
* not ok
TimToady avar: there is no length function in Perl 6; you probably want chars there instead. 16:27
avar TimToady: There is now! 16:28
>:)
Aankhen`` avar: I'm busy, stop bothering me! 16:34
TimToady nobody on irc is really busy, by definition 16:36
avar Aankhen``: IMPLEMENT 16:37
Aankhen`` avar: I've been working on something rather big since yesterday. 16:38
I think I'll be ready to land it soon.
(It's not all that big conceptually, but it took a long time to think it through and implement it, and I'm still not sure I've got it right.)
avar what? 16:39
PerlJam avar: the magic perl 6 compiler of course!
Aankhen`` avar: Basically creating a kp6-interpreter class that encapsulates an entire P6 world.
PerlJam Aankhen``: ala smalltalk? 16:40
Aankhen`` avar: Needless to say, creating the class is easy, implementing the encapsulation is not. :-)
PerlJam: I don't have a lot of experience with Smalltalk, so I'm not sure.
PerlJam: It's not an image, though, AFAIK.
avar PerlJam: We are doing that!
Aankhen`` Heh, I like how I say "I don't have a lot of experience" to indicate that I've never touched Smalltalk. 16:41
avar Job interview reflex?
Aankhen`` Never had one!
Lots of practice in embellishing the truth, though.
PerlJam That's always a good skill.
Aankhen`` Yup.
I'm an excellent liar.
I'd make a great lawyer.
[particle] now perljam is embellishing... 16:42
Aankhen`` PerlJam: I just realized that actually, we can already save images. 16:43
PerlJam Once, while on a trip to my parent's house in Louisiana with a friend, he asked me about some structure he saw in the swamp. I didn't know what it was, but I made a quick assessment and came up with what I thought was a plausible explanation, and then I told him as if I knew exactly what I was talking about.
Aankhen`` Most CL implementations let you save an image.
(SBCL being a case in point.)
Aankhen`` That functionality isn't exposed at present, however. 16:44
(By KP6-CL, I mean.)
avar How would it be exposed? 16:46
pugs_svnbot r18182 | avar++ | r65553@t: avar | 2007-09-26 16:45:24 +0000
r18182 | avar++ | Made := work, more tests pass
diff: dev.pugscode.org/changeset/18182
lambdabot Title: Changeset 18182 - Pugs - Trac
avar Well we have a machine code compiler currently based on sbcl's image saveing
Aankhen`` avar: &save_perl_and_die? <G>
avar why do you want that? 16:49
all the tests that currently fail are due to &&, ||, if and unless not knowing perl truth;/ 16:50
well, the ones that don't fail to compile.. 16:51
Aankhen`` avar: What'd you do to make := work? 16:56
avar see commit
no idea if that's correct though
Aankhen`` Ah, I'd tried that too. 16:57
avar and?
Aankhen`` It only assigns, not binds.
avar what's the difference?
ah, the VAR() won't get copied?
Aankhen`` my $x = "abcd"; my $y := $x; $y = "efgh"; # $x is still "abcd"
pmurias binding is VAR($var) = ...; 16:58
Aankhen`` I thought about it, and my idea was that entries in the variable tables should point to cells rather than kp6-* values.
(Completely untested and unimplemented, of course. It just came up. :-)
pmurias Aankhen``: cells == containers? 17:00
Aankhen`` pmurias: Er, possibly. I'm not sure I have the right terminology. 17:01
But yeah, that'd make sense.
So which wheel did I mentally reinvent this time?
pmurias Aankhen``: it's done that way in kp6 17:02
Aankhen`` pmurias: Ah, okay. 17:03
pmurias how should i make the c rules avalible from p6
XS?
avar You can use the cl-ffi interface:) 17:09
but more seriously it isn't (going to be) specced 17:10
fglock_ pmurias: just compile everything to C - examples/kp6-example.c is a quick experiment
avar well then you'd need a full C emitter 17:11
fglock_ it even looks like lisp: ( fetch_by_key( return_obj, METH_name ) ))( return_obj, "" ) 17:12
avar maybe lisp with your crazy coding style:) 17:13
lichtkind it is normal that i dont see any pugsshell at run.pugscode.org/ 17:14
lambdabot Title: Run Perl 6 Now -- in your browser!
lichtkind my js is on
pmurias fglock_: i haven't considered compiling everything to c, i would rather finish a small thing then start a big one 17:18
avar You could use it with the perl5 emitter and xs 17:20
Aankhen`` Is there no way to access the compilation unit from an AST node? 17:24
fglock_ or Inline::C
Aankhen``: you mean the root node?
Aankhen`` fglock_: I guess so, assuming a ::CompUnit is always the root node. 17:25
I'd like to store some data in the ::CompUnit and access it from nodes within that.
fglock_ KindaPerl6::Traverse passes a $path argument around, which is an array with the parent nodes 17:26
this is untested
Aankhen`` I'll get that in the implicit @_ of &emit_lisp?
fglock_ problem is, emit_lisp() is called everywhere, so you have to pass the arguments yourself 17:27
Aankhen`` Okay. 17:28
Sounds irritating, but ah well.
avar * sh-3.1$ echo 'if "0" { say "true" } else { say "false" }' | perl kp6-mp6-perl5.pl --lisp | sbcl 2>/dev/null | egrep "true|\
false"
* false
sh-3.1$ echo 'if "1" eq "0" { say "true" } else { say "false" }' | perl kp6-mp6-perl5.pl --lisp | sbcl 2>/dev/null | egrep "\
true|false"
* true
(defmethod kp6-Bit ((self kp6-Str))
(not (= (perl->cl (kp6-Num self)) 0)))
s
(defmethod kp6-Bit ((self kp6-Bit)) doesn't work however 17:29
Aankhen`` Oh, ::CompUnit's signature just mentions a $arg_secure
avar: What the heck are you doing?
fglock_ EmitLisp takes control out from Traverse.pm and does everything itself
avar I'm trying to fucking8 implement a concept of truthness
Aankhen`` avar: See Num.lisp to see how to do it.
Aankhen`` fglock_: Oh. 17:30
avar (defmethod initialize-instance :after ((obj kp6-Num) &key)
(when (= (kp6-value obj) 0) (setf (kp6-bit obj) nil)))
(defmethod (setf kp6-value) :after (val (obj kp6-Num))
(when (= val 0) (setf (kp6-bit obj) nil)))
what the hell does that do?
Aankhen`` fglock_: Any particular reason for that?
avar umm
Aankhen`` avar: Basically keeps the BIT slot up-to-date, which is supposed to be used when checking for truth.
avar: The first one runs after the creation of a new KP6-NUM object, and sets the BIT slot to NIL (i.e. false) when the value of the number is 0. 17:31
fglock_ Aankhen``: EmitLisp is not really an AST transform, it just reuses the AST-plugin API for convenience
avar bit is 1 or 0?
Aankhen`` avar: The second one runs whenever the value is set, and does the same thing.
avar: T or NIL.
fglock_: Ah.
avar riht 17:33
right
s/bit/bool/ maybe
Aankhen`` avar: The spec says every object has a .bit attribute that's used to check for truth.
fglock_: I just realized that since it calls emit_lisp manually anyway, I might as well pass the data I need there. 17:34
fglock_ yes
Aankhen`` Now, what should I do to generate a suitably random name in Perl… 17:36
fglock_ Aankhen``: more complex things, like node reordering, can be implemented as AST transforms in a separate visitor
Aankhen`` Kewl. 17:37
avar: Any ideas? 17:38
avar: Need random name!
fglock_ Aankhen``: you can use a class variable (for sequential numbers), or add a subroutine to the Main namespace in the Perl5 runtime 17:38
Aankhen`` Hmm, I'll try the former. 17:39
fglock_ see Runtime/Perl5/MP6Runtime.pm:267
home & 17:43
pugs_svnbot r18183 | avar++ | r65555@t: avar | 2007-09-26 18:07:09 +0000 18:07
r18183 | avar++ | make (kp6-bit on bits work, this makes if work
diff: dev.pugscode.org/changeset/18183
lambdabot Title: Changeset 18183 - Pugs - Trac
avar Aankhen``: I have no idea why && and || fail
* sh-3.1$ echo '1 == 2 && say "shit"' | perl kp6-mp6-perl5.pl --lisp | sbcl 2>/dev/null |grep shit 18:08
* shit
avar MAIN> (kp6-bit (make-instance 'kp6-Bit :value 0)) 18:10
NIL
MAIN> (kp6-bit (make-instance 'kp6-Bit :value 1))
1
MAIN> (kp6-bit (make-instance 'kp6-Bit :value 2))
2
M
[particle] kp6 -Ocurses 18:11
avar (define-kp6-function "infix:<&&>" (&rest operands) 18:12
(if (null operands)
(cl->perl 'true)
(if (kp6-bit (first operands))
(call-kp6-function "infix:<&&>" (cdr operands))
(cl->perl 'false))))
KP6-CL> (kp6-bit (cl->perl 'false)) 18:13
NIL
KP6-CL> (kp6-bit (cl->perl 'true))
1
K
should be working, but isn't
Aankhen`` avar: I fail to understand why you ignored coerce.lisp and wrote all that stuff instead. :-S 19:38
pugs_svnbot r18184 | lwall++ | [STD] closer to running again with new autolexer 20:04
diff: dev.pugscode.org/changeset/18184
lambdabot Title: Changeset 18184 - Pugs - Trac
pmurias how should emitters which emit multiple files be handled? 20:10
Aankhen`` Sorry in advance for the gigantic commit. 20:13
All this stuff got mixed up inextricably.
avar: Not to worry, though, I took into account your commits too.
Aankhen`` Now I have to fix stuff. 20:14
pugs_svnbot r18185 | Aankhen++ | [kp6-lisp]
r18185 | Aankhen++ | * implemented self-contained interpreters; this required a lot of reworking and affected many files. some things currently broken.
r18185 | Aankhen++ | * removed KP6-STR and KP6-NUM methods in favour of KP6-COERCE.
r18185 | Aankhen++ | * added util.lisp containing WITH-UNIQUE-NAMES and DEFINED.
r18185 | Aankhen++ | * added some error handling for package functions.
r18185 | Aankhen++ | * removed unnecessary INITIALIZE-INSTANCE :AFTER on KP6-BIT class.
r18185 | Aankhen++ | * stick Runtime.lisp code within a WITH-COMPILATION-UNIT.
r18185 | Aankhen++ | * don't always call COMPILE-FILE on Runtime.lisp
r18185 | Aankhen++ | * fixed report functions for KP6-WARNING and KP6-ERROR condition classes.
r18185 | Aankhen++ | * changed error functions to take a condition designator as the first argument.
r18185 | Aankhen++ | * CL->PERL should populate KP6-BITs with T and NIL.
r18185 | Aankhen++ | * added some error handling in functions.lisp 20:15
diff: dev.pugscode.org/changeset/18185
lambdabot Title: Changeset 18185 - Pugs - Trac
Aankhen`` Hmm, for some reason, EmitParrot.pm seems to be regenerated for me each time I run `make`. 20:20
pugs_svnbot r18186 | Aankhen++ | * [kp6-lisp] assigning to variables works again.
diff: dev.pugscode.org/changeset/18186
lambdabot Title: Changeset 18186 - Pugs - Trac
pmurias Aankhen``: why do you store the bool value in an attribiute, rather then determine it based on the content 20:36
?
pugs_svnbot r18187 | Aankhen++ | * [kp6-lisp] commented out autovivification of globals for now. 20:38
diff: dev.pugscode.org/changeset/18187
lambdabot Title: Changeset 18187 - Pugs - Trac
Aankhen`` pmurias: Just going by S02… 20:40
"Unlike in Perl 5, objects are no longer always considered true. It depends on the state of their .bit property. Classes get to decide which of their values are true and which are false. Individual objects can override the class definition" 20:41
pmurias seen it
buubot pmurias: Sorry, I haven't seen it
pmurias buubot--
buubot pmurias: is the module loaded?
pmurias Aankhen``: seen that paragraph 20:42
i don't think it referes to an actual $.bit slot
Aankhen`` Oh.
pmurias return 0 but True;
is used instead of an assignment 20:43
i could be wrong ;)
TimToady it should probably be the .true method instead of the .bit method
Aankhen`` Okay.
Aankhen`` will get to it after figuring out why "Argument X is not a number: NIL". 20:44
Ohh, durr. 20:45
pugs_svnbot r18188 | Aankhen++ | * [kp6-lisp] removed a few unneeded functions in GLOBAL.lisp 20:47
diff: dev.pugscode.org/changeset/18188
lambdabot Title: Changeset 18188 - Pugs - Trac
Aankhen`` TimToady: So it's a proper method rather than a slot?
pugs_svnbot r18189 | Aankhen++ | * [kp6-lisp] added coercion for KP6-BIT.
r18190 | Aankhen++ | * [kp6-lisp] fixed PERL->DISPLAY for KP6-BITs.
diff: dev.pugscode.org/changeset/18190
lambdabot Title: Changeset 18190 - Pugs - Trac
pugs_svnbot r18191 | Aankhen++ | * [kp6-lisp] replaced KP6-BIT with KP6-TRUE method. 20:53
diff: dev.pugscode.org/changeset/18191
lambdabot Title: Changeset 18191 - Pugs - Trac
Aankhen`` avar: Found the problem. 21:11
No lazy evaluation (at least at present). :-|
It returns false, but both arguments are evaluated first anyway.
I'm going to call it a night as far as the KP6 hackery goes. 21:13
pugs_svnbot r18192 | Aankhen++ | * [kp6-lisp] s/kp6-bit/kp6-true/g in GLOBAL.lisp
r18193 | Aankhen++ | * [kp6-lisp] pass -f rather than -v to rm in compile_tests_kp6_mp6-lisp.pl
diff: dev.pugscode.org/changeset/18193
lambdabot Title: Changeset 18193 - Pugs - Trac
TimToady Aankhen``: there's no requirement that .true be implemented as an attribute. We're just basically saying that all types do the Bool interface 21:18
Aankhen`` Okay.
Eidolos w 22 21:19
Aankhen`` 23 is better.
Eidolos no way! :)
Aankhen`` 24?
[particle] 21... blackjack! 21:20
Aankhen`` Bah. 21:21
Cheater.
avar how do I blog at pugs.blogs.com ? 22:56
avar finally gives up on svk 23:03
arg what the crap 23:06
pugs_svnbot r18194 | avar++ | r65568@t: avar | 2007-09-26 23:06:48 +0000 23:08
r18194 | avar++ | tabs to spaces
diff: dev.pugscode.org/changeset/18194
lambdabot Title: Changeset 18194 - Pugs - Trac
avar sees that aankhen isn't running tests 23:16
pugs_svnbot r18195 | avar++ | Define a Main function for the program (again), this is required for the sbcl image dumper to work 23:23
diff: dev.pugscode.org/changeset/18195
lambdabot Title: Changeset 18195 - Pugs - Trac