FLUENT INTERFACES TO A JAVA-BASED INTERNAL DOMAIN-SPECIFIC LANGUAGES FOR GRAPH GENERATION AND ANALYSIS Ken A. Hawick Computer Science, Massey University, North Shore 102-904, Auckland, New Zealand email: k.a.hawick@massey.ac.nz Tel: +64 9 414 0800 Fax: +64 9 441 8181 ABSTRACT Internal Domain-Specific Languages (DSL) provide an elegant mechanism to reduce the code complexity of complex systems simulations programming. Many com- plex systems problems manifest themselves as networks. Graph analysis techniques can be employed to count the number of: separate components; circuits; paths; or dis- tances in the network. Several other properties such as: mean and peak degree; component or community size; ad- jacency eigen-spectra, and so forth can also be calculated. Calculation of these properties gives a signature that can help classify a network as belonging to a particular cat- egory with known behaviours. In practice however, im- porting applications data into graph analysis software and managing these calculations can be complex. Domain- specific language techniques allow a high-level graph cal- culations language to be developed that invokes software components in a graph manipulations framework. We de- scribe a prototype graph generation and analysis domain- specific language built using fluent interface techniques and the Java programming language. We report on: attainable code complexity reduction, framework computational per- formance, and software engineering directions for internals DSLs for this sort of applications problem. KEY WORDS ation; graph computations; programming tools and lan- guages. 1 Introduction Engineering elegant and understandable software for simulating complex systems is a challenging problem. Complex models based on graphs and network struc- tures present an opportunity to abstract over some of the common data structures and traversal algorithms using a domain-specific programming language. Graph and network problems arise in many different application domains, including: physical infra-structural systems such as electricity, water and power networks; so- cial, financial and market systems; overlays such as web- page relationships on the Internet; and physical systems in materials science. Analysing such systems is not necessar- ily simple as they come in different formats. A useful ap- proach is to be able to compare different individual network sets with families or common classes of graph pattern to try to match up characteristic signature properties. To this end a domain-specific language for graph calculations is a de- sirable tool to ease the management of graph and network calculation experiments [13]. The designers of computer programming languages try to help the programmers express their ideas and algo- rithms concisely and clearly. However even with the most elegant programming language difficulties arise when pro- grams become significantly bigger and more complex. To an extent the standard computer science approach of “di- vide and conquer” can be applied to abstractify the relevant ideas and components of a large program into software li- braries that can be developed, tested and hidden away, to be invoked only when needed. This lowers the amount of program code the programmer needs to display on screen or in the mind at once and is one of the most important as- pects of managing the development of large-scale complex software [7]. Although many modern programming languages have introduced various feature to further this abstraction and the consequent lowering of code complexity applications developers are still easily overwhelmed by the sheer com- plexity and size of their programs [25]. General-purpose programming languages make good use of features such as: functions and subroutines; package modules; classes and objects; and more recently closures and iterators. Even so, these languages often have associated with them a set of operational baggage and idiomatic features that often ob- scure the essence of an application and can therefore make it unnecessarily complex to develop. A relatively recent approach is to develop a domain- specific programming language (DSL) [5, 8, 10, 12] that of- fers a high-level set of mechanisms for the programmer to formulate ideas for a particular application domain of in- terest and body of knowledge. DSLs aim is to have the lan- guage focus concisely and specifically on just those aspects and concepts that are relevant to the particular problem do- main. They are designed to hide away “boiler plate” code that is only an artifact of the underlying programming lan- guage and which does not contribute to the semantics of the application domain. Many application domains including: simulations [14]; business systems; database systems; materials Proceedings of the IASTED International Conference Software Engineering (SE 2013) February 11 - 13, 2013, Innsbruck, Austria DOI: 10.2316/P.2013.796-040 Domain-specific language; fluent interface; graph gener- 752