This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


On May 31, 2012, at 12:19 PM, Charles Turner wrote:

Having perused the LOOP implementation of SBCL, I believe the
following CL features are required to implement it:

* packages - maybe not, but it will probably get tricky in terms of
collisions if this isn't available

Per, you've said that the guts of this are in there with namespaces. Could you give us some pointers about how you intended for CL packages to be layered on top of them?

* defmacro with both destructuring and environment keywords
* structures
* flet, labels

Scheme's let/letrec might be able to help us here, though we need to make sure that bindings are made in the function namespace.

For instance, in the past I've written this Scheme version of flet:

(define-syntax flet
  (syntax-rules ()
    ((_ ((fname parameters body ...) ...)
        e ...)
     (let ((fname (lambda parameters body ...)) ...)
       e ...))))

but that (let ((fname (lambda ...)))) doesn't do the right thing
for Lisp 2. So maybe we can just use them as a model for how to
write flet.java/FletExp.java.

* some more iteration bits, we have DO, so things like DOTIMES,
DOLIST, etc should be a breeze.
* SBCL makes heavy use of tagbodies and GO's, RETURN-FROM, which I
don't have yet
* SBCL makes use of exceptions, maybe I can reuse the exception
handling stuff from Scheme, as this feature would probably require a
lot of wokr
* FUNCALL

We already have #'apply in primitives.lisp, so I *think* this should work:
(defmacro funcall (fn &rest args) `(apply ,fn ,@args ()))


* hash tables. OF course, this is already available, just needs plumbing in
* Maybe some more conditional exprs, like case, ecase, etypecase


Seems like quite of work to get done before the midterm, I'm not sure
how deep the packages, environment keywords, FLET or BLOCKS will go.
Am I missing something here? A lot of this could be avoided by writing
it in Java, but I'd like to draw the line somewhere in terms of what
should be kept as Java code, and what should be moved out into
language libraries.

Perhaps the first version should be written in Java and then moved to Lisp after those missing pieces get filled in?

Per, how long did it take you to write the hooks for Scheme's let?

Charles.

-- Jamison Hope The PTR Group www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]