[erlisp-devel] Lightweight processes

Dirk Gerrits dirk at dirkgerrits.com
Mon Jun 27 13:38:21 UTC 2005


> 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



More information about the Erlisp-devel mailing list