[erlisp-devel] Lightweight processes
Dirk Gerrits
dirk at dirkgerrits.com
Thu Jun 30 07:46:49 UTC 2005
Ivan Boldyrev wrote:
> On 9153 day of my life Dirk Gerrits wrote:
>
>>The biggest problem with CPS in CL is (as far as I'm concerned) that you
>>can only do it to your own code, and not the implementation's. So in
>>CPS-Erlisp you'll probably want to write
>>
>>(loop for x in very-long-list
>> collect (f x))
>>
>>rather than
>>
>>(mapcar #'f very-long-list)
>
>
> Well, MAPCAR is easy to reimplement.
Yes, but it is also easy to avoid.
> Perhaps, it worth to implement special package ERCL, where such
> reimplemented functions will reside. And force users to use only that
> functions in Erlisp programs.
>
> ,----
> | (in-package #:ercl-user)
> |
> | (defun test (f list)
> | (mapcar f list))
> `----
>
> Here DEFUN and MAPCAR are symbols from ERCL package, not CL.
>
> Erlisp will contain large subset of CL with some extenstions.
I have considered and rejected this approach.
It's a lot of work (even when borrowing the code from an open-source
Lisp implementation) and one gains very little. (More pre-emption in
standard Common Lisp functions.) Also, this still won't fix all the
other libraries out there that use :CL, not :ERCL.
> Perhaps, it worth to create number of branchs with different
> approaches. It is experimental software (yet) anyway!
Certainly. Different branches/subdirectories/whatever can be used to
try several strategies at once.
Right now I'm experimenting with a CPS+trampolining approach on my
laptop. At this point I don't know if it's going to work at all, so I
haven't uploaded it yet. Once I'm more confident that it could be made
to work I'll upload my patches.
Kind regards,
Dirk Gerrits
More information about the Erlisp-devel
mailing list