Subject: Re: Series. (was Re: About loops)
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/04/05
Newsgroups: comp.lang.lisp
Message-ID: <7ea5d2$si1b@fido.engr.sgi.com>
Stig Hemmer  <stig@pvv.ntnu.no> wrote:
+---------------
| Lieven Marchand <mal@bewoner.dma.be> writes:
| > Anybody aware of a language that has co-routines as a first class
| > supported concept? ...
| 
| Well, the obvious reference is SIMULA, anno 1967 or so.
+---------------

Or BLISS (1970), which had an "exchj(other_stack, value)" call. The CMU
BLISS tools included a thing called "POOMAS" ("POOr MAn's Simula") that
emulated a good deal of the Simula functionality with some macros and a
small library that sat on top of "exchj" (among other things). And using
BLISS-11 (1972) and "exchj", circa 1975 I wrote a toy multi-user operating
system in an afternoon[*].

And on a few architectures & C compilers [I mention both because both
matter], the C "setjmp()/longjmp()" can be used with no additional
assembly-language code to build coroutines [Unix kernel hackers should
be mumbling "resume()" right about now].  Circa 1982, Bakul Shah & I used
this to build a POOMAS clone in C [v.7 Unix PCC on an m68k], and then
used it for discrete simulation of multi-device DMA bus traffic in the
Fortune Systems 32:16. From the abstract of a talk I gave at the Spring
1984 USENIX:

	The toolkit, a library of C routines, comprises three conceptual
	layers (the user's simulation is the fourth), each reflecting some
	well-known design borrowed from other systems.  From the "bottom" up,
	they are:
	(1) Co-routines and process objects;
	(2) Condition variables and priority queues; and
	(3) A simulation kernel (the "clock" object and the "busy" statement).
	Co-routines and process objects are as in the BLISS language.
	Condition variables, priority queues, and the simulation kernel
	itself are from Holt's Concurrent Euclid. The overall idea of
	providing a simple skeleton for user-written simulations is from
	CMU's POOMAS package (POOr MAn's Simula).

But of course, these days one must mention Scheme's "call/cc", as well
as numerous Schemes & Lisps that have user-mode light-weight "threads"
of some sort...


-Rob

[*] Admittedly, it was pretty dumb -- no disk, no inter-user protection,
all the "commands" were compiled in (a la Xinu), etc. -- but we just *had*
to get something running in a hurry to demonstrate a stat-mux for a tradeshow,
and we didn't have a server we could carry with us, only a PDP-11 with 16KB
of core (yes, core!). The toy operating system allowed up to 8 people to
log in from remote terminals and execute a handful of shell commands (most
notably a stub "systat" that showed you who else was on and what they were
doing).

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-964-0811
Mountain View, CA  94043	PP-ASEL-IA