Using continuations and aspects to tame asynchronous programming on the web

Paul Leger, Hiroaki Fukuda

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

1 Citation (Scopus)

Abstract

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
Pages79-82
Number of pages4
ISBN (Print)9781450340335
DOIs
Publication statusPublished - 2016 Mar 14
Event15th International Conference on Modularity, MODULARITY 2016 - Malaga, Spain
Duration: 2016 Mar 142016 Mar 17

Other

Other15th International Conference on Modularity, MODULARITY 2016
CountrySpain
CityMalaga
Period16/3/1416/3/17

Keywords

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

ASJC Scopus subject areas

  • Software

Cite this

Leger, P., & Fukuda, H. (2016). Using continuations and aspects to tame asynchronous programming on the web. In MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity (pp. 79-82). Association for Computing Machinery, Inc. https://doi.org/10.1145/2892664.2892675

Using continuations and aspects to tame asynchronous programming on the web. / Leger, Paul; Fukuda, Hiroaki.

MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity. Association for Computing Machinery, Inc, 2016. p. 79-82.

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

Leger, P & Fukuda, H 2016, Using continuations and aspects to tame asynchronous programming on the web. in MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity. Association for Computing Machinery, Inc, pp. 79-82, 15th International Conference on Modularity, MODULARITY 2016, Malaga, Spain, 16/3/14. https://doi.org/10.1145/2892664.2892675
Leger P, Fukuda H. Using continuations and aspects to tame asynchronous programming on the web. In MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity. Association for Computing Machinery, Inc. 2016. p. 79-82 https://doi.org/10.1145/2892664.2892675
Leger, Paul ; Fukuda, Hiroaki. / Using continuations and aspects to tame asynchronous programming on the web. MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity. Association for Computing Machinery, Inc, 2016. pp. 79-82
@inproceedings{53c617b6c4b247168c55983909ccfdac,
title = "Using continuations and aspects to tame asynchronous programming on the web",
abstract = "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.",
keywords = "Aspectscript, Asynchronous programming, Continuations, Javascript, Sync/cc, Web applications",
author = "Paul Leger and Hiroaki Fukuda",
year = "2016",
month = "3",
day = "14",
doi = "10.1145/2892664.2892675",
language = "English",
isbn = "9781450340335",
pages = "79--82",
booktitle = "MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity",
publisher = "Association for Computing Machinery, Inc",

}

TY - GEN

T1 - Using continuations and aspects to tame asynchronous programming on the web

AU - Leger, Paul

AU - Fukuda, Hiroaki

PY - 2016/3/14

Y1 - 2016/3/14

N2 - 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.

AB - 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.

KW - Aspectscript

KW - Asynchronous programming

KW - Continuations

KW - Javascript

KW - Sync/cc

KW - Web applications

UR - http://www.scopus.com/inward/record.url?scp=84965082723&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=84965082723&partnerID=8YFLogxK

U2 - 10.1145/2892664.2892675

DO - 10.1145/2892664.2892675

M3 - Conference contribution

AN - SCOPUS:84965082723

SN - 9781450340335

SP - 79

EP - 82

BT - MODULARITY Companion 2016 - Companion Proceedings of the 15th International Conference on Modularity

PB - Association for Computing Machinery, Inc

ER -