**AspectScript** is a [[http://en.wikipedia.org/wiki/JavaScript|JavaScript]] extension for Aspect-Oriented Programming (AOP) that currently works in [[http://www.mozilla.com|Mozilla Firefox]]. AspectScript is an aspect language that integrates (with) the main features of JavaScript such as first-class and higher-order functions, dynamic typing, and prototype-based programming. AspectScript is based on the pointcut-advice mechanism and includes the followings state-of-the-art AOP features:
+
**AspectScript** is a [[http://en.wikipedia.org/wiki/JavaScript|JavaScript]] extension for Aspect-Oriented Programming (AOP) that currently supports [[http://www.mozilla.com|Mozilla Firefox]], [[http://www.apple.com/safari/|Safari]], [[http://www.google.com/chrome|Chrome]], and [[http://www.opera.com|Opera]] (no plug-ins or add-ons required!). AspectScript is an aspect language that integrates with the characterizing features of JavaScript such as first-class and higher-order functions, dynamic typing, and prototype-based programming. AspectScript is based on the pointcut-advice mechanism and includes the followings state-of-the-art AOP features:
-
* **Higher-order aspects**: Like [[http://www.cs.usask.ca/~cjd032/downloads/AspectScheme/|AspectScheme]], AspectScript aspects are first-class values (a pair pointcut-advice). Pointcuts and advices are plain JavaScript functions, which are first-class values as well. This feature allows programmers to use the full power of higher-order programming to define and manipulate aspects.
+
* **Higher-order aspects**: AspectScript is directly inspired by [[http://www.cs.usask.ca/~cjd032/downloads/AspectScheme/|AspectScheme]], in which aspects, pointcuts, and advices are first-class values. Consequently, they can be created and manipulated at runtime. An aspect in AspectScript is a pointcut-advice pair; pointcuts and advices are plain JavaScript functions. This feature allows programmers to use the full power of higher-order programming in AOP.
-
+
-
* **Dynamic deployment of aspects with scoping strategies**: Aspects in AspectScript are dynamically deployed like in [[http://caesarj.org/|CaesarJ]] and [[http://www.cs.usask.ca/~cjd032/downloads/AspectScheme/|AspectScheme]]. In addition, the deployment of aspects can be expressively refined using [[http://www.pleiad.cl/research/scope#expressive_scoping_of_dynamically-deployed_aspects|Scoping Strategies]].
+
* **Dynamic deployment of aspects with scoping strategies**: Aspects in AspectScript are dynamically deployed like in [[http://caesarj.org/|CaesarJ]] and [[http://www.cs.usask.ca/~cjd032/downloads/AspectScheme/|AspectScheme]]. In addition, the scope of dynamically deployed aspects can be expressively refined using [[http://www.pleiad.cl/research/scope#expressive_scoping_of_dynamically-deployed_aspects|Scoping Strategies]] ([[http://pleiad.dcc.uchile.cl/research/publications?key=tanter-aosd2008|AOSD'08]], [[http://pleiad.dcc.uchile.cl/research/publications?key=tanter-dls2009|DLS'09]]).
-
* ** An extensible join model**: The join point model is similar to the one found in [[http://www.eclipse.org/aspectj/|AspectJ]]. However, it is possible to extend it to identify other points of interest through customizable join points, similar to [[http://www.cs.iastate.edu/~ptolemy/|Ptolemy]].
+
* ** Hybrid join point model**: At its core, AspectScript adopts a join point model in the line of that of [[http://www.eclipse.org/aspectj/| AspectJ]] (see [[jp_list|the join point model]]), but tailored for the JavaScript language. However, AspectScript not only supports implicitly-generated join points following the language model, but also provides the possibility to define custom join points triggered explicitly, as in [[http://www.cs.iastate.edu/~ptolemy/|Ptolemy]].
-
+
Despite the numerous aspect-oriented features of AspectScript, it is still very easy to use, thanks to sensible default semantics. For instance, to define an aspect that shows a message before calls to the **foo** function, it is only necessary to write:
-
Despite the numerous AspectScript features, sensible default semantics make AspectScript very easy to use. For instance, to define an aspect that shows a message before calls to the **foo** function, it is only necessary to write:
+
<code java>
<code java>
Line 16:
Line 15:
AspectScript.before(pointcut, advice);
AspectScript.before(pointcut, advice);
</code>
</code>
+
+
* Do you want to see AspectScript in action? Please try the tetris game [[tetris|here]].
* Do you need more examples? You can find them [[examples|here]].
* Do you need more examples? You can find them [[examples|here]].
-
* Does it seem complex? Do not give up!, you can follow our [[tutorial|tutorial]].
+
* Do you want to learn more? You can follow our [[tutorial|tutorial]].
* Do you have any doubt? Please, do not hesitate to ask in our [[http://groups.google.com/group/aspectscript|mailing list]].
* Do you have any doubt? Please, do not hesitate to ask in our [[http://groups.google.com/group/aspectscript|mailing list]].
Line 32:
Line 33:
We are convinced that AspectScript can be useful for both researchers and developers:
We are convinced that AspectScript can be useful for both researchers and developers:
+
* **For developers**: AspectScript is a useful aspect language to modularize crosscutting concerns in the Web. Many common problems can be modularly solved using AspectScript! Take a look at the [[examples]] page.
* **For researchers**: AspectScript provides an extensible testbed for the experimentation with new AOP features.
* **For researchers**: AspectScript provides an extensible testbed for the experimentation with new AOP features.
-
-
* **For developers**: AspectScript is a useful aspect language to modularize crosscutting concerns in the Web. Many common problems can be modularly solved using AspectScript! Take a look at the [[examples]] page).