Yield Passing Style
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
node_modules
Makefile
README
index.html
machine.js
test-output.js
test.js
yps.js

README

It seems to me that you can implement a much simpler CPS in javascript using the new `yield` operator... This would also work really well with promises, completely eliminating callback hell in one simple step... It also easily integrates into non-CPS code. If this is true, I think I just found something awesome.

I call this technique "Yield Passing Style", as it abuses `yield` to generate individual frames that are controlled with an explicit stack manager, giving me control over the stack and execution.

NOTE: Ok, so I implemented this and go it working, but it's too slow for any real world use. Seems like it kills the JIT. Still interesting though!

Copyright (c) James Long 2012 and YPS is trademarked so I'll tweet mean things to you if you steal it.