The programming language XL is our implementation of relational growth grammars. XL is built on top of the programming language Java: This combines the advantages of the rule-based paradigm with the strength of Java, including the rich set of existing Java libraries.
XL extends Java in various aspects. To give you an impression, some examples are listed below. For more examples and details, have a look at the gallery or the publication list. A document in German “Wiki zur Programmiersprache XL” is also available which gives examples on the programming language XL.
- Rules are specified within a transformation statement. The snowflake curve (see L-systems) can be generated by the two rules
Axiom ==> F(1) RU(120) F(1) RU(120) F(1); F(x) ==> F(x/3) RU(-60) F(x/3) RU(120) F(x/3) RU(-60) F(x/3);
Behind the scenes, Axiom, F and RU correspond to Java classes of that name. The bound variable x corresponds to a field of class F.
- Expressions with multiple values
- XL supports expressions that have multiple values successively. E.g., the expression (* F *) returns all existing objects of class F. Operators like sum perform calculations on those expressions. To get the total length of all F‘s having a diameter greater than one, just write
sum ((* f:F, (f.diameter > 1) *).length)
Especially the graph query expressions of the form (* … *) enable you to specify local or global interactions in a concise and expressive way.
You can use XL as modelling language for your own specific data model by implementing XL’s graph model interface. This represents your data model as a graph on which XL programming statements can act.
However, it is easier to start with existing applications of XL. Currently, this website provides two such applications:
- Our modelling platform GroIMP uses XL as modelling language.
- XL4C4D allows XL to operate on the scene graph of CINEMA 4D.
How to Get XL
XL is distributed as part of the modelling platform GroIMP. However, it can be used independently of GroIMP.