[racket] Multi-return Function Call
On 02/21/2012 09:50 AM, David Fisher wrote:
> The implementation looks good!
Thank you, I do appreciate you taking the time to check it out.
> It is indeed possible to implement ,\_MR
> via exceptions, local continuations, or prompts as Anthony has here.
> While I can't speak for Olin, I expect that his point is that
> implementing the transformations we discuss in the paper practically
> would require a (possibly byte-code) compiler that knew about
> multi-returns internally. I don't know Racket internals well enough to
> discuss prompts, but I imagine they don't allow the kinds of tail-call
> optimizations that such a compiler would.
It begs the question, how far could the "language" thing in Racket go?
It seems like currently the languages must boil down to the racket
"machine", at some level, but perhaps a #lang could also supply a set of
primitives to terminate expansion and an evaluator (interpreter,
compiler, whatever). Racket could even provide a model interpreter for
the standard evaluator that could be tweaked to test out various
features or optimizations.
In the present case, multi would be added as a primitive and
super-tail-calls added to the evaluator. Any one such superset could run
any program that required just the standard racket machine. Linking more
than one such superset would be a bigger, stickier problem, requiring
some kind of internal FFI. I noticed Danny Yoo's comment introducing
Whalesong. What is going on there? I'm sure I haven't explored all the
hooks in Racket yet. [Danny: the single/multiple-value return points
does sound like a neat trick].
Anyway. Thanks again David, and all you pros who took the time to look
it over. I really appreciate it.
--
Anthony Carrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.racket-lang.org/users/archive/attachments/20120221/d77ae0a9/attachment-0001.sig>