Dependence-Driven Delimited CPS Transformation for JavaScript

Onderzoeksoutput: Conference paper

1 Citaat (Scopus)


In today’s web applications asynchronous requests to remote services using callbacks or futures are omnipresent. The continuation of such a non-blocking task is represented as a callback function that will later be called with the result of the request. This style of programming where the remainder of a computation is captured in a continuation function is called continuation-passing style (CPS). This style of programming can quickly lead to a phenomenon called “callback hell”, which has a negative impact on the maintainability of applications that employ this style. Several alter- natives to callbacks are therefore gaining traction within the web domain. For example, there are a number of frameworks that rely on automatically transforming code, written without callbacks in a direct sequential style, into the continuation-passing style. How- ever, these frameworks often employ a conservative approach in which each function call is transformed into CPS. Even when they do a selective transformation they will often encapsulate the entire remainder of the computation in the continuation. This conservative approach can sequentialise requests that could otherwise be run in parallel. So-called delimited continuations can remedy, but require special marks that have to be manually inserted in the code for marking the beginning and end of the continuation. In this paper we propose an alternative strategy in which we apply a delimited CPS transformation that operates on a Program Dependence Graph instead to find the limits of each continuation. We implement this strategy in JavaScript and demonstrate its applicability to various web programming scenarios.
Originele taal-2English
TitelProceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences (GPCE'16)
Plaats van productieNew York
ISBN van geprinte versie978-1-4503-4446-3
StatusPublished - 2016
EvenementACM SIGPLAN Conference on Systems, Programming, Languages and Applications: Software for Humanity - Amsterdam, Netherlands
Duur: 30 okt 20164 nov 2016


ConferenceACM SIGPLAN Conference on Systems, Programming, Languages and Applications: Software for Humanity
Verkorte titelSPLASH
Internet adres

Vingerafdruk Duik in de onderzoeksthema's van 'Dependence-Driven Delimited CPS Transformation for JavaScript'. Samen vormen ze een unieke vingerafdruk.

Citeer dit