Continuations, Oberon

Soren Renner — 2000-05-02 20:32:19

I'm not sure what a continuation is exactly, but Mr. Thun, Joy's author, does, because in the standard Joy library is the following:

...

(* - - - - - C O M B I N A T O R S - - - - - *)

b == [i] dip i;
leftdist == [app2] dip ternary;
callcc == [conts rest rest] dip step;
callcc1 == [conts stack put rest rest] dip step;


callcc means "call with current continuation". So there is a continuation combinator.

It would be nice if we could share code. I wrote a toy VM for a language that by strange coincidence, serendipity, or perhaps synechdoche resembles Joy. This toy could not have been written in C, at least by me. I give total props to Oberon. Oberon is compiled, as fast as C++, typesafe, and garbage collected. (M.C.: post to start a gc/refcount squabble thread). Its syntax will pose no problem to anyone. The only tricky thing about Oberon is the environment, which has its own conventions about mouse usage, editing, and other things. (Here I am speaking of Oberon S3 in particular, particularly Native and Linux Native.) It has a mode-less GUI (i.e. no modal dialogues) which runs either in an X window (Linux Native) or as an OS on bare x86 hardware. Details may be found at http://www.oberon.ethz.ch/native/ . If a few of us could download Oberon and set it up, I could easily post an .Arc (Oberon archive format) file with the toy VM.

Here's a T-shirt concept: (front) Its just one d*** thing after another...
(back) concatenative languages mailing list

sr

iepos@tunes.org — 2000-05-03 16:40:11

> I'm not sure what a continuation is exactly, but Mr. Thun,
> Joy's author, does, because in the standard Joy library is the following:
>
> ...
>
> callcc == [conts rest rest] dip step;
> callcc1 == [conts stack put rest rest] dip step;

That's interesting... I'd never noticed that before.
The core primitive at work seems to be "conts". But, it doesn't
seem to be working right on my (Linux i386) system. I suspect that
maybe "conts" is supposed to push the list of pending primitive programs.
I could be wrong, though. On my system, it does roughly that, except that
the very next primitive word is skipped, and the rest are all lumped
together. For instance,

conts 1 2 3 + + . .

gives me:

6
[[2 3 + +]]

I get a segfault when I do just "conts" by itself...

> It would be nice if we could share code. I wrote a toy VM for a
> language that by strange coincidence, serendipity, or perhaps
> synechdoche resembles Joy.

Cool...

> Details may be found at http://www.oberon.ethz.ch/native/ .
> If a few of us could download Oberon and set it up, I could easily
> post an .Arc (Oberon archive format) file with the toy VM.

All right... I'll have to take a look at Oberon...
I've never used it before...

- Brent Kerby ("iepos")

Massimo Dentico — 2000-05-04 21:14:43

A short introduction to continuations:

"Continuations Made Simple and Illustrated"
by Denys Duchier

- http://www.ps.uni-sb.de/~duchier/python/continuations.html

--
Massimo Dentico