Thinking until the 2147483648'th second

About This

I think all of the files I linked to in some of my older posts are gone now. I am working on fixing them.

Tuesday, October 30, 2007

shift/reset with correct dynamic environment for Gambit

I think there's a lot of potential for delimited continuations in graphics engines, and I plan on using them in what I'm working on. I am using Gambit Scheme however, which does not have a full shift/reset implementation. For the past couple weeks I looked into implementing shift/reset for Gambit (with a fixed dynamic environment), and I got it to work! I posted the following message on the Gambit list earlier today:


"Hello everyone,

I have been studying delimited continuations recently. After being
blissfully enlightened, I really wanted to have them in Gambit (with a
*correct* dynamic environment). I wasn't sure if this was possible
non-natively though (at least safely), because Gambit's dynamic
environment is somewhat complex, and I have to be able to
destructively manipulate the dynamic environment to make sure the
delimited continuation truly has its own dynamic environment 'slice'.

However, I figured out how to (hopefully safely) manipulate Gambit's
dynamic environment, and I have a full implementation of shift/reset
running in Gambit. This implementation is based off Oleg Kiselyov's
work; his paper is here:

http://okmij.org/ftp/Computation/dynamic-binding.html#DDBinding

I am not sure of the performance implications of the Gambit version of
shift/reset. I am unhappy with how much has to happen per reset or
shift, but such is the cost of a non-native implementation.
Unfortunately it goes against the grain of Gambit; after looking at
some of Gambit's internals, Marc obviously has fine-tuned the code to
be very efficient, and each reset or shift call is quite heavy
compared to call/cc. Marc... what are thoughts on a native
implementation of shift/reset?

I included some tests which show that the dynamic environment does
act the way we expect. [see 'tests.scm', snipped the tests out for the sake of this post]

If you are a zipped tar kind of guy:
http://james.tech.coptix.com/files/shift-reset-gambit/shift-reset-gambit.tar.gz

Or you just want the files:
http://james.tech.coptix.com/files/shift-reset-gambit/shift-reset-fixed.scm
http://james.tech.coptix.com/files/shift-reset-gambit/shift-reset-broken.scm
http://james.tech.coptix.com/files/shift-reset-gambit/tests.scm

'shift-reset-fixed.scm' contains the full shift/reset implementation.
'shift-reset-broken.scm' contains a naive implementation with a broken
dynamic environment.
'tests.scm' has some tests to show how the dynamic env is fixed. Note
that at the top you can include 'shift-reset-broken.scm' instead of
the fixed version to see how the dynamic env would normally be broken.

James"

6 comments:

Anonymous said...

Make the animalistic with two backs casinos? experimentation this late-model [url=http://www.realcazinoz.com]casino[/url] advisor and accomplish displeasing up online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also into our untrained [url=http://freecasinogames2010.webs.com]casino[/url] sustain at http://freecasinogames2010.webs.com and subsist crap tangled currency !
another late-model [url=http://www.ttittancasino.com]casino spiele[/url] fetter of events is www.ttittancasino.com , pro german gamblers, break into uphill during strewn online casino bonus.

Anonymous said...

Making money on the internet is easy in the underground world of [URL=http://www.www.blackhatmoneymaker.com]blackhat cpa[/URL], It's not a big surprise if you have no clue about blackhat marketing. Blackhat marketing uses little-known or little-understood ways to produce an income online.

Anonymous said...

I do not doubt it.

Anonymous said...

I've got an .mpg file, which was made from an .avi by what I don't know, and though it plays okay Virtual Dub, which I was trying to use to brighten up the picture a bit, won't process it because it says an audio frame is incomplete.

An audio frame! I'm pretty sure that's what it said.

How can i fix it or work with Virtual dub so's it can fix it?

regards,

ab :)
[url=http://www.topvideoconverter.com/ipad-video-converter/]ipad video converter[/url]

Health Blog said...

Unfortunately it goes against the grain of Gambit; after looking...

Generic Viagra said...

Very interesting points in your blog it sure cleared many questions that I may have had. I loved it because I did learn a lot from it because of it.

Random Notes

I work at Coptix

Ideas / To-do

  • Research .Mac style photo gallery for screenshots