Using continuations and aspects to tame asynchronous programming on the web

Paul Leger, Hiroaki Fukuda

Research output: Chapter in Book/Report/Conference proceedingConference contribution

3 Citations (Scopus)


In asynchronous programming of JavaScript, callbacks are widely used to develop rich interactiveWeb applications. However, the dependency among callbacks can make it difficult to understand and maintain pieces of code, which will mix concerns eventually. 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 asynchronous pieces of code 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, Sync/cc 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 languageEnglish
Title of host publicationMODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity
PublisherAssociation for Computing Machinery, Inc
Number of pages4
ISBN (Print)9781450340335
Publication statusPublished - 2016 Mar 14
Event15th International Conference on Modularity, MODULARITY 2016 - Malaga, Spain
Duration: 2016 Mar 142016 Mar 17


Other15th International Conference on Modularity, MODULARITY 2016


  • Aspectscript
  • Asynchronous programming
  • Continuations
  • Javascript
  • Sync/cc
  • Web applications

ASJC Scopus subject areas

  • Software

Cite this