Check out the new USENIX Web site. next up previous
Next: JAVA reflection Up: Discussion Previous: Application-defined filters

Towards a unified language

An alternative to our subscription API consists in using the JAVA language itself as the subscription language. That is, providing code in a stringified form (source code), that can be parsed and compiled at runtime. A pseudo-variable m would represent the runtime message object, and method invocations could be directly expressed, e.g.:



    "m.getSender().equals("Alice") && ...;"



The evaluation of the code given here as a string is deferred. This comes to introducing two levels of programming, in a way similar to [NN88]. The generalization of that approach leads to multi-stage programming, e.g., METAML [TS97]. METAML is a meta-programming language that was designed as a homogenous runtime code generator toolkit. In METAML, the evaluation of expressions in <> (called brackets) is deferred to the next stage, in a sense similar to our stringified code delimited by "" above. Expressions evaluated at a later stage can refer to constructs at a previous stage. When stringifying meta-code in JAVA as above, this is not possible, since JAVA reflection does not allow to dynamically obtain a reference to a variable by its name. This limitation can be circumvented as long as invocation arguments can be constructed inside the pattern string (e.g., "Alice"), but poses problems for complex matches. Extending the JAVA language in the sense of METAML would have contradicted our resolution of using merely standard language constructs.


next up previous
Next: JAVA reflection Up: Discussion Previous: Application-defined filters
Patrick Eugster
12/10/2000