Abstract
In JavaScript handlers, callbacks are widely used to develop rich responsive and interactive Web applications. However, the dependency among nested callbacks, known as callback hell, can make it difficult to understand and maintain them, which will eventually mix concerns. Unfortunately, current solutions for JavaScript do not fully address the aforementioned issue. This paper presents Sync/cc, a JavaScript library that uses continuations and aspects to allow developers to write handlers that need nested callbacks in a synchronous style, preventing callback dependencies. Unlike current solutions, Sync/cc is modular, customizable, and succinct because it does not require special and scattered keywords, code refactoring, or adding ad-hoc implementations like state machines. In practice, our proposal uses a) continuations to only suspend the current handler execution until the asynchronous operation is resolved, and b) aspects to apply continuations in a non-intrusive way.
Original language | English |
---|---|
Title of host publication | 32nd Annual ACM Symposium on Applied Computing, SAC 2017 |
Publisher | Association for Computing Machinery |
Pages | 1245-1250 |
Number of pages | 6 |
Volume | Part F128005 |
ISBN (Electronic) | 9781450344869 |
DOIs | |
Publication status | Published - 2017 Apr 3 |
Event | 32nd Annual ACM Symposium on Applied Computing, SAC 2017 - Marrakesh, Morocco Duration: 2017 Apr 4 → 2017 Apr 6 |
Other
Other | 32nd Annual ACM Symposium on Applied Computing, SAC 2017 |
---|---|
Country/Territory | Morocco |
City | Marrakesh |
Period | 17/4/4 → 17/4/6 |
Keywords
- Aspect-oriented programming
- AspectScript
- Callback dependencies
- Continuations
- JavaScript
- Sync/cc
- Web applications
ASJC Scopus subject areas
- Software