Language Support (I)
Want benefits of event-driven code …
- performance (fast context switch)
- better state management (control of live state)
… but without the pain of writing it.
- spaghetti code, manual FSMs
Compiler converts straight-line code to CPS
- bundle live (scoped) state into continuation
- potentially blocking call completion becomes state transition in FSM