On Jun 26, 2005, at 11:48 PM, Faré wrote:
One option would be to do global program transformation to CPS (as in Screamer or UCW), some kind of ANF or even lower-level machine, and thus provide interruptible lightweight green threads. Are you interested in doing that?
ok, good. I understand. I'm doing a similar project for java, so I won't be able to contribute directly to your effort directly at this point.
Of course, it is "a little" more convenient to rewrite CL code into CPS, than it is to rewrite java byte-code. :(
--Sriram.
On Jun 26, 2005, at 11:48 PM, Faré wrote:
One option would be to do global program transformation to CPS (as in Screamer or UCW),
Yes CPS is the option I'm currently pursuing. But it is far from ideal (no pre-emption in standard functions for example). Eventually there will have to be some implementation hacking and/or CLRFI'ing...
some kind of ANF or even lower-level machine, and thus provide interruptible lightweight green threads.
Indeed.
Sriram Srinivasan wrote:
ok, good. I understand. I'm doing a similar project for java, so I won't be able to contribute directly to your effort directly at this point.
Of course, it is "a little" more convenient to rewrite CL code into CPS, than it is to rewrite java byte-code. :(
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)
(That is, if pre-emption is important for this operation.)
A compromise can be reached by using multiple threads with several of these "CPS processes" per thread. That's basically the road I plan to pursue first.
But I'm not sure what "my" Summer of Code student is going to do, or in fact who he/she is...
Kind regards,
Dirk Gerrits
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.
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.
Perhaps, it worth to create number of branchs with different approaches. It is experimental software (yet) anyway!
But I'm not sure what "my" Summer of Code student is going to do, or in fact who he/she is...
Well, I am not student at all :)
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