# Status of Cat and CVML

## Christopher Diggins — 2008-12-30 17:51:20

    Quick Cat/CVML update.

    I am currently working on the next generation of Cat, which will use

    the Cat virtual machine language (CVML). CVML is an optimizing

    bytecode compiler developed from scratch in C++ and is hosted at

    http://cvml.googlecode.com The current version is not yet ready for

    public consumption (undocumented, fragile, and non-portable). It is

    going be used as the back-end for the next Cat interpreter version.

    I am also working on adding portable continuations to Cat and CVML. I

    expect to have the first prototype done by mid-February at the latest.

    There are opcodes being introduced into the bytecode to allow

    continuations (implemented by cloning the current VM state) to be

    created, cloned, and serialized over a stream or network. In addition

    I am adding an event passing mechanism to allow VM instances to

    communicate safely and asynchronously.

    I am also working on a paper for LCTES 09 about using CVML to generate

    compact byte-code. From my preliminary results CVML appears to be

    significantly smaller (space savings of 50% or more) over other

    byte-codes. Anyone interested in reviewing please drop me a line.

    - Christopher

## William Tanksley, Jr — 2008-12-30 19:39:29

    Christopher Diggins <cdiggins@...> wrote:

     > I am also working on adding portable continuations to Cat and CVML. I

    > expect to have the first prototype done by mid-February at the latest.

    > There are opcodes being introduced into the bytecode to allow

    > continuations (implemented by cloning the current VM state) to be

    > created, cloned, and serialized over a stream or network. In addition

    > I am adding an event passing mechanism to allow VM instances to

    > communicate safely and asynchronously.

     Nice! Parallelism will be important, and it looks like this might

    possibly help that.

    OTOH, I'm curious -- have you looked at partial continuations?

    http://en.wikipedia.org/wiki/Delimited_continuation

    "Unlike regular continuations, delimited continuations return a value,

    and thus may be reused and composed."

     > - Christopher

     -Wm

## Christopher Diggins — 2008-12-30 21:31:46

    On Tue, Dec 30, 2008 at 2:39 PM, William Tanksley, Jr

    <wtanksleyjr@...> wrote:

     > Christopher Diggins <cdiggins@...> wrote:

    >> I am also working on adding portable continuations to Cat and CVML. I

    >> expect to have the first prototype done by mid-February at the latest.

    >> There are opcodes being introduced into the bytecode to allow

    >> continuations (implemented by cloning the current VM state) to be

    >> created, cloned, and serialized over a stream or network. In addition

    >> I am adding an event passing mechanism to allow VM instances to

    >> communicate safely and asynchronously.

    >

    > Nice! Parallelism will be important, and it looks like this might

    > possibly help that.

    >

    > OTOH, I'm curious -- have you looked at partial continuations?

    >

    > http://en.wikipedia.org/wiki/Delimited_continuation

     Yeah, I am not a huge fan of delimited continuations. They are quite

    messy and unstructured.

     > "Unlike regular continuations, delimited continuations return a value,

    > and thus may be reused and composed."

     Well this wikipedia entry is not entirely accurate. For example in C++

    all programs return a value, so a continuation in a C++ program would

    theoretically return a value (if we were allowed to have continuations

    in C++ of course).

    I do plan on allowing continuations to return values because all Cat

    programs return a stack with a single value on the top. This means

    that Cat continuations (in fact any Cat program) can be composed

    together.

    Another related feature I am working on for CVML is the ability to

    chain programs together, and pipe the output from one into the input

    of another as you can within Unix shells.

     >> - Christopher

    >

    > -Wm

## John Nowak — 2008-12-31 05:30:58

    On Dec 30, 2008, at 4:31 PM, Christopher Diggins wrote:

     > Yeah, I am not a huge fan of delimited continuations. They are quite

    > messy and unstructured.

     Have you read Queinnec's "A library of high level control operators"?

    It contains several approaches that I consider nicer than shift/reset:

        http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29.4790

     > all Cat programs return a stack with a single value on the top.

     They do? I'm not sure what you mean by this.

    - John