Abstract
Web sites and web browsers have recently evolved into platforms on top of which entire applications are delivered dynamically, mostly as JavaScript source code. This delivery format has sparked extremely enthusiastic efforts to customize both individual web sites and entire browsers in ways the original authors never expected or accommodated. Such customizations take the form of yet more script dynamically injected into the application, and the current idioms to do so exploit arcane JavaScript features and are extremely brittle. In this work, we accept the popularity of extensions and seek better linguistic mechanisms to support them.
We suggest adding to JavaScript aspect-oriented features that allow straightforward and declarative ways for customization code to modify the targeted application. Compared to most prior aspect-related research, our work has a different motivation and a different target programming environment, both of which lead to novel design and implementation techniques. Our aspect weaving is entirely integrated into a new dynamic JIT compiler, which lets us properly handle advice to first-class functions in the presence of arbitrary aliasing, without resorting to whole-program code transformations. Our prototype demonstrates that an aspect-oriented approach to web-application customization is often more efficient than current idioms while simplifying the entire process.
- }}Adsafe, Nov. 2009. http://www.adsafe.org/.Google Scholar
- }}J. Aldrich. Open modules: Modular reasoning about advice. In European Conference on Object-Oriented Programming, volume 3586 of Lecture Notes in Computer Science, 2005. Google ScholarDigital Library
- }}P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhotak, O. Lhotak, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. Optimising AspectJ. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2005. Google ScholarDigital Library
- }}M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. SPUR: A trace-based JIT compiler for CIL. In 25th ACM SIGPLAN conference on Object-Oriented Programming Systems, Languages and Applications, 2010. Google ScholarDigital Library
- }}R. Chugh, J. A. Meister, R. Jhala, and S. Lerner. Staged information flow for JavaScript. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2009. Google ScholarDigital Library
- }}J. Clements. Portable and high-level access to the stack with Continuation Marks. PhD thesis, Northeastern University, 2005.Google Scholar
- }}J. Clements, A. Sundaram, and D. Herman. Implementing continuation marks in JavaScript. In 9th Scheme and Functional Programming Workshop, 2008.Google Scholar
- }}D. S. Dantas, D. Walker, G. Washburn, and S. Weirich. AspectML: A polymorphic aspect-oriented functional programming language. ACM Trans. Program. Lang. Syst., 30(3):1--60, 2008. Google ScholarDigital Library
- }}C. Dutchyn, D. B. Tucker, and S. Krishnamurthi. Semantics and scoping of aspects in higher-order languages. Sci. Comput. Program., 63(3):207--239, 2006. Google ScholarDigital Library
- }}ECMA International. ECMAScript language specification, 5th edition, Sept. 2009. http://www.ecmascript.org/.Google Scholar
- }}U. Erlingsson, B. Livshits, and Y. Xie. End-to-end web application security. In 11th USENIX workshop on Hot topics in Operating Systems, 2007. Google ScholarDigital Library
- }}M. Flatt, G. Yu, R. B. Findler, and M. Felleisen. Adding delimited and composable control to a production programming environment. In 12th ACM SIGPLAN International Conference on Functional Programming, 2007. Google ScholarDigital Library
- }}A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2009. Google ScholarDigital Library
- }}G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In 15th European Conference on Object-Oriented Programming, 2001. Google ScholarDigital Library
- }}L. Meyerovich and B. Livshits. ConScript: Specifying and enforcing fine-grained security policies for Javascript in the browser. In IEEE Symposium on Security and Privacy, May 2010. Google ScholarDigital Library
- }}J. Scott. How many Firefox users use add-ons?, Aug. 2009. http://blog.mozilla.com/addons/2009/08/11/ how-many-firefox-users-use-add-ons/.Google Scholar
- }}J. M. Siskind and B. A. Pearlmutter. First-class nonstandard interpretations by opening closures. In 34th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, 2007. Google ScholarDigital Library
- }}The AspectJ Team. The AspectJ programming guide, 2003. http://www.eclipse.org/aspectj/doc/released/ progguide/index.html.Google Scholar
- }}The AspectJ Team. The AspectJ 5 development kit developer's notebook, 2005. http://www.eclipse.org/ aspectj/doc/next/adk15notebook/.Google Scholar
- }}The Caja Team. Caja, Nov. 2009. http://code.google.com/p/google-caja/.Google Scholar
- }}R. Toledo, P. Leger, and E. Tanter. AspectScript: expressive aspects for the web. In 8th International Conference on Aspect-Oriented Software Development, 2010. Google ScholarDigital Library
- }}D. S. Wallach, A. W. Appel, and E. W. Felten. SAFKASI: a security mechanism for language-based systems. ACM Trans. Softw. Eng. Methodol., 9(4):341--378, 2000. Google ScholarDigital Library
- }}G. Washburn and S. Weirich. Good advice for type-directed programming: aspect-oriented programming and extensible generic functions. In ACM SIGPLAN Workshop on Generic Programming, 2006. Google ScholarDigital Library
- }}H. Washizaki, A. Kubo, T. Mizumachi, K. Eguchi, Y. Fukazawa, N. Yoshioka, H. Kanuka, T. Kodaka, N. Sugimoto, Y. Nagai, and R. Yamamoto. AOJS: Aspect-oriented JavaScript programming framework for web development. In 8th workshop on Aspects, Components, and Patterns for Infrastructure Software, 2009. Google ScholarDigital Library
Index Terms
- Supporting dynamic, third-party code customizations in JavaScript using aspects
Recommendations
Supporting dynamic, third-party code customizations in JavaScript using aspects
OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applicationsWeb sites and web browsers have recently evolved into platforms on top of which entire applications are delivered dynamically, mostly as JavaScript source code. This delivery format has sparked extremely enthusiastic efforts to customize both individual ...
Isolating JavaScript in dynamic code environments
APLWACA '10: Proceedings of the 2010 Workshop on Analysis and Programming Languages for Web Applications and Cloud ApplicationsWe analyze the source code of four well-known large web applications, namely WordPress, phpBB, phpMyAdmin and Drupal. We want to quantify the level of language intermixing in modern web applications and, if possible, we want to categorize all coding ...
A theory of aspects
This paper define the semantics of MinAML, an idealized aspect-oriented programming language, by giving a type-directed translation from its user-friendly external language to its compact, well-defined core language. We argue that our framework is an ...
Comments