unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* a rehash of the question of optimizing some prompt ideoms
@ 2013-08-30 18:54 Stefan Israelsson Tampe
  2013-08-31  4:35 ` Mark H Weaver
  2013-09-01 20:34 ` Stefan Israelsson Tampe
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Israelsson Tampe @ 2013-08-30 18:54 UTC (permalink / raw)
  To: guile-devel

Hi all,

In the wake of the wowely code Andy Mark and Noah have been producing
I want to lift the question of what we can do to compile some
delimeted continuation code effeciently.

Delimeted continuations can be looked upon as a generalization of
common lisps tagbody e.g. it's trivial to produce tagbody semantics
with the help of prompts. Now a quesiton is how we should make sure
that most sane code that can be compiled to goto's in the rtl backend
really get that far. As I understand the cps compiler is well suited
to take on this task. But we should not aim towards atgbody, but also
generators and similar constructs. To see what kind of semantics to
support maybe the code in 
 
  https://gitorious.org/guile-coroutines/guile-
coroutines/source/fc49d41dfa0cc0647aaeeddf8fb15d55dc2fb6ef:stis/coroutine.scm

Can help as well as the example in the same repo,

https://gitorious.org/guile-coroutines/guile-
coroutines/source/fc49d41dfa0cc0647aaeeddf8fb15d55dc2fb6ef:stis/coroutine/test.scm

So what can we do in rtl that we cannot do before? To note here is
that in rtl we can basically allocate a region of the register space
for e.g. a generator. The nice thing with rtl is that all functions
are executed at the end of the register space and therefore we could
basically use named gotos to jump between the different
generators located at different stack areas. This is not possible in a
stack based VM. So not only do we skip expensive function call's but
tear down and setup of the stack is not needed. Of cause to be
able to take advantage of this not all generators can be used in such
a scheme. (It would be nice to get Academic references for this) but
it should be doable. 

We would need some more one more instruction from RTL, namely named
gotos.

It's also perhaps possible to enlarge the ideas to separate where
functions are evaluated and where the "local rigister area" of the 
generator is 
situated. E.g. An area allocated from the heap. But this lead to a
complete redesign of RTL but it would could be a cool concept.

WDYT?




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-01 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30 18:54 a rehash of the question of optimizing some prompt ideoms Stefan Israelsson Tampe
2013-08-31  4:35 ` Mark H Weaver
2013-08-31  4:56   ` Mark H Weaver
2013-09-01 20:34 ` Stefan Israelsson Tampe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).