KindaPerl6 Common Lisp status update
A lot of work has been done on the KindaPerl6 Common Lisp backend for KindaPerl6 since I last 89wrote about it. Variables, subs, lexicals, closures, basic datatypes (int, str, num, hash, array, ..), control structures (if, for, while, ..) are working. We're missing user-defined classes & methods, some internal methods (sort, map, grep, ...), junctions, pairs, gather and probably some other things. Aankhen++ has been doing most of the work with the occasional contribution from myself.
Things sped up a bit recently after fax++ wrote a meta-object model (MOP) for us based on CLOS. The one in the Perl 5 backend does not use the Perl 5 object system (implements its own @ISA and so on) but so far it looks like we can build the Perl 6 MOP on top of CLOS which is more flexible.
A method in the MOP uses the same calling convention regardless of whether it's internal to the compiler or compiled from a user defined class. An example of an internal method using the new calling convention is the dispatch method that implements the .elems method for hashes:
(defmethod kp6-dispatch ((invocant kp6-Hash) interpreter (method (eql :elems)) &rest parameters)
"Returns the number of elements in the hash"
(declare (ignore parameters interpreter))
(make-instance 'kp6-Int
:value (hash-table-count (slot-value invocant 'value))))
In the case of %hash.elems this would be called as:
(kp6-dispatch (lookup-lexical-variable (kp6-generate-variable "%" "hash")) |Main| :elems)
The object system is used for pretty much everything. For example the .Str method is used to get the string representation of an object, .Int for its integer form, .true to check whether it wants to be true (used in all boolean contexts) etc. Not everything has been moved to the new system internally. Helping with that would be an easy beginner task.
Speaking of beginner tasks there's a lot more of them. And since we have MOP now implementing things is often just a matter of seeing how the Perl 5 backend does things and filling in the gaps in the Lisp backend.
We have some bugs like my @a; @a[123] = 456; which causes an error currently since the underlying CL array isn't extended properly. As well as a lot of things like substr() which are easy to implement but simply aren't at the moment.
So if you're interested in hacking a Perl 6 compiler in Perl 6 and Common Lisp head over to #perl6 and poke us for a commit bit.


Fascinating project. This is the shortest path that gives Perl the power of LISP. I hope you keep the updates coming!
Posted by: Richard Freytag | 2007.10.19 at 12:36 AM
Thanks for your support
Posted by: Alex | May 01, 2006 at 05:47 PM
The classic.goowy link is taking me to the same screen that tells me
I must download flash 8. HELP!
baadbobby
Posted by: R. Weaver | May 01, 2006 at 06:48 PM
Will we be able to use the website at all on May 3rd?
Posted by: Abby | May 01, 2006 at 09:17 PM
Many new people to comment the posts in this blog!... nice to see
though.
Any big updates in this maintenance?
Pls let us know...
Posted by: Madhu | May 01, 2006 at 11:52 PM
this suz i mean i really wanna use it but can u tell me wat ur gonna
install
Posted by: fullmetalkitty | May 02, 2006 at 11:44 AM
Do you have any plans to import calendar info from Outlook?
Posted by: Gail | May 02, 2006 at 01:45 PM
Nice site, but when its down its a great problem for me. Cool carry
on
Posted by: Arijit | May 02, 2006 at 09:30 PM
What, are you're hands broken or something? How long does it normally
take for you people to do these things?
Ugh!
Posted by: ... | May 03, 2006 at 12:08 PM
Thanks Alex for not disposing the classic goowy login feature
permanently. I really like the Flashy login feature very much due to
see thru email.
Pls dont del it in future too.
How abt a free sync of Goowy mail with OUTLOOK(pop/imap)?
Posted by: Madhu | May 05, 2006 at 04:37 AM
http://pharma4u.u.yuku.com/blog/post/id/401 buy cialis professional
http://proviagra.wikidot.com/ buy viagra professional
Posted by: trava | 2008.03.24 at 08:27 PM