This patch implements native extensions and continuations as pmcs. It also
cleans up the existing Sub and Coroutine types, and removes the following
now-obsolete ops:

callco
callcc
capturecc
call
callnative

These are all handled through various uses of "invoke" (see t/pmc/sub.t
for simple examples).  The patch also fixes some GC unfriendliness issues
with stack-copying for continuations.

Good things:

- less ops
- maybe even less lines of code

Things that could be better:

- it fixes stack-copying by reaching in and turning off GC.

- testing is light (though the continuations work for P6C's
  exception-handling as well).

- take a look at "new" in core.ops.  Creating a new continuation captures
context, but the register holding that continuation is part of the
context.  Unfortunately, it doesn't know what register it's in until after
it captures the context, so it has to go back and fill that in afterwards.
Blech.

- the way continuations work has the interesting side-effect that you can
capture context in one place, but tell the continuation to resume
somewhere else.

- not integrated with lexicals.  Parrot is a fast-moving target nowadays!

- the new utility functions it adds live in continuation.pmc and csub.pmc.
This is probably not a good permanent home -- some should go into the PXS
API, some elsewhere.  Not sure where, so I put them all in one place for
the moment, so they're easy to keep track of.

Anyways, please try these out and let me know if you run into problems, or
hate the design, or can think of a better way, or whatever.

/s

Attachment: subs.tgz
Description: Binary data

Reply via email to