Another approach to improve generation and model transformation performance, is to use the M2T Backend. The M2T Backend is a new execution engine for model to text (M2T) and model to model (M2M) transformations that provides:
One missing feature in Xpand / Xtend / Check, is to be able to compile Xpand templates and Xtend extensions into Java bytecode to speed up generator runs and hence reduce build time. The M2T Backend provides the foundation for compilation of Xpand / Xtend / Check and other languages by providing a common platform just like the JVM is a common platform for multiple languages. Likewise the backend enables language interoperability. This enables you to import templates, extensions and transformations written in other languages than Xpand/Xtend/Check and call functions declared in therein, e.g. call an QVT transformation from Xpand.
Beginning with the Eclipse Helios release (Eclipse 3.6) the M2T Backend is part of M2T Xpand. Currently the M2T Backend only runs in interpreted mode and includes translation of Xpand, Xtend and Check resources into backend code. However performance improvements can already be expected when working with large models. A compiler that generates optimized Java code will become available soon.
The basic idea behind the M2T Backend is to not build a compiler for every language but use an intermediary "language", i.e. the backend abstract syntax tree, that is compiled into executable code. Xpand, Xtend and Check are translated into a backend AST by so called middleends Middleends are specific for each language. Hence, there exists a language specific middleend for each supported language. If there exists a middleend for a language, it will be compilable into bytecode. Xpand, Xtend and Check are called frontend languages .
The M2T Backend supports functional and aspect oriented programming. Amongst others it supports language features such as:
In interpreted mode the following steps are executed: